Commit 10f9edae authored by Alexander Shiyan's avatar Alexander Shiyan Committed by Lee Jones

mfd: mc13xxx: Use regmap irq framework for interrupts

This patch convert mc13xxx MFD driver to use regmap irq framework
for interrupt registration.
Signed-off-by: default avatarAlexander Shiyan <shc_work@mail.ru>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent 215cd99a
...@@ -187,6 +187,7 @@ config MFD_MC13XXX ...@@ -187,6 +187,7 @@ config MFD_MC13XXX
tristate tristate
depends on (SPI_MASTER || I2C) depends on (SPI_MASTER || I2C)
select MFD_CORE select MFD_CORE
select REGMAP_IRQ
help help
Enable support for the Freescale MC13783 and MC13892 PMICs. Enable support for the Freescale MC13783 and MC13892 PMICs.
This driver provides common support for accessing the device, This driver provides common support for accessing the device,
......
This diff is collapsed.
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
#include <linux/mfd/mc13xxx.h> #include <linux/mfd/mc13xxx.h>
#define MC13XXX_NUMREGS 0x3f #define MC13XXX_NUMREGS 0x3f
#define MC13XXX_IRQ_REG_CNT 2
#define MC13XXX_IRQ_PER_REG 24
struct mc13xxx; struct mc13xxx;
...@@ -33,13 +35,14 @@ struct mc13xxx { ...@@ -33,13 +35,14 @@ struct mc13xxx {
struct device *dev; struct device *dev;
const struct mc13xxx_variant *variant; const struct mc13xxx_variant *variant;
struct regmap_irq irqs[MC13XXX_IRQ_PER_REG * MC13XXX_IRQ_REG_CNT];
struct regmap_irq_chip irq_chip;
struct regmap_irq_chip_data *irq_data;
struct mutex lock; struct mutex lock;
int irq; int irq;
int flags; int flags;
irq_handler_t irqhandler[MC13XXX_NUM_IRQ];
void *irqdata[MC13XXX_NUM_IRQ];
int adcflags; int adcflags;
}; };
......
...@@ -86,6 +86,5 @@ ...@@ -86,6 +86,5 @@
#define MC13783_IRQ_HSL 43 #define MC13783_IRQ_HSL 43
#define MC13783_IRQ_ALSPTH 44 #define MC13783_IRQ_ALSPTH 44
#define MC13783_IRQ_AHSSHORT 45 #define MC13783_IRQ_AHSSHORT 45
#define MC13783_NUM_IRQ MC13XXX_NUM_IRQ
#endif /* ifndef __LINUX_MFD_MC13783_H */ #endif /* ifndef __LINUX_MFD_MC13783_H */
...@@ -23,15 +23,10 @@ int mc13xxx_reg_rmw(struct mc13xxx *mc13xxx, unsigned int offset, ...@@ -23,15 +23,10 @@ int mc13xxx_reg_rmw(struct mc13xxx *mc13xxx, unsigned int offset,
int mc13xxx_irq_request(struct mc13xxx *mc13xxx, int irq, int mc13xxx_irq_request(struct mc13xxx *mc13xxx, int irq,
irq_handler_t handler, const char *name, void *dev); irq_handler_t handler, const char *name, void *dev);
int mc13xxx_irq_request_nounmask(struct mc13xxx *mc13xxx, int irq,
irq_handler_t handler, const char *name, void *dev);
int mc13xxx_irq_free(struct mc13xxx *mc13xxx, int irq, void *dev); int mc13xxx_irq_free(struct mc13xxx *mc13xxx, int irq, void *dev);
int mc13xxx_irq_mask(struct mc13xxx *mc13xxx, int irq);
int mc13xxx_irq_unmask(struct mc13xxx *mc13xxx, int irq);
int mc13xxx_irq_status(struct mc13xxx *mc13xxx, int irq, int mc13xxx_irq_status(struct mc13xxx *mc13xxx, int irq,
int *enabled, int *pending); int *enabled, int *pending);
int mc13xxx_irq_ack(struct mc13xxx *mc13xxx, int irq);
int mc13xxx_get_flags(struct mc13xxx *mc13xxx); int mc13xxx_get_flags(struct mc13xxx *mc13xxx);
...@@ -39,6 +34,22 @@ int mc13xxx_adc_do_conversion(struct mc13xxx *mc13xxx, ...@@ -39,6 +34,22 @@ int mc13xxx_adc_do_conversion(struct mc13xxx *mc13xxx,
unsigned int mode, unsigned int channel, unsigned int mode, unsigned int channel,
u8 ato, bool atox, unsigned int *sample); u8 ato, bool atox, unsigned int *sample);
/* Deprecated calls */
static inline int mc13xxx_irq_ack(struct mc13xxx *mc13xxx, int irq)
{
return 0;
}
static inline int mc13xxx_irq_request_nounmask(struct mc13xxx *mc13xxx, int irq,
irq_handler_t handler,
const char *name, void *dev)
{
return mc13xxx_irq_request(mc13xxx, irq, handler, name, dev);
}
int mc13xxx_irq_mask(struct mc13xxx *mc13xxx, int irq);
int mc13xxx_irq_unmask(struct mc13xxx *mc13xxx, int irq);
#define MC13783_AUDIO_RX0 36 #define MC13783_AUDIO_RX0 36
#define MC13783_AUDIO_RX1 37 #define MC13783_AUDIO_RX1 37
#define MC13783_AUDIO_TX 38 #define MC13783_AUDIO_TX 38
...@@ -68,8 +79,6 @@ int mc13xxx_adc_do_conversion(struct mc13xxx *mc13xxx, ...@@ -68,8 +79,6 @@ int mc13xxx_adc_do_conversion(struct mc13xxx *mc13xxx,
#define MC13XXX_IRQ_THWARNH 37 #define MC13XXX_IRQ_THWARNH 37
#define MC13XXX_IRQ_CLK 38 #define MC13XXX_IRQ_CLK 38
#define MC13XXX_NUM_IRQ 46
struct regulator_init_data; struct regulator_init_data;
struct mc13xxx_regulator_init_data { struct mc13xxx_regulator_init_data {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment