lp8788-isink.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * TI LP8788 MFD - common definitions for current sinks
  3. *
  4. * Copyright 2012 Texas Instruments
  5. *
  6. * Author: Milo(Woogyom) Kim <milo.kim@ti.com>
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. *
  12. */
  13. #ifndef __ISINK_LP8788_H__
  14. #define __ISINK_LP8788_H__
  15. /* register address */
  16. #define LP8788_ISINK_CTRL 0x99
  17. #define LP8788_ISINK12_IOUT 0x9A
  18. #define LP8788_ISINK3_IOUT 0x9B
  19. #define LP8788_ISINK1_PWM 0x9C
  20. #define LP8788_ISINK2_PWM 0x9D
  21. #define LP8788_ISINK3_PWM 0x9E
  22. /* mask bits */
  23. #define LP8788_ISINK1_IOUT_M 0x0F /* Addr 9Ah */
  24. #define LP8788_ISINK2_IOUT_M 0xF0
  25. #define LP8788_ISINK3_IOUT_M 0x0F /* Addr 9Bh */
  26. /* 6 bits used for PWM code : Addr 9C ~ 9Eh */
  27. #define LP8788_ISINK_MAX_PWM 63
  28. #define LP8788_ISINK_SCALE_OFFSET 3
  29. static const u8 lp8788_iout_addr[] = {
  30. LP8788_ISINK12_IOUT,
  31. LP8788_ISINK12_IOUT,
  32. LP8788_ISINK3_IOUT,
  33. };
  34. static const u8 lp8788_iout_mask[] = {
  35. LP8788_ISINK1_IOUT_M,
  36. LP8788_ISINK2_IOUT_M,
  37. LP8788_ISINK3_IOUT_M,
  38. };
  39. static const u8 lp8788_pwm_addr[] = {
  40. LP8788_ISINK1_PWM,
  41. LP8788_ISINK2_PWM,
  42. LP8788_ISINK3_PWM,
  43. };
  44. #endif