diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-01 21:46:13 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-01 21:46:13 -0400 |
commit | 8f446a7a069e0af0639385f67c78ee2279bca04c (patch) | |
tree | 580cf495616b36ca0af0826afa87c430cdc1e7cb /arch/arm/mach-omap1 | |
parent | 84be4ae2c038e2b03d650cbf2a7cfd9e8d6e9e51 (diff) | |
parent | 04ef037c926ddb31088c976538e29eada4fd1490 (diff) |
Merge tag 'drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM soc driver specific changes from Olof Johansson:
- A long-coming conversion of various platforms to a common LED
infrastructure
- AT91 is moved over to use the newer MCI driver for MMC
- Pincontrol conversions for samsung platforms
- DT bindings for gscaler on samsung
- i2c driver fixes for tegra, acked by i2c maintainer
Fix up conflicts as per Olof.
* tag 'drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (48 commits)
drivers: bus: omap_l3: use resources instead of hardcoded irqs
pinctrl: exynos: Fix wakeup IRQ domain registration check
pinctrl: samsung: Uninline samsung_pinctrl_get_soc_data
pinctrl: exynos: Correct the detection of wakeup-eint node
pinctrl: exynos: Mark exynos_irq_demux_eint as inline
pinctrl: exynos: Handle only unmasked wakeup interrupts
pinctrl: exynos: Fix typos in gpio/wkup _irq_mask
pinctrl: exynos: Set pin function to EINT in irq_set_type of GPIO EINTa
drivers: bus: Move the OMAP interconnect driver to drivers/bus/
i2c: tegra: dynamically control fast clk
i2c: tegra: I2_M_NOSTART functionality not supported in Tegra20
ARM: tegra: clock: remove unused clock entry for i2c
ARM: tegra: clock: add connection name in i2c clock entry
i2c: tegra: pass proper name for getting clock
ARM: tegra: clock: add i2c fast clock entry in clock table
ARM: EXYNOS: Adds G-Scaler device from Device Tree
ARM: EXYNOS: Add clock support for G-Scaler
ARM: EXYNOS: Enable pinctrl driver support for EXYNOS4 device tree enabled platform
ARM: dts: Add pinctrl node entries for SAMSUNG EXYNOS4210 SoC
ARM: EXYNOS: skip wakeup interrupt setup if pinctrl driver is used
...
Diffstat (limited to 'arch/arm/mach-omap1')
-rw-r--r-- | arch/arm/mach-omap1/Makefile | 8 | ||||
-rw-r--r-- | arch/arm/mach-omap1/board-h2.c | 32 | ||||
-rw-r--r-- | arch/arm/mach-omap1/board-h3.c | 32 | ||||
-rw-r--r-- | arch/arm/mach-omap1/board-osk.c | 33 | ||||
-rw-r--r-- | arch/arm/mach-omap1/leds-h2p2-debug.c | 169 | ||||
-rw-r--r-- | arch/arm/mach-omap1/leds-innovator.c | 98 | ||||
-rw-r--r-- | arch/arm/mach-omap1/leds-osk.c | 113 | ||||
-rw-r--r-- | arch/arm/mach-omap1/leds.c | 70 | ||||
-rw-r--r-- | arch/arm/mach-omap1/leds.h | 3 | ||||
-rw-r--r-- | arch/arm/mach-omap1/time.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-omap1/timer32k.c | 1 |
11 files changed, 97 insertions, 463 deletions
diff --git a/arch/arm/mach-omap1/Makefile b/arch/arm/mach-omap1/Makefile index 398e9e53e189..cd169c386161 100644 --- a/arch/arm/mach-omap1/Makefile +++ b/arch/arm/mach-omap1/Makefile | |||
@@ -61,14 +61,6 @@ obj-$(CONFIG_ARCH_OMAP850) += gpio7xx.o | |||
61 | obj-$(CONFIG_ARCH_OMAP15XX) += gpio15xx.o | 61 | obj-$(CONFIG_ARCH_OMAP15XX) += gpio15xx.o |
62 | obj-$(CONFIG_ARCH_OMAP16XX) += gpio16xx.o | 62 | obj-$(CONFIG_ARCH_OMAP16XX) += gpio16xx.o |
63 | 63 | ||
64 | # LEDs support | ||
65 | led-$(CONFIG_MACH_OMAP_H2) += leds-h2p2-debug.o | ||
66 | led-$(CONFIG_MACH_OMAP_H3) += leds-h2p2-debug.o | ||
67 | led-$(CONFIG_MACH_OMAP_INNOVATOR) += leds-innovator.o | ||
68 | led-$(CONFIG_MACH_OMAP_PERSEUS2) += leds-h2p2-debug.o | ||
69 | led-$(CONFIG_MACH_OMAP_OSK) += leds-osk.o | ||
70 | obj-$(CONFIG_LEDS) += $(led-y) | ||
71 | |||
72 | ifneq ($(CONFIG_FB_OMAP),) | 64 | ifneq ($(CONFIG_FB_OMAP),) |
73 | obj-y += lcd_dma.o | 65 | obj-y += lcd_dma.o |
74 | endif | 66 | endif |
diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c index af283a2bc7c7..376f7f29ef77 100644 --- a/arch/arm/mach-omap1/board-h2.c +++ b/arch/arm/mach-omap1/board-h2.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/smc91x.h> | 32 | #include <linux/smc91x.h> |
33 | #include <linux/omapfb.h> | 33 | #include <linux/omapfb.h> |
34 | #include <linux/platform_data/gpio-omap.h> | 34 | #include <linux/platform_data/gpio-omap.h> |
35 | #include <linux/leds.h> | ||
35 | 36 | ||
36 | #include <asm/mach-types.h> | 37 | #include <asm/mach-types.h> |
37 | #include <asm/mach/arch.h> | 38 | #include <asm/mach/arch.h> |
@@ -307,12 +308,39 @@ static struct platform_device h2_irda_device = { | |||
307 | .resource = h2_irda_resources, | 308 | .resource = h2_irda_resources, |
308 | }; | 309 | }; |
309 | 310 | ||
311 | static struct gpio_led h2_gpio_led_pins[] = { | ||
312 | { | ||
313 | .name = "h2:red", | ||
314 | .default_trigger = "heartbeat", | ||
315 | .gpio = 3, | ||
316 | }, | ||
317 | { | ||
318 | .name = "h2:green", | ||
319 | .default_trigger = "cpu0", | ||
320 | .gpio = OMAP_MPUIO(4), | ||
321 | }, | ||
322 | }; | ||
323 | |||
324 | static struct gpio_led_platform_data h2_gpio_led_data = { | ||
325 | .leds = h2_gpio_led_pins, | ||
326 | .num_leds = ARRAY_SIZE(h2_gpio_led_pins), | ||
327 | }; | ||
328 | |||
329 | static struct platform_device h2_gpio_leds = { | ||
330 | .name = "leds-gpio", | ||
331 | .id = -1, | ||
332 | .dev = { | ||
333 | .platform_data = &h2_gpio_led_data, | ||
334 | }, | ||
335 | }; | ||
336 | |||
310 | static struct platform_device *h2_devices[] __initdata = { | 337 | static struct platform_device *h2_devices[] __initdata = { |
311 | &h2_nor_device, | 338 | &h2_nor_device, |
312 | &h2_nand_device, | 339 | &h2_nand_device, |
313 | &h2_smc91x_device, | 340 | &h2_smc91x_device, |
314 | &h2_irda_device, | 341 | &h2_irda_device, |
315 | &h2_kp_device, | 342 | &h2_kp_device, |
343 | &h2_gpio_leds, | ||
316 | }; | 344 | }; |
317 | 345 | ||
318 | static void __init h2_init_smc91x(void) | 346 | static void __init h2_init_smc91x(void) |
@@ -407,6 +435,10 @@ static void __init h2_init(void) | |||
407 | omap_cfg_reg(E19_1610_KBR4); | 435 | omap_cfg_reg(E19_1610_KBR4); |
408 | omap_cfg_reg(N19_1610_KBR5); | 436 | omap_cfg_reg(N19_1610_KBR5); |
409 | 437 | ||
438 | /* GPIO based LEDs */ | ||
439 | omap_cfg_reg(P18_1610_GPIO3); | ||
440 | omap_cfg_reg(MPUIO4); | ||
441 | |||
410 | h2_smc91x_resources[1].start = gpio_to_irq(0); | 442 | h2_smc91x_resources[1].start = gpio_to_irq(0); |
411 | h2_smc91x_resources[1].end = gpio_to_irq(0); | 443 | h2_smc91x_resources[1].end = gpio_to_irq(0); |
412 | platform_add_devices(h2_devices, ARRAY_SIZE(h2_devices)); | 444 | platform_add_devices(h2_devices, ARRAY_SIZE(h2_devices)); |
diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c index 06d11b1ee9c6..ededdb7ef28c 100644 --- a/arch/arm/mach-omap1/board-h3.c +++ b/arch/arm/mach-omap1/board-h3.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/smc91x.h> | 32 | #include <linux/smc91x.h> |
33 | #include <linux/omapfb.h> | 33 | #include <linux/omapfb.h> |
34 | #include <linux/platform_data/gpio-omap.h> | 34 | #include <linux/platform_data/gpio-omap.h> |
35 | #include <linux/leds.h> | ||
35 | 36 | ||
36 | #include <asm/setup.h> | 37 | #include <asm/setup.h> |
37 | #include <asm/page.h> | 38 | #include <asm/page.h> |
@@ -325,6 +326,32 @@ static struct spi_board_info h3_spi_board_info[] __initdata = { | |||
325 | }, | 326 | }, |
326 | }; | 327 | }; |
327 | 328 | ||
329 | static struct gpio_led h3_gpio_led_pins[] = { | ||
330 | { | ||
331 | .name = "h3:red", | ||
332 | .default_trigger = "heartbeat", | ||
333 | .gpio = 3, | ||
334 | }, | ||
335 | { | ||
336 | .name = "h3:green", | ||
337 | .default_trigger = "cpu0", | ||
338 | .gpio = OMAP_MPUIO(4), | ||
339 | }, | ||
340 | }; | ||
341 | |||
342 | static struct gpio_led_platform_data h3_gpio_led_data = { | ||
343 | .leds = h3_gpio_led_pins, | ||
344 | .num_leds = ARRAY_SIZE(h3_gpio_led_pins), | ||
345 | }; | ||
346 | |||
347 | static struct platform_device h3_gpio_leds = { | ||
348 | .name = "leds-gpio", | ||
349 | .id = -1, | ||
350 | .dev = { | ||
351 | .platform_data = &h3_gpio_led_data, | ||
352 | }, | ||
353 | }; | ||
354 | |||
328 | static struct platform_device *devices[] __initdata = { | 355 | static struct platform_device *devices[] __initdata = { |
329 | &nor_device, | 356 | &nor_device, |
330 | &nand_device, | 357 | &nand_device, |
@@ -332,6 +359,7 @@ static struct platform_device *devices[] __initdata = { | |||
332 | &intlat_device, | 359 | &intlat_device, |
333 | &h3_kp_device, | 360 | &h3_kp_device, |
334 | &h3_lcd_device, | 361 | &h3_lcd_device, |
362 | &h3_gpio_leds, | ||
335 | }; | 363 | }; |
336 | 364 | ||
337 | static struct omap_usb_config h3_usb_config __initdata = { | 365 | static struct omap_usb_config h3_usb_config __initdata = { |
@@ -399,6 +427,10 @@ static void __init h3_init(void) | |||
399 | omap_cfg_reg(E19_1610_KBR4); | 427 | omap_cfg_reg(E19_1610_KBR4); |
400 | omap_cfg_reg(N19_1610_KBR5); | 428 | omap_cfg_reg(N19_1610_KBR5); |
401 | 429 | ||
430 | /* GPIO based LEDs */ | ||
431 | omap_cfg_reg(P18_1610_GPIO3); | ||
432 | omap_cfg_reg(MPUIO4); | ||
433 | |||
402 | smc91x_resources[1].start = gpio_to_irq(40); | 434 | smc91x_resources[1].start = gpio_to_irq(40); |
403 | smc91x_resources[1].end = gpio_to_irq(40); | 435 | smc91x_resources[1].end = gpio_to_irq(40); |
404 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 436 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
diff --git a/arch/arm/mach-omap1/board-osk.c b/arch/arm/mach-omap1/board-osk.c index 2f1f9b967576..5973945a8741 100644 --- a/arch/arm/mach-omap1/board-osk.c +++ b/arch/arm/mach-omap1/board-osk.c | |||
@@ -382,10 +382,37 @@ static struct platform_device osk5912_lcd_device = { | |||
382 | .id = -1, | 382 | .id = -1, |
383 | }; | 383 | }; |
384 | 384 | ||
385 | static struct gpio_led mistral_gpio_led_pins[] = { | ||
386 | { | ||
387 | .name = "mistral:red", | ||
388 | .default_trigger = "heartbeat", | ||
389 | .gpio = 3, | ||
390 | }, | ||
391 | { | ||
392 | .name = "mistral:green", | ||
393 | .default_trigger = "cpu0", | ||
394 | .gpio = OMAP_MPUIO(4), | ||
395 | }, | ||
396 | }; | ||
397 | |||
398 | static struct gpio_led_platform_data mistral_gpio_led_data = { | ||
399 | .leds = mistral_gpio_led_pins, | ||
400 | .num_leds = ARRAY_SIZE(mistral_gpio_led_pins), | ||
401 | }; | ||
402 | |||
403 | static struct platform_device mistral_gpio_leds = { | ||
404 | .name = "leds-gpio", | ||
405 | .id = -1, | ||
406 | .dev = { | ||
407 | .platform_data = &mistral_gpio_led_data, | ||
408 | }, | ||
409 | }; | ||
410 | |||
385 | static struct platform_device *mistral_devices[] __initdata = { | 411 | static struct platform_device *mistral_devices[] __initdata = { |
386 | &osk5912_kp_device, | 412 | &osk5912_kp_device, |
387 | &mistral_bl_device, | 413 | &mistral_bl_device, |
388 | &osk5912_lcd_device, | 414 | &osk5912_lcd_device, |
415 | &mistral_gpio_leds, | ||
389 | }; | 416 | }; |
390 | 417 | ||
391 | static int mistral_get_pendown_state(void) | 418 | static int mistral_get_pendown_state(void) |
@@ -510,6 +537,12 @@ static void __init osk_mistral_init(void) | |||
510 | if (gpio_request(2, "lcd_pwr") == 0) | 537 | if (gpio_request(2, "lcd_pwr") == 0) |
511 | gpio_direction_output(2, 1); | 538 | gpio_direction_output(2, 1); |
512 | 539 | ||
540 | /* | ||
541 | * GPIO based LEDs | ||
542 | */ | ||
543 | omap_cfg_reg(P18_1610_GPIO3); | ||
544 | omap_cfg_reg(MPUIO4); | ||
545 | |||
513 | i2c_register_board_info(1, mistral_i2c_board_info, | 546 | i2c_register_board_info(1, mistral_i2c_board_info, |
514 | ARRAY_SIZE(mistral_i2c_board_info)); | 547 | ARRAY_SIZE(mistral_i2c_board_info)); |
515 | 548 | ||
diff --git a/arch/arm/mach-omap1/leds-h2p2-debug.c b/arch/arm/mach-omap1/leds-h2p2-debug.c deleted file mode 100644 index 6f958aec9459..000000000000 --- a/arch/arm/mach-omap1/leds-h2p2-debug.c +++ /dev/null | |||
@@ -1,169 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-omap1/leds-h2p2-debug.c | ||
3 | * | ||
4 | * Copyright 2003 by Texas Instruments Incorporated | ||
5 | * | ||
6 | * There are 16 LEDs on the debug board (all green); four may be used | ||
7 | * for logical 'green', 'amber', 'red', and 'blue' (after "claiming"). | ||
8 | * | ||
9 | * The "surfer" expansion board and H2 sample board also have two-color | ||
10 | * green+red LEDs (in parallel), used here for timer and idle indicators. | ||
11 | */ | ||
12 | #include <linux/gpio.h> | ||
13 | #include <linux/init.h> | ||
14 | #include <linux/kernel_stat.h> | ||
15 | #include <linux/sched.h> | ||
16 | #include <linux/io.h> | ||
17 | #include <linux/platform_data/gpio-omap.h> | ||
18 | |||
19 | #include <mach/hardware.h> | ||
20 | #include <asm/leds.h> | ||
21 | #include <asm/mach-types.h> | ||
22 | |||
23 | #include <plat/fpga.h> | ||
24 | |||
25 | #include "leds.h" | ||
26 | |||
27 | |||
28 | #define GPIO_LED_RED 3 | ||
29 | #define GPIO_LED_GREEN OMAP_MPUIO(4) | ||
30 | |||
31 | |||
32 | #define LED_STATE_ENABLED 0x01 | ||
33 | #define LED_STATE_CLAIMED 0x02 | ||
34 | #define LED_TIMER_ON 0x04 | ||
35 | |||
36 | #define GPIO_IDLE GPIO_LED_GREEN | ||
37 | #define GPIO_TIMER GPIO_LED_RED | ||
38 | |||
39 | |||
40 | void h2p2_dbg_leds_event(led_event_t evt) | ||
41 | { | ||
42 | unsigned long flags; | ||
43 | |||
44 | static struct h2p2_dbg_fpga __iomem *fpga; | ||
45 | static u16 led_state, hw_led_state; | ||
46 | |||
47 | local_irq_save(flags); | ||
48 | |||
49 | if (!(led_state & LED_STATE_ENABLED) && evt != led_start) | ||
50 | goto done; | ||
51 | |||
52 | switch (evt) { | ||
53 | case led_start: | ||
54 | if (!fpga) | ||
55 | fpga = ioremap(H2P2_DBG_FPGA_START, | ||
56 | H2P2_DBG_FPGA_SIZE); | ||
57 | if (fpga) { | ||
58 | led_state |= LED_STATE_ENABLED; | ||
59 | __raw_writew(~0, &fpga->leds); | ||
60 | } | ||
61 | break; | ||
62 | |||
63 | case led_stop: | ||
64 | case led_halted: | ||
65 | /* all leds off during suspend or shutdown */ | ||
66 | |||
67 | if (! machine_is_omap_perseus2()) { | ||
68 | gpio_set_value(GPIO_TIMER, 0); | ||
69 | gpio_set_value(GPIO_IDLE, 0); | ||
70 | } | ||
71 | |||
72 | led_state &= ~LED_STATE_ENABLED; | ||
73 | if (fpga) { | ||
74 | __raw_writew(~0, &fpga->leds); | ||
75 | if (evt == led_halted) { | ||
76 | iounmap(fpga); | ||
77 | fpga = NULL; | ||
78 | } | ||
79 | } | ||
80 | |||
81 | goto done; | ||
82 | |||
83 | case led_claim: | ||
84 | led_state |= LED_STATE_CLAIMED; | ||
85 | hw_led_state = 0; | ||
86 | break; | ||
87 | |||
88 | case led_release: | ||
89 | led_state &= ~LED_STATE_CLAIMED; | ||
90 | break; | ||
91 | |||
92 | #ifdef CONFIG_LEDS_TIMER | ||
93 | case led_timer: | ||
94 | led_state ^= LED_TIMER_ON; | ||
95 | |||
96 | if (machine_is_omap_perseus2()) | ||
97 | hw_led_state ^= H2P2_DBG_FPGA_P2_LED_TIMER; | ||
98 | else { | ||
99 | gpio_set_value(GPIO_TIMER, led_state & LED_TIMER_ON); | ||
100 | goto done; | ||
101 | } | ||
102 | |||
103 | break; | ||
104 | #endif | ||
105 | |||
106 | #ifdef CONFIG_LEDS_CPU | ||
107 | case led_idle_start: | ||
108 | if (machine_is_omap_perseus2()) | ||
109 | hw_led_state |= H2P2_DBG_FPGA_P2_LED_IDLE; | ||
110 | else { | ||
111 | gpio_set_value(GPIO_IDLE, 1); | ||
112 | goto done; | ||
113 | } | ||
114 | |||
115 | break; | ||
116 | |||
117 | case led_idle_end: | ||
118 | if (machine_is_omap_perseus2()) | ||
119 | hw_led_state &= ~H2P2_DBG_FPGA_P2_LED_IDLE; | ||
120 | else { | ||
121 | gpio_set_value(GPIO_IDLE, 0); | ||
122 | goto done; | ||
123 | } | ||
124 | |||
125 | break; | ||
126 | #endif | ||
127 | |||
128 | case led_green_on: | ||
129 | hw_led_state |= H2P2_DBG_FPGA_LED_GREEN; | ||
130 | break; | ||
131 | case led_green_off: | ||
132 | hw_led_state &= ~H2P2_DBG_FPGA_LED_GREEN; | ||
133 | break; | ||
134 | |||
135 | case led_amber_on: | ||
136 | hw_led_state |= H2P2_DBG_FPGA_LED_AMBER; | ||
137 | break; | ||
138 | case led_amber_off: | ||
139 | hw_led_state &= ~H2P2_DBG_FPGA_LED_AMBER; | ||
140 | break; | ||
141 | |||
142 | case led_red_on: | ||
143 | hw_led_state |= H2P2_DBG_FPGA_LED_RED; | ||
144 | break; | ||
145 | case led_red_off: | ||
146 | hw_led_state &= ~H2P2_DBG_FPGA_LED_RED; | ||
147 | break; | ||
148 | |||
149 | case led_blue_on: | ||
150 | hw_led_state |= H2P2_DBG_FPGA_LED_BLUE; | ||
151 | break; | ||
152 | case led_blue_off: | ||
153 | hw_led_state &= ~H2P2_DBG_FPGA_LED_BLUE; | ||
154 | break; | ||
155 | |||
156 | default: | ||
157 | break; | ||
158 | } | ||
159 | |||
160 | |||
161 | /* | ||
162 | * Actually burn the LEDs | ||
163 | */ | ||
164 | if (led_state & LED_STATE_ENABLED && fpga) | ||
165 | __raw_writew(~hw_led_state, &fpga->leds); | ||
166 | |||
167 | done: | ||
168 | local_irq_restore(flags); | ||
169 | } | ||
diff --git a/arch/arm/mach-omap1/leds-innovator.c b/arch/arm/mach-omap1/leds-innovator.c deleted file mode 100644 index 3a066ee8d02c..000000000000 --- a/arch/arm/mach-omap1/leds-innovator.c +++ /dev/null | |||
@@ -1,98 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-omap1/leds-innovator.c | ||
3 | */ | ||
4 | #include <linux/init.h> | ||
5 | |||
6 | #include <mach/hardware.h> | ||
7 | #include <asm/leds.h> | ||
8 | |||
9 | #include "leds.h" | ||
10 | |||
11 | |||
12 | #define LED_STATE_ENABLED 1 | ||
13 | #define LED_STATE_CLAIMED 2 | ||
14 | |||
15 | static unsigned int led_state; | ||
16 | static unsigned int hw_led_state; | ||
17 | |||
18 | void innovator_leds_event(led_event_t evt) | ||
19 | { | ||
20 | unsigned long flags; | ||
21 | |||
22 | local_irq_save(flags); | ||
23 | |||
24 | switch (evt) { | ||
25 | case led_start: | ||
26 | hw_led_state = 0; | ||
27 | led_state = LED_STATE_ENABLED; | ||
28 | break; | ||
29 | |||
30 | case led_stop: | ||
31 | led_state &= ~LED_STATE_ENABLED; | ||
32 | hw_led_state = 0; | ||
33 | break; | ||
34 | |||
35 | case led_claim: | ||
36 | led_state |= LED_STATE_CLAIMED; | ||
37 | hw_led_state = 0; | ||
38 | break; | ||
39 | |||
40 | case led_release: | ||
41 | led_state &= ~LED_STATE_CLAIMED; | ||
42 | hw_led_state = 0; | ||
43 | break; | ||
44 | |||
45 | #ifdef CONFIG_LEDS_TIMER | ||
46 | case led_timer: | ||
47 | if (!(led_state & LED_STATE_CLAIMED)) | ||
48 | hw_led_state ^= 0; | ||
49 | break; | ||
50 | #endif | ||
51 | |||
52 | #ifdef CONFIG_LEDS_CPU | ||
53 | case led_idle_start: | ||
54 | if (!(led_state & LED_STATE_CLAIMED)) | ||
55 | hw_led_state |= 0; | ||
56 | break; | ||
57 | |||
58 | case led_idle_end: | ||
59 | if (!(led_state & LED_STATE_CLAIMED)) | ||
60 | hw_led_state &= ~0; | ||
61 | break; | ||
62 | #endif | ||
63 | |||
64 | case led_halted: | ||
65 | break; | ||
66 | |||
67 | case led_green_on: | ||
68 | if (led_state & LED_STATE_CLAIMED) | ||
69 | hw_led_state &= ~0; | ||
70 | break; | ||
71 | |||
72 | case led_green_off: | ||
73 | if (led_state & LED_STATE_CLAIMED) | ||
74 | hw_led_state |= 0; | ||
75 | break; | ||
76 | |||
77 | case led_amber_on: | ||
78 | break; | ||
79 | |||
80 | case led_amber_off: | ||
81 | break; | ||
82 | |||
83 | case led_red_on: | ||
84 | if (led_state & LED_STATE_CLAIMED) | ||
85 | hw_led_state &= ~0; | ||
86 | break; | ||
87 | |||
88 | case led_red_off: | ||
89 | if (led_state & LED_STATE_CLAIMED) | ||
90 | hw_led_state |= 0; | ||
91 | break; | ||
92 | |||
93 | default: | ||
94 | break; | ||
95 | } | ||
96 | |||
97 | local_irq_restore(flags); | ||
98 | } | ||
diff --git a/arch/arm/mach-omap1/leds-osk.c b/arch/arm/mach-omap1/leds-osk.c deleted file mode 100644 index 936ed426b84f..000000000000 --- a/arch/arm/mach-omap1/leds-osk.c +++ /dev/null | |||
@@ -1,113 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-omap1/leds-osk.c | ||
3 | * | ||
4 | * LED driver for OSK with optional Mistral QVGA board | ||
5 | */ | ||
6 | #include <linux/gpio.h> | ||
7 | #include <linux/init.h> | ||
8 | |||
9 | #include <mach/hardware.h> | ||
10 | #include <asm/leds.h> | ||
11 | |||
12 | #include "leds.h" | ||
13 | |||
14 | |||
15 | #define LED_STATE_ENABLED (1 << 0) | ||
16 | #define LED_STATE_CLAIMED (1 << 1) | ||
17 | static u8 led_state; | ||
18 | |||
19 | #define TIMER_LED (1 << 3) /* Mistral board */ | ||
20 | #define IDLE_LED (1 << 4) /* Mistral board */ | ||
21 | static u8 hw_led_state; | ||
22 | |||
23 | |||
24 | #ifdef CONFIG_OMAP_OSK_MISTRAL | ||
25 | |||
26 | /* For now, all system indicators require the Mistral board, since that | ||
27 | * LED can be manipulated without a task context. This LED is either red, | ||
28 | * or green, but not both; it can't give the full "disco led" effect. | ||
29 | */ | ||
30 | |||
31 | #define GPIO_LED_RED 3 | ||
32 | #define GPIO_LED_GREEN OMAP_MPUIO(4) | ||
33 | |||
34 | static void mistral_setled(void) | ||
35 | { | ||
36 | int red = 0; | ||
37 | int green = 0; | ||
38 | |||
39 | if (hw_led_state & TIMER_LED) | ||
40 | red = 1; | ||
41 | else if (hw_led_state & IDLE_LED) | ||
42 | green = 1; | ||
43 | /* else both sides are disabled */ | ||
44 | |||
45 | gpio_set_value(GPIO_LED_GREEN, green); | ||
46 | gpio_set_value(GPIO_LED_RED, red); | ||
47 | } | ||
48 | |||
49 | #endif | ||
50 | |||
51 | void osk_leds_event(led_event_t evt) | ||
52 | { | ||
53 | unsigned long flags; | ||
54 | u16 leds; | ||
55 | |||
56 | local_irq_save(flags); | ||
57 | |||
58 | if (!(led_state & LED_STATE_ENABLED) && evt != led_start) | ||
59 | goto done; | ||
60 | |||
61 | leds = hw_led_state; | ||
62 | switch (evt) { | ||
63 | case led_start: | ||
64 | led_state |= LED_STATE_ENABLED; | ||
65 | hw_led_state = 0; | ||
66 | leds = ~0; | ||
67 | break; | ||
68 | |||
69 | case led_halted: | ||
70 | case led_stop: | ||
71 | led_state &= ~LED_STATE_ENABLED; | ||
72 | hw_led_state = 0; | ||
73 | break; | ||
74 | |||
75 | case led_claim: | ||
76 | led_state |= LED_STATE_CLAIMED; | ||
77 | hw_led_state = 0; | ||
78 | leds = ~0; | ||
79 | break; | ||
80 | |||
81 | case led_release: | ||
82 | led_state &= ~LED_STATE_CLAIMED; | ||
83 | hw_led_state = 0; | ||
84 | break; | ||
85 | |||
86 | #ifdef CONFIG_OMAP_OSK_MISTRAL | ||
87 | |||
88 | case led_timer: | ||
89 | hw_led_state ^= TIMER_LED; | ||
90 | mistral_setled(); | ||
91 | break; | ||
92 | |||
93 | case led_idle_start: /* idle == off */ | ||
94 | hw_led_state &= ~IDLE_LED; | ||
95 | mistral_setled(); | ||
96 | break; | ||
97 | |||
98 | case led_idle_end: | ||
99 | hw_led_state |= IDLE_LED; | ||
100 | mistral_setled(); | ||
101 | break; | ||
102 | |||
103 | #endif /* CONFIG_OMAP_OSK_MISTRAL */ | ||
104 | |||
105 | default: | ||
106 | break; | ||
107 | } | ||
108 | |||
109 | leds ^= hw_led_state; | ||
110 | |||
111 | done: | ||
112 | local_irq_restore(flags); | ||
113 | } | ||
diff --git a/arch/arm/mach-omap1/leds.c b/arch/arm/mach-omap1/leds.c deleted file mode 100644 index 4071479f7106..000000000000 --- a/arch/arm/mach-omap1/leds.c +++ /dev/null | |||
@@ -1,70 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-omap1/leds.c | ||
3 | * | ||
4 | * OMAP LEDs dispatcher | ||
5 | */ | ||
6 | #include <linux/gpio.h> | ||
7 | #include <linux/kernel.h> | ||
8 | #include <linux/init.h> | ||
9 | #include <linux/platform_data/gpio-omap.h> | ||
10 | |||
11 | #include <asm/leds.h> | ||
12 | #include <asm/mach-types.h> | ||
13 | |||
14 | #include <mach/mux.h> | ||
15 | |||
16 | #include "leds.h" | ||
17 | |||
18 | static int __init | ||
19 | omap_leds_init(void) | ||
20 | { | ||
21 | if (!cpu_class_is_omap1()) | ||
22 | return -ENODEV; | ||
23 | |||
24 | if (machine_is_omap_innovator()) | ||
25 | leds_event = innovator_leds_event; | ||
26 | |||
27 | else if (machine_is_omap_h2() | ||
28 | || machine_is_omap_h3() | ||
29 | || machine_is_omap_perseus2()) | ||
30 | leds_event = h2p2_dbg_leds_event; | ||
31 | |||
32 | else if (machine_is_omap_osk()) | ||
33 | leds_event = osk_leds_event; | ||
34 | |||
35 | else | ||
36 | return -1; | ||
37 | |||
38 | if (machine_is_omap_h2() | ||
39 | || machine_is_omap_h3() | ||
40 | #ifdef CONFIG_OMAP_OSK_MISTRAL | ||
41 | || machine_is_omap_osk() | ||
42 | #endif | ||
43 | ) { | ||
44 | |||
45 | /* LED1/LED2 pins can be used as GPIO (as done here), or by | ||
46 | * the LPG (works even in deep sleep!), to drive a bicolor | ||
47 | * LED on the H2 sample board, and another on the H2/P2 | ||
48 | * "surfer" expansion board. | ||
49 | * | ||
50 | * The same pins drive a LED on the OSK Mistral board, but | ||
51 | * that's a different kind of LED (just one color at a time). | ||
52 | */ | ||
53 | omap_cfg_reg(P18_1610_GPIO3); | ||
54 | if (gpio_request(3, "LED red") == 0) | ||
55 | gpio_direction_output(3, 1); | ||
56 | else | ||
57 | printk(KERN_WARNING "LED: can't get GPIO3/red?\n"); | ||
58 | |||
59 | omap_cfg_reg(MPUIO4); | ||
60 | if (gpio_request(OMAP_MPUIO(4), "LED green") == 0) | ||
61 | gpio_direction_output(OMAP_MPUIO(4), 1); | ||
62 | else | ||
63 | printk(KERN_WARNING "LED: can't get MPUIO4/green?\n"); | ||
64 | } | ||
65 | |||
66 | leds_event(led_start); | ||
67 | return 0; | ||
68 | } | ||
69 | |||
70 | __initcall(omap_leds_init); | ||
diff --git a/arch/arm/mach-omap1/leds.h b/arch/arm/mach-omap1/leds.h deleted file mode 100644 index a1e9fedc376c..000000000000 --- a/arch/arm/mach-omap1/leds.h +++ /dev/null | |||
@@ -1,3 +0,0 @@ | |||
1 | extern void innovator_leds_event(led_event_t evt); | ||
2 | extern void h2p2_dbg_leds_event(led_event_t evt); | ||
3 | extern void osk_leds_event(led_event_t evt); | ||
diff --git a/arch/arm/mach-omap1/time.c b/arch/arm/mach-omap1/time.c index 4062480bfec7..4d4816fd6fc9 100644 --- a/arch/arm/mach-omap1/time.c +++ b/arch/arm/mach-omap1/time.c | |||
@@ -44,7 +44,6 @@ | |||
44 | #include <linux/clockchips.h> | 44 | #include <linux/clockchips.h> |
45 | #include <linux/io.h> | 45 | #include <linux/io.h> |
46 | 46 | ||
47 | #include <asm/leds.h> | ||
48 | #include <asm/irq.h> | 47 | #include <asm/irq.h> |
49 | #include <asm/sched_clock.h> | 48 | #include <asm/sched_clock.h> |
50 | 49 | ||
diff --git a/arch/arm/mach-omap1/timer32k.c b/arch/arm/mach-omap1/timer32k.c index eae49c3980c9..74529549130c 100644 --- a/arch/arm/mach-omap1/timer32k.c +++ b/arch/arm/mach-omap1/timer32k.c | |||
@@ -46,7 +46,6 @@ | |||
46 | #include <linux/clockchips.h> | 46 | #include <linux/clockchips.h> |
47 | #include <linux/io.h> | 47 | #include <linux/io.h> |
48 | 48 | ||
49 | #include <asm/leds.h> | ||
50 | #include <asm/irq.h> | 49 | #include <asm/irq.h> |
51 | #include <asm/mach/irq.h> | 50 | #include <asm/mach/irq.h> |
52 | #include <asm/mach/time.h> | 51 | #include <asm/mach/time.h> |