Skip to content

Commit

Permalink
ARM: mach-omap1: retire custom LED code
Browse files Browse the repository at this point in the history
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
Acked-by: Tony Lindgren <tony@atomide.com>
  • Loading branch information
Bryan Wu committed Aug 1, 2012
1 parent 4ad5419 commit dafbead
Show file tree
Hide file tree
Showing 13 changed files with 165 additions and 687 deletions.
8 changes: 0 additions & 8 deletions arch/arm/mach-omap1/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,6 @@ obj-$(CONFIG_ARCH_OMAP850) += gpio7xx.o
obj-$(CONFIG_ARCH_OMAP15XX) += gpio15xx.o
obj-$(CONFIG_ARCH_OMAP16XX) += gpio16xx.o

# LEDs support
led-$(CONFIG_MACH_OMAP_H2) += leds-h2p2-debug.o
led-$(CONFIG_MACH_OMAP_H3) += leds-h2p2-debug.o
led-$(CONFIG_MACH_OMAP_INNOVATOR) += leds-innovator.o
led-$(CONFIG_MACH_OMAP_PERSEUS2) += leds-h2p2-debug.o
led-$(CONFIG_MACH_OMAP_OSK) += leds-osk.o
obj-$(CONFIG_LEDS) += $(led-y)

ifneq ($(CONFIG_FB_OMAP),)
obj-y += lcd_dma.o
endif
32 changes: 32 additions & 0 deletions arch/arm/mach-omap1/board-h2.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <linux/i2c/tps65010.h>
#include <linux/smc91x.h>
#include <linux/omapfb.h>
#include <linux/leds.h>

#include <asm/mach-types.h>
#include <asm/mach/arch.h>
Expand Down Expand Up @@ -306,12 +307,39 @@ static struct platform_device h2_irda_device = {
.resource = h2_irda_resources,
};

static struct gpio_led h2_gpio_led_pins[] = {
{
.name = "h2:red",
.default_trigger = "heartbeat",
.gpio = 3,
},
{
.name = "h2:green",
.default_trigger = "cpu0",
.gpio = OMAP_MPUIO(4),
},
};

static struct gpio_led_platform_data h2_gpio_led_data = {
.leds = h2_gpio_led_pins,
.num_leds = ARRAY_SIZE(h2_gpio_led_pins),
};

static struct platform_device h2_gpio_leds = {
.name = "leds-gpio",
.id = -1,
.dev = {
.platform_data = &h2_gpio_led_data,
},
};

static struct platform_device *h2_devices[] __initdata = {
&h2_nor_device,
&h2_nand_device,
&h2_smc91x_device,
&h2_irda_device,
&h2_kp_device,
&h2_gpio_leds,
};

static void __init h2_init_smc91x(void)
Expand Down Expand Up @@ -406,6 +434,10 @@ static void __init h2_init(void)
omap_cfg_reg(E19_1610_KBR4);
omap_cfg_reg(N19_1610_KBR5);

/* GPIO based LEDs */
omap_cfg_reg(P18_1610_GPIO3);
omap_cfg_reg(MPUIO4);

h2_smc91x_resources[1].start = gpio_to_irq(0);
h2_smc91x_resources[1].end = gpio_to_irq(0);
platform_add_devices(h2_devices, ARRAY_SIZE(h2_devices));
Expand Down
32 changes: 32 additions & 0 deletions arch/arm/mach-omap1/board-h3.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <linux/i2c/tps65010.h>
#include <linux/smc91x.h>
#include <linux/omapfb.h>
#include <linux/leds.h>

#include <asm/setup.h>
#include <asm/page.h>
Expand Down Expand Up @@ -324,13 +325,40 @@ static struct spi_board_info h3_spi_board_info[] __initdata = {
},
};

static struct gpio_led h3_gpio_led_pins[] = {
{
.name = "h3:red",
.default_trigger = "heartbeat",
.gpio = 3,
},
{
.name = "h3:green",
.default_trigger = "cpu0",
.gpio = OMAP_MPUIO(4),
},
};

static struct gpio_led_platform_data h3_gpio_led_data = {
.leds = h3_gpio_led_pins,
.num_leds = ARRAY_SIZE(h3_gpio_led_pins),
};

static struct platform_device h3_gpio_leds = {
.name = "leds-gpio",
.id = -1,
.dev = {
.platform_data = &h3_gpio_led_data,
},
};

static struct platform_device *devices[] __initdata = {
&nor_device,
&nand_device,
&smc91x_device,
&intlat_device,
&h3_kp_device,
&h3_lcd_device,
&h3_gpio_leds,
};

static struct omap_usb_config h3_usb_config __initdata = {
Expand Down Expand Up @@ -398,6 +426,10 @@ static void __init h3_init(void)
omap_cfg_reg(E19_1610_KBR4);
omap_cfg_reg(N19_1610_KBR5);

/* GPIO based LEDs */
omap_cfg_reg(P18_1610_GPIO3);
omap_cfg_reg(MPUIO4);

smc91x_resources[1].start = gpio_to_irq(40);
smc91x_resources[1].end = gpio_to_irq(40);
platform_add_devices(devices, ARRAY_SIZE(devices));
Expand Down
33 changes: 33 additions & 0 deletions arch/arm/mach-omap1/board-osk.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,10 +380,37 @@ static struct platform_device osk5912_lcd_device = {
.id = -1,
};

static struct gpio_led mistral_gpio_led_pins[] = {
{
.name = "mistral:red",
.default_trigger = "heartbeat",
.gpio = 3,
},
{
.name = "mistral:green",
.default_trigger = "cpu0",
.gpio = OMAP_MPUIO(4),
},
};

static struct gpio_led_platform_data mistral_gpio_led_data = {
.leds = mistral_gpio_led_pins,
.num_leds = ARRAY_SIZE(mistral_gpio_led_pins),
};

static struct platform_device mistral_gpio_leds = {
.name = "leds-gpio",
.id = -1,
.dev = {
.platform_data = &mistral_gpio_led_data,
},
};

static struct platform_device *mistral_devices[] __initdata = {
&osk5912_kp_device,
&mistral_bl_device,
&osk5912_lcd_device,
&mistral_gpio_leds,
};

static int mistral_get_pendown_state(void)
Expand Down Expand Up @@ -508,6 +535,12 @@ static void __init osk_mistral_init(void)
if (gpio_request(2, "lcd_pwr") == 0)
gpio_direction_output(2, 1);

/*
* GPIO based LEDs
*/
omap_cfg_reg(P18_1610_GPIO3);
omap_cfg_reg(MPUIO4);

i2c_register_board_info(1, mistral_i2c_board_info,
ARRAY_SIZE(mistral_i2c_board_info));

Expand Down
166 changes: 0 additions & 166 deletions arch/arm/mach-omap1/leds-h2p2-debug.c

This file was deleted.

Loading

0 comments on commit dafbead

Please sign in to comment.