Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

backlight: lp855x_bl: support new LP8555 device

LP8555 is one of the LP855x family devices.

This device needs pre_init_device() and post_init_device() driver
structure. It's same as LP8557, so the device configuration code is
shared with LP8557. Backlight outputs are generated from dual DC-DC boost
converters. It's configurable EPROM settings which are defined in the
platform data.

Driver documentation and device tree bindings are updated.

Signed-off-by: Milo Kim <milo.kim@ti.com>
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Milo Kim and committed by
Linus Torvalds
5812c13a b300645a

+67 -7
+3 -2
Documentation/backlight/lp855x-driver.txt
··· 4 4 Backlight driver for LP855x ICs 5 5 6 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 10 Author: Milo(Woogyom) Kim <milo.kim@ti.com> 10 11 ··· 25 24 26 25 2) chip_id 27 26 The lp855x chip id. 28 - Value : lp8550/lp8551/lp8552/lp8553/lp8556/lp8557 27 + Value : lp8550/lp8551/lp8552/lp8553/lp8555/lp8556/lp8557 29 28 30 29 Platform data for lp855x 31 30 ------------------------
+28 -1
Documentation/devicetree/bindings/video/backlight/lp855x.txt
··· 2 2 3 3 Required properties: 4 4 - compatible: "ti,lp8550", "ti,lp8551", "ti,lp8552", "ti,lp8553", 5 - "ti,lp8556", "ti,lp8557" 5 + "ti,lp8555", "ti,lp8556", "ti,lp8557" 6 6 - reg: I2C slave address (u8) 7 7 - dev-ctrl: Value of DEVICE CONTROL register (u8). It depends on the device. 8 8 ··· 14 14 - rom-val: Register value to be updated (u8) 15 15 16 16 Example: 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 + }; 17 44 18 45 /* LP8556 */ 19 46 backlight@2c {
+2 -2
drivers/video/backlight/Kconfig
··· 388 388 tristate "Backlight driver for TI LP855X" 389 389 depends on BACKLIGHT_CLASS_DEVICE && I2C 390 390 help 391 - This supports TI LP8550, LP8551, LP8552, LP8553, LP8556 and LP8557 392 - backlight driver. 391 + This supports TI LP8550, LP8551, LP8552, LP8553, LP8555, LP8556 and 392 + LP8557 backlight driver. 393 393 394 394 config BACKLIGHT_LP8788 395 395 tristate "Backlight driver for TI LP8788 MFD"
+15 -2
drivers/video/backlight/lp855x_bl.c
··· 26 26 #define LP8556_EPROM_START 0xA0 27 27 #define LP8556_EPROM_END 0xAF 28 28 29 - /* LP8557 Registers */ 29 + /* LP8555/7 Registers */ 30 30 #define LP8557_BL_CMD 0x00 31 31 #define LP8557_BL_MASK 0x01 32 32 #define LP8557_BL_ON 0x01 33 33 #define LP8557_BL_OFF 0x00 34 34 #define LP8557_BRIGHTNESS_CTRL 0x04 35 35 #define LP8557_CONFIG 0x10 36 + #define LP8555_EPROM_START 0x10 37 + #define LP8555_EPROM_END 0x7A 36 38 #define LP8557_EPROM_START 0x10 37 39 #define LP8557_EPROM_END 0x1E 38 40 ··· 113 111 start = LP8556_EPROM_START; 114 112 end = LP8556_EPROM_END; 115 113 break; 114 + case LP8555: 115 + start = LP8555_EPROM_START; 116 + end = LP8555_EPROM_END; 117 + break; 116 118 case LP8557: 117 119 start = LP8557_EPROM_START; 118 120 end = LP8557_EPROM_END; ··· 171 165 struct lp855x_platform_data *pd = lp->pdata; 172 166 173 167 switch (lp->chip_id) { 174 - case LP8550 ... LP8556: 168 + case LP8550: 169 + case LP8551: 170 + case LP8552: 171 + case LP8553: 172 + case LP8556: 175 173 lp->cfg = &lp855x_dev_cfg; 176 174 break; 175 + case LP8555: 177 176 case LP8557: 178 177 lp->cfg = &lp8557_dev_cfg; 179 178 break; ··· 481 470 { .compatible = "ti,lp8551", }, 482 471 { .compatible = "ti,lp8552", }, 483 472 { .compatible = "ti,lp8553", }, 473 + { .compatible = "ti,lp8555", }, 484 474 { .compatible = "ti,lp8556", }, 485 475 { .compatible = "ti,lp8557", }, 486 476 { } ··· 493 481 {"lp8551", LP8551}, 494 482 {"lp8552", LP8552}, 495 483 {"lp8553", LP8553}, 484 + {"lp8555", LP8555}, 496 485 {"lp8556", LP8556}, 497 486 {"lp8557", LP8557}, 498 487 { }
+19
include/linux/platform_data/lp855x.h
··· 40 40 #define LP8553_PWM_CONFIG LP8550_PWM_CONFIG 41 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 54 /* DEVICE CONTROL register - LP8556 */ 44 55 #define LP8556_PWM_CONFIG (LP8556_PWM_ONLY << BRT_MODE_SHFT) 45 56 #define LP8556_COMB1_CONFIG (LP8556_COMBINED1 << BRT_MODE_SHFT) ··· 76 65 LP8551, 77 66 LP8552, 78 67 LP8553, 68 + LP8555, 79 69 LP8556, 80 70 LP8557, 81 71 }; ··· 99 87 enum lp8553_brighntess_source { 100 88 LP8553_PWM_ONLY = LP8550_PWM_ONLY, 101 89 LP8553_I2C_ONLY = LP8550_I2C_ONLY, 90 + }; 91 + 92 + enum lp8555_brightness_source { 93 + LP8555_PWM_ONLY, 94 + LP8555_I2C_ONLY, 95 + LP8555_COMBINED1, /* Brightness register with shaped PWM */ 96 + LP8555_COMBINED2, /* PWM with shaped brightness register */ 102 97 }; 103 98 104 99 enum lp8556_brightness_source {