summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 87d93a1)
raw | patch | inline | side by side (parent: 87d93a1)
author | Grazvydas Ignotas <notasas@gmail.com> | |
Thu, 10 Dec 2009 15:10:21 +0000 (17:10 +0200) | ||
committer | Tom Rix <Tom.Rix@windriver.com> | |
Mon, 4 Jan 2010 14:48:15 +0000 (08:48 -0600) |
Not all boards have both LEDs hooked, so enabling both on
boards with single LED will just waste power. Make it
possible to choose LEDs by adding argument to
twl4030_led_init().
Using this turn on only LEDB for pandora, leave both LEDs
on for all other boards, as it was before this patch.
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
boards with single LED will just waste power. Make it
possible to choose LEDs by adding argument to
twl4030_led_init().
Using this turn on only LEDB for pandora, leave both LEDs
on for all other boards, as it was before this patch.
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
index a144f52e6f16f55536f70d2d8a7f56a813cf5957..e442d687b735f3cbfb50e6c1f8848f325cb8f950 100644 (file)
int misc_init_r(void)
{
twl4030_power_init();
- twl4030_led_init();
+ twl4030_led_init(TWL4030_LED_LEDEN_LEDAON | TWL4030_LED_LEDEN_LEDBON);
dieid_num_r();
/*
index 21afc29b38747199b3a75659c38f1d08fc347550..387ed2d3968211dbff057dece019af12caabf1e5 100644 (file)
{
zoom2_identify();
twl4030_power_init();
- twl4030_led_init();
+ twl4030_led_init(TWL4030_LED_LEDEN_LEDAON | TWL4030_LED_LEDEN_LEDBON);
dieid_num_r();
/*
diff --git a/board/overo/overo.c b/board/overo/overo.c
index d42dc1326088b164bf98bac1356b8ac962ea311b..f363281568a0b7830899a7906475214894d8a4c7 100644 (file)
--- a/board/overo/overo.c
+++ b/board/overo/overo.c
int misc_init_r(void)
{
twl4030_power_init();
- twl4030_led_init();
+ twl4030_led_init(TWL4030_LED_LEDEN_LEDAON | TWL4030_LED_LEDEN_LEDBON);
#if defined(CONFIG_CMD_NET)
setup_net_chip();
index 460ed123595bec1d25c8e504f859961bf0c682ae..e84c9461538b3a87ac1f13a47588b42bcf13cb6c 100644 (file)
--- a/board/pandora/pandora.c
+++ b/board/pandora/pandora.c
struct gpio *gpio6_base = (struct gpio *)OMAP34XX_GPIO6_BASE;
twl4030_power_init();
- twl4030_led_init();
+ twl4030_led_init(TWL4030_LED_LEDEN_LEDBON);
/* Configure GPIOs to output */
writel(~(GPIO14 | GPIO15 | GPIO16 | GPIO23), &gpio1_base->oe);
index 32d501e2284037721054382925f2935878fefb46..3b4c9e73b570f4c57168d4efd40d6031c60a172a 100644 (file)
--- a/board/ti/beagle/beagle.c
+++ b/board/ti/beagle/beagle.c
struct gpio *gpio6_base = (struct gpio *)OMAP34XX_GPIO6_BASE;
twl4030_power_init();
- twl4030_led_init();
+ twl4030_led_init(TWL4030_LED_LEDEN_LEDAON | TWL4030_LED_LEDEN_LEDBON);
/* Configure GPIOs to output */
writel(~(GPIO23 | GPIO10 | GPIO8 | GPIO2 | GPIO1), &gpio6_base->oe);
index db7d2e27e2a524bca1a97e213117056435051695..95afaaaaa4f1f786934e6e67175c0387f19f05ee 100644 (file)
twl4030_power_init();
#ifdef CONFIG_TWL4030_LED
- twl4030_led_init();
+ twl4030_led_init(TWL4030_LED_LEDEN_LEDAON | TWL4030_LED_LEDEN_LEDBON);
#endif
#ifdef CONFIG_DRIVER_DM9000
index bfdafef38bae0829aa8549b1c1d418ca510eefeb..33cea116d2920792d7e0cce5687603ae9fc323aa 100644 (file)
#include <twl4030.h>
-#define LEDAON (0x1 << 0)
-#define LEDBON (0x1 << 1)
-#define LEDAPWM (0x1 << 4)
-#define LEDBPWM (0x1 << 5)
-
-void twl4030_led_init(void)
+void twl4030_led_init(unsigned char ledon_mask)
{
- unsigned char byte;
-
- /* enable LED */
- byte = LEDBPWM | LEDAPWM | LEDBON | LEDAON;
+ /* LEDs need to have corresponding PWMs enabled */
+ if (ledon_mask & TWL4030_LED_LEDEN_LEDAON)
+ ledon_mask |= TWL4030_LED_LEDEN_LEDAPWM;
+ if (ledon_mask & TWL4030_LED_LEDEN_LEDBON)
+ ledon_mask |= TWL4030_LED_LEDEN_LEDBPWM;
- twl4030_i2c_write_u8(TWL4030_CHIP_LED, byte,
+ twl4030_i2c_write_u8(TWL4030_CHIP_LED, ledon_mask,
TWL4030_LED_LEDEN);
}
diff --git a/include/twl4030.h b/include/twl4030.h
index feaec47b36afd512d132bfe68dce84a026d671e5..2b2f5ae6cde8dbe74a7580b1b43ba17f71edefab 100644 (file)
--- a/include/twl4030.h
+++ b/include/twl4030.h
/* LED */
#define TWL4030_LED_LEDEN 0xEE
+#define TWL4030_LED_LEDEN_LEDAON (1 << 0)
+#define TWL4030_LED_LEDEN_LEDBON (1 << 1)
+#define TWL4030_LED_LEDEN_LEDAPWM (1 << 4)
+#define TWL4030_LED_LEDEN_LEDBPWM (1 << 5)
/* Keypad */
#define TWL4030_KEYPAD_KEYP_CTRL_REG 0xD2
/*
* LED
*/
-void twl4030_led_init(void);
+void twl4030_led_init(unsigned char ledon_mask);
/*
* USB