lp855x-driver.txt 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. Kernel driver lp855x
  2. ====================
  3. Backlight driver for LP855x ICs
  4. Supported chips:
  5. Texas Instruments LP8550, LP8551, LP8552, LP8553 and LP8556
  6. Author: Milo(Woogyom) Kim <milo.kim@ti.com>
  7. Description
  8. -----------
  9. * Brightness control
  10. Brightness can be controlled by the pwm input or the i2c command.
  11. The lp855x driver supports both cases.
  12. * Device attributes
  13. 1) bl_ctl_mode
  14. Backlight control mode.
  15. Value : pwm based or register based
  16. 2) chip_id
  17. The lp855x chip id.
  18. Value : lp8550/lp8551/lp8552/lp8553/lp8556
  19. Platform data for lp855x
  20. ------------------------
  21. For supporting platform specific data, the lp855x platform data can be used.
  22. * name : Backlight driver name. If it is not defined, default name is set.
  23. * mode : Brightness control mode. PWM or register based.
  24. * device_control : Value of DEVICE CONTROL register.
  25. * initial_brightness : Initial value of backlight brightness.
  26. * pwm_data : Platform specific pwm generation functions.
  27. Only valid when brightness is pwm input mode.
  28. Functions should be implemented by PWM driver.
  29. - pwm_set_intensity() : set duty of PWM
  30. - pwm_get_intensity() : get current duty of PWM
  31. * load_new_rom_data :
  32. 0 : use default configuration data
  33. 1 : update values of eeprom or eprom registers on loading driver
  34. * size_program : Total size of lp855x_rom_data.
  35. * rom_data : List of new eeprom/eprom registers.
  36. example 1) lp8552 platform data : i2c register mode with new eeprom data
  37. #define EEPROM_A5_ADDR 0xA5
  38. #define EEPROM_A5_VAL 0x4f /* EN_VSYNC=0 */
  39. static struct lp855x_rom_data lp8552_eeprom_arr[] = {
  40. {EEPROM_A5_ADDR, EEPROM_A5_VAL},
  41. };
  42. static struct lp855x_platform_data lp8552_pdata = {
  43. .name = "lcd-bl",
  44. .mode = REGISTER_BASED,
  45. .device_control = I2C_CONFIG(LP8552),
  46. .initial_brightness = INITIAL_BRT,
  47. .load_new_rom_data = 1,
  48. .size_program = ARRAY_SIZE(lp8552_eeprom_arr),
  49. .rom_data = lp8552_eeprom_arr,
  50. };
  51. example 2) lp8556 platform data : pwm input mode with default rom data
  52. static struct lp855x_platform_data lp8556_pdata = {
  53. .mode = PWM_BASED,
  54. .device_control = PWM_CONFIG(LP8556),
  55. .initial_brightness = INITIAL_BRT,
  56. .pwm_data = {
  57. .pwm_set_intensity = platform_pwm_set_intensity,
  58. .pwm_get_intensity = platform_pwm_get_intensity,
  59. },
  60. };