diff options
author | Michael Brandt <Michael.Brandt@stericsson.com> | 2010-01-13 17:34:25 +0100 |
---|---|---|
committer | Michael Brandt <Michael.Brandt@stericsson.com> | 2010-01-13 17:34:25 +0100 |
commit | c8f05f17eb440b3ef88d9417bf02797475583737 (patch) | |
tree | 81e1bf25dd75b1bad7ba738dd15eb76d882912ea /drivers/misc/twl4030_led.c | |
parent | 074f516bda136e5464499fc63a854d8469f8e9fb (diff) | |
parent | 2ff6922280025c1315c53fa2eb4ab33f0c9591de (diff) |
Merge branch 'master' of http://git.denx.de/u-boot
Diffstat (limited to 'drivers/misc/twl4030_led.c')
-rw-r--r-- | drivers/misc/twl4030_led.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/misc/twl4030_led.c b/drivers/misc/twl4030_led.c index bfdafef38..33cea116d 100644 --- a/drivers/misc/twl4030_led.c +++ b/drivers/misc/twl4030_led.c @@ -34,19 +34,15 @@ #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); } |