RTC:driver for Cortina's SOC
PATCH v3 1/1 RTC:driver for Cortina's SOC
this is the third round for including the RTC driver on Gemini SoC changes:
v2:
- using readl/writel
- line wrapping at parenthesis
- fixed spaces around '*'
- add driver file to MAINTAINERS
v3:
- spaces around '*' (again)
- line wrapping at parenthesis (again)
- add missed ARCH_GEMINI (found by Paul)
Hope I missed nothing ;-)
Ulli
From: Hans Ulli Kroll <[email protected]>
Subject: [PATCHv3] RTC:driver for Cortina's SOC
In-Reply-To:
PATCH 1/1 RTC:driver for Cortina's SOC
Driver for the on chip RTC found on Cortina's SoC Gemini.
--- MAINTAINERS | 3 +- drivers/rtc/Kconfig | 10 +++ drivers/rtc/Makefile | 1 + drivers/rtc/rtc-gemini.c | 191 +++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 204 insertions(+), 1 deletion(-) create mode 100644 drivers/rtc/rtc-gemini.c
MAINTAINERS +2 -1
@@ -975,9 +975,10 @@ S: Maintained ARM/CORTINA SYSTEMS GEMINI ARM ARCHITECTURE M: Hans Ulli Kroll <[email protected]> L: [email protected] (moderated for non-subscribers) -T: git git://git.berlios.de/gemini-board +T: git git://github.com/ulli-kroll/linux.git S: Maintained F: arch/arm/mach-gemini/ +F: drivers/rtc/rtc-gemini.c ARM/CSR SIRFPRIMA2 MACHINE SUPPORT M: Barry Song <[email protected]>
drivers/rtc/Kconfig +10 -0
@@ -1362,6 +1362,16 @@ config RTC_DRV_ARMADA38X This driver can also be built as a module. If so, the module will be called armada38x-rtc. +config RTC_DRV_GEMINI + tristate "Gemini SoC RTC" + depends on ARCH_GEMINI + help + If you say Y here you will get support for the + RTC found on Gemini SoC's. + + This driver can also be built as a module. If so, the module + will be called rtc-gemini. + config RTC_DRV_PS3 tristate "PS3 RTC" depends on PPC_PS3
drivers/rtc/Makefile +1 -0
@@ -64,6 +64,7 @@ obj-$(CONFIG_RTC_DRV_EFI) += rtc-efi.o obj-$(CONFIG_RTC_DRV_EM3027) += rtc-em3027.o obj-$(CONFIG_RTC_DRV_EP93XX) += rtc-ep93xx.o obj-$(CONFIG_RTC_DRV_FM3130) += rtc-fm3130.o +obj-$(CONFIG_RTC_DRV_GEMINI) += rtc-gemini.o obj-$(CONFIG_RTC_DRV_GENERIC) += rtc-generic.o obj-$(CONFIG_RTC_DRV_HID_SENSOR_TIME) += rtc-hid-sensor-time.o obj-$(CONFIG_RTC_DRV_HYM8563) += rtc-hym8563.o
drivers/rtc/rtc-gemini.c new file +191 -0
191 lines not on this page · raw message
Signature · 1 line
2.4.0
Quoted 1 line · Hans Ulli Kroll
Driver for the on chip RTC found on Cortina's SoC Gemini.
[]
Quoted 1 line
Hope I missed nothing ;-)
Nothing important enough to stop this being applied as far as I can tell.
Just a trivial typo or two
drivers/rtc/rtc-gemini.c
Quoted 1 line
drivers/rtc/rtc-gemini.c +0
-0
[]
Quoted 1 line
+ * Original code for older kernel 2.6.15 are form Stormlinksemi
form/from
Quoted 3 lines
+ * first update from Janos Laube for > 2.6.29 kernels
+ *
+ * checkpatch fixes and usage off rtc-lib code
off/of
drivers/rtc/rtc-gemini.c line 98
Quoted 8 lines
drivers/rtc/rtc-gemini.c +8
-0+static int gemini_rtc_set_time (struct device *dev,struct rtc_time *tm) +{ +struct gemini_rtc *rtc =dev_get_drvdata (dev); +unsigned int sec, min, hour, day; +unsigned long offset, time; + +if (tm->tm_year >=2148 )/* EPOCH Year + 179 */ +return -EINVAL ;
obviously defective hardware...
drivers/rtc/rtc-gemini.c line 129
Quoted 10 lines
drivers/rtc/rtc-gemini.c +10
-0+static int gemini_rtc_probe (struct platform_device *pdev) +{ +struct gemini_rtc *rtc; +struct device *dev = &pdev->dev; +struct resource *res; +int ret; + + rtc =kzalloc (sizeof (*rtc),GFP_KERNEL ); +if (unlikely (!rtc)) +return -ENOMEM ;
likely unnecessary unlikely
Quoted 3 lines · Hans Ulli Kroll
- add missed
ARCH_GEMINI(found by Paul)Hope I missed nothing ;-)
As the driver uses readl(), perhaps it needs a dependency on HAS_IOMEM, to exclude the driver on UML?
I didn't check, though.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Quoted 11 lines · Geert Uytterhoeven
Quoted 3 lines · Hans Ulli Kroll
- add missed
ARCH_GEMINI(found by Paul)Hope I missed nothing ;-)
As the driver uses
readl(), perhaps it needs a dependency onHAS_IOMEM, to exclude the driver on UML?I didn't check, though.
Hmm, as this is using mem regionms for IO this will be better.
I will resend another patch which HAS_IOMEM, and some type fixesy
Ulli.