leds: pm8xxx: Add support for WLED
White LED(WLED) is a newly introduced feature from pmic 8922.
It can drive series/parallel combination of led strings that are
used to drive lcd backlight. Add support for WLED brightness
control in the existing pm8xxx led framework.
Change-Id: I991fdc500877beec01c2c7b5c822139d2aa960dc
Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org>
diff --git a/include/linux/leds-pm8xxx.h b/include/linux/leds-pm8xxx.h
index 3f31498..18e6398 100644
--- a/include/linux/leds-pm8xxx.h
+++ b/include/linux/leds-pm8xxx.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+/* Copyright (c) 2010-2012, Code Aurora Forum. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -34,6 +34,8 @@
PM8XXX_ID_LED_2,
PM8XXX_ID_FLASH_LED_0,
PM8XXX_ID_FLASH_LED_1,
+ PM8XXX_ID_WLED,
+ PM8XXX_ID_MAX,
};
/**
@@ -50,6 +52,48 @@
PM8XXX_LED_MODE_DTEST4
};
+/* current boost limit */
+enum wled_current_bost_limit {
+ WLED_CURR_LIMIT_105mA,
+ WLED_CURR_LIMIT_385mA,
+ WLED_CURR_LIMIT_525mA,
+ WLED_CURR_LIMIT_805mA,
+ WLED_CURR_LIMIT_980mA,
+ WLED_CURR_LIMIT_1260mA,
+ WLED_CURR_LIMIT_1400mA,
+ WLED_CURR_LIMIT_1680mA,
+};
+
+/* over voltage protection threshold */
+enum wled_ovp_threshold {
+ WLED_OVP_35V,
+ WLED_OVP_32V,
+ WLED_OVP_29V,
+ WLED_OVP_37V,
+};
+
+/**
+ * wled_config_data - wled configuration data
+ * @num_strings - number of wled strings supported
+ * @ovp_val - over voltage protection threshold
+ * @boost_curr_lim - boot current limit
+ * @cp_select - high pole capacitance
+ * @ctrl_delay_us - delay in activation of led
+ * @dig_mod_gen_en - digital module generator
+ * @cs_out_en - current sink output enable
+ * @op_fdbck - selection of output as feedback for the boost
+ */
+struct wled_config_data {
+ u8 num_strings;
+ u8 ovp_val;
+ u8 boost_curr_lim;
+ u8 cp_select;
+ u8 ctrl_delay_us;
+ bool dig_mod_gen_en;
+ bool cs_out_en;
+ bool op_fdbck;
+};
+
/**
* pm8xxx_led_config - led configuration parameters
* @id - LED id
@@ -57,6 +101,7 @@
* @max_current - maximum current that LED can sustain
* @pwm_channel - PWM channel ID the LED is driven to
* @pwm_period_us - PWM period value in micro seconds
+ * @default_state - default state of the led
* @pwm_duty_cycles - PWM duty cycle information
*/
struct pm8xxx_led_config {
@@ -65,7 +110,9 @@
u16 max_current;
int pwm_channel;
u32 pwm_period_us;
+ bool default_state;
struct pm8xxx_pwm_duty_cycles *pwm_duty_cycles;
+ struct wled_config_data *wled_cfg;
};
/**