diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2010-05-22 06:54:55 -0400 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-05-26 08:07:55 -0400 |
commit | 2146325df2c2640059a9e064890c30c6e259b458 (patch) | |
tree | 022468b1246d7d795ee351b80404efd4b25b5610 /include/linux/leds.h | |
parent | 14e40f644b020d473415342461b7c62e3bb5e312 (diff) |
leds: leds-gpio: Change blink_set callback to be able to turn off blinking
The leds-gpio blink_set() callback follows the same prototype as the
main leds subsystem blink_set() one.
The problem is that to stop blink, normally, a leds driver does it
in the brightness_set() callback when asked to set a new fixed value.
However, with leds-gpio, the platform has no hook to do so, as this
later callback results in a standard GPIO manipulation.
This changes the leds-gpio specific callback to take a new argument
that indicates whether the LED should be blinking or not and in what
state it should be set if not. We also update the dns323 platform
which seems to be the only user of this so far.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'include/linux/leds.h')
-rw-r--r-- | include/linux/leds.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/include/linux/leds.h b/include/linux/leds.h index d8bf9665e70c..ba6986a11663 100644 --- a/include/linux/leds.h +++ b/include/linux/leds.h | |||
@@ -149,14 +149,18 @@ struct gpio_led { | |||
149 | unsigned default_state : 2; | 149 | unsigned default_state : 2; |
150 | /* default_state should be one of LEDS_GPIO_DEFSTATE_(ON|OFF|KEEP) */ | 150 | /* default_state should be one of LEDS_GPIO_DEFSTATE_(ON|OFF|KEEP) */ |
151 | }; | 151 | }; |
152 | #define LEDS_GPIO_DEFSTATE_OFF 0 | 152 | #define LEDS_GPIO_DEFSTATE_OFF 0 |
153 | #define LEDS_GPIO_DEFSTATE_ON 1 | 153 | #define LEDS_GPIO_DEFSTATE_ON 1 |
154 | #define LEDS_GPIO_DEFSTATE_KEEP 2 | 154 | #define LEDS_GPIO_DEFSTATE_KEEP 2 |
155 | 155 | ||
156 | struct gpio_led_platform_data { | 156 | struct gpio_led_platform_data { |
157 | int num_leds; | 157 | int num_leds; |
158 | struct gpio_led *leds; | 158 | struct gpio_led *leds; |
159 | int (*gpio_blink_set)(unsigned gpio, | 159 | |
160 | #define GPIO_LED_NO_BLINK_LOW 0 /* No blink GPIO state low */ | ||
161 | #define GPIO_LED_NO_BLINK_HIGH 1 /* No blink GPIO state high */ | ||
162 | #define GPIO_LED_BLINK 2 /* Plase, blink */ | ||
163 | int (*gpio_blink_set)(unsigned gpio, int state, | ||
160 | unsigned long *delay_on, | 164 | unsigned long *delay_on, |
161 | unsigned long *delay_off); | 165 | unsigned long *delay_off); |
162 | }; | 166 | }; |