Lines Matching +full:primary +full:- +full:pmic
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * wm8350-irq.c -- IRQ support for Wolfson WM8350
21 #include <linux/mfd/wm8350/pmic.h>
35 int primary; member
43 .primary = WM8350_OC_INT,
49 .primary = WM8350_UV_INT,
54 .primary = WM8350_UV_INT,
59 .primary = WM8350_UV_INT,
64 .primary = WM8350_UV_INT,
69 .primary = WM8350_UV_INT,
74 .primary = WM8350_UV_INT,
79 .primary = WM8350_UV_INT,
84 .primary = WM8350_UV_INT,
89 .primary = WM8350_UV_INT,
94 .primary = WM8350_UV_INT,
99 .primary = WM8350_CHG_INT,
104 .primary = WM8350_CHG_INT,
109 .primary = WM8350_CHG_INT,
114 .primary = WM8350_CHG_INT,
119 .primary = WM8350_CHG_INT,
124 .primary = WM8350_CHG_INT,
129 .primary = WM8350_CHG_INT,
134 .primary = WM8350_CHG_INT,
139 .primary = WM8350_CHG_INT,
144 .primary = WM8350_CHG_INT,
149 .primary = WM8350_RTC_INT,
154 .primary = WM8350_RTC_INT,
159 .primary = WM8350_RTC_INT,
164 .primary = WM8350_CS_INT,
169 .primary = WM8350_CS_INT,
174 .primary = WM8350_SYS_INT,
179 .primary = WM8350_SYS_INT,
184 .primary = WM8350_SYS_INT,
189 .primary = WM8350_SYS_INT,
194 .primary = WM8350_AUXADC_INT,
199 .primary = WM8350_AUXADC_INT,
204 .primary = WM8350_AUXADC_INT,
209 .primary = WM8350_AUXADC_INT,
214 .primary = WM8350_AUXADC_INT,
219 .primary = WM8350_USB_INT,
225 .primary = WM8350_WKUP_INT,
230 .primary = WM8350_WKUP_INT,
235 .primary = WM8350_WKUP_INT,
240 .primary = WM8350_WKUP_INT,
245 .primary = WM8350_WKUP_INT,
250 .primary = WM8350_WKUP_INT,
255 .primary = WM8350_WKUP_INT,
260 .primary = WM8350_CODEC_INT,
265 .primary = WM8350_CODEC_INT,
270 .primary = WM8350_CODEC_INT,
275 .primary = WM8350_CODEC_INT,
280 .primary = WM8350_EXT_INT,
285 .primary = WM8350_EXT_INT,
290 .primary = WM8350_EXT_INT,
295 .primary = WM8350_GP_INT,
300 .primary = WM8350_GP_INT,
305 .primary = WM8350_GP_INT,
310 .primary = WM8350_GP_INT,
315 .primary = WM8350_GP_INT,
320 .primary = WM8350_GP_INT,
325 .primary = WM8350_GP_INT,
330 .primary = WM8350_GP_INT,
335 .primary = WM8350_GP_INT,
340 .primary = WM8350_GP_INT,
345 .primary = WM8350_GP_INT,
350 .primary = WM8350_GP_INT,
355 .primary = WM8350_GP_INT,
364 return &wm8350_irqs[irq - wm8350->irq_base]; in irq_to_wm8350_irq()
371 * asserted while we run - in the normal course of events this is a
396 if (!(level_one & data->primary)) in wm8350_irq()
399 if (!read_done[data->reg]) { in wm8350_irq()
400 sub_reg[data->reg] = in wm8350_irq()
402 data->reg); in wm8350_irq()
403 sub_reg[data->reg] &= ~wm8350->irq_masks[data->reg]; in wm8350_irq()
404 read_done[data->reg] = 1; in wm8350_irq()
407 if (sub_reg[data->reg] & data->mask) in wm8350_irq()
408 handle_nested_irq(wm8350->irq_base + i); in wm8350_irq()
418 mutex_lock(&wm8350->irq_lock); in wm8350_irq_lock()
426 for (i = 0; i < ARRAY_SIZE(wm8350->irq_masks); i++) { in wm8350_irq_sync_unlock()
429 WARN_ON(regmap_update_bits(wm8350->regmap, in wm8350_irq_sync_unlock()
431 0xffff, wm8350->irq_masks[i])); in wm8350_irq_sync_unlock()
434 mutex_unlock(&wm8350->irq_lock); in wm8350_irq_sync_unlock()
441 data->irq); in wm8350_irq_enable()
443 wm8350->irq_masks[irq_data->reg] &= ~irq_data->mask; in wm8350_irq_enable()
450 data->irq); in wm8350_irq_disable()
452 wm8350->irq_masks[irq_data->reg] |= irq_data->mask; in wm8350_irq_disable()
468 int irq_base = -1; in wm8350_irq_init()
471 dev_warn(wm8350->dev, "No interrupt support, no core IRQ\n"); in wm8350_irq_init()
481 for (i = 0; i < ARRAY_SIZE(wm8350->irq_masks); i++) { in wm8350_irq_init()
484 wm8350->irq_masks[i] = in wm8350_irq_init()
489 mutex_init(&wm8350->irq_lock); in wm8350_irq_init()
490 wm8350->chip_irq = irq; in wm8350_irq_init()
492 if (pdata && pdata->irq_base > 0) in wm8350_irq_init()
493 irq_base = pdata->irq_base; in wm8350_irq_init()
495 wm8350->irq_base = in wm8350_irq_init()
497 if (wm8350->irq_base < 0) { in wm8350_irq_init()
498 dev_warn(wm8350->dev, "Allocating irqs failed with %d\n", in wm8350_irq_init()
499 wm8350->irq_base); in wm8350_irq_init()
503 if (pdata && pdata->irq_high) { in wm8350_irq_init()
516 for (cur_irq = wm8350->irq_base; in wm8350_irq_init()
517 cur_irq < ARRAY_SIZE(wm8350_irqs) + wm8350->irq_base; in wm8350_irq_init()
530 dev_err(wm8350->dev, "Failed to request IRQ: %d\n", ret); in wm8350_irq_init()
540 free_irq(wm8350->chip_irq, wm8350); in wm8350_irq_exit()