aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mfd/lp8788.h
diff options
context:
space:
mode:
authorKim, Milo <Milo.Kim@ti.com>2013-02-27 20:02:43 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-27 22:10:09 -0500
commitc5a51053cf3b499ddba60a89ab067ea05ad15840 (patch)
tree0f76cd10dc1ee7f57782434f1aff21a4a4e39bc0 /include/linux/mfd/lp8788.h
parent9ed8a30f3471347c1b763bd062fa78ae80f18eae (diff)
backlight: add new lp8788 backlight driver
TI LP8788 PMU supports regulators, battery charger, RTC, ADC, backlight dri= ver and current sinks. This patch enables LP8788 backlight module. (Brightness mode) The brightness is controlled by PWM input or I2C register. All modes are supported in the driver. (Platform data) Configurable data can be defined in the platform side. name : backlight driver name. (default: "lcd-backlight") initial_brightness : initial value of backlight brightness bl_mode : brightness control by PWM or lp8788 register dim_mode : dimming mode selection full_scale : full scale current setting rise_time : brightness ramp up step time fall_time : brightness ramp down step time pwm_pol : PWM polarity setting when bl_mode is PWM based period_ns : platform specific PWM period value. unit is nano. The default values are set in case no platform data is defined. [akpm@linux-foundation.org: checkpatch fixes] Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: Samuel Ortiz <sameo@linux.intel.com> Cc: Thierry Reding <thierry.reding@avionic-design.de> Cc: "devendra.aaru" <devendra.aaru@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/mfd/lp8788.h')
-rw-r--r--include/linux/mfd/lp8788.h24
1 files changed, 5 insertions, 19 deletions
diff --git a/include/linux/mfd/lp8788.h b/include/linux/mfd/lp8788.h
index 2a32b16f79cb..786bf6679a28 100644
--- a/include/linux/mfd/lp8788.h
+++ b/include/linux/mfd/lp8788.h
@@ -16,6 +16,7 @@
16 16
17#include <linux/gpio.h> 17#include <linux/gpio.h>
18#include <linux/irqdomain.h> 18#include <linux/irqdomain.h>
19#include <linux/pwm.h>
19#include <linux/regmap.h> 20#include <linux/regmap.h>
20 21
21#define LP8788_DEV_BUCK "lp8788-buck" 22#define LP8788_DEV_BUCK "lp8788-buck"
@@ -124,11 +125,6 @@ enum lp8788_bl_ramp_step {
124 LP8788_RAMP_65538us, 125 LP8788_RAMP_65538us,
125}; 126};
126 127
127enum lp8788_bl_pwm_polarity {
128 LP8788_PWM_ACTIVE_HIGH,
129 LP8788_PWM_ACTIVE_LOW,
130};
131
132enum lp8788_isink_scale { 128enum lp8788_isink_scale {
133 LP8788_ISINK_SCALE_100mA, 129 LP8788_ISINK_SCALE_100mA,
134 LP8788_ISINK_SCALE_120mA, 130 LP8788_ISINK_SCALE_120mA,
@@ -229,16 +225,6 @@ struct lp8788_charger_platform_data {
229}; 225};
230 226
231/* 227/*
232 * struct lp8788_bl_pwm_data
233 * @pwm_set_intensity : set duty of pwm
234 * @pwm_get_intensity : get current duty of pwm
235 */
236struct lp8788_bl_pwm_data {
237 void (*pwm_set_intensity) (int brightness, int max_brightness);
238 int (*pwm_get_intensity) (int max_brightness);
239};
240
241/*
242 * struct lp8788_backlight_platform_data 228 * struct lp8788_backlight_platform_data
243 * @name : backlight driver name. (default: "lcd-backlight") 229 * @name : backlight driver name. (default: "lcd-backlight")
244 * @initial_brightness : initial value of backlight brightness 230 * @initial_brightness : initial value of backlight brightness
@@ -248,8 +234,8 @@ struct lp8788_bl_pwm_data {
248 * @rise_time : brightness ramp up step time 234 * @rise_time : brightness ramp up step time
249 * @fall_time : brightness ramp down step time 235 * @fall_time : brightness ramp down step time
250 * @pwm_pol : pwm polarity setting when bl_mode is pwm based 236 * @pwm_pol : pwm polarity setting when bl_mode is pwm based
251 * @pwm_data : platform specific pwm generation functions 237 * @period_ns : platform specific pwm period value. unit is nano.
252 * only valid when bl_mode is pwm based 238 Only valid when bl_mode is LP8788_BL_COMB_PWM_BASED
253 */ 239 */
254struct lp8788_backlight_platform_data { 240struct lp8788_backlight_platform_data {
255 char *name; 241 char *name;
@@ -259,8 +245,8 @@ struct lp8788_backlight_platform_data {
259 enum lp8788_bl_full_scale_current full_scale; 245 enum lp8788_bl_full_scale_current full_scale;
260 enum lp8788_bl_ramp_step rise_time; 246 enum lp8788_bl_ramp_step rise_time;
261 enum lp8788_bl_ramp_step fall_time; 247 enum lp8788_bl_ramp_step fall_time;
262 enum lp8788_bl_pwm_polarity pwm_pol; 248 enum pwm_polarity pwm_pol;
263 struct lp8788_bl_pwm_data pwm_data; 249 unsigned int period_ns;
264}; 250};
265 251
266/* 252/*