diff options
| author | Javier Martinez Canillas <javier.martinez@collabora.co.uk> | 2014-07-04 16:24:04 -0400 |
|---|---|---|
| committer | Lee Jones <lee.jones@linaro.org> | 2014-07-21 11:54:26 -0400 |
| commit | 6f1c1e71d933f58a6248f1681aededdd407f32a8 (patch) | |
| tree | 8625163e93481f9b28eb838883b37ebb1f29f85e /include/linux | |
| parent | 4eb9560b8ffa854caa7c625a955762d4b43b4841 (diff) | |
mfd: max77686: Convert to use regmap_irq
By using the generic IRQ support in the Register map API, it
is possible to get rid max77686-irq.c and simplify the code.
Suggested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Reviewed-by: Doug Anderson <dianders@chromium.org>
Tested-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/mfd/max77686-private.h | 31 | ||||
| -rw-r--r-- | include/linux/mfd/max77686.h | 2 |
2 files changed, 22 insertions, 11 deletions
diff --git a/include/linux/mfd/max77686-private.h b/include/linux/mfd/max77686-private.h index 8c75a9c8dfab..8e177806cba1 100644 --- a/include/linux/mfd/max77686-private.h +++ b/include/linux/mfd/max77686-private.h | |||
| @@ -181,9 +181,6 @@ enum max77686_rtc_reg { | |||
| 181 | MAX77686_ALARM2_DATE = 0x1B, | 181 | MAX77686_ALARM2_DATE = 0x1B, |
| 182 | }; | 182 | }; |
| 183 | 183 | ||
| 184 | #define MAX77686_IRQSRC_PMIC (0) | ||
| 185 | #define MAX77686_IRQSRC_RTC (1 << 0) | ||
| 186 | |||
| 187 | enum max77686_irq_source { | 184 | enum max77686_irq_source { |
| 188 | PMIC_INT1 = 0, | 185 | PMIC_INT1 = 0, |
| 189 | PMIC_INT2, | 186 | PMIC_INT2, |
| @@ -205,16 +202,33 @@ enum max77686_irq { | |||
| 205 | MAX77686_PMICIRQ_140C, | 202 | MAX77686_PMICIRQ_140C, |
| 206 | MAX77686_PMICIRQ_120C, | 203 | MAX77686_PMICIRQ_120C, |
| 207 | 204 | ||
| 208 | MAX77686_RTCIRQ_RTC60S, | 205 | MAX77686_RTCIRQ_RTC60S = 0, |
| 209 | MAX77686_RTCIRQ_RTCA1, | 206 | MAX77686_RTCIRQ_RTCA1, |
| 210 | MAX77686_RTCIRQ_RTCA2, | 207 | MAX77686_RTCIRQ_RTCA2, |
| 211 | MAX77686_RTCIRQ_SMPL, | 208 | MAX77686_RTCIRQ_SMPL, |
| 212 | MAX77686_RTCIRQ_RTC1S, | 209 | MAX77686_RTCIRQ_RTC1S, |
| 213 | MAX77686_RTCIRQ_WTSR, | 210 | MAX77686_RTCIRQ_WTSR, |
| 214 | |||
| 215 | MAX77686_IRQ_NR, | ||
| 216 | }; | 211 | }; |
| 217 | 212 | ||
| 213 | #define MAX77686_INT1_PWRONF_MSK BIT(0) | ||
| 214 | #define MAX77686_INT1_PWRONR_MSK BIT(1) | ||
| 215 | #define MAX77686_INT1_JIGONBF_MSK BIT(2) | ||
| 216 | #define MAX77686_INT1_JIGONBR_MSK BIT(3) | ||
| 217 | #define MAX77686_INT1_ACOKBF_MSK BIT(4) | ||
| 218 | #define MAX77686_INT1_ACOKBR_MSK BIT(5) | ||
| 219 | #define MAX77686_INT1_ONKEY1S_MSK BIT(6) | ||
| 220 | #define MAX77686_INT1_MRSTB_MSK BIT(7) | ||
| 221 | |||
| 222 | #define MAX77686_INT2_140C_MSK BIT(0) | ||
| 223 | #define MAX77686_INT2_120C_MSK BIT(1) | ||
| 224 | |||
| 225 | #define MAX77686_RTCINT_RTC60S_MSK BIT(0) | ||
| 226 | #define MAX77686_RTCINT_RTCA1_MSK BIT(1) | ||
| 227 | #define MAX77686_RTCINT_RTCA2_MSK BIT(2) | ||
| 228 | #define MAX77686_RTCINT_SMPL_MSK BIT(3) | ||
| 229 | #define MAX77686_RTCINT_RTC1S_MSK BIT(4) | ||
| 230 | #define MAX77686_RTCINT_WTSR_MSK BIT(5) | ||
| 231 | |||
| 218 | struct max77686_dev { | 232 | struct max77686_dev { |
| 219 | struct device *dev; | 233 | struct device *dev; |
| 220 | struct i2c_client *i2c; /* 0xcc / PMIC, Battery Control, and FLASH */ | 234 | struct i2c_client *i2c; /* 0xcc / PMIC, Battery Control, and FLASH */ |
| @@ -224,11 +238,10 @@ struct max77686_dev { | |||
| 224 | 238 | ||
| 225 | struct regmap *regmap; /* regmap for mfd */ | 239 | struct regmap *regmap; /* regmap for mfd */ |
| 226 | struct regmap *rtc_regmap; /* regmap for rtc */ | 240 | struct regmap *rtc_regmap; /* regmap for rtc */ |
| 227 | 241 | struct regmap_irq_chip_data *irq_data; | |
| 228 | struct irq_domain *irq_domain; | 242 | struct regmap_irq_chip_data *rtc_irq_data; |
| 229 | 243 | ||
| 230 | int irq; | 244 | int irq; |
| 231 | int irq_gpio; | ||
| 232 | bool wakeup; | 245 | bool wakeup; |
| 233 | struct mutex irqlock; | 246 | struct mutex irqlock; |
| 234 | int irq_masks_cur[MAX77686_IRQ_GROUP_NR]; | 247 | int irq_masks_cur[MAX77686_IRQ_GROUP_NR]; |
diff --git a/include/linux/mfd/max77686.h b/include/linux/mfd/max77686.h index 46c0f320ed76..4cbcc13e8a2a 100644 --- a/include/linux/mfd/max77686.h +++ b/include/linux/mfd/max77686.h | |||
| @@ -89,8 +89,6 @@ struct max77686_opmode_data { | |||
| 89 | }; | 89 | }; |
| 90 | 90 | ||
| 91 | struct max77686_platform_data { | 91 | struct max77686_platform_data { |
| 92 | /* IRQ */ | ||
| 93 | int irq_gpio; | ||
| 94 | int ono; | 92 | int ono; |
| 95 | int wakeup; | 93 | int wakeup; |
| 96 | 94 | ||
