diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2012-02-15 20:51:37 +0800 |
---|---|---|
committer | Nicolas Ferre <nicolas.ferre@atmel.com> | 2012-02-23 14:57:57 +0100 |
commit | 205056a3ea33f5aca7adffa4584eb6572b1d3273 (patch) | |
tree | 1672d459205d815001b097ff951a55c8a1299b86 /arch/arm/mach-at91/at91sam9263_devices.c | |
parent | b55149529d265718a989b67468c4f03de0d3af7a (diff) | |
download | linux-205056a3ea33f5aca7adffa4584eb6572b1d3273.tar.gz linux-205056a3ea33f5aca7adffa4584eb6572b1d3273.tar.bz2 linux-205056a3ea33f5aca7adffa4584eb6572b1d3273.zip |
ARM: at91/rtc-at91sam9: each SoC can select the RTT device to use
For the RTT as RTC driver rtc-at91sam9, the platform_device structure
is filled during SoC initialization. This will allow to convert this
RTC driver as a standard platform driver.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Diffstat (limited to 'arch/arm/mach-at91/at91sam9263_devices.c')
-rw-r--r-- | arch/arm/mach-at91/at91sam9263_devices.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c index 545826b16a87..b4a6adb39b22 100644 --- a/arch/arm/mach-at91/at91sam9263_devices.c +++ b/arch/arm/mach-at91/at91sam9263_devices.c @@ -992,8 +992,33 @@ static struct platform_device at91sam9263_rtt1_device = { .num_resources = ARRAY_SIZE(rtt1_resources), }; +#if IS_ENABLED(CONFIG_RTC_DRV_AT91SAM9) +static void __init at91_add_device_rtt_rtc(void) +{ + struct platform_device *pdev; + + switch (CONFIG_RTC_DRV_AT91SAM9_RTT) { + case 0: + pdev = &at91sam9263_rtt0_device; + break; + case 1: + pdev = &at91sam9263_rtt1_device; + break; + default: + pr_err("at91sam9263: support only 2 RTT (%d)\n", + CONFIG_RTC_DRV_AT91SAM9_RTT); + return; + } + + pdev->name = "rtc-at91sam9"; +} +#else +static void __init at91_add_device_rtt_rtc(void) {} +#endif + static void __init at91_add_device_rtt(void) { + at91_add_device_rtt_rtc(); platform_device_register(&at91sam9263_rtt0_device); platform_device_register(&at91sam9263_rtt1_device); } |