linux-ti335x-psp 3.1: enable support for beaglebone cape EEPROM based detection
[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-ti33x-psp-3.1 / 0035-beaglebone-add-structs-for-DVI-cape-LEDs.patch
1 From f4d66b3ee9bbe36e17f9aaee2aedfa547e7bbb8c Mon Sep 17 00:00:00 2001
2 From: Koen Kooi <koen@dominion.thruhere.net>
3 Date: Wed, 25 Jan 2012 10:04:15 +0100
4 Subject: [PATCH 35/35] beaglebone: add structs for DVI cape LEDs
6 Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
7 ---
8  arch/arm/mach-omap2/board-am335xevm.c |   67 +++++++++++++++++++++++++++++---
9  1 files changed, 60 insertions(+), 7 deletions(-)
11 diff --git a/arch/arm/mach-omap2/board-am335xevm.c b/arch/arm/mach-omap2/board-am335xevm.c
12 index 9556736..1b398c7 100644
13 --- a/arch/arm/mach-omap2/board-am335xevm.c
14 +++ b/arch/arm/mach-omap2/board-am335xevm.c
15 @@ -847,10 +847,45 @@ static struct pinmux_config usb1_pin_mux[] = {
16  #define BEAGLEBONE_USR3_LED  GPIO_TO_PIN(1, 23)
17  #define BEAGLEBONE_USR4_LED  GPIO_TO_PIN(1, 24)
18  
19 +static struct gpio_led bone_gpio_leds[] = {
20 +       {
21 +               .name                   = "beaglebone::usr0",
22 +               .default_trigger        = "heartbeat",
23 +               .gpio                   = BEAGLEBONE_USR1_LED,
24 +       },
25 +       {
26 +               .name                   = "beaglebone::usr1",
27 +               .default_trigger        = "mmc0",
28 +               .gpio                   = BEAGLEBONE_USR2_LED,
29 +       },
30 +       {
31 +               .name                   = "beaglebone::usr2",
32 +               .gpio                   = BEAGLEBONE_USR3_LED,
33 +       },
34 +       {
35 +               .name           = "beaglebone::usr3",
36 +               .gpio           = BEAGLEBONE_USR4_LED,
37 +       },
38 +};
39 +
40 +static struct gpio_led_platform_data bone_gpio_led_info = {
41 +       .leds           = bone_gpio_leds,
42 +       .num_leds       = ARRAY_SIZE(bone_gpio_leds),
43 +};
44 +
45 +static struct platform_device bone_leds_gpio = {
46 +       .name   = "leds-gpio",
47 +       .id     = -1,
48 +       .dev    = {
49 +               .platform_data  = &bone_gpio_led_info,
50 +       },
51 +};
52 +
53 +
54  #define BEAGLEBONEDVI_USR0_LED  GPIO_TO_PIN(1, 18)
55  #define BEAGLEBONEDVI_USR1_LED  GPIO_TO_PIN(1, 19)
56  
57 -static struct gpio_led gpio_leds[] = {
58 +static struct gpio_led dvi_gpio_leds[] = {
59         {
60                 .name                   = "beaglebone::usr0",
61                 .default_trigger        = "heartbeat",
62 @@ -869,18 +904,28 @@ static struct gpio_led gpio_leds[] = {
63                 .name           = "beaglebone::usr3",
64                 .gpio           = BEAGLEBONE_USR4_LED,
65         },
66 +       {
67 +               .name                   = "dvi::usr0",
68 +               .default_trigger        = "heartbeat",
69 +               .gpio                   = BEAGLEBONEDVI_USR0_LED,
70 +       },
71 +       {
72 +               .name                   = "dvi::usr1",
73 +               .default_trigger        = "mmc0",
74 +               .gpio                   = BEAGLEBONEDVI_USR1_LED,
75 +       },
76  };
77  
78 -static struct gpio_led_platform_data gpio_led_info = {
79 -       .leds           = gpio_leds,
80 -       .num_leds       = ARRAY_SIZE(gpio_leds),
81 +static struct gpio_led_platform_data dvi_gpio_led_info = {
82 +       .leds           = dvi_gpio_leds,
83 +       .num_leds       = ARRAY_SIZE(dvi_gpio_leds),
84  };
85  
86 -static struct platform_device leds_gpio = {
87 +static struct platform_device dvi_leds_gpio = {
88         .name   = "leds-gpio",
89         .id     = -1,
90         .dev    = {
91 -               .platform_data  = &gpio_led_info,
92 +               .platform_data  = &dvi_gpio_led_info,
93         },
94  };
95  
96 @@ -1074,11 +1119,19 @@ static void boneleds_init(int evm_id, int profile )
97  {
98         int err;
99         setup_pin_mux(bone_pin_mux);
100 -       err = platform_device_register(&leds_gpio);
101 +       err = platform_device_register(&bone_leds_gpio);
102         if (err)
103                 pr_err("failed to register BeagleBone LEDS\n");
104  }
105  
106 +static void dvileds_init(int evm_id, int profile )
107 +{
108 +       int err;
109 +       err = platform_device_register(&dvi_leds_gpio);
110 +       if (err)
111 +               pr_err("failed to register BeagleBone DVI cape LEDS\n");
112 +}
114  static void rgmii1_init(int evm_id, int profile)
115  {
116         setup_pin_mux(rgmii1_pin_mux);
117 -- 
118 1.7.2.5