diff options
22 files changed, 86 insertions, 64 deletions
diff --git a/arch/arm/configs/realview-smp_defconfig b/arch/arm/configs/realview-smp_defconfig index abe61bf379d2..1da5d9e48224 100644 --- a/arch/arm/configs/realview-smp_defconfig +++ b/arch/arm/configs/realview-smp_defconfig | |||
@@ -76,8 +76,10 @@ CONFIG_MMC=y | |||
76 | CONFIG_MMC_ARMMMCI=y | 76 | CONFIG_MMC_ARMMMCI=y |
77 | CONFIG_NEW_LEDS=y | 77 | CONFIG_NEW_LEDS=y |
78 | CONFIG_LEDS_CLASS=y | 78 | CONFIG_LEDS_CLASS=y |
79 | CONFIG_LEDS_VERSATILE=y | ||
79 | CONFIG_LEDS_TRIGGERS=y | 80 | CONFIG_LEDS_TRIGGERS=y |
80 | CONFIG_LEDS_TRIGGER_HEARTBEAT=y | 81 | CONFIG_LEDS_TRIGGER_HEARTBEAT=y |
82 | CONFIG_LEDS_TRIGGER_CPU=y | ||
81 | CONFIG_RTC_CLASS=y | 83 | CONFIG_RTC_CLASS=y |
82 | CONFIG_RTC_DRV_DS1307=y | 84 | CONFIG_RTC_DRV_DS1307=y |
83 | CONFIG_RTC_DRV_PL031=y | 85 | CONFIG_RTC_DRV_PL031=y |
diff --git a/arch/arm/configs/realview_defconfig b/arch/arm/configs/realview_defconfig index 7079cbe898a8..d02e9d911bb7 100644 --- a/arch/arm/configs/realview_defconfig +++ b/arch/arm/configs/realview_defconfig | |||
@@ -75,8 +75,10 @@ CONFIG_MMC=y | |||
75 | CONFIG_MMC_ARMMMCI=y | 75 | CONFIG_MMC_ARMMMCI=y |
76 | CONFIG_NEW_LEDS=y | 76 | CONFIG_NEW_LEDS=y |
77 | CONFIG_LEDS_CLASS=y | 77 | CONFIG_LEDS_CLASS=y |
78 | CONFIG_LEDS_VERSATILE=y | ||
78 | CONFIG_LEDS_TRIGGERS=y | 79 | CONFIG_LEDS_TRIGGERS=y |
79 | CONFIG_LEDS_TRIGGER_HEARTBEAT=y | 80 | CONFIG_LEDS_TRIGGER_HEARTBEAT=y |
81 | CONFIG_LEDS_TRIGGER_CPU=y | ||
80 | CONFIG_RTC_CLASS=y | 82 | CONFIG_RTC_CLASS=y |
81 | CONFIG_RTC_DRV_DS1307=y | 83 | CONFIG_RTC_DRV_DS1307=y |
82 | CONFIG_RTC_DRV_PL031=y | 84 | CONFIG_RTC_DRV_PL031=y |
diff --git a/arch/arm/configs/versatile_defconfig b/arch/arm/configs/versatile_defconfig index 073541a50e23..d52b4ffe2012 100644 --- a/arch/arm/configs/versatile_defconfig +++ b/arch/arm/configs/versatile_defconfig | |||
@@ -61,6 +61,9 @@ CONFIG_SND_ARMAACI=m | |||
61 | CONFIG_MMC=y | 61 | CONFIG_MMC=y |
62 | CONFIG_MMC_ARMMMCI=m | 62 | CONFIG_MMC_ARMMMCI=m |
63 | CONFIG_NEW_LEDS=y | 63 | CONFIG_NEW_LEDS=y |
64 | CONFIG_LEDS_CLASS=y | ||
65 | CONFIG_LEDS_VERSATILE=y | ||
66 | CONFIG_LEDS_TRIGGERS=y | ||
64 | CONFIG_LEDS_TRIGGER_HEARTBEAT=y | 67 | CONFIG_LEDS_TRIGGER_HEARTBEAT=y |
65 | CONFIG_LEDS_TRIGGER_CPU=y | 68 | CONFIG_LEDS_TRIGGER_CPU=y |
66 | CONFIG_EXT2_FS=y | 69 | CONFIG_EXT2_FS=y |
diff --git a/arch/arm/mach-bcm/Kconfig b/arch/arm/mach-bcm/Kconfig index 49c914cd9c7a..9f19636fea2f 100644 --- a/arch/arm/mach-bcm/Kconfig +++ b/arch/arm/mach-bcm/Kconfig | |||
@@ -11,7 +11,6 @@ menu "Broadcom SoC Selection" | |||
11 | 11 | ||
12 | config ARCH_BCM_MOBILE | 12 | config ARCH_BCM_MOBILE |
13 | bool "Broadcom Mobile SoC" if ARCH_MULTI_V7 | 13 | bool "Broadcom Mobile SoC" if ARCH_MULTI_V7 |
14 | depends on MMU | ||
15 | select ARCH_REQUIRE_GPIOLIB | 14 | select ARCH_REQUIRE_GPIOLIB |
16 | select ARM_ERRATA_754322 | 15 | select ARM_ERRATA_754322 |
17 | select ARM_ERRATA_764369 if SMP | 16 | select ARM_ERRATA_764369 if SMP |
@@ -33,10 +32,7 @@ config ARCH_BCM2835 | |||
33 | select ARM_AMBA | 32 | select ARM_AMBA |
34 | select ARM_ERRATA_411920 | 33 | select ARM_ERRATA_411920 |
35 | select ARM_TIMER_SP804 | 34 | select ARM_TIMER_SP804 |
36 | select CLKDEV_LOOKUP | ||
37 | select CLKSRC_OF | 35 | select CLKSRC_OF |
38 | select CPU_V6 | ||
39 | select GENERIC_CLOCKEVENTS | ||
40 | select PINCTRL | 36 | select PINCTRL |
41 | select PINCTRL_BCM2835 | 37 | select PINCTRL_BCM2835 |
42 | help | 38 | help |
@@ -45,14 +41,10 @@ config ARCH_BCM2835 | |||
45 | 41 | ||
46 | config ARCH_BCM_5301X | 42 | config ARCH_BCM_5301X |
47 | bool "Broadcom BCM470X / BCM5301X ARM SoC" if ARCH_MULTI_V7 | 43 | bool "Broadcom BCM470X / BCM5301X ARM SoC" if ARCH_MULTI_V7 |
48 | depends on MMU | ||
49 | select ARM_GIC | 44 | select ARM_GIC |
50 | select CACHE_L2X0 | 45 | select CACHE_L2X0 |
51 | select HAVE_ARM_SCU if SMP | 46 | select HAVE_ARM_SCU if SMP |
52 | select HAVE_ARM_TWD if SMP | 47 | select HAVE_ARM_TWD if SMP |
53 | select HAVE_SMP | ||
54 | select COMMON_CLK | ||
55 | select GENERIC_CLOCKEVENTS | ||
56 | select ARM_GLOBAL_TIMER | 48 | select ARM_GLOBAL_TIMER |
57 | select CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK | 49 | select CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK |
58 | select MIGHT_HAVE_PCI | 50 | select MIGHT_HAVE_PCI |
diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig index 3f73eecbcfb0..bfc5af18e483 100644 --- a/arch/arm/mach-mvebu/Kconfig +++ b/arch/arm/mach-mvebu/Kconfig | |||
@@ -3,7 +3,6 @@ config ARCH_MVEBU | |||
3 | select ARCH_SUPPORTS_BIG_ENDIAN | 3 | select ARCH_SUPPORTS_BIG_ENDIAN |
4 | select CLKSRC_MMIO | 4 | select CLKSRC_MMIO |
5 | select GENERIC_IRQ_CHIP | 5 | select GENERIC_IRQ_CHIP |
6 | select IRQ_DOMAIN | ||
7 | select PINCTRL | 6 | select PINCTRL |
8 | select PLAT_ORION | 7 | select PLAT_ORION |
9 | select MVEBU_MBUS | 8 | select MVEBU_MBUS |
@@ -11,7 +10,6 @@ config ARCH_MVEBU | |||
11 | select ARCH_REQUIRE_GPIOLIB | 10 | select ARCH_REQUIRE_GPIOLIB |
12 | select MIGHT_HAVE_PCI | 11 | select MIGHT_HAVE_PCI |
13 | select PCI_QUIRKS if PCI | 12 | select PCI_QUIRKS if PCI |
14 | select OF_ADDRESS_PCI | ||
15 | 13 | ||
16 | if ARCH_MVEBU | 14 | if ARCH_MVEBU |
17 | 15 | ||
@@ -38,7 +36,6 @@ config MACH_ARMADA_375 | |||
38 | select ARM_ERRATA_753970 | 36 | select ARM_ERRATA_753970 |
39 | select ARM_GIC | 37 | select ARM_GIC |
40 | select ARMADA_375_CLK | 38 | select ARMADA_375_CLK |
41 | select CPU_V7 | ||
42 | select MACH_MVEBU_V7 | 39 | select MACH_MVEBU_V7 |
43 | select PINCTRL_ARMADA_375 | 40 | select PINCTRL_ARMADA_375 |
44 | help | 41 | help |
@@ -51,7 +48,6 @@ config MACH_ARMADA_38X | |||
51 | select ARM_ERRATA_753970 | 48 | select ARM_ERRATA_753970 |
52 | select ARM_GIC | 49 | select ARM_GIC |
53 | select ARMADA_38X_CLK | 50 | select ARMADA_38X_CLK |
54 | select CPU_V7 | ||
55 | select MACH_MVEBU_V7 | 51 | select MACH_MVEBU_V7 |
56 | select PINCTRL_ARMADA_38X | 52 | select PINCTRL_ARMADA_38X |
57 | help | 53 | help |
@@ -86,13 +82,11 @@ config MACH_KIRKWOOD | |||
86 | select ARCH_REQUIRE_GPIOLIB | 82 | select ARCH_REQUIRE_GPIOLIB |
87 | select CPU_FEROCEON | 83 | select CPU_FEROCEON |
88 | select KIRKWOOD_CLK | 84 | select KIRKWOOD_CLK |
89 | select OF_IRQ | ||
90 | select ORION_IRQCHIP | 85 | select ORION_IRQCHIP |
91 | select ORION_TIMER | 86 | select ORION_TIMER |
92 | select PCI | 87 | select PCI |
93 | select PCI_QUIRKS | 88 | select PCI_QUIRKS |
94 | select PINCTRL_KIRKWOOD | 89 | select PINCTRL_KIRKWOOD |
95 | select USE_OF | ||
96 | help | 90 | help |
97 | Say 'Y' here if you want your kernel to support boards based | 91 | Say 'Y' here if you want your kernel to support boards based |
98 | on the Marvell Kirkwood device tree. | 92 | on the Marvell Kirkwood device tree. |
diff --git a/arch/arm/mach-qcom/Kconfig b/arch/arm/mach-qcom/Kconfig index a028be234334..6aa22147cace 100644 --- a/arch/arm/mach-qcom/Kconfig +++ b/arch/arm/mach-qcom/Kconfig | |||
@@ -3,8 +3,6 @@ config ARCH_QCOM | |||
3 | select ARCH_REQUIRE_GPIOLIB | 3 | select ARCH_REQUIRE_GPIOLIB |
4 | select ARM_GIC | 4 | select ARM_GIC |
5 | select CLKSRC_OF | 5 | select CLKSRC_OF |
6 | select GENERIC_CLOCKEVENTS | ||
7 | select HAVE_SMP | ||
8 | select QCOM_SCM if SMP | 6 | select QCOM_SCM if SMP |
9 | help | 7 | help |
10 | Support for Qualcomm's devicetree based systems. | 8 | Support for Qualcomm's devicetree based systems. |
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c index 1d5ee5c9a1dc..960b8dd78c44 100644 --- a/arch/arm/mach-realview/core.c +++ b/arch/arm/mach-realview/core.c | |||
@@ -148,6 +148,21 @@ struct platform_device realview_cf_device = { | |||
148 | }, | 148 | }, |
149 | }; | 149 | }; |
150 | 150 | ||
151 | static struct resource realview_leds_resources[] = { | ||
152 | { | ||
153 | .start = REALVIEW_SYS_BASE + REALVIEW_SYS_LED_OFFSET, | ||
154 | .end = REALVIEW_SYS_BASE + REALVIEW_SYS_LED_OFFSET + 4, | ||
155 | .flags = IORESOURCE_MEM, | ||
156 | }, | ||
157 | }; | ||
158 | |||
159 | struct platform_device realview_leds_device = { | ||
160 | .name = "versatile-leds", | ||
161 | .id = -1, | ||
162 | .num_resources = ARRAY_SIZE(realview_leds_resources), | ||
163 | .resource = realview_leds_resources, | ||
164 | }; | ||
165 | |||
151 | static struct resource realview_i2c_resource = { | 166 | static struct resource realview_i2c_resource = { |
152 | .start = REALVIEW_I2C_BASE, | 167 | .start = REALVIEW_I2C_BASE, |
153 | .end = REALVIEW_I2C_BASE + SZ_4K - 1, | 168 | .end = REALVIEW_I2C_BASE + SZ_4K - 1, |
diff --git a/arch/arm/mach-realview/core.h b/arch/arm/mach-realview/core.h index 602ca5ec52c5..13dc830ef469 100644 --- a/arch/arm/mach-realview/core.h +++ b/arch/arm/mach-realview/core.h | |||
@@ -37,6 +37,7 @@ struct machine_desc; | |||
37 | 37 | ||
38 | extern struct platform_device realview_flash_device; | 38 | extern struct platform_device realview_flash_device; |
39 | extern struct platform_device realview_cf_device; | 39 | extern struct platform_device realview_cf_device; |
40 | extern struct platform_device realview_leds_device; | ||
40 | extern struct platform_device realview_i2c_device; | 41 | extern struct platform_device realview_i2c_device; |
41 | extern struct mmci_platform_data realview_mmc0_plat_data; | 42 | extern struct mmci_platform_data realview_mmc0_plat_data; |
42 | extern struct mmci_platform_data realview_mmc1_plat_data; | 43 | extern struct mmci_platform_data realview_mmc1_plat_data; |
diff --git a/arch/arm/mach-realview/realview_eb.c b/arch/arm/mach-realview/realview_eb.c index c85ddb2a0ad0..6bb070e80128 100644 --- a/arch/arm/mach-realview/realview_eb.c +++ b/arch/arm/mach-realview/realview_eb.c | |||
@@ -452,6 +452,7 @@ static void __init realview_eb_init(void) | |||
452 | realview_flash_register(&realview_eb_flash_resource, 1); | 452 | realview_flash_register(&realview_eb_flash_resource, 1); |
453 | platform_device_register(&realview_i2c_device); | 453 | platform_device_register(&realview_i2c_device); |
454 | platform_device_register(&char_lcd_device); | 454 | platform_device_register(&char_lcd_device); |
455 | platform_device_register(&realview_leds_device); | ||
455 | eth_device_register(); | 456 | eth_device_register(); |
456 | realview_usb_register(realview_eb_isp1761_resources); | 457 | realview_usb_register(realview_eb_isp1761_resources); |
457 | 458 | ||
diff --git a/arch/arm/mach-realview/realview_pb1176.c b/arch/arm/mach-realview/realview_pb1176.c index c5eade76461b..173f2c15de49 100644 --- a/arch/arm/mach-realview/realview_pb1176.c +++ b/arch/arm/mach-realview/realview_pb1176.c | |||
@@ -367,6 +367,7 @@ static void __init realview_pb1176_init(void) | |||
367 | realview_usb_register(realview_pb1176_isp1761_resources); | 367 | realview_usb_register(realview_pb1176_isp1761_resources); |
368 | platform_device_register(&pmu_device); | 368 | platform_device_register(&pmu_device); |
369 | platform_device_register(&char_lcd_device); | 369 | platform_device_register(&char_lcd_device); |
370 | platform_device_register(&realview_leds_device); | ||
370 | 371 | ||
371 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { | 372 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { |
372 | struct amba_device *d = amba_devs[i]; | 373 | struct amba_device *d = amba_devs[i]; |
diff --git a/arch/arm/mach-realview/realview_pb11mp.c b/arch/arm/mach-realview/realview_pb11mp.c index f4b0962578fe..bde7e6b1fd44 100644 --- a/arch/arm/mach-realview/realview_pb11mp.c +++ b/arch/arm/mach-realview/realview_pb11mp.c | |||
@@ -347,6 +347,7 @@ static void __init realview_pb11mp_init(void) | |||
347 | realview_eth_register(NULL, realview_pb11mp_smsc911x_resources); | 347 | realview_eth_register(NULL, realview_pb11mp_smsc911x_resources); |
348 | platform_device_register(&realview_i2c_device); | 348 | platform_device_register(&realview_i2c_device); |
349 | platform_device_register(&realview_cf_device); | 349 | platform_device_register(&realview_cf_device); |
350 | platform_device_register(&realview_leds_device); | ||
350 | realview_usb_register(realview_pb11mp_isp1761_resources); | 351 | realview_usb_register(realview_pb11mp_isp1761_resources); |
351 | platform_device_register(&pmu_device); | 352 | platform_device_register(&pmu_device); |
352 | 353 | ||
diff --git a/arch/arm/mach-realview/realview_pba8.c b/arch/arm/mach-realview/realview_pba8.c index 10a3e1d76891..4e57a8599265 100644 --- a/arch/arm/mach-realview/realview_pba8.c +++ b/arch/arm/mach-realview/realview_pba8.c | |||
@@ -289,6 +289,7 @@ static void __init realview_pba8_init(void) | |||
289 | realview_eth_register(NULL, realview_pba8_smsc911x_resources); | 289 | realview_eth_register(NULL, realview_pba8_smsc911x_resources); |
290 | platform_device_register(&realview_i2c_device); | 290 | platform_device_register(&realview_i2c_device); |
291 | platform_device_register(&realview_cf_device); | 291 | platform_device_register(&realview_cf_device); |
292 | platform_device_register(&realview_leds_device); | ||
292 | realview_usb_register(realview_pba8_isp1761_resources); | 293 | realview_usb_register(realview_pba8_isp1761_resources); |
293 | platform_device_register(&pmu_device); | 294 | platform_device_register(&pmu_device); |
294 | 295 | ||
diff --git a/arch/arm/mach-realview/realview_pbx.c b/arch/arm/mach-realview/realview_pbx.c index 9d75493e3f0c..72c96caebefa 100644 --- a/arch/arm/mach-realview/realview_pbx.c +++ b/arch/arm/mach-realview/realview_pbx.c | |||
@@ -385,6 +385,7 @@ static void __init realview_pbx_init(void) | |||
385 | realview_eth_register(NULL, realview_pbx_smsc911x_resources); | 385 | realview_eth_register(NULL, realview_pbx_smsc911x_resources); |
386 | platform_device_register(&realview_i2c_device); | 386 | platform_device_register(&realview_i2c_device); |
387 | platform_device_register(&realview_cf_device); | 387 | platform_device_register(&realview_cf_device); |
388 | platform_device_register(&realview_leds_device); | ||
388 | realview_usb_register(realview_pbx_isp1761_resources); | 389 | realview_usb_register(realview_pbx_isp1761_resources); |
389 | 390 | ||
390 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { | 391 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { |
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig index 0f92ba8e7884..edb1a914deb3 100644 --- a/arch/arm/mach-shmobile/Kconfig +++ b/arch/arm/mach-shmobile/Kconfig | |||
@@ -205,8 +205,8 @@ config MACH_ARMADILLO800EVA_REFERENCE | |||
205 | select SND_SOC_WM8978 if SND_SIMPLE_CARD | 205 | select SND_SOC_WM8978 if SND_SIMPLE_CARD |
206 | select USE_OF | 206 | select USE_OF |
207 | ---help--- | 207 | ---help--- |
208 | Use reference implementation of Aramdillo800 EVA board support | 208 | Use reference implementation of Armadillo800 EVA board support |
209 | which makes a greater use of device tree at the expense | 209 | which makes greater use of device tree at the expense |
210 | of not supporting a number of devices. | 210 | of not supporting a number of devices. |
211 | 211 | ||
212 | This is intended to aid developers | 212 | This is intended to aid developers |
diff --git a/arch/arm/mach-shmobile/setup-r8a7740.c b/arch/arm/mach-shmobile/setup-r8a7740.c index 8f3c68101d59..a177a7b3bdbd 100644 --- a/arch/arm/mach-shmobile/setup-r8a7740.c +++ b/arch/arm/mach-shmobile/setup-r8a7740.c | |||
@@ -765,7 +765,7 @@ static struct platform_device *r8a7740_late_devices[] __initdata = { | |||
765 | * "Media RAM (MERAM)" on r8a7740 documentation | 765 | * "Media RAM (MERAM)" on r8a7740 documentation |
766 | */ | 766 | */ |
767 | #define MEBUFCNTR 0xFE950098 | 767 | #define MEBUFCNTR 0xFE950098 |
768 | void r8a7740_meram_workaround(void) | 768 | void __init r8a7740_meram_workaround(void) |
769 | { | 769 | { |
770 | void __iomem *reg; | 770 | void __iomem *reg; |
771 | 771 | ||
@@ -869,17 +869,6 @@ void __init r8a7740_add_early_devices(void) | |||
869 | 869 | ||
870 | #ifdef CONFIG_USE_OF | 870 | #ifdef CONFIG_USE_OF |
871 | 871 | ||
872 | void __init r8a7740_add_early_devices_dt(void) | ||
873 | { | ||
874 | shmobile_setup_delay(800, 1, 3); /* Cortex-A9 @ 800MHz */ | ||
875 | |||
876 | early_platform_add_devices(r8a7740_early_devices, | ||
877 | ARRAY_SIZE(r8a7740_early_devices)); | ||
878 | |||
879 | /* setup early console here as well */ | ||
880 | shmobile_setup_console(); | ||
881 | } | ||
882 | |||
883 | void __init r8a7740_add_standard_devices_dt(void) | 872 | void __init r8a7740_add_standard_devices_dt(void) |
884 | { | 873 | { |
885 | platform_add_devices(r8a7740_devices_dt, | 874 | platform_add_devices(r8a7740_devices_dt, |
diff --git a/arch/arm/mach-shmobile/setup-sh7372.c b/arch/arm/mach-shmobile/setup-sh7372.c index 27301278c208..f8176b051be4 100644 --- a/arch/arm/mach-shmobile/setup-sh7372.c +++ b/arch/arm/mach-shmobile/setup-sh7372.c | |||
@@ -1037,11 +1037,7 @@ void __init sh7372_add_early_devices_dt(void) | |||
1037 | { | 1037 | { |
1038 | shmobile_setup_delay(800, 1, 3); /* Cortex-A8 @ 800MHz */ | 1038 | shmobile_setup_delay(800, 1, 3); /* Cortex-A8 @ 800MHz */ |
1039 | 1039 | ||
1040 | early_platform_add_devices(sh7372_early_devices, | 1040 | sh7372_add_early_devices(); |
1041 | ARRAY_SIZE(sh7372_early_devices)); | ||
1042 | |||
1043 | /* setup early console here as well */ | ||
1044 | shmobile_setup_console(); | ||
1045 | } | 1041 | } |
1046 | 1042 | ||
1047 | void __init sh7372_add_standard_devices_dt(void) | 1043 | void __init sh7372_add_standard_devices_dt(void) |
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c index f2c89fb8fca9..be83ba25f81b 100644 --- a/arch/arm/mach-versatile/core.c +++ b/arch/arm/mach-versatile/core.c | |||
@@ -310,6 +310,21 @@ static struct platform_device char_lcd_device = { | |||
310 | .resource = char_lcd_resources, | 310 | .resource = char_lcd_resources, |
311 | }; | 311 | }; |
312 | 312 | ||
313 | static struct resource leds_resources[] = { | ||
314 | { | ||
315 | .start = VERSATILE_SYS_BASE + VERSATILE_SYS_LED_OFFSET, | ||
316 | .end = VERSATILE_SYS_BASE + VERSATILE_SYS_LED_OFFSET + 4, | ||
317 | .flags = IORESOURCE_MEM, | ||
318 | }, | ||
319 | }; | ||
320 | |||
321 | static struct platform_device leds_device = { | ||
322 | .name = "versatile-leds", | ||
323 | .id = -1, | ||
324 | .num_resources = ARRAY_SIZE(leds_resources), | ||
325 | .resource = leds_resources, | ||
326 | }; | ||
327 | |||
313 | /* | 328 | /* |
314 | * Clock handling | 329 | * Clock handling |
315 | */ | 330 | */ |
@@ -795,6 +810,7 @@ void __init versatile_init(void) | |||
795 | platform_device_register(&versatile_i2c_device); | 810 | platform_device_register(&versatile_i2c_device); |
796 | platform_device_register(&smc91x_device); | 811 | platform_device_register(&smc91x_device); |
797 | platform_device_register(&char_lcd_device); | 812 | platform_device_register(&char_lcd_device); |
813 | platform_device_register(&leds_device); | ||
798 | 814 | ||
799 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { | 815 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { |
800 | struct amba_device *d = amba_devs[i]; | 816 | struct amba_device *d = amba_devs[i]; |
diff --git a/arch/arm/plat-versatile/Kconfig b/arch/arm/plat-versatile/Kconfig index 2c4332b9f948..fce41e93b6a4 100644 --- a/arch/arm/plat-versatile/Kconfig +++ b/arch/arm/plat-versatile/Kconfig | |||
@@ -6,12 +6,6 @@ config PLAT_VERSATILE_CLOCK | |||
6 | config PLAT_VERSATILE_CLCD | 6 | config PLAT_VERSATILE_CLCD |
7 | bool | 7 | bool |
8 | 8 | ||
9 | config PLAT_VERSATILE_LEDS | ||
10 | def_bool y if NEW_LEDS | ||
11 | depends on ARCH_REALVIEW || ARCH_VERSATILE | ||
12 | select LEDS_CLASS | ||
13 | select LEDS_TRIGGERS | ||
14 | |||
15 | config PLAT_VERSATILE_SCHED_CLOCK | 9 | config PLAT_VERSATILE_SCHED_CLOCK |
16 | def_bool y | 10 | def_bool y |
17 | 11 | ||
diff --git a/arch/arm/plat-versatile/Makefile b/arch/arm/plat-versatile/Makefile index f88d448b629c..2e0c472958ae 100644 --- a/arch/arm/plat-versatile/Makefile +++ b/arch/arm/plat-versatile/Makefile | |||
@@ -2,6 +2,5 @@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include | |||
2 | 2 | ||
3 | obj-$(CONFIG_PLAT_VERSATILE_CLOCK) += clock.o | 3 | obj-$(CONFIG_PLAT_VERSATILE_CLOCK) += clock.o |
4 | obj-$(CONFIG_PLAT_VERSATILE_CLCD) += clcd.o | 4 | obj-$(CONFIG_PLAT_VERSATILE_CLCD) += clcd.o |
5 | obj-$(CONFIG_PLAT_VERSATILE_LEDS) += leds.o | ||
6 | obj-$(CONFIG_PLAT_VERSATILE_SCHED_CLOCK) += sched-clock.o | 5 | obj-$(CONFIG_PLAT_VERSATILE_SCHED_CLOCK) += sched-clock.o |
7 | obj-$(CONFIG_SMP) += headsmp.o platsmp.o | 6 | obj-$(CONFIG_SMP) += headsmp.o platsmp.o |
diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig index 6de9dfbf61c1..39e717797cc0 100644 --- a/drivers/leds/Kconfig +++ b/drivers/leds/Kconfig | |||
@@ -487,6 +487,14 @@ config LEDS_BLINKM | |||
487 | This option enables support for the BlinkM RGB LED connected | 487 | This option enables support for the BlinkM RGB LED connected |
488 | through I2C. Say Y to enable support for the BlinkM LED. | 488 | through I2C. Say Y to enable support for the BlinkM LED. |
489 | 489 | ||
490 | config LEDS_VERSATILE | ||
491 | tristate "LED support for the ARM Versatile and RealView" | ||
492 | depends on ARCH_REALVIEW || ARCH_VERSATILE | ||
493 | depends on LEDS_CLASS | ||
494 | help | ||
495 | This option enabled support for the LEDs on the ARM Versatile | ||
496 | and RealView boards. Say Y to enabled these. | ||
497 | |||
490 | comment "LED Triggers" | 498 | comment "LED Triggers" |
491 | source "drivers/leds/trigger/Kconfig" | 499 | source "drivers/leds/trigger/Kconfig" |
492 | 500 | ||
diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile index 3cd76dbd9be2..8b4c956e11ba 100644 --- a/drivers/leds/Makefile +++ b/drivers/leds/Makefile | |||
@@ -54,6 +54,7 @@ obj-$(CONFIG_LEDS_ASIC3) += leds-asic3.o | |||
54 | obj-$(CONFIG_LEDS_MAX8997) += leds-max8997.o | 54 | obj-$(CONFIG_LEDS_MAX8997) += leds-max8997.o |
55 | obj-$(CONFIG_LEDS_LM355x) += leds-lm355x.o | 55 | obj-$(CONFIG_LEDS_LM355x) += leds-lm355x.o |
56 | obj-$(CONFIG_LEDS_BLINKM) += leds-blinkm.o | 56 | obj-$(CONFIG_LEDS_BLINKM) += leds-blinkm.o |
57 | obj-$(CONFIG_LEDS_VERSATILE) += leds-versatile.o | ||
57 | 58 | ||
58 | # LED SPI Drivers | 59 | # LED SPI Drivers |
59 | obj-$(CONFIG_LEDS_DAC124S085) += leds-dac124s085.o | 60 | obj-$(CONFIG_LEDS_DAC124S085) += leds-dac124s085.o |
diff --git a/arch/arm/plat-versatile/leds.c b/drivers/leds/leds-versatile.c index d2490d00b46c..80553022d661 100644 --- a/arch/arm/plat-versatile/leds.c +++ b/drivers/leds/leds-versatile.c | |||
@@ -7,22 +7,14 @@ | |||
7 | */ | 7 | */ |
8 | #include <linux/kernel.h> | 8 | #include <linux/kernel.h> |
9 | #include <linux/init.h> | 9 | #include <linux/init.h> |
10 | #include <linux/module.h> | ||
10 | #include <linux/io.h> | 11 | #include <linux/io.h> |
11 | #include <linux/slab.h> | 12 | #include <linux/slab.h> |
12 | #include <linux/leds.h> | 13 | #include <linux/leds.h> |
13 | 14 | #include <linux/platform_device.h> | |
14 | #include <mach/hardware.h> | ||
15 | #include <mach/platform.h> | ||
16 | |||
17 | #ifdef VERSATILE_SYS_BASE | ||
18 | #define LEDREG (__io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_LED_OFFSET) | ||
19 | #endif | ||
20 | |||
21 | #ifdef REALVIEW_SYS_BASE | ||
22 | #define LEDREG (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_LED_OFFSET) | ||
23 | #endif | ||
24 | 15 | ||
25 | struct versatile_led { | 16 | struct versatile_led { |
17 | void __iomem *base; | ||
26 | struct led_classdev cdev; | 18 | struct led_classdev cdev; |
27 | u8 mask; | 19 | u8 mask; |
28 | }; | 20 | }; |
@@ -50,30 +42,37 @@ static void versatile_led_set(struct led_classdev *cdev, | |||
50 | { | 42 | { |
51 | struct versatile_led *led = container_of(cdev, | 43 | struct versatile_led *led = container_of(cdev, |
52 | struct versatile_led, cdev); | 44 | struct versatile_led, cdev); |
53 | u32 reg = readl(LEDREG); | 45 | u32 reg = readl(led->base); |
54 | 46 | ||
55 | if (b != LED_OFF) | 47 | if (b != LED_OFF) |
56 | reg |= led->mask; | 48 | reg |= led->mask; |
57 | else | 49 | else |
58 | reg &= ~led->mask; | 50 | reg &= ~led->mask; |
59 | writel(reg, LEDREG); | 51 | writel(reg, led->base); |
60 | } | 52 | } |
61 | 53 | ||
62 | static enum led_brightness versatile_led_get(struct led_classdev *cdev) | 54 | static enum led_brightness versatile_led_get(struct led_classdev *cdev) |
63 | { | 55 | { |
64 | struct versatile_led *led = container_of(cdev, | 56 | struct versatile_led *led = container_of(cdev, |
65 | struct versatile_led, cdev); | 57 | struct versatile_led, cdev); |
66 | u32 reg = readl(LEDREG); | 58 | u32 reg = readl(led->base); |
67 | 59 | ||
68 | return (reg & led->mask) ? LED_FULL : LED_OFF; | 60 | return (reg & led->mask) ? LED_FULL : LED_OFF; |
69 | } | 61 | } |
70 | 62 | ||
71 | static int __init versatile_leds_init(void) | 63 | static int versatile_leds_probe(struct platform_device *dev) |
72 | { | 64 | { |
73 | int i; | 65 | int i; |
66 | struct resource *res; | ||
67 | void __iomem *base; | ||
74 | 68 | ||
75 | /* All ON */ | 69 | res = platform_get_resource(dev, IORESOURCE_MEM, 0); |
76 | writel(0xff, LEDREG); | 70 | base = devm_ioremap_resource(&dev->dev, res); |
71 | if (IS_ERR(base)) | ||
72 | return PTR_ERR(base); | ||
73 | |||
74 | /* All off */ | ||
75 | writel(0, base); | ||
77 | for (i = 0; i < ARRAY_SIZE(versatile_leds); i++) { | 76 | for (i = 0; i < ARRAY_SIZE(versatile_leds); i++) { |
78 | struct versatile_led *led; | 77 | struct versatile_led *led; |
79 | 78 | ||
@@ -81,6 +80,7 @@ static int __init versatile_leds_init(void) | |||
81 | if (!led) | 80 | if (!led) |
82 | break; | 81 | break; |
83 | 82 | ||
83 | led->base = base; | ||
84 | led->cdev.name = versatile_leds[i].name; | 84 | led->cdev.name = versatile_leds[i].name; |
85 | led->cdev.brightness_set = versatile_led_set; | 85 | led->cdev.brightness_set = versatile_led_set; |
86 | led->cdev.brightness_get = versatile_led_get; | 86 | led->cdev.brightness_get = versatile_led_get; |
@@ -96,8 +96,15 @@ static int __init versatile_leds_init(void) | |||
96 | return 0; | 96 | return 0; |
97 | } | 97 | } |
98 | 98 | ||
99 | /* | 99 | static struct platform_driver versatile_leds_driver = { |
100 | * Since we may have triggers on any subsystem, defer registration | 100 | .driver = { |
101 | * until after subsystem_init. | 101 | .name = "versatile-leds", |
102 | */ | 102 | }, |
103 | fs_initcall(versatile_leds_init); | 103 | .probe = versatile_leds_probe, |
104 | }; | ||
105 | |||
106 | module_platform_driver(versatile_leds_driver); | ||
107 | |||
108 | MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); | ||
109 | MODULE_DESCRIPTION("ARM Versatile LED driver"); | ||
110 | MODULE_LICENSE("GPL v2"); | ||