stw481x.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (C) 2011 ST-Ericsson SA
  4. * Written on behalf of Linaro for ST-Ericsson
  5. *
  6. * Author: Linus Walleij <linus.walleij@linaro.org>
  7. */
  8. #ifndef MFD_STW481X_H
  9. #define MFD_STW481X_H
  10. #include <linux/i2c.h>
  11. #include <linux/regulator/machine.h>
  12. #include <linux/regmap.h>
  13. #include <linux/bitops.h>
  14. /* These registers are accessed from more than one driver */
  15. #define STW_CONF1 0x11U
  16. #define STW_CONF1_PDN_VMMC 0x01U
  17. #define STW_CONF1_VMMC_MASK 0x0eU
  18. #define STW_CONF1_VMMC_1_8V 0x02U
  19. #define STW_CONF1_VMMC_2_85V 0x04U
  20. #define STW_CONF1_VMMC_3V 0x06U
  21. #define STW_CONF1_VMMC_1_85V 0x08U
  22. #define STW_CONF1_VMMC_2_6V 0x0aU
  23. #define STW_CONF1_VMMC_2_7V 0x0cU
  24. #define STW_CONF1_VMMC_3_3V 0x0eU
  25. #define STW_CONF1_MMC_LS_STATUS 0x10U
  26. #define STW_PCTL_REG_LO 0x1eU
  27. #define STW_PCTL_REG_HI 0x1fU
  28. #define STW_CONF1_V_MONITORING 0x20U
  29. #define STW_CONF1_IT_WARN 0x40U
  30. #define STW_CONF1_PDN_VAUX 0x80U
  31. #define STW_CONF2 0x20U
  32. #define STW_CONF2_MASK_TWARN 0x01U
  33. #define STW_CONF2_VMMC_EXT 0x02U
  34. #define STW_CONF2_MASK_IT_WAKE_UP 0x04U
  35. #define STW_CONF2_GPO1 0x08U
  36. #define STW_CONF2_GPO2 0x10U
  37. #define STW_VCORE_SLEEP 0x21U
  38. /**
  39. * struct stw481x - state holder for the Stw481x drivers
  40. * @i2c_client: corresponding I2C client
  41. * @map: regmap handle to access device registers
  42. */
  43. struct stw481x {
  44. struct i2c_client *client;
  45. struct regmap *map;
  46. };
  47. #endif