pf0100.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright (C) 2014-2016, Toradex AG
  4. */
  5. /*
  6. * Helpers for Freescale PMIC PF0100
  7. */
  8. #ifndef PF0100_H_
  9. #define PF0100_H_
  10. /* 7-bit I2C bus slave address */
  11. #define PFUZE100_I2C_ADDR (0x08)
  12. /* Register Addresses */
  13. #define PFUZE100_DEVICEID (0x0)
  14. #define PFUZE100_REVID (0x3)
  15. #define PFUZE100_SW1AMODE (0x23)
  16. #define PFUZE100_SW1ACON 36
  17. #define PFUZE100_SW1ACON_SPEED_VAL (0x1<<6) /*default */
  18. #define PFUZE100_SW1ACON_SPEED_M (0x3<<6)
  19. #define PFUZE100_SW1CCON 49
  20. #define PFUZE100_SW1CCON_SPEED_VAL (0x1<<6) /*default */
  21. #define PFUZE100_SW1CCON_SPEED_M (0x3<<6)
  22. #define PFUZE100_SW1AVOL 32
  23. #define PFUZE100_SW1AVOL_VSEL_M (0x3f<<0)
  24. #define PFUZE100_SW1CVOL 46
  25. #define PFUZE100_SW1CVOL_VSEL_M (0x3f<<0)
  26. #define PFUZE100_VGEN1CTL (0x6c)
  27. #define PFUZE100_VGEN1_VAL (0x30 + 0x08) /* Always ON, 1.2V */
  28. #define PFUZE100_SWBSTCTL (0x66)
  29. /* Always ON, Auto Switching Mode, 5.0V */
  30. #define PFUZE100_SWBST_VAL (0x40 + 0x08 + 0x00)
  31. /* chooses the extended page (registers 0x80..0xff) */
  32. #define PFUZE100_PAGE_REGISTER 0x7f
  33. #define PFUZE100_PAGE_REGISTER_PAGE_M (0x1f << 0)
  34. #define PFUZE100_PAGE_REGISTER_PAGE1 (0x01 & PFUZE100_PAGE_REGISTER_PAGE_M)
  35. #define PFUZE100_PAGE_REGISTER_PAGE2 (0x02 & PFUZE100_PAGE_REGISTER_PAGE_M)
  36. /* extended page 1 */
  37. #define PFUZE100_FUSE_POR1 0xe4
  38. #define PFUZE100_FUSE_POR2 0xe5
  39. #define PFUZE100_FUSE_POR3 0xe6
  40. #define PFUZE100_FUSE_POR_M (0x1 << 1)
  41. /* output some informational messages, return the number FUSE_POR=1 */
  42. /* i.e. 0: unprogrammed, 3: programmed, other: undefined prog. state */
  43. unsigned pmic_init(void);
  44. #endif /* PF0100_H_ */