^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) ====================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) Kernel driver lp855x
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) ====================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) Backlight driver for LP855x ICs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) Supported chips:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) Texas Instruments LP8550, LP8551, LP8552, LP8553, LP8555, LP8556 and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) LP8557
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) Author: Milo(Woogyom) Kim <milo.kim@ti.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) Description
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) -----------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) * Brightness control
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) Brightness can be controlled by the pwm input or the i2c command.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) The lp855x driver supports both cases.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) * Device attributes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) 1) bl_ctl_mode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) Backlight control mode.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) Value: pwm based or register based
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) 2) chip_id
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) The lp855x chip id.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) Value: lp8550/lp8551/lp8552/lp8553/lp8555/lp8556/lp8557
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) Platform data for lp855x
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) ------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) For supporting platform specific data, the lp855x platform data can be used.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) * name:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) Backlight driver name. If it is not defined, default name is set.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) * device_control:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) Value of DEVICE CONTROL register.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) * initial_brightness:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) Initial value of backlight brightness.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) * period_ns:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) Platform specific PWM period value. unit is nano.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) Only valid when brightness is pwm input mode.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) * size_program:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) Total size of lp855x_rom_data.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) * rom_data:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) List of new eeprom/eprom registers.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) Examples
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) ========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) 1) lp8552 platform data: i2c register mode with new eeprom data::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) #define EEPROM_A5_ADDR 0xA5
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) #define EEPROM_A5_VAL 0x4f /* EN_VSYNC=0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) static struct lp855x_rom_data lp8552_eeprom_arr[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) {EEPROM_A5_ADDR, EEPROM_A5_VAL},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) static struct lp855x_platform_data lp8552_pdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) .name = "lcd-bl",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) .device_control = I2C_CONFIG(LP8552),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) .initial_brightness = INITIAL_BRT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) .size_program = ARRAY_SIZE(lp8552_eeprom_arr),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) .rom_data = lp8552_eeprom_arr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) 2) lp8556 platform data: pwm input mode with default rom data::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) static struct lp855x_platform_data lp8556_pdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) .device_control = PWM_CONFIG(LP8556),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) .initial_brightness = INITIAL_BRT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) .period_ns = 1000000,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) };