diff options
-rw-r--r-- | Documentation/backlight/lp855x-driver.txt | 5 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/video/backlight/lp855x.txt | 29 | ||||
-rw-r--r-- | drivers/video/backlight/Kconfig | 4 | ||||
-rw-r--r-- | drivers/video/backlight/lp855x_bl.c | 17 | ||||
-rw-r--r-- | include/linux/platform_data/lp855x.h | 19 |
5 files changed, 67 insertions, 7 deletions
diff --git a/Documentation/backlight/lp855x-driver.txt b/Documentation/backlight/lp855x-driver.txt index 1c732f0c6758..01bce243d3d7 100644 --- a/Documentation/backlight/lp855x-driver.txt +++ b/Documentation/backlight/lp855x-driver.txt | |||
@@ -4,7 +4,8 @@ Kernel driver lp855x | |||
4 | Backlight driver for LP855x ICs | 4 | Backlight driver for LP855x ICs |
5 | 5 | ||
6 | Supported chips: | 6 | Supported chips: |
7 | Texas Instruments LP8550, LP8551, LP8552, LP8553, LP8556 and LP8557 | 7 | Texas Instruments LP8550, LP8551, LP8552, LP8553, LP8555, LP8556 and |
8 | LP8557 | ||
8 | 9 | ||
9 | Author: Milo(Woogyom) Kim <milo.kim@ti.com> | 10 | Author: Milo(Woogyom) Kim <milo.kim@ti.com> |
10 | 11 | ||
@@ -24,7 +25,7 @@ Value : pwm based or register based | |||
24 | 25 | ||
25 | 2) chip_id | 26 | 2) chip_id |
26 | The lp855x chip id. | 27 | The lp855x chip id. |
27 | Value : lp8550/lp8551/lp8552/lp8553/lp8556/lp8557 | 28 | Value : lp8550/lp8551/lp8552/lp8553/lp8555/lp8556/lp8557 |
28 | 29 | ||
29 | Platform data for lp855x | 30 | Platform data for lp855x |
30 | ------------------------ | 31 | ------------------------ |
diff --git a/Documentation/devicetree/bindings/video/backlight/lp855x.txt b/Documentation/devicetree/bindings/video/backlight/lp855x.txt index 1482103d288f..96e83a56048e 100644 --- a/Documentation/devicetree/bindings/video/backlight/lp855x.txt +++ b/Documentation/devicetree/bindings/video/backlight/lp855x.txt | |||
@@ -2,7 +2,7 @@ lp855x bindings | |||
2 | 2 | ||
3 | Required properties: | 3 | Required properties: |
4 | - compatible: "ti,lp8550", "ti,lp8551", "ti,lp8552", "ti,lp8553", | 4 | - compatible: "ti,lp8550", "ti,lp8551", "ti,lp8552", "ti,lp8553", |
5 | "ti,lp8556", "ti,lp8557" | 5 | "ti,lp8555", "ti,lp8556", "ti,lp8557" |
6 | - reg: I2C slave address (u8) | 6 | - reg: I2C slave address (u8) |
7 | - dev-ctrl: Value of DEVICE CONTROL register (u8). It depends on the device. | 7 | - dev-ctrl: Value of DEVICE CONTROL register (u8). It depends on the device. |
8 | 8 | ||
@@ -15,6 +15,33 @@ Optional properties: | |||
15 | 15 | ||
16 | Example: | 16 | Example: |
17 | 17 | ||
18 | /* LP8555 */ | ||
19 | backlight@2c { | ||
20 | compatible = "ti,lp8555"; | ||
21 | reg = <0x2c>; | ||
22 | |||
23 | dev-ctrl = /bits/ 8 <0x00>; | ||
24 | pwm-period = <10000>; | ||
25 | |||
26 | /* 4V OV, 4 output LED0 string enabled */ | ||
27 | rom_14h { | ||
28 | rom-addr = /bits/ 8 <0x14>; | ||
29 | rom-val = /bits/ 8 <0xcf>; | ||
30 | }; | ||
31 | |||
32 | /* Heavy smoothing, 24ms ramp time step */ | ||
33 | rom_15h { | ||
34 | rom-addr = /bits/ 8 <0x15>; | ||
35 | rom-val = /bits/ 8 <0xc7>; | ||
36 | }; | ||
37 | |||
38 | /* 4 output LED1 string enabled */ | ||
39 | rom_19h { | ||
40 | rom-addr = /bits/ 8 <0x19>; | ||
41 | rom-val = /bits/ 8 <0x0f>; | ||
42 | }; | ||
43 | }; | ||
44 | |||
18 | /* LP8556 */ | 45 | /* LP8556 */ |
19 | backlight@2c { | 46 | backlight@2c { |
20 | compatible = "ti,lp8556"; | 47 | compatible = "ti,lp8556"; |
diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig index d4a7a351d67c..a65dd063ecad 100644 --- a/drivers/video/backlight/Kconfig +++ b/drivers/video/backlight/Kconfig | |||
@@ -388,8 +388,8 @@ config BACKLIGHT_LP855X | |||
388 | tristate "Backlight driver for TI LP855X" | 388 | tristate "Backlight driver for TI LP855X" |
389 | depends on BACKLIGHT_CLASS_DEVICE && I2C | 389 | depends on BACKLIGHT_CLASS_DEVICE && I2C |
390 | help | 390 | help |
391 | This supports TI LP8550, LP8551, LP8552, LP8553, LP8556 and LP8557 | 391 | This supports TI LP8550, LP8551, LP8552, LP8553, LP8555, LP8556 and |
392 | backlight driver. | 392 | LP8557 backlight driver. |
393 | 393 | ||
394 | config BACKLIGHT_LP8788 | 394 | config BACKLIGHT_LP8788 |
395 | tristate "Backlight driver for TI LP8788 MFD" | 395 | tristate "Backlight driver for TI LP8788 MFD" |
diff --git a/drivers/video/backlight/lp855x_bl.c b/drivers/video/backlight/lp855x_bl.c index c0b41f13bd4a..c952175d4113 100644 --- a/drivers/video/backlight/lp855x_bl.c +++ b/drivers/video/backlight/lp855x_bl.c | |||
@@ -26,13 +26,15 @@ | |||
26 | #define LP8556_EPROM_START 0xA0 | 26 | #define LP8556_EPROM_START 0xA0 |
27 | #define LP8556_EPROM_END 0xAF | 27 | #define LP8556_EPROM_END 0xAF |
28 | 28 | ||
29 | /* LP8557 Registers */ | 29 | /* LP8555/7 Registers */ |
30 | #define LP8557_BL_CMD 0x00 | 30 | #define LP8557_BL_CMD 0x00 |
31 | #define LP8557_BL_MASK 0x01 | 31 | #define LP8557_BL_MASK 0x01 |
32 | #define LP8557_BL_ON 0x01 | 32 | #define LP8557_BL_ON 0x01 |
33 | #define LP8557_BL_OFF 0x00 | 33 | #define LP8557_BL_OFF 0x00 |
34 | #define LP8557_BRIGHTNESS_CTRL 0x04 | 34 | #define LP8557_BRIGHTNESS_CTRL 0x04 |
35 | #define LP8557_CONFIG 0x10 | 35 | #define LP8557_CONFIG 0x10 |
36 | #define LP8555_EPROM_START 0x10 | ||
37 | #define LP8555_EPROM_END 0x7A | ||
36 | #define LP8557_EPROM_START 0x10 | 38 | #define LP8557_EPROM_START 0x10 |
37 | #define LP8557_EPROM_END 0x1E | 39 | #define LP8557_EPROM_END 0x1E |
38 | 40 | ||
@@ -111,6 +113,10 @@ static bool lp855x_is_valid_rom_area(struct lp855x *lp, u8 addr) | |||
111 | start = LP8556_EPROM_START; | 113 | start = LP8556_EPROM_START; |
112 | end = LP8556_EPROM_END; | 114 | end = LP8556_EPROM_END; |
113 | break; | 115 | break; |
116 | case LP8555: | ||
117 | start = LP8555_EPROM_START; | ||
118 | end = LP8555_EPROM_END; | ||
119 | break; | ||
114 | case LP8557: | 120 | case LP8557: |
115 | start = LP8557_EPROM_START; | 121 | start = LP8557_EPROM_START; |
116 | end = LP8557_EPROM_END; | 122 | end = LP8557_EPROM_END; |
@@ -165,9 +171,14 @@ static int lp855x_configure(struct lp855x *lp) | |||
165 | struct lp855x_platform_data *pd = lp->pdata; | 171 | struct lp855x_platform_data *pd = lp->pdata; |
166 | 172 | ||
167 | switch (lp->chip_id) { | 173 | switch (lp->chip_id) { |
168 | case LP8550 ... LP8556: | 174 | case LP8550: |
175 | case LP8551: | ||
176 | case LP8552: | ||
177 | case LP8553: | ||
178 | case LP8556: | ||
169 | lp->cfg = &lp855x_dev_cfg; | 179 | lp->cfg = &lp855x_dev_cfg; |
170 | break; | 180 | break; |
181 | case LP8555: | ||
171 | case LP8557: | 182 | case LP8557: |
172 | lp->cfg = &lp8557_dev_cfg; | 183 | lp->cfg = &lp8557_dev_cfg; |
173 | break; | 184 | break; |
@@ -470,6 +481,7 @@ static const struct of_device_id lp855x_dt_ids[] = { | |||
470 | { .compatible = "ti,lp8551", }, | 481 | { .compatible = "ti,lp8551", }, |
471 | { .compatible = "ti,lp8552", }, | 482 | { .compatible = "ti,lp8552", }, |
472 | { .compatible = "ti,lp8553", }, | 483 | { .compatible = "ti,lp8553", }, |
484 | { .compatible = "ti,lp8555", }, | ||
473 | { .compatible = "ti,lp8556", }, | 485 | { .compatible = "ti,lp8556", }, |
474 | { .compatible = "ti,lp8557", }, | 486 | { .compatible = "ti,lp8557", }, |
475 | { } | 487 | { } |
@@ -481,6 +493,7 @@ static const struct i2c_device_id lp855x_ids[] = { | |||
481 | {"lp8551", LP8551}, | 493 | {"lp8551", LP8551}, |
482 | {"lp8552", LP8552}, | 494 | {"lp8552", LP8552}, |
483 | {"lp8553", LP8553}, | 495 | {"lp8553", LP8553}, |
496 | {"lp8555", LP8555}, | ||
484 | {"lp8556", LP8556}, | 497 | {"lp8556", LP8556}, |
485 | {"lp8557", LP8557}, | 498 | {"lp8557", LP8557}, |
486 | { } | 499 | { } |
diff --git a/include/linux/platform_data/lp855x.h b/include/linux/platform_data/lp855x.h index ea3200527dd3..1b2ba24e4e03 100644 --- a/include/linux/platform_data/lp855x.h +++ b/include/linux/platform_data/lp855x.h | |||
@@ -40,6 +40,17 @@ | |||
40 | #define LP8553_PWM_CONFIG LP8550_PWM_CONFIG | 40 | #define LP8553_PWM_CONFIG LP8550_PWM_CONFIG |
41 | #define LP8553_I2C_CONFIG LP8550_I2C_CONFIG | 41 | #define LP8553_I2C_CONFIG LP8550_I2C_CONFIG |
42 | 42 | ||
43 | /* CONFIG register - LP8555 */ | ||
44 | #define LP8555_PWM_STANDBY BIT(7) | ||
45 | #define LP8555_PWM_FILTER BIT(6) | ||
46 | #define LP8555_RELOAD_EPROM BIT(3) /* use it if EPROMs should be reset | ||
47 | when the backlight turns on */ | ||
48 | #define LP8555_OFF_OPENLEDS BIT(2) | ||
49 | #define LP8555_PWM_CONFIG LP8555_PWM_ONLY | ||
50 | #define LP8555_I2C_CONFIG LP8555_I2C_ONLY | ||
51 | #define LP8555_COMB1_CONFIG LP8555_COMBINED1 | ||
52 | #define LP8555_COMB2_CONFIG LP8555_COMBINED2 | ||
53 | |||
43 | /* DEVICE CONTROL register - LP8556 */ | 54 | /* DEVICE CONTROL register - LP8556 */ |
44 | #define LP8556_PWM_CONFIG (LP8556_PWM_ONLY << BRT_MODE_SHFT) | 55 | #define LP8556_PWM_CONFIG (LP8556_PWM_ONLY << BRT_MODE_SHFT) |
45 | #define LP8556_COMB1_CONFIG (LP8556_COMBINED1 << BRT_MODE_SHFT) | 56 | #define LP8556_COMB1_CONFIG (LP8556_COMBINED1 << BRT_MODE_SHFT) |
@@ -65,6 +76,7 @@ enum lp855x_chip_id { | |||
65 | LP8551, | 76 | LP8551, |
66 | LP8552, | 77 | LP8552, |
67 | LP8553, | 78 | LP8553, |
79 | LP8555, | ||
68 | LP8556, | 80 | LP8556, |
69 | LP8557, | 81 | LP8557, |
70 | }; | 82 | }; |
@@ -89,6 +101,13 @@ enum lp8553_brighntess_source { | |||
89 | LP8553_I2C_ONLY = LP8550_I2C_ONLY, | 101 | LP8553_I2C_ONLY = LP8550_I2C_ONLY, |
90 | }; | 102 | }; |
91 | 103 | ||
104 | enum lp8555_brightness_source { | ||
105 | LP8555_PWM_ONLY, | ||
106 | LP8555_I2C_ONLY, | ||
107 | LP8555_COMBINED1, /* Brightness register with shaped PWM */ | ||
108 | LP8555_COMBINED2, /* PWM with shaped brightness register */ | ||
109 | }; | ||
110 | |||
92 | enum lp8556_brightness_source { | 111 | enum lp8556_brightness_source { |
93 | LP8556_PWM_ONLY, | 112 | LP8556_PWM_ONLY, |
94 | LP8556_COMBINED1, /* pwm + i2c before the shaper block */ | 113 | LP8556_COMBINED1, /* pwm + i2c before the shaper block */ |