pm8xxx-led: Add API to configure pm8xxx LEDs
Add pm8xxx_led_configure API. It takes LED Id, mode,
and maximum current to be set.
Moreover,
1) Convert current values to actual current level using
appropriate LED current factor.
2) Check brightness values against acceptable
limits.
Signed-off-by: Jay Chokshi <jchokshi@codeaurora.org>
diff --git a/include/linux/leds-pm8xxx.h b/include/linux/leds-pm8xxx.h
index 3a03100..6e65958 100644
--- a/include/linux/leds-pm8xxx.h
+++ b/include/linux/leds-pm8xxx.h
@@ -34,4 +34,20 @@
PM8XXX_ID_FLASH_LED_1,
};
+/**
+ * pm8xxx_led_modes - Operating modes of LEDs
+ */
+enum pm8xxx_led_modes {
+ PM8XXX_LED_MODE_MANUAL,
+ PM8XXX_LED_MODE_PWM1,
+ PM8XXX_LED_MODE_PWM2,
+ PM8XXX_LED_MODE_PWM3,
+ PM8XXX_LED_MODE_DTEST1,
+ PM8XXX_LED_MODE_DTEST2,
+ PM8XXX_LED_MODE_DTEST3,
+ PM8XXX_LED_MODE_DTEST4
+};
+
+int pm8xxx_led_config(enum pm8xxx_leds led_id,
+ enum pm8xxx_led_modes led_mode, int max_current);
#endif /* __LEDS_PM8XXX_H__ */