diff options
author | Graeme Gregory <gg@slimlogic.co.uk> | 2011-05-02 17:20:04 -0400 |
---|---|---|
committer | Liam Girdwood <lrg@slimlogic.co.uk> | 2011-05-27 05:48:43 -0400 |
commit | e3471bdc2784ee20a0d636c5904200c2d1148ef9 (patch) | |
tree | b8031223f737830b05d59189fae09452cabfd8aa /drivers/mfd/tps65910.c | |
parent | 2537df722d338ab687d7ed91dc589265c0d14aec (diff) |
TPS65910: IRQ: Add interrupt controller
This module controls the interrupt handling for the tps chip. The
interrupt sources are the following:
- GPIO falling/rising edge detection
- Battery voltage below/above threshold
- PWRON signal
- PWRHOLD signal
- Temperature detection
- RTC alarm and periodic event
Signed-off-by: Graeme Gregory <gg@slimlogic.co.uk>
Signed-off-by: Jorge Eduardo Candelaria <jedu@slimlogic.co.uk>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'drivers/mfd/tps65910.c')
-rw-r--r-- | drivers/mfd/tps65910.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c index 5a6a7be1f8cf..bf649cf6a0ae 100644 --- a/drivers/mfd/tps65910.c +++ b/drivers/mfd/tps65910.c | |||
@@ -136,12 +136,20 @@ static int tps65910_i2c_probe(struct i2c_client *i2c, | |||
136 | { | 136 | { |
137 | struct tps65910 *tps65910; | 137 | struct tps65910 *tps65910; |
138 | struct tps65910_board *pmic_plat_data; | 138 | struct tps65910_board *pmic_plat_data; |
139 | struct tps65910_platform_data *init_data; | ||
139 | int ret = 0; | 140 | int ret = 0; |
140 | 141 | ||
141 | pmic_plat_data = dev_get_platdata(&i2c->dev); | 142 | pmic_plat_data = dev_get_platdata(&i2c->dev); |
142 | if (!pmic_plat_data) | 143 | if (!pmic_plat_data) |
143 | return -EINVAL; | 144 | return -EINVAL; |
144 | 145 | ||
146 | init_data = kzalloc(sizeof(struct tps65910_platform_data), GFP_KERNEL); | ||
147 | if (init_data == NULL) | ||
148 | return -ENOMEM; | ||
149 | |||
150 | init_data->irq = pmic_plat_data->irq; | ||
151 | init_data->irq_base = pmic_plat_data->irq; | ||
152 | |||
145 | tps65910 = kzalloc(sizeof(struct tps65910), GFP_KERNEL); | 153 | tps65910 = kzalloc(sizeof(struct tps65910), GFP_KERNEL); |
146 | if (tps65910 == NULL) | 154 | if (tps65910 == NULL) |
147 | return -ENOMEM; | 155 | return -ENOMEM; |
@@ -161,6 +169,10 @@ static int tps65910_i2c_probe(struct i2c_client *i2c, | |||
161 | 169 | ||
162 | tps65910_gpio_init(tps65910, pmic_plat_data->gpio_base); | 170 | tps65910_gpio_init(tps65910, pmic_plat_data->gpio_base); |
163 | 171 | ||
172 | ret = tps65910_irq_init(tps65910, init_data->irq, init_data); | ||
173 | if (ret < 0) | ||
174 | goto err; | ||
175 | |||
164 | return ret; | 176 | return ret; |
165 | 177 | ||
166 | err: | 178 | err: |