diff options
Diffstat (limited to 'include/linux/mfd/tps65910.h')
-rw-r--r-- | include/linux/mfd/tps65910.h | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/include/linux/mfd/tps65910.h b/include/linux/mfd/tps65910.h index 56903ad04283..949f1da661d2 100644 --- a/include/linux/mfd/tps65910.h +++ b/include/linux/mfd/tps65910.h | |||
@@ -18,6 +18,7 @@ | |||
18 | #define __LINUX_MFD_TPS65910_H | 18 | #define __LINUX_MFD_TPS65910_H |
19 | 19 | ||
20 | #include <linux/gpio.h> | 20 | #include <linux/gpio.h> |
21 | #include <linux/regmap.h> | ||
21 | 22 | ||
22 | /* TPS chip id list */ | 23 | /* TPS chip id list */ |
23 | #define TPS65910 0 | 24 | #define TPS65910 0 |
@@ -823,8 +824,6 @@ struct tps65910 { | |||
823 | struct regmap *regmap; | 824 | struct regmap *regmap; |
824 | struct mutex io_mutex; | 825 | struct mutex io_mutex; |
825 | unsigned int id; | 826 | unsigned int id; |
826 | int (*read)(struct tps65910 *tps65910, u8 reg, int size, void *dest); | ||
827 | int (*write)(struct tps65910 *tps65910, u8 reg, int size, void *src); | ||
828 | 827 | ||
829 | /* Client devices */ | 828 | /* Client devices */ |
830 | struct tps65910_pmic *pmic; | 829 | struct tps65910_pmic *pmic; |
@@ -847,8 +846,6 @@ struct tps65910_platform_data { | |||
847 | int irq_base; | 846 | int irq_base; |
848 | }; | 847 | }; |
849 | 848 | ||
850 | int tps65910_set_bits(struct tps65910 *tps65910, u8 reg, u8 mask); | ||
851 | int tps65910_clear_bits(struct tps65910 *tps65910, u8 reg, u8 mask); | ||
852 | void tps65910_gpio_init(struct tps65910 *tps65910, int gpio_base); | 849 | void tps65910_gpio_init(struct tps65910 *tps65910, int gpio_base); |
853 | int tps65910_irq_init(struct tps65910 *tps65910, int irq, | 850 | int tps65910_irq_init(struct tps65910 *tps65910, int irq, |
854 | struct tps65910_platform_data *pdata); | 851 | struct tps65910_platform_data *pdata); |
@@ -859,4 +856,28 @@ static inline int tps65910_chip_id(struct tps65910 *tps65910) | |||
859 | return tps65910->id; | 856 | return tps65910->id; |
860 | } | 857 | } |
861 | 858 | ||
859 | static inline int tps65910_reg_read(struct tps65910 *tps65910, u8 reg, | ||
860 | unsigned int *val) | ||
861 | { | ||
862 | return regmap_read(tps65910->regmap, reg, val); | ||
863 | } | ||
864 | |||
865 | static inline int tps65910_reg_write(struct tps65910 *tps65910, u8 reg, | ||
866 | unsigned int val) | ||
867 | { | ||
868 | return regmap_write(tps65910->regmap, reg, val); | ||
869 | } | ||
870 | |||
871 | static inline int tps65910_reg_set_bits(struct tps65910 *tps65910, u8 reg, | ||
872 | u8 mask) | ||
873 | { | ||
874 | return regmap_update_bits(tps65910->regmap, reg, mask, mask); | ||
875 | } | ||
876 | |||
877 | static inline int tps65910_reg_clear_bits(struct tps65910 *tps65910, u8 reg, | ||
878 | u8 mask) | ||
879 | { | ||
880 | return regmap_update_bits(tps65910->regmap, reg, mask, 0); | ||
881 | } | ||
882 | |||
862 | #endif /* __LINUX_MFD_TPS65910_H */ | 883 | #endif /* __LINUX_MFD_TPS65910_H */ |