Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 296858
b: refs/heads/master
c: b3b9747
h: refs/heads/master
v: v3
  • Loading branch information
Jett.Zhou authored and Samuel Ortiz committed Mar 6, 2012
1 parent 0c8ca0a commit 389b3e7
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1efc15812d8ce5d9096bb8af400f51a85b5f5af0
refs/heads/master: b3b97473ee07ae8904e9d8fe02914de2188d302c
23 changes: 23 additions & 0 deletions trunk/drivers/leds/leds-88pm860x.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,27 @@ static inline int __blink_ctl_mask(int port)
return ret;
}

static int led_power_set(struct pm860x_chip *chip, int port, int on)
{
int ret = -EINVAL;

switch (port) {
case PM8606_LED1_RED:
case PM8606_LED1_GREEN:
case PM8606_LED1_BLUE:
ret = on ? pm8606_osc_enable(chip, RGB1_ENABLE) :
pm8606_osc_disable(chip, RGB1_ENABLE);
break;
case PM8606_LED2_RED:
case PM8606_LED2_GREEN:
case PM8606_LED2_BLUE:
ret = on ? pm8606_osc_enable(chip, RGB2_ENABLE) :
pm8606_osc_disable(chip, RGB2_ENABLE);
break;
}
return ret;
}

static void pm860x_led_work(struct work_struct *work)
{

Expand All @@ -126,6 +147,7 @@ static void pm860x_led_work(struct work_struct *work)
chip = led->chip;
mutex_lock(&led->lock);
if ((led->current_brightness == 0) && led->brightness) {
led_power_set(chip, led->port, 1);
if (led->iset) {
pm860x_set_bits(led->i2c, __led_off(led->port),
LED_CURRENT_MASK, led->iset);
Expand All @@ -149,6 +171,7 @@ static void pm860x_led_work(struct work_struct *work)
LED_CURRENT_MASK, 0);
mask = __blink_ctl_mask(led->port);
pm860x_set_bits(led->i2c, PM8606_WLED3B, mask, 0);
led_power_set(chip, led->port, 0);
}
}
led->current_brightness = led->brightness;
Expand Down

0 comments on commit 389b3e7

Please sign in to comment.