diff options
Diffstat (limited to 'include/linux/mfd/tps65910.h')
-rw-r--r-- | include/linux/mfd/tps65910.h | 52 |
1 files changed, 49 insertions, 3 deletions
diff --git a/include/linux/mfd/tps65910.h b/include/linux/mfd/tps65910.h index 8bb85b930c0..f6021cc9d91 100644 --- a/include/linux/mfd/tps65910.h +++ b/include/linux/mfd/tps65910.h | |||
@@ -243,7 +243,8 @@ | |||
243 | 243 | ||
244 | 244 | ||
245 | /*Registers VDD1, VDD2 voltage values definitions */ | 245 | /*Registers VDD1, VDD2 voltage values definitions */ |
246 | #define VDD1_2_NUM_VOLTS 73 | 246 | #define VDD1_2_NUM_VOLT_FINE 73 |
247 | #define VDD1_2_NUM_VOLT_COARSE 3 | ||
247 | #define VDD1_2_MIN_VOLT 6000 | 248 | #define VDD1_2_MIN_VOLT 6000 |
248 | #define VDD1_2_OFFSET 125 | 249 | #define VDD1_2_OFFSET 125 |
249 | 250 | ||
@@ -269,7 +270,7 @@ | |||
269 | #define LDO1_SEL_MASK 0xFC | 270 | #define LDO1_SEL_MASK 0xFC |
270 | #define LDO3_SEL_MASK 0x7C | 271 | #define LDO3_SEL_MASK 0x7C |
271 | #define LDO_MIN_VOLT 1000 | 272 | #define LDO_MIN_VOLT 1000 |
272 | #define LDO_MAX_VOLT 3300; | 273 | #define LDO_MAX_VOLT 3300 |
273 | 274 | ||
274 | 275 | ||
275 | /*Register VDIG1 (0x80) register.RegisterDescription */ | 276 | /*Register VDIG1 (0x80) register.RegisterDescription */ |
@@ -656,6 +657,8 @@ | |||
656 | 657 | ||
657 | 658 | ||
658 | /*Register GPIO (0x80) register.RegisterDescription */ | 659 | /*Register GPIO (0x80) register.RegisterDescription */ |
660 | #define GPIO_SLEEP_MASK 0x80 | ||
661 | #define GPIO_SLEEP_SHIFT 7 | ||
659 | #define GPIO_DEB_MASK 0x10 | 662 | #define GPIO_DEB_MASK 0x10 |
660 | #define GPIO_DEB_SHIFT 4 | 663 | #define GPIO_DEB_SHIFT 4 |
661 | #define GPIO_PUEN_MASK 0x08 | 664 | #define GPIO_PUEN_MASK 0x08 |
@@ -739,6 +742,45 @@ | |||
739 | #define TPS65910_GPIO_STS BIT(1) | 742 | #define TPS65910_GPIO_STS BIT(1) |
740 | #define TPS65910_GPIO_SET BIT(0) | 743 | #define TPS65910_GPIO_SET BIT(0) |
741 | 744 | ||
745 | /* Max number of TPS65910/11 GPIOs */ | ||
746 | #define TPS65910_NUM_GPIO 6 | ||
747 | #define TPS65911_NUM_GPIO 9 | ||
748 | #define TPS6591X_MAX_NUM_GPIO 9 | ||
749 | |||
750 | /* Regulator Index Definitions */ | ||
751 | #define TPS65910_REG_VRTC 0 | ||
752 | #define TPS65910_REG_VIO 1 | ||
753 | #define TPS65910_REG_VDD1 2 | ||
754 | #define TPS65910_REG_VDD2 3 | ||
755 | #define TPS65910_REG_VDD3 4 | ||
756 | #define TPS65910_REG_VDIG1 5 | ||
757 | #define TPS65910_REG_VDIG2 6 | ||
758 | #define TPS65910_REG_VPLL 7 | ||
759 | #define TPS65910_REG_VDAC 8 | ||
760 | #define TPS65910_REG_VAUX1 9 | ||
761 | #define TPS65910_REG_VAUX2 10 | ||
762 | #define TPS65910_REG_VAUX33 11 | ||
763 | #define TPS65910_REG_VMMC 12 | ||
764 | |||
765 | #define TPS65911_REG_VDDCTRL 4 | ||
766 | #define TPS65911_REG_LDO1 5 | ||
767 | #define TPS65911_REG_LDO2 6 | ||
768 | #define TPS65911_REG_LDO3 7 | ||
769 | #define TPS65911_REG_LDO4 8 | ||
770 | #define TPS65911_REG_LDO5 9 | ||
771 | #define TPS65911_REG_LDO6 10 | ||
772 | #define TPS65911_REG_LDO7 11 | ||
773 | #define TPS65911_REG_LDO8 12 | ||
774 | |||
775 | /* Max number of TPS65910/11 regulators */ | ||
776 | #define TPS65910_NUM_REGS 13 | ||
777 | |||
778 | /* External sleep controls through EN1/EN2/EN3/SLEEP inputs */ | ||
779 | #define TPS65910_SLEEP_CONTROL_EXT_INPUT_EN1 0x1 | ||
780 | #define TPS65910_SLEEP_CONTROL_EXT_INPUT_EN2 0x2 | ||
781 | #define TPS65910_SLEEP_CONTROL_EXT_INPUT_EN3 0x4 | ||
782 | #define TPS65911_SLEEP_CONTROL_EXT_INPUT_SLEEP 0x8 | ||
783 | |||
742 | /** | 784 | /** |
743 | * struct tps65910_board | 785 | * struct tps65910_board |
744 | * Board platform data may be used to initialize regulators. | 786 | * Board platform data may be used to initialize regulators. |
@@ -750,7 +792,9 @@ struct tps65910_board { | |||
750 | int irq_base; | 792 | int irq_base; |
751 | int vmbch_threshold; | 793 | int vmbch_threshold; |
752 | int vmbch2_threshold; | 794 | int vmbch2_threshold; |
753 | struct regulator_init_data *tps65910_pmic_init_data; | 795 | unsigned long regulator_ext_sleep_control[TPS65910_NUM_REGS]; |
796 | bool en_gpio_sleep[TPS6591X_MAX_NUM_GPIO]; | ||
797 | struct regulator_init_data *tps65910_pmic_init_data[TPS65910_NUM_REGS]; | ||
754 | }; | 798 | }; |
755 | 799 | ||
756 | /** | 800 | /** |
@@ -760,6 +804,7 @@ struct tps65910_board { | |||
760 | struct tps65910 { | 804 | struct tps65910 { |
761 | struct device *dev; | 805 | struct device *dev; |
762 | struct i2c_client *i2c_client; | 806 | struct i2c_client *i2c_client; |
807 | struct regmap *regmap; | ||
763 | struct mutex io_mutex; | 808 | struct mutex io_mutex; |
764 | unsigned int id; | 809 | unsigned int id; |
765 | int (*read)(struct tps65910 *tps65910, u8 reg, int size, void *dest); | 810 | int (*read)(struct tps65910 *tps65910, u8 reg, int size, void *dest); |
@@ -791,6 +836,7 @@ int tps65910_clear_bits(struct tps65910 *tps65910, u8 reg, u8 mask); | |||
791 | void tps65910_gpio_init(struct tps65910 *tps65910, int gpio_base); | 836 | void tps65910_gpio_init(struct tps65910 *tps65910, int gpio_base); |
792 | int tps65910_irq_init(struct tps65910 *tps65910, int irq, | 837 | int tps65910_irq_init(struct tps65910 *tps65910, int irq, |
793 | struct tps65910_platform_data *pdata); | 838 | struct tps65910_platform_data *pdata); |
839 | int tps65910_irq_exit(struct tps65910 *tps65910); | ||
794 | 840 | ||
795 | static inline int tps65910_chip_id(struct tps65910 *tps65910) | 841 | static inline int tps65910_chip_id(struct tps65910 *tps65910) |
796 | { | 842 | { |