aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorMarcin Niestroj <m.niestroj@grinn-global.com>2016-09-09 04:42:02 -0400
committerLee Jones <lee.jones@linaro.org>2016-10-04 10:48:03 -0400
commit6556bdacf646fcaa0586123ba85412de1c8f0eee (patch)
tree08127ad074d74b7b3e66a2abea909171abd06067 /include/linux
parent7e94e51525d3a289ed0c60b57dff36630a8413e4 (diff)
mfd: tps65217: Add support for IRQs
Add support for handling IRQs: power button, AC and USB power state changes. Mask and interrupt bits are shared within one register, which prevents us to use regmap_irq implementation. New irq_domain is created in order to add interrupt handling for each tps65217's subsystem. IRQ resources have been added for charger subsystem to be able to notify about AC and USB state changes. Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com> Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com> Tested-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mfd/tps65217.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/mfd/tps65217.h b/include/linux/mfd/tps65217.h
index 1c88231496d3..4ccda8969639 100644
--- a/include/linux/mfd/tps65217.h
+++ b/include/linux/mfd/tps65217.h
@@ -73,6 +73,7 @@
73#define TPS65217_PPATH_AC_CURRENT_MASK 0x0C 73#define TPS65217_PPATH_AC_CURRENT_MASK 0x0C
74#define TPS65217_PPATH_USB_CURRENT_MASK 0x03 74#define TPS65217_PPATH_USB_CURRENT_MASK 0x03
75 75
76#define TPS65217_INT_RESERVEDM BIT(7)
76#define TPS65217_INT_PBM BIT(6) 77#define TPS65217_INT_PBM BIT(6)
77#define TPS65217_INT_ACM BIT(5) 78#define TPS65217_INT_ACM BIT(5)
78#define TPS65217_INT_USBM BIT(4) 79#define TPS65217_INT_USBM BIT(4)
@@ -233,6 +234,13 @@ struct tps65217_bl_pdata {
233 int dft_brightness; 234 int dft_brightness;
234}; 235};
235 236
237enum tps65217_irq_type {
238 TPS65217_IRQ_PB,
239 TPS65217_IRQ_AC,
240 TPS65217_IRQ_USB,
241 TPS65217_NUM_IRQ
242};
243
236/** 244/**
237 * struct tps65217_board - packages regulator init data 245 * struct tps65217_board - packages regulator init data
238 * @tps65217_regulator_data: regulator initialization values 246 * @tps65217_regulator_data: regulator initialization values
@@ -258,6 +266,10 @@ struct tps65217 {
258 struct regulator_desc desc[TPS65217_NUM_REGULATOR]; 266 struct regulator_desc desc[TPS65217_NUM_REGULATOR];
259 struct regmap *regmap; 267 struct regmap *regmap;
260 u8 *strobes; 268 u8 *strobes;
269 struct irq_domain *irq_domain;
270 struct mutex irq_lock;
271 u8 irq_mask;
272 int irq;
261}; 273};
262 274
263static inline struct tps65217 *dev_to_tps65217(struct device *dev) 275static inline struct tps65217 *dev_to_tps65217(struct device *dev)