mfd: tps65090: Fix ifdefs for suspend mode
PATCH 1/2 mfd: tps65090: Fix ifdefs for suspend mode
CONFIG_PM also covers runtime only PM.
--- drivers/mfd/tps65090.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/mfd/tps65090.c +2 -2
@@ -334,7 +334,7 @@ static int __devexit tps65090_i2c_remove(struct i2c_client *client)return 0 ; } -#ifdef CONFIG_PM +#ifdef CONFIG_PM_SLEEP static int tps65090_i2c_suspend (struct i2c_client *client,pm_message_t state) {if (client->irq)
@@ -363,7 +363,7 @@ static struct i2c_driver tps65090_driver = { }, .probe = tps65090_i2c_probe, .remove =__devexit_p (tps65090_i2c_remove), -#ifdef CONFIG_PM +#ifdef CONFIG_PM_SLEEP .suspend = tps65090_i2c_suspend, .resume = tps65090_i2c_resume, #endif
Signature · 1 line
1.7.9.1
PATCH 2/2 mfd: tps65090: Don't use I2C-specific suspend and resume operations
The legacy suspend operations have been deprecated and printing warnings on boot for over a year now.
---
It's not clear to me that we should have these operations at all...
drivers/mfd/tps65090.c | 15 +++++++++------ 1 files changed, 9 insertions(+), 6 deletions(-)
drivers/mfd/tps65090.c +9 -6
@@ -335,21 +335,27 @@ static int __devexit tps65090_i2c_remove(struct i2c_client *client) }#ifdef CONFIG_PM_SLEEP -static int tps65090_i2c_suspend (struct i2c_client *client,pm_message_t state) +static int tps65090_suspend (struct device *dev) { +struct i2c_client *client =to_i2c_client (dev);if (client->irq)disable_irq (client->irq);return 0 ; } -static int tps65090_i2c_resume (struct i2c_client *client) +static int tps65090_resume (struct device *dev) { +struct i2c_client *client =to_i2c_client (dev);if (client->irq)enable_irq (client->irq);return 0 ; }#endif +static const struct dev_pm_ops tps65090_pm_ops = { +SET_SYSTEM_SLEEP_PM_OPS (tps65090_suspend, tps65090_resume) +}; +static const struct i2c_device_id tps65090_id_table[] = { {"tps65090" ,0 }, { },
@@ -360,13 +366,10 @@ static struct i2c_driver tps65090_driver = { .driver = { .name = "tps65090", .owner = THIS_MODULE, + .pm = &tps65090_pm_ops, }, .probe = tps65090_i2c_probe, .remove = __devexit_p(tps65090_i2c_remove), -#ifdef CONFIG_PM_SLEEP - .suspend = tps65090_i2c_suspend, - .resume = tps65090_i2c_resume, -#endif .id_table = tps65090_id_table, };
Signature · 1 line
1.7.9.1
RE: [PATCH 2/2] mfd: tps65090: Don't use I2C-specific suspend and resume operations
Quoted 4 lines
Signed-off-by Mark Brown <[email protected]>---
It's not clear to me that we should have these operations at all...
Mark,
Can you please explain why do you think that these operations are not needed?
Quoted 56 lines
drivers/mfd/tps65090.c | 15 +++++++++------ 1 files changed, 9 insertions(+), 6 deletions(-)drivers/mfd/tps65090.c +8
-2@@ -335,21 +335,27 @@ static int __devexit tps65090_i2c_remove(struct i2c_client *client) }#ifdef CONFIG_PM_SLEEP -static int tps65090_i2c_suspend (struct i2c_client *client,pm_message_t state) +static int tps65090_suspend (struct device *dev) { +struct i2c_client *client =to_i2c_client (dev);if (client->irq)disable_irq (client->irq);return 0 ; } -static int tps65090_i2c_resume (struct i2c_client *client) +static int tps65090_resume (struct device *dev) { +struct i2c_client *client =to_i2c_client (dev);if (client->irq)enable_irq (client->irq);return 0 ; }#endif +static const struct dev_pm_ops tps65090_pm_ops = { +SET_SYSTEM_SLEEP_PM_OPS (tps65090_suspend, tps65090_resume) +}; +static const struct i2c_device_id tps65090_id_table[] = { {"tps65090" ,0 },drivers/mfd/tps65090.c +1
-5{ },@@ -360,13 +366,10 @@ static struct i2c_driver tps65090_driver = { .driver = { .name = "tps65090", .owner = THIS_MODULE, + .pm = &tps65090_pm_ops, }, .probe = tps65090_i2c_probe, .remove = __devexit_p(tps65090_i2c_remove), -#ifdef CONFIG_PM_SLEEP - .suspend = tps65090_i2c_suspend, - .resume = tps65090_i2c_resume, -#endif .id_table = tps65090_id_table, }; --1.7.9.1
Quoted 2 lines
CONFIG_PMalso covers runtime only PM.
Hi Mark,
As CONFIG_PM covers both runtime and full system suspend/resume activities, I do not really understand what we gain with this change.
Can you please provide more details?
Thanks,
Venu
Quoted 17 lines
Signed-off-by Mark Brown <[email protected]>--- drivers/mfd/tps65090.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)drivers/mfd/tps65090.c +1
-1@@ -334,7 +334,7 @@ static int __devexit tps65090_i2c_remove(struct i2c_client *client)return 0 ; } -#ifdef CONFIG_PM +#ifdef CONFIG_PM_SLEEP
Re: [PATCH 2/2] mfd: tps65090: Don't use I2C-specific suspend and resume operations
In reply to Venu ByravarasuQuoted 5 lines · Venu Byravarasu
Quoted 3 lines
Signed-off-by Mark Brown <[email protected]>It's not clear to me that we should have these operations at all...
Can you please explain why do you think that these operations are not needed?
They've been deprecated for over a year, if you'd looked at the kernel boot log you'd see that it's been complaining about them at startup time.
Quoted 6 lines · Venu Byravarasu
Quoted 1 line
CONFIG_PMalso covers runtime only PM.As
CONFIG_PMcovers both runtime and full system suspend/resume activities, I do not really understand what we gain with this change.Can you please provide more details?
You've only got system sleep PM operations, CONFIG_PM will leave them built when CONFIG_PM_SLEEP is disabled so you'll get build warnings.
RE: [PATCH 2/2] mfd: tps65090: Don't use I2C-specific suspend and resume operations
In reply to Mark BrownQuoted 8 lines
Quoted 3 lines
Quoted 1 line
It's not clear to me that we should have these operations at all...
Can you please explain why do you think that these operations are not
needed?
They've been deprecated for over a year, if you'd looked at the kernel boot log you'd see that it's been complaining about them at startup time.
Thanks, understood.
Thanks Mark for clarifying.
Quoted 39 lines
-----Original Message-----
From: Mark Brown [mailto:[email protected]]
Sent: Friday, March 23, 2012 12:09 AM
To: Samuel Ortiz; Venu Byravarasu
Cc: [email protected]; Mark Brown
Subject: [PATCH 1/2] mfd: tps65090: Fix ifdefs for suspend mode
CONFIG_PMalso covers runtime only PM.Signed-off-by Mark Brown <[email protected]>--- drivers/mfd/tps65090.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)drivers/mfd/tps65090.c +1
-1@@ -334,7 +334,7 @@ static int __devexit tps65090_i2c_remove(struct i2c_client *client)return 0 ; } -#ifdef CONFIG_PM +#ifdef CONFIG_PM_SLEEP static int tps65090_i2c_suspend (struct i2c_client *client,pm_message_t state) {drivers/mfd/tps65090.c +1
-2if (client->irq)@@ -363,7 +363,7 @@ static struct i2c_driver tps65090_driver = { }, .probe = tps65090_i2c_probe, .remove =__devexit_p (tps65090_i2c_remove), -#ifdef CONFIG_PM +#ifdef CONFIG_PM_SLEEP .suspend = tps65090_i2c_suspend, .resume = tps65090_i2c_resume, #endif --1.7.9.1
RE: [PATCH 2/2] mfd: tps65090: Don't use I2C-specific suspend and resume operations
In reply to Mark BrownThanks Mark for clarifying.
Quoted 71 lines
-----Original Message-----
From: Mark Brown [mailto:[email protected]]
Sent: Friday, March 23, 2012 12:09 AM
To: Samuel Ortiz; Venu Byravarasu
Cc: [email protected]; Mark Brown
Subject: [PATCH 2/2] mfd: tps65090: Don't use I2C-specific suspend and resume operationsThe legacy suspend operations have been deprecated and printing warnings on boot for over a year now.
Signed-off-by Mark Brown <[email protected]>---
It's not clear to me that we should have these operations at all...
drivers/mfd/tps65090.c | 15 +++++++++------ 1 files changed, 9 insertions(+), 6 deletions(-)drivers/mfd/tps65090.c +8
-2@@ -335,21 +335,27 @@ static int __devexit tps65090_i2c_remove(struct i2c_client *client) }#ifdef CONFIG_PM_SLEEP -static int tps65090_i2c_suspend (struct i2c_client *client,pm_message_t state) +static int tps65090_suspend (struct device *dev) { +struct i2c_client *client =to_i2c_client (dev);if (client->irq)disable_irq (client->irq);return 0 ; } -static int tps65090_i2c_resume (struct i2c_client *client) +static int tps65090_resume (struct device *dev) { +struct i2c_client *client =to_i2c_client (dev);if (client->irq)enable_irq (client->irq);return 0 ; }#endif +static const struct dev_pm_ops tps65090_pm_ops = { +SET_SYSTEM_SLEEP_PM_OPS (tps65090_suspend, tps65090_resume) +}; +static const struct i2c_device_id tps65090_id_table[] = { {"tps65090" ,0 },drivers/mfd/tps65090.c +1
-5{ },@@ -360,13 +366,10 @@ static struct i2c_driver tps65090_driver = { .driver = { .name = "tps65090", .owner = THIS_MODULE, + .pm = &tps65090_pm_ops, }, .probe = tps65090_i2c_probe, .remove = __devexit_p(tps65090_i2c_remove), -#ifdef CONFIG_PM_SLEEP - .suspend = tps65090_i2c_suspend, - .resume = tps65090_i2c_resume, -#endif .id_table = tps65090_id_table, }; --1.7.9.1