diff --git a/drivers/hid/intel-thc-hid/intel-quicki2c/pci-quicki2c.c b/drivers/hid/intel-thc-hid/intel-quicki2c/pci-quicki2c.c index cfda66ee4895..f178017352ba 100644 --- a/drivers/hid/intel-thc-hid/intel-quicki2c/pci-quicki2c.c +++ b/drivers/hid/intel-thc-hid/intel-quicki2c/pci-quicki2c.c @@ -807,6 +807,12 @@ static int quicki2c_suspend(struct device *device) if (!qcdev) return -ENODEV; + if (!device_may_wakeup(qcdev->dev)) { + ret = quicki2c_set_power(qcdev, HIDI2C_SLEEP); + if (ret) + return ret; + } + /* * As I2C is THC subsystem, no register auto save/restore support, * need driver to do that explicitly for every D3 case. @@ -856,6 +862,9 @@ static int quicki2c_resume(struct device *device) if (ret) return ret; + if (!device_may_wakeup(qcdev->dev)) + return quicki2c_set_power(qcdev, HIDI2C_ON); + return 0; } @@ -913,6 +922,9 @@ static int quicki2c_poweroff(struct device *device) if (!qcdev) return -ENODEV; + /* Ignore the return value as platform will be poweroff soon */ + quicki2c_set_power(qcdev, HIDI2C_SLEEP); + ret = thc_interrupt_quiesce(qcdev->thc_hw, true); if (ret) return ret; @@ -966,7 +978,7 @@ static int quicki2c_restore(struct device *device) thc_change_ltr_mode(qcdev->thc_hw, THC_LTR_MODE_ACTIVE); - return 0; + return quicki2c_set_power(qcdev, HIDI2C_ON); } static int quicki2c_runtime_suspend(struct device *device)