aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/max8998-irq.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mfd/max8998-irq.c')
-rw-r--r--drivers/mfd/max8998-irq.c37
1 files changed, 23 insertions, 14 deletions
diff --git a/drivers/mfd/max8998-irq.c b/drivers/mfd/max8998-irq.c
index 45bfe77b639b..3903e1fbb334 100644
--- a/drivers/mfd/max8998-irq.c
+++ b/drivers/mfd/max8998-irq.c
@@ -102,16 +102,16 @@ irq_to_max8998_irq(struct max8998_dev *max8998, int irq)
102 return &max8998_irqs[irq - max8998->irq_base]; 102 return &max8998_irqs[irq - max8998->irq_base];
103} 103}
104 104
105static void max8998_irq_lock(unsigned int irq) 105static void max8998_irq_lock(struct irq_data *data)
106{ 106{
107 struct max8998_dev *max8998 = get_irq_chip_data(irq); 107 struct max8998_dev *max8998 = irq_data_get_irq_chip_data(data);
108 108
109 mutex_lock(&max8998->irqlock); 109 mutex_lock(&max8998->irqlock);
110} 110}
111 111
112static void max8998_irq_sync_unlock(unsigned int irq) 112static void max8998_irq_sync_unlock(struct irq_data *data)
113{ 113{
114 struct max8998_dev *max8998 = get_irq_chip_data(irq); 114 struct max8998_dev *max8998 = irq_data_get_irq_chip_data(data);
115 int i; 115 int i;
116 116
117 for (i = 0; i < ARRAY_SIZE(max8998->irq_masks_cur); i++) { 117 for (i = 0; i < ARRAY_SIZE(max8998->irq_masks_cur); i++) {
@@ -129,28 +129,30 @@ static void max8998_irq_sync_unlock(unsigned int irq)
129 mutex_unlock(&max8998->irqlock); 129 mutex_unlock(&max8998->irqlock);
130} 130}
131 131
132static void max8998_irq_unmask(unsigned int irq) 132static void max8998_irq_unmask(struct irq_data *data)
133{ 133{
134 struct max8998_dev *max8998 = get_irq_chip_data(irq); 134 struct max8998_dev *max8998 = irq_data_get_irq_chip_data(data);
135 struct max8998_irq_data *irq_data = irq_to_max8998_irq(max8998, irq); 135 struct max8998_irq_data *irq_data = irq_to_max8998_irq(max8998,
136 data->irq);
136 137
137 max8998->irq_masks_cur[irq_data->reg - 1] &= ~irq_data->mask; 138 max8998->irq_masks_cur[irq_data->reg - 1] &= ~irq_data->mask;
138} 139}
139 140
140static void max8998_irq_mask(unsigned int irq) 141static void max8998_irq_mask(struct irq_data *data)
141{ 142{
142 struct max8998_dev *max8998 = get_irq_chip_data(irq); 143 struct max8998_dev *max8998 = irq_data_get_irq_chip_data(data);
143 struct max8998_irq_data *irq_data = irq_to_max8998_irq(max8998, irq); 144 struct max8998_irq_data *irq_data = irq_to_max8998_irq(max8998,
145 data->irq);
144 146
145 max8998->irq_masks_cur[irq_data->reg - 1] |= irq_data->mask; 147 max8998->irq_masks_cur[irq_data->reg - 1] |= irq_data->mask;
146} 148}
147 149
148static struct irq_chip max8998_irq_chip = { 150static struct irq_chip max8998_irq_chip = {
149 .name = "max8998", 151 .name = "max8998",
150 .bus_lock = max8998_irq_lock, 152 .irq_bus_lock = max8998_irq_lock,
151 .bus_sync_unlock = max8998_irq_sync_unlock, 153 .irq_bus_sync_unlock = max8998_irq_sync_unlock,
152 .mask = max8998_irq_mask, 154 .irq_mask = max8998_irq_mask,
153 .unmask = max8998_irq_unmask, 155 .irq_unmask = max8998_irq_unmask,
154}; 156};
155 157
156static irqreturn_t max8998_irq_thread(int irq, void *data) 158static irqreturn_t max8998_irq_thread(int irq, void *data)
@@ -181,6 +183,13 @@ static irqreturn_t max8998_irq_thread(int irq, void *data)
181 return IRQ_HANDLED; 183 return IRQ_HANDLED;
182} 184}
183 185
186int max8998_irq_resume(struct max8998_dev *max8998)
187{
188 if (max8998->irq && max8998->irq_base)
189 max8998_irq_thread(max8998->irq_base, max8998);
190 return 0;
191}
192
184int max8998_irq_init(struct max8998_dev *max8998) 193int max8998_irq_init(struct max8998_dev *max8998)
185{ 194{
186 int i; 195 int i;