diff options
author | Magnus Damm <damm@igel.co.jp> | 2009-07-08 07:22:47 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2009-07-21 18:28:39 -0400 |
commit | 6a6c6189b1fef97de9b8b936131fe2085ac42a5a (patch) | |
tree | 5c3c1e6f3a36a06ab5b0deea4f750ca7775aacc3 /drivers/i2c/busses | |
parent | 57f4d4f1b72983f8c76e2f232e064730aeffe599 (diff) |
I2C: Rework i2c-s3c2410 suspend_late()/resume() V2
This is V2 of the i2c-s3c2410 dev_pm_ops patch.
The callbacks are converted for CONFIG_SUSPEND like this:
suspend_late() -> suspend_noirq()
resume() -> resume()
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'drivers/i2c/busses')
-rw-r--r-- | drivers/i2c/busses/i2c-s3c2410.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c index 8f42a4536cdf..3be0d6a4d630 100644 --- a/drivers/i2c/busses/i2c-s3c2410.c +++ b/drivers/i2c/busses/i2c-s3c2410.c | |||
@@ -951,17 +951,20 @@ static int s3c24xx_i2c_remove(struct platform_device *pdev) | |||
951 | } | 951 | } |
952 | 952 | ||
953 | #ifdef CONFIG_PM | 953 | #ifdef CONFIG_PM |
954 | static int s3c24xx_i2c_suspend_late(struct platform_device *dev, | 954 | static int s3c24xx_i2c_suspend_noirq(struct device *dev) |
955 | pm_message_t msg) | ||
956 | { | 955 | { |
957 | struct s3c24xx_i2c *i2c = platform_get_drvdata(dev); | 956 | struct platform_device *pdev = to_platform_device(dev); |
957 | struct s3c24xx_i2c *i2c = platform_get_drvdata(pdev); | ||
958 | |||
958 | i2c->suspended = 1; | 959 | i2c->suspended = 1; |
960 | |||
959 | return 0; | 961 | return 0; |
960 | } | 962 | } |
961 | 963 | ||
962 | static int s3c24xx_i2c_resume(struct platform_device *dev) | 964 | static int s3c24xx_i2c_resume(struct device *dev) |
963 | { | 965 | { |
964 | struct s3c24xx_i2c *i2c = platform_get_drvdata(dev); | 966 | struct platform_device *pdev = to_platform_device(dev); |
967 | struct s3c24xx_i2c *i2c = platform_get_drvdata(pdev); | ||
965 | 968 | ||
966 | i2c->suspended = 0; | 969 | i2c->suspended = 0; |
967 | s3c24xx_i2c_init(i2c); | 970 | s3c24xx_i2c_init(i2c); |
@@ -969,9 +972,14 @@ static int s3c24xx_i2c_resume(struct platform_device *dev) | |||
969 | return 0; | 972 | return 0; |
970 | } | 973 | } |
971 | 974 | ||
975 | static struct dev_pm_ops s3c24xx_i2c_dev_pm_ops = { | ||
976 | .suspend_noirq = s3c24xx_i2c_suspend_noirq, | ||
977 | .resume = s3c24xx_i2c_resume, | ||
978 | }; | ||
979 | |||
980 | #define S3C24XX_DEV_PM_OPS (&s3c24xx_i2c_dev_pm_ops) | ||
972 | #else | 981 | #else |
973 | #define s3c24xx_i2c_suspend_late NULL | 982 | #define S3C24XX_DEV_PM_OPS NULL |
974 | #define s3c24xx_i2c_resume NULL | ||
975 | #endif | 983 | #endif |
976 | 984 | ||
977 | /* device driver for platform bus bits */ | 985 | /* device driver for platform bus bits */ |
@@ -990,12 +998,11 @@ MODULE_DEVICE_TABLE(platform, s3c24xx_driver_ids); | |||
990 | static struct platform_driver s3c24xx_i2c_driver = { | 998 | static struct platform_driver s3c24xx_i2c_driver = { |
991 | .probe = s3c24xx_i2c_probe, | 999 | .probe = s3c24xx_i2c_probe, |
992 | .remove = s3c24xx_i2c_remove, | 1000 | .remove = s3c24xx_i2c_remove, |
993 | .suspend_late = s3c24xx_i2c_suspend_late, | ||
994 | .resume = s3c24xx_i2c_resume, | ||
995 | .id_table = s3c24xx_driver_ids, | 1001 | .id_table = s3c24xx_driver_ids, |
996 | .driver = { | 1002 | .driver = { |
997 | .owner = THIS_MODULE, | 1003 | .owner = THIS_MODULE, |
998 | .name = "s3c-i2c", | 1004 | .name = "s3c-i2c", |
1005 | .pm = S3C24XX_DEV_PM_OPS, | ||
999 | }, | 1006 | }, |
1000 | }; | 1007 | }; |
1001 | 1008 | ||