lp8788-isink.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * TI LP8788 MFD - common definitions for current sinks
  4. *
  5. * Copyright 2012 Texas Instruments
  6. *
  7. * Author: Milo(Woogyom) Kim <[email protected]>
  8. */
  9. #ifndef __ISINK_LP8788_H__
  10. #define __ISINK_LP8788_H__
  11. /* register address */
  12. #define LP8788_ISINK_CTRL 0x99
  13. #define LP8788_ISINK12_IOUT 0x9A
  14. #define LP8788_ISINK3_IOUT 0x9B
  15. #define LP8788_ISINK1_PWM 0x9C
  16. #define LP8788_ISINK2_PWM 0x9D
  17. #define LP8788_ISINK3_PWM 0x9E
  18. /* mask bits */
  19. #define LP8788_ISINK1_IOUT_M 0x0F /* Addr 9Ah */
  20. #define LP8788_ISINK2_IOUT_M 0xF0
  21. #define LP8788_ISINK3_IOUT_M 0x0F /* Addr 9Bh */
  22. /* 6 bits used for PWM code : Addr 9C ~ 9Eh */
  23. #define LP8788_ISINK_MAX_PWM 63
  24. #define LP8788_ISINK_SCALE_OFFSET 3
  25. static const u8 lp8788_iout_addr[] = {
  26. LP8788_ISINK12_IOUT,
  27. LP8788_ISINK12_IOUT,
  28. LP8788_ISINK3_IOUT,
  29. };
  30. static const u8 lp8788_iout_mask[] = {
  31. LP8788_ISINK1_IOUT_M,
  32. LP8788_ISINK2_IOUT_M,
  33. LP8788_ISINK3_IOUT_M,
  34. };
  35. static const u8 lp8788_pwm_addr[] = {
  36. LP8788_ISINK1_PWM,
  37. LP8788_ISINK2_PWM,
  38. LP8788_ISINK3_PWM,
  39. };
  40. #endif