diff mbox series

[1/1] i2c: i801: Don't restore config registers on runtime PM

Message ID 20181123083304.10013-2-aaron.ma@canonical.com
State New
Headers show
Series Fix touchpad not working on smbus | expand

Commit Message

Aaron Ma Nov. 23, 2018, 8:33 a.m. UTC
From: Jean Delvare <jdelvare@suse.de>

BugLink: https://bugs.launchpad.net/bugs/1802135

Restoring configuration registers is only needed when we hand control
to the firmware. This is never the case with runtime power
management. The device will autosuspend whenever not used, so avoid
useless register writes by defining suspend/resume only, and not
runtime_suspend/runtime_resume.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
(cherry picked from commit a9c8088c7988e3a8a364cac9c26eba9ee2ea6153)
Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
---
 drivers/i2c/busses/i2c-i801.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Hui Wang Nov. 26, 2018, 7:59 a.m. UTC | #1
Acked-by: Hui Wang <hui.wang@canonical.com>

On 2018/11/23 下午4:33, Aaron Ma wrote:
> From: Jean Delvare <jdelvare@suse.de>
>
> BugLink: https://bugs.launchpad.net/bugs/1802135
>
> Restoring configuration registers is only needed when we hand control
> to the firmware. This is never the case with runtime power
> management. The device will autosuspend whenever not used, so avoid
> useless register writes by defining suspend/resume only, and not
> runtime_suspend/runtime_resume.
>
> Signed-off-by: Jean Delvare <jdelvare@suse.de>
> Reviewed-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
> (cherry picked from commit a9c8088c7988e3a8a364cac9c26eba9ee2ea6153)
> Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
> ---
>   drivers/i2c/busses/i2c-i801.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
> index ba8df2fde1b2..00da6eae32db 100644
> --- a/drivers/i2c/busses/i2c-i801.c
> +++ b/drivers/i2c/busses/i2c-i801.c
> @@ -1730,8 +1730,7 @@ static int i801_resume(struct device *dev)
>   }
>   #endif
>   
> -static UNIVERSAL_DEV_PM_OPS(i801_pm_ops, i801_suspend,
> -			    i801_resume, NULL);
> +static SIMPLE_DEV_PM_OPS(i801_pm_ops, i801_suspend, i801_resume);
>   
>   static struct pci_driver i801_driver = {
>   	.name		= "i801_smbus",
Anthony Wong Nov. 28, 2018, 1:11 p.m. UTC | #2
On Fri, Nov 23, 2018 at 04:33:04PM +0800, Aaron Ma wrote:
> From: Jean Delvare <jdelvare@suse.de>
> 
> BugLink: https://bugs.launchpad.net/bugs/1802135
> 
> Restoring configuration registers is only needed when we hand control
> to the firmware. This is never the case with runtime power
> management. The device will autosuspend whenever not used, so avoid
> useless register writes by defining suspend/resume only, and not
> runtime_suspend/runtime_resume.
> 
> Signed-off-by: Jean Delvare <jdelvare@suse.de>
> Reviewed-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
> (cherry picked from commit a9c8088c7988e3a8a364cac9c26eba9ee2ea6153)
> Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
> ---
>  drivers/i2c/busses/i2c-i801.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
> index ba8df2fde1b2..00da6eae32db 100644
> --- a/drivers/i2c/busses/i2c-i801.c
> +++ b/drivers/i2c/busses/i2c-i801.c
> @@ -1730,8 +1730,7 @@ static int i801_resume(struct device *dev)
>  }
>  #endif
>  
> -static UNIVERSAL_DEV_PM_OPS(i801_pm_ops, i801_suspend,
> -			    i801_resume, NULL);
> +static SIMPLE_DEV_PM_OPS(i801_pm_ops, i801_suspend, i801_resume);
>  
>  static struct pci_driver i801_driver = {
>  	.name		= "i801_smbus",
> -- 
> 2.17.1

Acked-by: Anthony Wong <anthony.wong@canonical.com>
diff mbox series

Patch

diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index ba8df2fde1b2..00da6eae32db 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -1730,8 +1730,7 @@  static int i801_resume(struct device *dev)
 }
 #endif
 
-static UNIVERSAL_DEV_PM_OPS(i801_pm_ops, i801_suspend,
-			    i801_resume, NULL);
+static SIMPLE_DEV_PM_OPS(i801_pm_ops, i801_suspend, i801_resume);
 
 static struct pci_driver i801_driver = {
 	.name		= "i801_smbus",