Lines Matching refs:wm8350
361 static inline struct wm8350_irq_data *irq_to_wm8350_irq(struct wm8350 *wm8350, in irq_to_wm8350_irq() argument
364 return &wm8350_irqs[irq - wm8350->irq_base]; in irq_to_wm8350_irq()
378 struct wm8350 *wm8350 = irq_data; in wm8350_irq() local
385 level_one = wm8350_reg_read(wm8350, WM8350_SYSTEM_INTERRUPTS) in wm8350_irq()
386 & ~wm8350_reg_read(wm8350, WM8350_SYSTEM_INTERRUPTS_MASK); in wm8350_irq()
401 wm8350_reg_read(wm8350, WM8350_INT_STATUS_1 + in wm8350_irq()
403 sub_reg[data->reg] &= ~wm8350->irq_masks[data->reg]; in wm8350_irq()
408 handle_nested_irq(wm8350->irq_base + i); in wm8350_irq()
416 struct wm8350 *wm8350 = irq_data_get_irq_chip_data(data); in wm8350_irq_lock() local
418 mutex_lock(&wm8350->irq_lock); in wm8350_irq_lock()
423 struct wm8350 *wm8350 = irq_data_get_irq_chip_data(data); in wm8350_irq_sync_unlock() local
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()
439 struct wm8350 *wm8350 = irq_data_get_irq_chip_data(data); in wm8350_irq_enable() local
440 struct wm8350_irq_data *irq_data = irq_to_wm8350_irq(wm8350, in wm8350_irq_enable()
443 wm8350->irq_masks[irq_data->reg] &= ~irq_data->mask; in wm8350_irq_enable()
448 struct wm8350 *wm8350 = irq_data_get_irq_chip_data(data); in wm8350_irq_disable() local
449 struct wm8350_irq_data *irq_data = irq_to_wm8350_irq(wm8350, in wm8350_irq_disable()
452 wm8350->irq_masks[irq_data->reg] |= irq_data->mask; in wm8350_irq_disable()
463 int wm8350_irq_init(struct wm8350 *wm8350, int irq, in wm8350_irq_init() argument
471 dev_warn(wm8350->dev, "No interrupt support, no core IRQ\n"); in wm8350_irq_init()
476 wm8350_reg_write(wm8350, WM8350_SYSTEM_INTERRUPTS_MASK, 0xFFFF); in wm8350_irq_init()
481 for (i = 0; i < ARRAY_SIZE(wm8350->irq_masks); i++) { in wm8350_irq_init()
482 wm8350_reg_write(wm8350, WM8350_INT_STATUS_1_MASK + i, in wm8350_irq_init()
484 wm8350->irq_masks[i] = in wm8350_irq_init()
485 wm8350_reg_read(wm8350, in wm8350_irq_init()
489 mutex_init(&wm8350->irq_lock); in wm8350_irq_init()
490 wm8350->chip_irq = irq; 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()
506 wm8350_set_bits(wm8350, WM8350_SYSTEM_CONTROL_1, in wm8350_irq_init()
511 wm8350_clear_bits(wm8350, WM8350_SYSTEM_CONTROL_1, 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()
519 irq_set_chip_data(cur_irq, wm8350); in wm8350_irq_init()
528 "wm8350", wm8350); in wm8350_irq_init()
530 dev_err(wm8350->dev, "Failed to request IRQ: %d\n", ret); in wm8350_irq_init()
533 wm8350_reg_write(wm8350, WM8350_SYSTEM_INTERRUPTS_MASK, 0); in wm8350_irq_init()
538 int wm8350_irq_exit(struct wm8350 *wm8350) in wm8350_irq_exit() argument
540 free_irq(wm8350->chip_irq, wm8350); in wm8350_irq_exit()