diff options
-rw-r--r-- | MAINTAINERS | 1 | ||||
-rw-r--r-- | arch/unicore32/Kconfig | 4 | ||||
-rw-r--r-- | arch/unicore32/configs/debug_defconfig | 6 | ||||
-rw-r--r-- | arch/unicore32/kernel/Makefile | 1 | ||||
-rw-r--r-- | drivers/rtc/Kconfig | 9 | ||||
-rw-r--r-- | drivers/rtc/Makefile | 1 | ||||
-rw-r--r-- | drivers/rtc/rtc-puv3.c (renamed from arch/unicore32/kernel/rtc.c) | 14 |
7 files changed, 15 insertions, 21 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index b5ea4d033730..bbe49d8c22af 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -4945,6 +4945,7 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/epip/linux-2.6-unicore32.gi | |||
4945 | F: drivers/input/serio/i8042-unicore32io.h | 4945 | F: drivers/input/serio/i8042-unicore32io.h |
4946 | F: drivers/i2c/busses/i2c-puv3.c | 4946 | F: drivers/i2c/busses/i2c-puv3.c |
4947 | F: drivers/video/fb-puv3.c | 4947 | F: drivers/video/fb-puv3.c |
4948 | F: drivers/rtc/rtc-puv3.c | ||
4948 | 4949 | ||
4949 | PMC SIERRA MaxRAID DRIVER | 4950 | PMC SIERRA MaxRAID DRIVER |
4950 | M: Anil Ravindranath <anil_ravindranath@pmc-sierra.com> | 4951 | M: Anil Ravindranath <anil_ravindranath@pmc-sierra.com> |
diff --git a/arch/unicore32/Kconfig b/arch/unicore32/Kconfig index d3a303246c9f..e57dcce9bfda 100644 --- a/arch/unicore32/Kconfig +++ b/arch/unicore32/Kconfig | |||
@@ -231,10 +231,6 @@ config PUV3_PWM | |||
231 | help | 231 | help |
232 | Enable support for NB0916 PWM controllers | 232 | Enable support for NB0916 PWM controllers |
233 | 233 | ||
234 | config PUV3_RTC | ||
235 | tristate "PKUnity v3 RTC Support" | ||
236 | depends on !ARCH_FPGA | ||
237 | |||
238 | if PUV3_NB0916 | 234 | if PUV3_NB0916 |
239 | 235 | ||
240 | menu "PKUnity NetBook-0916 Features" | 236 | menu "PKUnity NetBook-0916 Features" |
diff --git a/arch/unicore32/configs/debug_defconfig b/arch/unicore32/configs/debug_defconfig index b5fbde9f1cb2..9b9c2519a38f 100644 --- a/arch/unicore32/configs/debug_defconfig +++ b/arch/unicore32/configs/debug_defconfig | |||
@@ -64,7 +64,6 @@ CONFIG_I2C_BATTERY_BQ27200=n | |||
64 | CONFIG_I2C_EEPROM_AT24=n | 64 | CONFIG_I2C_EEPROM_AT24=n |
65 | CONFIG_LCD_BACKLIGHT=n | 65 | CONFIG_LCD_BACKLIGHT=n |
66 | 66 | ||
67 | CONFIG_PUV3_RTC=y | ||
68 | CONFIG_PUV3_UMAL=y | 67 | CONFIG_PUV3_UMAL=y |
69 | CONFIG_PUV3_MUSB=n | 68 | CONFIG_PUV3_MUSB=n |
70 | CONFIG_PUV3_AC97=n | 69 | CONFIG_PUV3_AC97=n |
@@ -167,8 +166,9 @@ CONFIG_LEDS_TRIGGER_IDE_DISK=y | |||
167 | CONFIG_LEDS_TRIGGER_HEARTBEAT=y | 166 | CONFIG_LEDS_TRIGGER_HEARTBEAT=y |
168 | 167 | ||
169 | # Real Time Clock | 168 | # Real Time Clock |
170 | CONFIG_RTC_LIB=m | 169 | CONFIG_RTC_LIB=y |
171 | CONFIG_RTC_CLASS=m | 170 | CONFIG_RTC_CLASS=y |
171 | CONFIG_RTC_DRV_PUV3=y | ||
172 | 172 | ||
173 | ### File systems | 173 | ### File systems |
174 | CONFIG_EXT2_FS=m | 174 | CONFIG_EXT2_FS=m |
diff --git a/arch/unicore32/kernel/Makefile b/arch/unicore32/kernel/Makefile index ec23a2fb2f50..aeb0f181568e 100644 --- a/arch/unicore32/kernel/Makefile +++ b/arch/unicore32/kernel/Makefile | |||
@@ -16,7 +16,6 @@ obj-$(CONFIG_UNICORE_FPU_F64) += fpu-ucf64.o | |||
16 | obj-$(CONFIG_ARCH_PUV3) += clock.o irq.o time.o | 16 | obj-$(CONFIG_ARCH_PUV3) += clock.o irq.o time.o |
17 | 17 | ||
18 | obj-$(CONFIG_PUV3_GPIO) += gpio.o | 18 | obj-$(CONFIG_PUV3_GPIO) += gpio.o |
19 | obj-$(CONFIG_PUV3_RTC) += rtc.o | ||
20 | obj-$(CONFIG_PUV3_PWM) += pwm.o | 19 | obj-$(CONFIG_PUV3_PWM) += pwm.o |
21 | obj-$(CONFIG_PUV3_PM) += pm.o sleep.o | 20 | obj-$(CONFIG_PUV3_PM) += pm.o sleep.o |
22 | obj-$(CONFIG_HIBERNATION) += hibernate.o hibernate_asm.o | 21 | obj-$(CONFIG_HIBERNATION) += hibernate.o hibernate_asm.o |
diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig index f822e13dc04b..ce2aabf5c550 100644 --- a/drivers/rtc/Kconfig +++ b/drivers/rtc/Kconfig | |||
@@ -1051,4 +1051,13 @@ config RTC_DRV_TILE | |||
1051 | Enable support for the Linux driver side of the Tilera | 1051 | Enable support for the Linux driver side of the Tilera |
1052 | hypervisor's real-time clock interface. | 1052 | hypervisor's real-time clock interface. |
1053 | 1053 | ||
1054 | config RTC_DRV_PUV3 | ||
1055 | tristate "PKUnity v3 RTC support" | ||
1056 | depends on ARCH_PUV3 | ||
1057 | help | ||
1058 | This enables support for the RTC in the PKUnity-v3 SoCs. | ||
1059 | |||
1060 | This drive can also be built as a module. If so, the module | ||
1061 | will be called rtc-puv3. | ||
1062 | |||
1054 | endif # RTC_CLASS | 1063 | endif # RTC_CLASS |
diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile index 213d725f16d4..0ffefe877bfa 100644 --- a/drivers/rtc/Makefile +++ b/drivers/rtc/Makefile | |||
@@ -78,6 +78,7 @@ obj-$(CONFIG_RTC_DRV_PCF50633) += rtc-pcf50633.o | |||
78 | obj-$(CONFIG_RTC_DRV_PL030) += rtc-pl030.o | 78 | obj-$(CONFIG_RTC_DRV_PL030) += rtc-pl030.o |
79 | obj-$(CONFIG_RTC_DRV_PL031) += rtc-pl031.o | 79 | obj-$(CONFIG_RTC_DRV_PL031) += rtc-pl031.o |
80 | obj-$(CONFIG_RTC_DRV_PS3) += rtc-ps3.o | 80 | obj-$(CONFIG_RTC_DRV_PS3) += rtc-ps3.o |
81 | obj-$(CONFIG_RTC_DRV_PUV3) += rtc-puv3.o | ||
81 | obj-$(CONFIG_RTC_DRV_PXA) += rtc-pxa.o | 82 | obj-$(CONFIG_RTC_DRV_PXA) += rtc-pxa.o |
82 | obj-$(CONFIG_RTC_DRV_R9701) += rtc-r9701.o | 83 | obj-$(CONFIG_RTC_DRV_R9701) += rtc-r9701.o |
83 | obj-$(CONFIG_RTC_DRV_RP5C01) += rtc-rp5c01.o | 84 | obj-$(CONFIG_RTC_DRV_RP5C01) += rtc-rp5c01.o |
diff --git a/arch/unicore32/kernel/rtc.c b/drivers/rtc/rtc-puv3.c index 8cad70b3302c..46f14b82f3ab 100644 --- a/arch/unicore32/kernel/rtc.c +++ b/drivers/rtc/rtc-puv3.c | |||
@@ -1,7 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * linux/arch/unicore32/kernel/rtc.c | 2 | * RTC driver code specific to PKUnity SoC and UniCore ISA |
3 | * | ||
4 | * Code specific to PKUnity SoC and UniCore ISA | ||
5 | * | 3 | * |
6 | * Maintained by GUAN Xue-tao <gxt@mprc.pku.edu.cn> | 4 | * Maintained by GUAN Xue-tao <gxt@mprc.pku.edu.cn> |
7 | * Copyright (C) 2001-2010 Guan Xuetao | 5 | * Copyright (C) 2001-2010 Guan Xuetao |
@@ -36,7 +34,6 @@ static int puv3_rtc_tickno = IRQ_RTC; | |||
36 | static DEFINE_SPINLOCK(puv3_rtc_pie_lock); | 34 | static DEFINE_SPINLOCK(puv3_rtc_pie_lock); |
37 | 35 | ||
38 | /* IRQ Handlers */ | 36 | /* IRQ Handlers */ |
39 | |||
40 | static irqreturn_t puv3_rtc_alarmirq(int irq, void *id) | 37 | static irqreturn_t puv3_rtc_alarmirq(int irq, void *id) |
41 | { | 38 | { |
42 | struct rtc_device *rdev = id; | 39 | struct rtc_device *rdev = id; |
@@ -89,7 +86,6 @@ static int puv3_rtc_setpie(struct device *dev, int enabled) | |||
89 | } | 86 | } |
90 | 87 | ||
91 | /* Time read/write */ | 88 | /* Time read/write */ |
92 | |||
93 | static int puv3_rtc_gettime(struct device *dev, struct rtc_time *rtc_tm) | 89 | static int puv3_rtc_gettime(struct device *dev, struct rtc_time *rtc_tm) |
94 | { | 90 | { |
95 | rtc_time_to_tm(readl(RTC_RCNR), rtc_tm); | 91 | rtc_time_to_tm(readl(RTC_RCNR), rtc_tm); |
@@ -196,7 +192,6 @@ static void puv3_rtc_release(struct device *dev) | |||
196 | struct rtc_device *rtc_dev = platform_get_drvdata(pdev); | 192 | struct rtc_device *rtc_dev = platform_get_drvdata(pdev); |
197 | 193 | ||
198 | /* do not clear AIE here, it may be needed for wake */ | 194 | /* do not clear AIE here, it may be needed for wake */ |
199 | |||
200 | puv3_rtc_setpie(dev, 0); | 195 | puv3_rtc_setpie(dev, 0); |
201 | free_irq(puv3_rtc_alarmno, rtc_dev); | 196 | free_irq(puv3_rtc_alarmno, rtc_dev); |
202 | free_irq(puv3_rtc_tickno, rtc_dev); | 197 | free_irq(puv3_rtc_tickno, rtc_dev); |
@@ -218,7 +213,6 @@ static void puv3_rtc_enable(struct platform_device *pdev, int en) | |||
218 | writel(readl(RTC_RTSR) & ~RTC_RTSR_HZE, RTC_RTSR); | 213 | writel(readl(RTC_RTSR) & ~RTC_RTSR_HZE, RTC_RTSR); |
219 | } else { | 214 | } else { |
220 | /* re-enable the device, and check it is ok */ | 215 | /* re-enable the device, and check it is ok */ |
221 | |||
222 | if ((readl(RTC_RTSR) & RTC_RTSR_HZE) == 0) { | 216 | if ((readl(RTC_RTSR) & RTC_RTSR_HZE) == 0) { |
223 | dev_info(&pdev->dev, "rtc disabled, re-enabling\n"); | 217 | dev_info(&pdev->dev, "rtc disabled, re-enabling\n"); |
224 | writel(readl(RTC_RTSR) | RTC_RTSR_HZE, RTC_RTSR); | 218 | writel(readl(RTC_RTSR) | RTC_RTSR_HZE, RTC_RTSR); |
@@ -251,7 +245,6 @@ static int puv3_rtc_probe(struct platform_device *pdev) | |||
251 | pr_debug("%s: probe=%p\n", __func__, pdev); | 245 | pr_debug("%s: probe=%p\n", __func__, pdev); |
252 | 246 | ||
253 | /* find the IRQs */ | 247 | /* find the IRQs */ |
254 | |||
255 | puv3_rtc_tickno = platform_get_irq(pdev, 1); | 248 | puv3_rtc_tickno = platform_get_irq(pdev, 1); |
256 | if (puv3_rtc_tickno < 0) { | 249 | if (puv3_rtc_tickno < 0) { |
257 | dev_err(&pdev->dev, "no irq for rtc tick\n"); | 250 | dev_err(&pdev->dev, "no irq for rtc tick\n"); |
@@ -268,7 +261,6 @@ static int puv3_rtc_probe(struct platform_device *pdev) | |||
268 | puv3_rtc_tickno, puv3_rtc_alarmno); | 261 | puv3_rtc_tickno, puv3_rtc_alarmno); |
269 | 262 | ||
270 | /* get the memory region */ | 263 | /* get the memory region */ |
271 | |||
272 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 264 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
273 | if (res == NULL) { | 265 | if (res == NULL) { |
274 | dev_err(&pdev->dev, "failed to get memory region resource\n"); | 266 | dev_err(&pdev->dev, "failed to get memory region resource\n"); |
@@ -288,7 +280,6 @@ static int puv3_rtc_probe(struct platform_device *pdev) | |||
288 | puv3_rtc_enable(pdev, 1); | 280 | puv3_rtc_enable(pdev, 1); |
289 | 281 | ||
290 | /* register RTC and exit */ | 282 | /* register RTC and exit */ |
291 | |||
292 | rtc = rtc_device_register("pkunity", &pdev->dev, &puv3_rtcops, | 283 | rtc = rtc_device_register("pkunity", &pdev->dev, &puv3_rtcops, |
293 | THIS_MODULE); | 284 | THIS_MODULE); |
294 | 285 | ||
@@ -315,8 +306,6 @@ static int puv3_rtc_probe(struct platform_device *pdev) | |||
315 | 306 | ||
316 | #ifdef CONFIG_PM | 307 | #ifdef CONFIG_PM |
317 | 308 | ||
318 | /* RTC Power management control */ | ||
319 | |||
320 | static int ticnt_save; | 309 | static int ticnt_save; |
321 | 310 | ||
322 | static int puv3_rtc_suspend(struct platform_device *pdev, pm_message_t state) | 311 | static int puv3_rtc_suspend(struct platform_device *pdev, pm_message_t state) |
@@ -368,4 +357,3 @@ module_exit(puv3_rtc_exit); | |||
368 | MODULE_DESCRIPTION("RTC Driver for the PKUnity v3 chip"); | 357 | MODULE_DESCRIPTION("RTC Driver for the PKUnity v3 chip"); |
369 | MODULE_AUTHOR("Hu Dongliang"); | 358 | MODULE_AUTHOR("Hu Dongliang"); |
370 | MODULE_LICENSE("GPL v2"); | 359 | MODULE_LICENSE("GPL v2"); |
371 | |||