Move cold reset handling from servo to power_state_controller.
New board support for Link will use cold_reset, but the usage pattern
will be slightly different. This moves cold_reset from class Servo to
power_state_controller and provides hooks to accommodate board
differences.
Ths change also includes minor additional refactoring and cleanup.
BUG=chromium:223199
TEST=run_remote_tests with platform_InstallTestImage
TEST=trigger repair with a local autotest instance
Change-Id: Ic1f2e58ca2e7553527aa2a6cad3b9314f7aba597
Reviewed-on: https://gerrit.chromium.org/gerrit/46589
Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
Commit-Queue: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
diff --git a/server/cros/faftsequence.py b/server/cros/faftsequence.py
index 7fea193..55b2b97 100644
--- a/server/cros/faftsequence.py
+++ b/server/cros/faftsequence.py
@@ -1172,7 +1172,7 @@
logging.info('broken_warm_reset is True. Cold rebooting instead.')
self.cold_reboot()
else:
- self.servo.warm_reset()
+ self.servo.get_power_state_controller().warm_reset()
def cold_reboot(self):
@@ -1187,7 +1187,7 @@
time.sleep(self.delay.ec_boot_to_pwr_button)
self.servo.set('pwr_button', 'release')
else:
- self.servo.cold_reset()
+ self.servo.get_power_state_controller().cold_reset()
def sync_and_warm_reboot(self):