aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-cmos.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/rtc-cmos.c')
-rw-r--r--drivers/rtc/rtc-cmos.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c
index 5856167a0c90..c7ff8df347e7 100644
--- a/drivers/rtc/rtc-cmos.c
+++ b/drivers/rtc/rtc-cmos.c
@@ -36,6 +36,7 @@
36#include <linux/platform_device.h> 36#include <linux/platform_device.h>
37#include <linux/mod_devicetable.h> 37#include <linux/mod_devicetable.h>
38#include <linux/log2.h> 38#include <linux/log2.h>
39#include <linux/pm.h>
39 40
40/* this is for "generic access to PC-style RTC" using CMOS_READ/CMOS_WRITE */ 41/* this is for "generic access to PC-style RTC" using CMOS_READ/CMOS_WRITE */
41#include <asm-generic/rtc.h> 42#include <asm-generic/rtc.h>
@@ -687,7 +688,8 @@ cmos_do_probe(struct device *dev, struct resource *ports, int rtc_irq)
687#if defined(CONFIG_ATARI) 688#if defined(CONFIG_ATARI)
688 address_space = 64; 689 address_space = 64;
689#elif defined(__i386__) || defined(__x86_64__) || defined(__arm__) \ 690#elif defined(__i386__) || defined(__x86_64__) || defined(__arm__) \
690 || defined(__sparc__) || defined(__mips__) 691 || defined(__sparc__) || defined(__mips__) \
692 || defined(__powerpc__)
691 address_space = 128; 693 address_space = 128;
692#else 694#else
693#warning Assuming 128 bytes of RTC+NVRAM address space, not 64 bytes. 695#warning Assuming 128 bytes of RTC+NVRAM address space, not 64 bytes.
@@ -850,7 +852,7 @@ static void __exit cmos_do_remove(struct device *dev)
850 852
851#ifdef CONFIG_PM 853#ifdef CONFIG_PM
852 854
853static int cmos_suspend(struct device *dev, pm_message_t mesg) 855static int cmos_suspend(struct device *dev)
854{ 856{
855 struct cmos_rtc *cmos = dev_get_drvdata(dev); 857 struct cmos_rtc *cmos = dev_get_drvdata(dev);
856 unsigned char tmp; 858 unsigned char tmp;
@@ -898,7 +900,7 @@ static int cmos_suspend(struct device *dev, pm_message_t mesg)
898 */ 900 */
899static inline int cmos_poweroff(struct device *dev) 901static inline int cmos_poweroff(struct device *dev)
900{ 902{
901 return cmos_suspend(dev, PMSG_HIBERNATE); 903 return cmos_suspend(dev);
902} 904}
903 905
904static int cmos_resume(struct device *dev) 906static int cmos_resume(struct device *dev)
@@ -945,9 +947,9 @@ static int cmos_resume(struct device *dev)
945 return 0; 947 return 0;
946} 948}
947 949
950static SIMPLE_DEV_PM_OPS(cmos_pm_ops, cmos_suspend, cmos_resume);
951
948#else 952#else
949#define cmos_suspend NULL
950#define cmos_resume NULL
951 953
952static inline int cmos_poweroff(struct device *dev) 954static inline int cmos_poweroff(struct device *dev)
953{ 955{
@@ -1077,7 +1079,7 @@ static void __exit cmos_pnp_remove(struct pnp_dev *pnp)
1077 1079
1078static int cmos_pnp_suspend(struct pnp_dev *pnp, pm_message_t mesg) 1080static int cmos_pnp_suspend(struct pnp_dev *pnp, pm_message_t mesg)
1079{ 1081{
1080 return cmos_suspend(&pnp->dev, mesg); 1082 return cmos_suspend(&pnp->dev);
1081} 1083}
1082 1084
1083static int cmos_pnp_resume(struct pnp_dev *pnp) 1085static int cmos_pnp_resume(struct pnp_dev *pnp)
@@ -1157,8 +1159,9 @@ static struct platform_driver cmos_platform_driver = {
1157 .shutdown = cmos_platform_shutdown, 1159 .shutdown = cmos_platform_shutdown,
1158 .driver = { 1160 .driver = {
1159 .name = (char *) driver_name, 1161 .name = (char *) driver_name,
1160 .suspend = cmos_suspend, 1162#ifdef CONFIG_PM
1161 .resume = cmos_resume, 1163 .pm = &cmos_pm_ops,
1164#endif
1162 } 1165 }
1163}; 1166};
1164 1167