stw481x.h 1.6 KB

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