Lines Matching refs:wm8350
366 static inline struct wm8350_irq_data *irq_to_wm8350_irq(struct wm8350 *wm8350, in irq_to_wm8350_irq() argument
369 return &wm8350_irqs[irq - wm8350->irq_base]; in irq_to_wm8350_irq()
383 struct wm8350 *wm8350 = irq_data; in wm8350_irq() local
390 level_one = wm8350_reg_read(wm8350, WM8350_SYSTEM_INTERRUPTS) in wm8350_irq()
391 & ~wm8350_reg_read(wm8350, WM8350_SYSTEM_INTERRUPTS_MASK); in wm8350_irq()
406 wm8350_reg_read(wm8350, WM8350_INT_STATUS_1 + in wm8350_irq()
408 sub_reg[data->reg] &= ~wm8350->irq_masks[data->reg]; in wm8350_irq()
413 handle_nested_irq(wm8350->irq_base + i); in wm8350_irq()
421 struct wm8350 *wm8350 = irq_data_get_irq_chip_data(data); in wm8350_irq_lock() local
423 mutex_lock(&wm8350->irq_lock); in wm8350_irq_lock()
428 struct wm8350 *wm8350 = irq_data_get_irq_chip_data(data); in wm8350_irq_sync_unlock() local
431 for (i = 0; i < ARRAY_SIZE(wm8350->irq_masks); i++) { in wm8350_irq_sync_unlock()
434 WARN_ON(regmap_update_bits(wm8350->regmap, in wm8350_irq_sync_unlock()
436 0xffff, wm8350->irq_masks[i])); in wm8350_irq_sync_unlock()
439 mutex_unlock(&wm8350->irq_lock); in wm8350_irq_sync_unlock()
444 struct wm8350 *wm8350 = irq_data_get_irq_chip_data(data); in wm8350_irq_enable() local
445 struct wm8350_irq_data *irq_data = irq_to_wm8350_irq(wm8350, in wm8350_irq_enable()
448 wm8350->irq_masks[irq_data->reg] &= ~irq_data->mask; in wm8350_irq_enable()
453 struct wm8350 *wm8350 = irq_data_get_irq_chip_data(data); in wm8350_irq_disable() local
454 struct wm8350_irq_data *irq_data = irq_to_wm8350_irq(wm8350, in wm8350_irq_disable()
457 wm8350->irq_masks[irq_data->reg] |= irq_data->mask; in wm8350_irq_disable()
468 int wm8350_irq_init(struct wm8350 *wm8350, int irq, in wm8350_irq_init() argument
476 dev_warn(wm8350->dev, "No interrupt support, no core IRQ\n"); in wm8350_irq_init()
481 wm8350_reg_write(wm8350, WM8350_SYSTEM_INTERRUPTS_MASK, 0xFFFF); in wm8350_irq_init()
486 for (i = 0; i < ARRAY_SIZE(wm8350->irq_masks); i++) { in wm8350_irq_init()
487 wm8350_reg_write(wm8350, WM8350_INT_STATUS_1_MASK + i, in wm8350_irq_init()
489 wm8350->irq_masks[i] = in wm8350_irq_init()
490 wm8350_reg_read(wm8350, in wm8350_irq_init()
494 mutex_init(&wm8350->irq_lock); in wm8350_irq_init()
495 wm8350->chip_irq = irq; in wm8350_irq_init()
500 wm8350->irq_base = in wm8350_irq_init()
502 if (wm8350->irq_base < 0) { in wm8350_irq_init()
503 dev_warn(wm8350->dev, "Allocating irqs failed with %d\n", in wm8350_irq_init()
504 wm8350->irq_base); in wm8350_irq_init()
511 wm8350_set_bits(wm8350, WM8350_SYSTEM_CONTROL_1, in wm8350_irq_init()
516 wm8350_clear_bits(wm8350, WM8350_SYSTEM_CONTROL_1, in wm8350_irq_init()
521 for (cur_irq = wm8350->irq_base; in wm8350_irq_init()
522 cur_irq < ARRAY_SIZE(wm8350_irqs) + wm8350->irq_base; in wm8350_irq_init()
524 irq_set_chip_data(cur_irq, wm8350); in wm8350_irq_init()
533 "wm8350", wm8350); in wm8350_irq_init()
535 dev_err(wm8350->dev, "Failed to request IRQ: %d\n", ret); in wm8350_irq_init()
538 wm8350_reg_write(wm8350, WM8350_SYSTEM_INTERRUPTS_MASK, 0); in wm8350_irq_init()
543 int wm8350_irq_exit(struct wm8350 *wm8350) in wm8350_irq_exit() argument
545 free_irq(wm8350->chip_irq, wm8350); in wm8350_irq_exit()