aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2010-05-13 23:20:53 +0200
committerLars-Peter Clausen <lars@metafoo.de>2010-05-17 19:30:27 +0200
commit3a821bff143548dd67dbc7292fa9dce24f5b864e (patch)
treee41b3339c895c41453e79c1b1392a4fda2aca833 /include
parente40152ee1e1c7a63f4777791863215e3faa37a86 (diff)
LEDS: leds-pwm: Add init, notfiy and exit callbacks
This patch adds init, notify and exit callbacks to the leds-pwm driver. One usecase for these callbacks is that on certain platforms it is neccessary to configure a gpio pin as pwm pin. On these platforms it is usefull to have the added callbacks, so that the gpio pin can be configured at the same time as the pwm device. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Diffstat (limited to 'include')
-rw-r--r--include/linux/leds_pwm.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/linux/leds_pwm.h b/include/linux/leds_pwm.h
index 33a07116748..42d49694cbd 100644
--- a/include/linux/leds_pwm.h
+++ b/include/linux/leds_pwm.h
@@ -16,6 +16,26 @@ struct led_pwm {
struct led_pwm_platform_data {
int num_leds;
struct led_pwm *leds;
+
+ /* @init: The init callback is called after the pwm device for a led has
+ * been successfully configured. If the return value is negative it will be
+ * seen as an error and initzalisation of the leds-pwm device will fail.
+ */
+ int (*init)(struct device *dev, struct led_pwm *led);
+
+ /* @notify: The notify callback is called whenever the brightness of a led
+ * is changed.
+ * The return value of the callback will be the brightness which is used to
+ * configure the pwm device.
+ */
+ enum led_brightness (*notify)(struct device *dev, struct led_pwm *led,
+ enum led_brightness brightness);
+
+ /* @exit: The exit callback is called, whenever a led device registered by
+ * the leds-pwm device is unregistered. It will be called prior to freeing
+ * the pwm device.
+ */
+ void (*exit)(struct device *dev, struct led_pwm *led);
};
#endif