Merge branch 'for-3.11' of git://linux-nfs.org/~bfields/linux
[linux-2.6.git] / include / linux / platform_data / lp855x.h
blobea3200527dd302c6028d5f23d39f53415e89870c
1 /*
2 * LP855x Backlight Driver
4 * Copyright (C) 2011 Texas Instruments
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
12 #ifndef _LP855X_H
13 #define _LP855X_H
15 #define BL_CTL_SHFT (0)
16 #define BRT_MODE_SHFT (1)
17 #define BRT_MODE_MASK (0x06)
19 /* Enable backlight. Only valid when BRT_MODE=10(I2C only) */
20 #define ENABLE_BL (1)
21 #define DISABLE_BL (0)
23 #define I2C_CONFIG(id) id ## _I2C_CONFIG
24 #define PWM_CONFIG(id) id ## _PWM_CONFIG
26 /* DEVICE CONTROL register - LP8550 */
27 #define LP8550_PWM_CONFIG (LP8550_PWM_ONLY << BRT_MODE_SHFT)
28 #define LP8550_I2C_CONFIG ((ENABLE_BL << BL_CTL_SHFT) | \
29 (LP8550_I2C_ONLY << BRT_MODE_SHFT))
31 /* DEVICE CONTROL register - LP8551 */
32 #define LP8551_PWM_CONFIG LP8550_PWM_CONFIG
33 #define LP8551_I2C_CONFIG LP8550_I2C_CONFIG
35 /* DEVICE CONTROL register - LP8552 */
36 #define LP8552_PWM_CONFIG LP8550_PWM_CONFIG
37 #define LP8552_I2C_CONFIG LP8550_I2C_CONFIG
39 /* DEVICE CONTROL register - LP8553 */
40 #define LP8553_PWM_CONFIG LP8550_PWM_CONFIG
41 #define LP8553_I2C_CONFIG LP8550_I2C_CONFIG
43 /* DEVICE CONTROL register - LP8556 */
44 #define LP8556_PWM_CONFIG (LP8556_PWM_ONLY << BRT_MODE_SHFT)
45 #define LP8556_COMB1_CONFIG (LP8556_COMBINED1 << BRT_MODE_SHFT)
46 #define LP8556_I2C_CONFIG ((ENABLE_BL << BL_CTL_SHFT) | \
47 (LP8556_I2C_ONLY << BRT_MODE_SHFT))
48 #define LP8556_COMB2_CONFIG (LP8556_COMBINED2 << BRT_MODE_SHFT)
49 #define LP8556_FAST_CONFIG BIT(7) /* use it if EPROMs should be maintained
50 when exiting the low power mode */
52 /* CONFIG register - LP8557 */
53 #define LP8557_PWM_STANDBY BIT(7)
54 #define LP8557_PWM_FILTER BIT(6)
55 #define LP8557_RELOAD_EPROM BIT(3) /* use it if EPROMs should be reset
56 when the backlight turns on */
57 #define LP8557_OFF_OPENLEDS BIT(2)
58 #define LP8557_PWM_CONFIG LP8557_PWM_ONLY
59 #define LP8557_I2C_CONFIG LP8557_I2C_ONLY
60 #define LP8557_COMB1_CONFIG LP8557_COMBINED1
61 #define LP8557_COMB2_CONFIG LP8557_COMBINED2
63 enum lp855x_chip_id {
64 LP8550,
65 LP8551,
66 LP8552,
67 LP8553,
68 LP8556,
69 LP8557,
72 enum lp8550_brighntess_source {
73 LP8550_PWM_ONLY,
74 LP8550_I2C_ONLY = 2,
77 enum lp8551_brighntess_source {
78 LP8551_PWM_ONLY = LP8550_PWM_ONLY,
79 LP8551_I2C_ONLY = LP8550_I2C_ONLY,
82 enum lp8552_brighntess_source {
83 LP8552_PWM_ONLY = LP8550_PWM_ONLY,
84 LP8552_I2C_ONLY = LP8550_I2C_ONLY,
87 enum lp8553_brighntess_source {
88 LP8553_PWM_ONLY = LP8550_PWM_ONLY,
89 LP8553_I2C_ONLY = LP8550_I2C_ONLY,
92 enum lp8556_brightness_source {
93 LP8556_PWM_ONLY,
94 LP8556_COMBINED1, /* pwm + i2c before the shaper block */
95 LP8556_I2C_ONLY,
96 LP8556_COMBINED2, /* pwm + i2c after the shaper block */
99 enum lp8557_brightness_source {
100 LP8557_PWM_ONLY,
101 LP8557_I2C_ONLY,
102 LP8557_COMBINED1, /* pwm + i2c after the shaper block */
103 LP8557_COMBINED2, /* pwm + i2c before the shaper block */
106 struct lp855x_rom_data {
107 u8 addr;
108 u8 val;
112 * struct lp855x_platform_data
113 * @name : Backlight driver name. If it is not defined, default name is set.
114 * @device_control : value of DEVICE CONTROL register
115 * @initial_brightness : initial value of backlight brightness
116 * @period_ns : platform specific pwm period value. unit is nano.
117 Only valid when mode is PWM_BASED.
118 * @size_program : total size of lp855x_rom_data
119 * @rom_data : list of new eeprom/eprom registers
121 struct lp855x_platform_data {
122 const char *name;
123 u8 device_control;
124 u8 initial_brightness;
125 unsigned int period_ns;
126 int size_program;
127 struct lp855x_rom_data *rom_data;
130 #endif