: Add support for Dallas/Maxim DS1685/1687 RTC
PATCH 2/2 : Add support for Dallas/Maxim DS1685/1687 RTC
Wire SGI O2 (IP32) to use the rtc-ds1685 driver as its RTC.
Signed-off-by Joshua Kinard <[email protected]>
--- arch/mips/sgi-ip32/ip32-platform.c | 25 ++++++++++----- arch/mips/sgi-ip32/ip32-reset.c | 53 --------------------------------- drivers/rtc/Kconfig | 17 +++++++++- include/linux/rtc/ds1685.h | 58 +++++++++++++++++++++++++++++++++++-- 4 files changed, 88 insertions(+), 65 deletions(-)
arch/mips/sgi-ip32/ip32-platform.c +17 -8
@@ -90,21 +90,30 @@ static __init int sgio2btns_devinit(voiddevice_initcall (sgio2btns_devinit); -static struct resource sgio2_cmos_rsrc[] = { +#define MACE_RTC_RES_START (MACE_BASE + offsetof(struct sgi_mace, isa.rtc)) +#define MACE_RTC_RES_END (MACE_RTC_RES_START + 32767) + +static struct resource ip32_rtc_resources[] = { { - .start =0x70 , - .end =0x71 , - .flags =IORESOURCE_IO + .start =MACEISA_RTC_IRQ , + .end =MACEISA_RTC_IRQ , + .flags =IORESOURCE_IRQ + }, { + .start =MACE_RTC_RES_START , + .end =MACE_RTC_RES_END , + .flags =IORESOURCE_MEM , } }; -static __init int sgio2_cmos_devinit (void ) + + +static __init int sgio2_rtc_devinit (void ) { -return IS_ERR (platform_device_register_simple ("rtc_cmos" ,-1 , - sgio2_cmos_rsrc,1 )); +return IS_ERR (platform_device_register_simple ("rtc-ds1685" ,-1 , + ip32_rtc_resources,ARRAY_SIZE (ip32_rtc_resources))); } -device_initcall (sgio2_cmos_devinit); +device_initcall (sgio2_rtc_devinit);MODULE_AUTHOR ("Ralf Baechle <[email protected]>" );MODULE_LICENSE ("GPL" );
arch/mips/sgi-ip32/ip32-reset.c +1 -52
77 lines not on this page · raw message
drivers/rtc/Kconfig +15 -2
@@ -501,17 +501,30 @@ config RTC_DRV_DS1553 config RTC_DRV_DS1685 tristate "Dallas/Maxim DS1685/DS1687" - depends on I2C + depends on (I2C || SGI_IP32) help If you say yes here you get support for the Dallas/Maxim DS1685/DS1687 timekeeping chip. Systems that use this chip include EPPC-405-UC modules, by - electronic system design GmbH. + electronic system design GmbH, and the SGI O2 (IP32). + + This module also supports the DS17285/DS17287 timekeeping chips + that are sometimes found in place of the DS1685/DS1687 in some + SGI O2 systems. This driver can also be built as a module. If so, the module will be called rtc-ds1685. +config RTC_DRV_DS17285 + bool "Enable DS17285/DS17287 Differences" + depends on (SGI_IP32 && RTC_DRV_DS1685) + help + If your SGI O2 has one of these RTC chips instead of the more + common DS1687-5 chip, say Y here to enable the minor differences + this particular chip has. For more information, refer to the + Dallas/Maxim datasheet for the DS17285/DS17287 chip. + config RTC_DRV_DS1742 tristate "Maxim/Dallas DS1742/1743" help
include/linux/rtc/ds1685.h +55 -3
104 lines not on this page · raw message