Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 93419
b: refs/heads/master
c: ca3259b
h: refs/heads/master
i:
  93417: cf5c5f2
  93415: a290d28
v: v3
  • Loading branch information
Herbert Valerio Riedel authored and Richard Purdie committed Apr 24, 2008
1 parent a583e0f commit 2f9d515
Show file tree
Hide file tree
Showing 3 changed files with 19 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: 4d404fd5c51772720e9c72aa3185bd5119bc6e69
refs/heads/master: ca3259b3603539e72faacc6821050ee889a52103
15 changes: 15 additions & 0 deletions trunk/drivers/leds/leds-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ struct gpio_led_data {
u8 new_level;
u8 can_sleep;
u8 active_low;
int (*platform_gpio_blink_set)(unsigned gpio,
unsigned long *delay_on, unsigned long *delay_off);
};

static void gpio_led_work(struct work_struct *work)
Expand Down Expand Up @@ -60,6 +62,15 @@ static void gpio_led_set(struct led_classdev *led_cdev,
gpio_set_value(led_dat->gpio, level);
}

static int gpio_blink_set(struct led_classdev *led_cdev,
unsigned long *delay_on, unsigned long *delay_off)
{
struct gpio_led_data *led_dat =
container_of(led_cdev, struct gpio_led_data, cdev);

return led_dat->platform_gpio_blink_set(led_dat->gpio, delay_on, delay_off);
}

static int gpio_led_probe(struct platform_device *pdev)
{
struct gpio_led_platform_data *pdata = pdev->dev.platform_data;
Expand Down Expand Up @@ -88,6 +99,10 @@ static int gpio_led_probe(struct platform_device *pdev)
led_dat->gpio = cur_led->gpio;
led_dat->can_sleep = gpio_cansleep(cur_led->gpio);
led_dat->active_low = cur_led->active_low;
if (pdata->gpio_blink_set) {
led_dat->platform_gpio_blink_set = pdata->gpio_blink_set;
led_dat->cdev.blink_set = gpio_blink_set;
}
led_dat->cdev.brightness_set = gpio_led_set;
led_dat->cdev.brightness = LED_OFF;

Expand Down
3 changes: 3 additions & 0 deletions trunk/include/linux/leds.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ struct gpio_led {
struct gpio_led_platform_data {
int num_leds;
struct gpio_led *leds;
int (*gpio_blink_set)(unsigned gpio,
unsigned long *delay_on,
unsigned long *delay_off);
};


Expand Down

0 comments on commit 2f9d515

Please sign in to comment.