Lines Matching full:nau8825
3 * Nuvoton NAU8825 audio codec driver
32 #include "nau8825.h"
35 #define NUVOTON_CODEC_DAI "nau8825-hifi"
48 static int nau8825_configure_sysclk(struct nau8825 *nau8825,
224 * @nau8825: component to register the codec private data with
241 static int nau8825_sema_acquire(struct nau8825 *nau8825, long timeout) in nau8825_sema_acquire() argument
246 ret = down_timeout(&nau8825->xtalk_sem, timeout); in nau8825_sema_acquire()
248 dev_warn(nau8825->dev, "Acquire semaphore timeout\n"); in nau8825_sema_acquire()
250 ret = down_trylock(&nau8825->xtalk_sem); in nau8825_sema_acquire()
252 dev_warn(nau8825->dev, "Acquire semaphore fail\n"); in nau8825_sema_acquire()
260 * @nau8825: component to register the codec private data with
265 static inline void nau8825_sema_release(struct nau8825 *nau8825) in nau8825_sema_release() argument
267 up(&nau8825->xtalk_sem); in nau8825_sema_release()
272 * @nau8825: component to register the codec private data with
277 static inline void nau8825_sema_reset(struct nau8825 *nau8825) in nau8825_sema_reset() argument
279 nau8825->xtalk_sem.count = 1; in nau8825_sema_reset()
285 * @nau8825: component to register the codec private data with
295 static void nau8825_hpvol_ramp(struct nau8825 *nau8825, in nau8825_hpvol_ramp() argument
320 regmap_update_bits(nau8825->regmap, NAU8825_REG_HSVOL_CTRL, in nau8825_hpvol_ramp()
329 regmap_update_bits(nau8825->regmap, NAU8825_REG_HSVOL_CTRL, in nau8825_hpvol_ramp()
387 static void nau8825_xtalk_backup(struct nau8825 *nau8825) in nau8825_xtalk_backup() argument
391 if (nau8825->xtalk_baktab_initialized) in nau8825_xtalk_backup()
396 regmap_read(nau8825->regmap, nau8825_xtalk_baktab[i].reg, in nau8825_xtalk_backup()
399 nau8825->xtalk_baktab_initialized = true; in nau8825_xtalk_backup()
402 static void nau8825_xtalk_restore(struct nau8825 *nau8825, bool cause_cancel) in nau8825_xtalk_restore() argument
406 if (!nau8825->xtalk_baktab_initialized) in nau8825_xtalk_restore()
420 nau8825_hpvol_ramp(nau8825, 0, volume, 3); in nau8825_xtalk_restore()
423 regmap_write(nau8825->regmap, nau8825_xtalk_baktab[i].reg, in nau8825_xtalk_restore()
427 nau8825->xtalk_baktab_initialized = false; in nau8825_xtalk_restore()
430 static void nau8825_xtalk_prepare_dac(struct nau8825 *nau8825) in nau8825_xtalk_prepare_dac() argument
433 regmap_update_bits(nau8825->regmap, NAU8825_REG_ENA_CTRL, in nau8825_xtalk_prepare_dac()
442 regmap_update_bits(nau8825->regmap, NAU8825_REG_CHARGE_PUMP, in nau8825_xtalk_prepare_dac()
446 regmap_update_bits(nau8825->regmap, NAU8825_REG_RDAC, in nau8825_xtalk_prepare_dac()
451 regmap_update_bits(nau8825->regmap, NAU8825_REG_POWER_UP_CONTROL, in nau8825_xtalk_prepare_dac()
456 regmap_update_bits(nau8825->regmap, NAU8825_REG_POWER_UP_CONTROL, in nau8825_xtalk_prepare_dac()
460 regmap_update_bits(nau8825->regmap, NAU8825_REG_HSD_CTRL, in nau8825_xtalk_prepare_dac()
463 regmap_update_bits(nau8825->regmap, NAU8825_REG_BOOST, in nau8825_xtalk_prepare_dac()
466 regmap_update_bits(nau8825->regmap, NAU8825_REG_CLASSG_CTRL, in nau8825_xtalk_prepare_dac()
471 static void nau8825_xtalk_prepare_adc(struct nau8825 *nau8825) in nau8825_xtalk_prepare_adc() argument
474 regmap_update_bits(nau8825->regmap, NAU8825_REG_ANALOG_ADC_2, in nau8825_xtalk_prepare_adc()
479 static void nau8825_xtalk_clock(struct nau8825 *nau8825) in nau8825_xtalk_clock() argument
482 regmap_write(nau8825->regmap, NAU8825_REG_FLL1, 0x0); in nau8825_xtalk_clock()
483 regmap_write(nau8825->regmap, NAU8825_REG_FLL2, 0x3126); in nau8825_xtalk_clock()
484 regmap_write(nau8825->regmap, NAU8825_REG_FLL3, 0x0008); in nau8825_xtalk_clock()
485 regmap_write(nau8825->regmap, NAU8825_REG_FLL4, 0x0010); in nau8825_xtalk_clock()
486 regmap_write(nau8825->regmap, NAU8825_REG_FLL5, 0x0); in nau8825_xtalk_clock()
487 regmap_write(nau8825->regmap, NAU8825_REG_FLL6, 0x6000); in nau8825_xtalk_clock()
489 regmap_update_bits(nau8825->regmap, NAU8825_REG_CLK_DIVIDER, in nau8825_xtalk_clock()
491 regmap_update_bits(nau8825->regmap, NAU8825_REG_FLL6, NAU8825_DCO_EN, in nau8825_xtalk_clock()
496 regmap_update_bits(nau8825->regmap, NAU8825_REG_CLK_DIVIDER, in nau8825_xtalk_clock()
498 regmap_update_bits(nau8825->regmap, NAU8825_REG_FLL1, in nau8825_xtalk_clock()
502 static void nau8825_xtalk_prepare(struct nau8825 *nau8825) in nau8825_xtalk_prepare() argument
507 nau8825_xtalk_backup(nau8825); in nau8825_xtalk_prepare()
509 regmap_update_bits(nau8825->regmap, NAU8825_REG_I2S_PCM_CTRL2, in nau8825_xtalk_prepare()
520 nau8825_hpvol_ramp(nau8825, volume, 0, 3); in nau8825_xtalk_prepare()
522 nau8825_xtalk_clock(nau8825); in nau8825_xtalk_prepare()
523 nau8825_xtalk_prepare_dac(nau8825); in nau8825_xtalk_prepare()
524 nau8825_xtalk_prepare_adc(nau8825); in nau8825_xtalk_prepare()
526 regmap_update_bits(nau8825->regmap, NAU8825_REG_DACL_CTRL, in nau8825_xtalk_prepare()
529 regmap_update_bits(nau8825->regmap, NAU8825_REG_DACR_CTRL, in nau8825_xtalk_prepare()
535 regmap_update_bits(nau8825->regmap, NAU8825_REG_IMM_MODE_CTRL, in nau8825_xtalk_prepare()
541 regmap_update_bits(nau8825->regmap, in nau8825_xtalk_prepare()
544 if (nau8825->sw_id == NAU8825_SOFTWARE_ID_NAU8825) in nau8825_xtalk_prepare()
545 regmap_update_bits(nau8825->regmap, NAU8825_REG_CHARGE_PUMP, in nau8825_xtalk_prepare()
548 regmap_update_bits(nau8825->regmap, NAU8825_REG_CHARGE_PUMP, in nau8825_xtalk_prepare()
553 static void nau8825_xtalk_clean_dac(struct nau8825 *nau8825) in nau8825_xtalk_clean_dac() argument
556 regmap_update_bits(nau8825->regmap, NAU8825_REG_BOOST, in nau8825_xtalk_clean_dac()
559 regmap_update_bits(nau8825->regmap, NAU8825_REG_HSD_CTRL, in nau8825_xtalk_clean_dac()
563 if (nau8825->sw_id == NAU8825_SOFTWARE_ID_NAU8825) in nau8825_xtalk_clean_dac()
564 regmap_update_bits(nau8825->regmap, NAU8825_REG_CHARGE_PUMP, in nau8825_xtalk_clean_dac()
568 regmap_update_bits(nau8825->regmap, NAU8825_REG_CHARGE_PUMP, in nau8825_xtalk_clean_dac()
572 regmap_update_bits(nau8825->regmap, NAU8825_REG_BIAS_ADJ, in nau8825_xtalk_clean_dac()
576 regmap_update_bits(nau8825->regmap, NAU8825_REG_POWER_UP_CONTROL, in nau8825_xtalk_clean_dac()
578 regmap_update_bits(nau8825->regmap, NAU8825_REG_POWER_UP_CONTROL, in nau8825_xtalk_clean_dac()
582 regmap_update_bits(nau8825->regmap, NAU8825_REG_RDAC, in nau8825_xtalk_clean_dac()
585 regmap_update_bits(nau8825->regmap, NAU8825_REG_CHARGE_PUMP, in nau8825_xtalk_clean_dac()
588 regmap_update_bits(nau8825->regmap, NAU8825_REG_ENA_CTRL, in nau8825_xtalk_clean_dac()
591 if (!nau8825->irq) in nau8825_xtalk_clean_dac()
592 regmap_update_bits(nau8825->regmap, in nau8825_xtalk_clean_dac()
596 static void nau8825_xtalk_clean_adc(struct nau8825 *nau8825) in nau8825_xtalk_clean_adc() argument
599 regmap_update_bits(nau8825->regmap, NAU8825_REG_ANALOG_ADC_2, in nau8825_xtalk_clean_adc()
603 static void nau8825_xtalk_clean(struct nau8825 *nau8825, bool cause_cancel) in nau8825_xtalk_clean() argument
606 nau8825_configure_sysclk(nau8825, NAU8825_CLK_INTERNAL, 0); in nau8825_xtalk_clean()
607 nau8825_xtalk_clean_dac(nau8825); in nau8825_xtalk_clean()
608 nau8825_xtalk_clean_adc(nau8825); in nau8825_xtalk_clean()
610 regmap_write(nau8825->regmap, NAU8825_REG_IMM_MODE_CTRL, 0); in nau8825_xtalk_clean()
612 regmap_update_bits(nau8825->regmap, NAU8825_REG_INTERRUPT_MASK, in nau8825_xtalk_clean()
615 regmap_update_bits(nau8825->regmap, NAU8825_REG_I2S_PCM_CTRL2, in nau8825_xtalk_clean()
619 nau8825_xtalk_restore(nau8825, cause_cancel); in nau8825_xtalk_clean()
622 static void nau8825_xtalk_imm_start(struct nau8825 *nau8825, int vol) in nau8825_xtalk_imm_start() argument
625 regmap_update_bits(nau8825->regmap, NAU8825_REG_ADC_DGAIN_CTRL, in nau8825_xtalk_imm_start()
630 regmap_update_bits(nau8825->regmap, NAU8825_REG_BIAS_ADJ, in nau8825_xtalk_imm_start()
633 switch (nau8825->xtalk_state) { in nau8825_xtalk_imm_start()
636 regmap_update_bits(nau8825->regmap, NAU8825_REG_BIAS_ADJ, in nau8825_xtalk_imm_start()
642 regmap_update_bits(nau8825->regmap, NAU8825_REG_BIAS_ADJ, in nau8825_xtalk_imm_start()
651 regmap_update_bits(nau8825->regmap, NAU8825_REG_IMM_MODE_CTRL, in nau8825_xtalk_imm_start()
655 static void nau8825_xtalk_imm_stop(struct nau8825 *nau8825) in nau8825_xtalk_imm_stop() argument
658 regmap_update_bits(nau8825->regmap, in nau8825_xtalk_imm_stop()
682 static void nau8825_xtalk_measure(struct nau8825 *nau8825) in nau8825_xtalk_measure() argument
686 switch (nau8825->xtalk_state) { in nau8825_xtalk_measure()
691 nau8825_xtalk_prepare(nau8825); in nau8825_xtalk_measure()
694 nau8825->xtalk_state = NAU8825_XTALK_HPR_R2L; in nau8825_xtalk_measure()
695 nau8825_xtalk_imm_start(nau8825, 0x00d2); in nau8825_xtalk_measure()
701 regmap_read(nau8825->regmap, NAU8825_REG_IMM_RMS_L, in nau8825_xtalk_measure()
702 &nau8825->imp_rms[NAU8825_XTALK_HPR_R2L]); in nau8825_xtalk_measure()
703 dev_dbg(nau8825->dev, "HPR_R2L imm: %x\n", in nau8825_xtalk_measure()
704 nau8825->imp_rms[NAU8825_XTALK_HPR_R2L]); in nau8825_xtalk_measure()
706 nau8825_xtalk_imm_stop(nau8825); in nau8825_xtalk_measure()
708 nau8825->xtalk_state = NAU8825_XTALK_HPL_R2L; in nau8825_xtalk_measure()
709 nau8825_xtalk_imm_start(nau8825, 0x00ff); in nau8825_xtalk_measure()
718 regmap_read(nau8825->regmap, NAU8825_REG_IMM_RMS_L, in nau8825_xtalk_measure()
719 &nau8825->imp_rms[NAU8825_XTALK_HPL_R2L]); in nau8825_xtalk_measure()
720 dev_dbg(nau8825->dev, "HPL_R2L imm: %x\n", in nau8825_xtalk_measure()
721 nau8825->imp_rms[NAU8825_XTALK_HPL_R2L]); in nau8825_xtalk_measure()
722 nau8825_xtalk_imm_stop(nau8825); in nau8825_xtalk_measure()
724 nau8825->xtalk_state = NAU8825_XTALK_IMM; in nau8825_xtalk_measure()
733 nau8825->imp_rms[NAU8825_XTALK_HPR_R2L], in nau8825_xtalk_measure()
734 nau8825->imp_rms[NAU8825_XTALK_HPL_R2L]); in nau8825_xtalk_measure()
735 dev_dbg(nau8825->dev, "cross talk sidetone: %x\n", sidetone); in nau8825_xtalk_measure()
736 regmap_write(nau8825->regmap, NAU8825_REG_DAC_DGAIN_CTRL, in nau8825_xtalk_measure()
738 nau8825_xtalk_clean(nau8825, false); in nau8825_xtalk_measure()
739 nau8825->xtalk_state = NAU8825_XTALK_DONE; in nau8825_xtalk_measure()
748 struct nau8825 *nau8825 = container_of( in nau8825_xtalk_work() local
749 work, struct nau8825, xtalk_work); in nau8825_xtalk_work()
751 nau8825_xtalk_measure(nau8825); in nau8825_xtalk_work()
755 if (nau8825->xtalk_state == NAU8825_XTALK_IMM) in nau8825_xtalk_work()
756 nau8825_xtalk_measure(nau8825); in nau8825_xtalk_work()
764 if (nau8825->xtalk_state == NAU8825_XTALK_DONE) { in nau8825_xtalk_work()
765 snd_soc_jack_report(nau8825->jack, nau8825->xtalk_event, in nau8825_xtalk_work()
766 nau8825->xtalk_event_mask); in nau8825_xtalk_work()
767 nau8825_sema_release(nau8825); in nau8825_xtalk_work()
768 nau8825->xtalk_protect = false; in nau8825_xtalk_work()
772 static void nau8825_xtalk_cancel(struct nau8825 *nau8825) in nau8825_xtalk_cancel() argument
778 if (nau8825->xtalk_enable && nau8825->xtalk_state != in nau8825_xtalk_cancel()
780 cancel_work_sync(&nau8825->xtalk_work); in nau8825_xtalk_cancel()
781 nau8825_xtalk_clean(nau8825, true); in nau8825_xtalk_cancel()
784 nau8825_sema_reset(nau8825); in nau8825_xtalk_cancel()
785 nau8825->xtalk_state = NAU8825_XTALK_DONE; in nau8825_xtalk_cancel()
786 nau8825->xtalk_protect = false; in nau8825_xtalk_cancel()
862 struct nau8825 *nau8825 = snd_soc_component_get_drvdata(component); in nau8825_fepga_event() local
866 regmap_update_bits(nau8825->regmap, NAU8825_REG_FEPGA, in nau8825_fepga_event()
869 regmap_update_bits(nau8825->regmap, NAU8825_REG_BOOST, in nau8825_fepga_event()
872 regmap_update_bits(nau8825->regmap, NAU8825_REG_BOOST, in nau8825_fepga_event()
874 regmap_update_bits(nau8825->regmap, NAU8825_REG_FEPGA, in nau8825_fepga_event()
888 struct nau8825 *nau8825 = snd_soc_component_get_drvdata(component); in nau8825_adc_event() local
892 msleep(nau8825->adc_delay); in nau8825_adc_event()
893 regmap_update_bits(nau8825->regmap, NAU8825_REG_ENA_CTRL, in nau8825_adc_event()
897 if (!nau8825->irq) in nau8825_adc_event()
898 regmap_update_bits(nau8825->regmap, in nau8825_adc_event()
912 struct nau8825 *nau8825 = snd_soc_component_get_drvdata(component); in nau8825_pump_event() local
918 regmap_update_bits(nau8825->regmap, NAU8825_REG_CHARGE_PUMP, in nau8825_pump_event()
922 regmap_update_bits(nau8825->regmap, NAU8825_REG_CHARGE_PUMP, in nau8825_pump_event()
936 struct nau8825 *nau8825 = snd_soc_component_get_drvdata(component); in nau8825_output_dac_event() local
941 regmap_update_bits(nau8825->regmap, NAU8825_REG_BIAS_ADJ, in nau8825_output_dac_event()
943 if (nau8825->sw_id == NAU8825_SOFTWARE_ID_NAU8825) in nau8825_output_dac_event()
944 regmap_update_bits(nau8825->regmap, NAU8825_REG_CHARGE_PUMP, in nau8825_output_dac_event()
947 regmap_update_bits(nau8825->regmap, NAU8825_REG_CHARGE_PUMP, in nau8825_output_dac_event()
952 regmap_update_bits(nau8825->regmap, NAU8825_REG_BIAS_ADJ, in nau8825_output_dac_event()
954 if (nau8825->sw_id == NAU8825_SOFTWARE_ID_NAU8825) in nau8825_output_dac_event()
955 regmap_update_bits(nau8825->regmap, NAU8825_REG_CHARGE_PUMP, in nau8825_output_dac_event()
959 regmap_update_bits(nau8825->regmap, NAU8825_REG_CHARGE_PUMP, in nau8825_output_dac_event()
974 struct nau8825 *nau8825 = snd_soc_component_get_drvdata(component); in system_clock_control() local
975 struct regmap *regmap = nau8825->regmap; in system_clock_control()
978 dev_dbg(nau8825->dev, "system clock control : POWER OFF\n"); in system_clock_control()
985 nau8825_configure_sysclk(nau8825, in system_clock_control()
988 nau8825_configure_sysclk(nau8825, NAU8825_CLK_DIS, 0); in system_clock_control()
1237 nau8825_get_osr(struct nau8825 *nau8825, int stream) in nau8825_get_osr() argument
1242 regmap_read(nau8825->regmap, in nau8825_get_osr()
1249 regmap_read(nau8825->regmap, in nau8825_get_osr()
1262 struct nau8825 *nau8825 = snd_soc_component_get_drvdata(component); in nau8825_dai_startup() local
1265 osr = nau8825_get_osr(nau8825, substream->stream); in nau8825_dai_startup()
1279 struct nau8825 *nau8825 = snd_soc_component_get_drvdata(component); in nau8825_hw_params() local
1284 nau8825_sema_acquire(nau8825, 3 * HZ); in nau8825_hw_params()
1292 osr = nau8825_get_osr(nau8825, substream->stream); in nau8825_hw_params()
1298 regmap_update_bits(nau8825->regmap, NAU8825_REG_CLK_DIVIDER, in nau8825_hw_params()
1302 regmap_update_bits(nau8825->regmap, NAU8825_REG_CLK_DIVIDER, in nau8825_hw_params()
1307 regmap_read(nau8825->regmap, NAU8825_REG_I2S_PCM_CTRL2, &ctrl_val); in nau8825_hw_params()
1319 regmap_update_bits(nau8825->regmap, NAU8825_REG_I2S_PCM_CTRL2, in nau8825_hw_params()
1341 regmap_update_bits(nau8825->regmap, NAU8825_REG_I2S_PCM_CTRL1, in nau8825_hw_params()
1347 nau8825_sema_release(nau8825); in nau8825_hw_params()
1355 struct nau8825 *nau8825 = snd_soc_component_get_drvdata(component); in nau8825_set_dai_fmt() local
1399 nau8825_sema_acquire(nau8825, 3 * HZ); in nau8825_set_dai_fmt()
1401 regmap_update_bits(nau8825->regmap, NAU8825_REG_I2S_PCM_CTRL1, in nau8825_set_dai_fmt()
1405 regmap_update_bits(nau8825->regmap, NAU8825_REG_I2S_PCM_CTRL2, in nau8825_set_dai_fmt()
1409 nau8825_sema_release(nau8825); in nau8825_set_dai_fmt()
1429 struct nau8825 *nau8825 = snd_soc_component_get_drvdata(component); in nau8825_set_tdm_slot() local
1433 dev_err(nau8825->dev, "Only support 4 or 8 slots!\n"); in nau8825_set_tdm_slot()
1440 dev_err(nau8825->dev, in nau8825_set_tdm_slot()
1449 dev_err(nau8825->dev, in nau8825_set_tdm_slot()
1456 regmap_update_bits(nau8825->regmap, NAU8825_REG_I2S_PCM_CTRL2, in nau8825_set_tdm_slot()
1458 regmap_read(nau8825->regmap, NAU8825_REG_I2S_PCM_CTRL1, &value); in nau8825_set_tdm_slot()
1500 regmap_update_bits(nau8825->regmap, NAU8825_REG_TDM_CTRL, in nau8825_set_tdm_slot()
1504 regmap_update_bits(nau8825->regmap, NAU8825_REG_LEFT_TIME_SLOT, in nau8825_set_tdm_slot()
1522 .name = "nau8825-hifi",
1553 struct nau8825 *nau8825 = snd_soc_component_get_drvdata(component); in nau8825_enable_jack_detect() local
1554 struct regmap *regmap = nau8825->regmap; in nau8825_enable_jack_detect()
1556 nau8825->jack = jack; in nau8825_enable_jack_detect()
1558 if (!nau8825->jack) { in nau8825_enable_jack_detect()
1619 static void nau8825_eject_jack(struct nau8825 *nau8825) in nau8825_eject_jack() argument
1621 struct snd_soc_dapm_context *dapm = nau8825->dapm; in nau8825_eject_jack()
1622 struct regmap *regmap = nau8825->regmap; in nau8825_eject_jack()
1625 nau8825_xtalk_cancel(nau8825); in nau8825_eject_jack()
1659 nau8825_configure_sysclk(nau8825, NAU8825_CLK_DIS, 0); in nau8825_eject_jack()
1663 static void nau8825_setup_auto_irq(struct nau8825 *nau8825) in nau8825_setup_auto_irq() argument
1665 struct regmap *regmap = nau8825->regmap; in nau8825_setup_auto_irq()
1678 nau8825_configure_sysclk(nau8825, NAU8825_CLK_INTERNAL, 0); in nau8825_setup_auto_irq()
1729 static int nau8825_high_imped_detection(struct nau8825 *nau8825) in nau8825_high_imped_detection() argument
1731 struct regmap *regmap = nau8825->regmap; in nau8825_high_imped_detection()
1732 struct snd_soc_dapm_context *dapm = nau8825->dapm; in nau8825_high_imped_detection()
1788 NAU8825_MICBIAS_VOLTAGE_MASK, nau8825->micbias_voltage); in nau8825_high_imped_detection()
1798 nau8825->sar_voltage << NAU8825_SAR_TRACKING_GAIN_SFT); in nau8825_high_imped_detection()
1801 (nau8825->sar_compare_time << NAU8825_SAR_COMPARE_TIME_SFT) | in nau8825_high_imped_detection()
1802 (nau8825->sar_sampling_time << NAU8825_SAR_SAMPLING_TIME_SFT)); in nau8825_high_imped_detection()
1803 dev_dbg(nau8825->dev, "adc_mg1:%x, adc_mg2:%x\n", adc_mg1, adc_mg2); in nau8825_high_imped_detection()
1807 dev_dbg(nau8825->dev, "OMTP (micgnd1) mic connected\n"); in nau8825_high_imped_detection()
1822 dev_dbg(nau8825->dev, "CTIA (micgnd2) mic connected\n"); in nau8825_high_imped_detection()
1837 dev_err(nau8825->dev, "Jack broken.\n"); in nau8825_high_imped_detection()
1844 static int nau8825_jack_insert(struct nau8825 *nau8825) in nau8825_jack_insert() argument
1846 struct regmap *regmap = nau8825->regmap; in nau8825_jack_insert()
1847 struct snd_soc_dapm_context *dapm = nau8825->dapm; in nau8825_jack_insert()
1855 nau8825->high_imped = true; in nau8825_jack_insert()
1857 nau8825->high_imped = false; in nau8825_jack_insert()
1865 dev_dbg(nau8825->dev, "OMTP (micgnd1) mic connected\n"); in nau8825_jack_insert()
1885 dev_dbg(nau8825->dev, "CTIA (micgnd2) mic connected\n"); in nau8825_jack_insert()
1906 dev_warn(nau8825->dev, in nau8825_jack_insert()
1908 if (!nau8825_high_imped_detection(nau8825)) { in nau8825_jack_insert()
1937 struct nau8825 *nau8825 = (struct nau8825 *)data; in nau8825_interrupt() local
1938 struct regmap *regmap = nau8825->regmap; in nau8825_interrupt()
1942 dev_err(nau8825->dev, "failed to read irq status\n"); in nau8825_interrupt()
1949 nau8825_eject_jack(nau8825); in nau8825_interrupt()
1961 nau8825->button_pressed = nau8825_button_decode( in nau8825_interrupt()
1964 event |= nau8825->button_pressed; in nau8825_interrupt()
1972 event |= nau8825_jack_insert(nau8825); in nau8825_interrupt()
1973 if (nau8825->xtalk_enable && !nau8825->high_imped) { in nau8825_interrupt()
1977 if (!nau8825->xtalk_protect) { in nau8825_interrupt()
1985 nau8825->xtalk_protect = true; in nau8825_interrupt()
1986 ret = nau8825_sema_acquire(nau8825, 0); in nau8825_interrupt()
1988 nau8825->xtalk_protect = false; in nau8825_interrupt()
1991 if (nau8825->xtalk_protect) { in nau8825_interrupt()
1992 nau8825->xtalk_state = in nau8825_interrupt()
1994 schedule_work(&nau8825->xtalk_work); in nau8825_interrupt()
2001 if (nau8825->xtalk_protect) { in nau8825_interrupt()
2002 nau8825_sema_release(nau8825); in nau8825_interrupt()
2003 nau8825->xtalk_protect = false; in nau8825_interrupt()
2007 dev_warn(nau8825->dev, "Headset completion IRQ fired but no headset connected\n"); in nau8825_interrupt()
2008 nau8825_eject_jack(nau8825); in nau8825_interrupt()
2017 if (nau8825->xtalk_state == NAU8825_XTALK_PREPARE) { in nau8825_interrupt()
2018 nau8825->xtalk_event = event; in nau8825_interrupt()
2019 nau8825->xtalk_event_mask = event_mask; in nau8825_interrupt()
2023 if (nau8825->xtalk_enable && nau8825->xtalk_protect) in nau8825_interrupt()
2024 schedule_work(&nau8825->xtalk_work); in nau8825_interrupt()
2044 nau8825_setup_auto_irq(nau8825); in nau8825_interrupt()
2058 if (event_mask && nau8825->xtalk_state == NAU8825_XTALK_DONE) in nau8825_interrupt()
2059 snd_soc_jack_report(nau8825->jack, event, event_mask); in nau8825_interrupt()
2064 static void nau8825_setup_buttons(struct nau8825 *nau8825) in nau8825_setup_buttons() argument
2066 struct regmap *regmap = nau8825->regmap; in nau8825_setup_buttons()
2070 nau8825->sar_voltage << NAU8825_SAR_TRACKING_GAIN_SFT); in nau8825_setup_buttons()
2073 nau8825->sar_compare_time << NAU8825_SAR_COMPARE_TIME_SFT); in nau8825_setup_buttons()
2076 nau8825->sar_sampling_time << NAU8825_SAR_SAMPLING_TIME_SFT); in nau8825_setup_buttons()
2080 (nau8825->sar_threshold_num - 1) << NAU8825_KEYDET_LEVELS_NR_SFT); in nau8825_setup_buttons()
2083 nau8825->sar_hysteresis << NAU8825_KEYDET_HYSTERESIS_SFT); in nau8825_setup_buttons()
2086 nau8825->key_debounce << NAU8825_KEYDET_SHORTKEY_DEBOUNCE_SFT); in nau8825_setup_buttons()
2089 (nau8825->sar_threshold[0] << 8) | nau8825->sar_threshold[1]); in nau8825_setup_buttons()
2091 (nau8825->sar_threshold[2] << 8) | nau8825->sar_threshold[3]); in nau8825_setup_buttons()
2093 (nau8825->sar_threshold[4] << 8) | nau8825->sar_threshold[5]); in nau8825_setup_buttons()
2095 (nau8825->sar_threshold[6] << 8) | nau8825->sar_threshold[7]); in nau8825_setup_buttons()
2103 static void nau8825_init_regs(struct nau8825 *nau8825) in nau8825_init_regs() argument
2105 struct regmap *regmap = nau8825->regmap; in nau8825_init_regs()
2110 regmap_update_bits(nau8825->regmap, NAU8825_REG_BIAS_ADJ, in nau8825_init_regs()
2112 regmap_update_bits(nau8825->regmap, NAU8825_REG_BOOST, in nau8825_init_regs()
2118 nau8825->vref_impedance << NAU8825_BIAS_VMID_SEL_SFT); in nau8825_init_regs()
2128 nau8825->jkdet_enable ? 0 : NAU8825_JKDET_OUTPUT_EN); in nau8825_init_regs()
2131 nau8825->jkdet_pull_enable ? 0 : NAU8825_JKDET_PULL_EN); in nau8825_init_regs()
2134 nau8825->jkdet_pull_up ? NAU8825_JKDET_PULL_UP : 0); in nau8825_init_regs()
2138 nau8825->jkdet_polarity ? 0 : NAU8825_JACK_POLARITY); in nau8825_init_regs()
2142 nau8825->jack_insert_debounce << NAU8825_JACK_INSERT_DEBOUNCE_SFT); in nau8825_init_regs()
2145 nau8825->jack_eject_debounce << NAU8825_JACK_EJECT_DEBOUNCE_SFT); in nau8825_init_regs()
2155 NAU8825_MICBIAS_VOLTAGE_MASK, nau8825->micbias_voltage); in nau8825_init_regs()
2157 if (nau8825->sar_threshold_num) in nau8825_init_regs()
2158 nau8825_setup_buttons(nau8825); in nau8825_init_regs()
2169 if (nau8825->sw_id == NAU8825_SOFTWARE_ID_NAU8825) in nau8825_init_regs()
2177 regmap_update_bits(nau8825->regmap, NAU8825_REG_BIAS_ADJ, in nau8825_init_regs()
2199 regmap_update_bits(nau8825->regmap, NAU8825_REG_DACL_CTRL, in nau8825_init_regs()
2201 regmap_update_bits(nau8825->regmap, NAU8825_REG_DACR_CTRL, in nau8825_init_regs()
2209 nau8825->adcout_ds << NAU8825_ADCOUT_DS_SFT); in nau8825_init_regs()
2228 struct nau8825 *nau8825 = snd_soc_component_get_drvdata(component); in nau8825_component_probe() local
2231 nau8825->dapm = dapm; in nau8825_component_probe()
2238 struct nau8825 *nau8825 = snd_soc_component_get_drvdata(component); in nau8825_component_remove() local
2241 nau8825_xtalk_cancel(nau8825); in nau8825_component_remove()
2313 static void nau8825_fll_apply(struct nau8825 *nau8825, in nau8825_fll_apply() argument
2316 regmap_update_bits(nau8825->regmap, NAU8825_REG_CLK_DIVIDER, in nau8825_fll_apply()
2320 regmap_update_bits(nau8825->regmap, NAU8825_REG_FLL1, in nau8825_fll_apply()
2325 regmap_write(nau8825->regmap, NAU8825_REG_FLL2, in nau8825_fll_apply()
2328 regmap_write(nau8825->regmap, NAU8825_REG_FLL2_LOWER, in nau8825_fll_apply()
2330 regmap_write(nau8825->regmap, NAU8825_REG_FLL2_UPPER, in nau8825_fll_apply()
2334 regmap_update_bits(nau8825->regmap, NAU8825_REG_FLL3, in nau8825_fll_apply()
2337 regmap_update_bits(nau8825->regmap, NAU8825_REG_FLL4, in nau8825_fll_apply()
2341 regmap_update_bits(nau8825->regmap, NAU8825_REG_FLL5, in nau8825_fll_apply()
2344 regmap_update_bits(nau8825->regmap, in nau8825_fll_apply()
2348 regmap_update_bits(nau8825->regmap, NAU8825_REG_FLL5, in nau8825_fll_apply()
2353 regmap_update_bits(nau8825->regmap, NAU8825_REG_FLL6, in nau8825_fll_apply()
2358 regmap_update_bits(nau8825->regmap, NAU8825_REG_FLL5, in nau8825_fll_apply()
2361 regmap_update_bits(nau8825->regmap, NAU8825_REG_FLL6, in nau8825_fll_apply()
2370 struct nau8825 *nau8825 = snd_soc_component_get_drvdata(component); in nau8825_set_pll() local
2374 if (nau8825->sw_id == NAU8825_SOFTWARE_ID_NAU8825) in nau8825_set_pll()
2389 nau8825_fll_apply(nau8825, &fll_param); in nau8825_set_pll()
2391 regmap_update_bits(nau8825->regmap, NAU8825_REG_CLK_DIVIDER, in nau8825_set_pll()
2396 static int nau8825_mclk_prepare(struct nau8825 *nau8825, unsigned int freq) in nau8825_mclk_prepare() argument
2400 nau8825->mclk = devm_clk_get(nau8825->dev, "mclk"); in nau8825_mclk_prepare()
2401 if (IS_ERR(nau8825->mclk)) { in nau8825_mclk_prepare()
2402 dev_info(nau8825->dev, "No 'mclk' clock found, assume MCLK is managed externally"); in nau8825_mclk_prepare()
2406 if (!nau8825->mclk_freq) { in nau8825_mclk_prepare()
2407 ret = clk_prepare_enable(nau8825->mclk); in nau8825_mclk_prepare()
2409 dev_err(nau8825->dev, "Unable to prepare codec mclk\n"); in nau8825_mclk_prepare()
2414 if (nau8825->mclk_freq != freq) { in nau8825_mclk_prepare()
2415 freq = clk_round_rate(nau8825->mclk, freq); in nau8825_mclk_prepare()
2416 ret = clk_set_rate(nau8825->mclk, freq); in nau8825_mclk_prepare()
2418 dev_err(nau8825->dev, "Unable to set mclk rate\n"); in nau8825_mclk_prepare()
2421 nau8825->mclk_freq = freq; in nau8825_mclk_prepare()
2438 static int nau8825_configure_sysclk(struct nau8825 *nau8825, int clk_id, in nau8825_configure_sysclk() argument
2441 struct regmap *regmap = nau8825->regmap; in nau8825_configure_sysclk()
2448 if (nau8825->mclk_freq) { in nau8825_configure_sysclk()
2449 clk_disable_unprepare(nau8825->mclk); in nau8825_configure_sysclk()
2450 nau8825->mclk_freq = 0; in nau8825_configure_sysclk()
2460 nau8825_sema_acquire(nau8825, 3 * HZ); in nau8825_configure_sysclk()
2466 nau8825_sema_release(nau8825); in nau8825_configure_sysclk()
2468 ret = nau8825_mclk_prepare(nau8825, freq); in nau8825_configure_sysclk()
2474 if (nau8825_is_jack_inserted(nau8825->regmap)) { in nau8825_configure_sysclk()
2494 dev_warn(nau8825->dev, "Disable clock for power saving when no headset connected\n"); in nau8825_configure_sysclk()
2496 if (nau8825->mclk_freq) { in nau8825_configure_sysclk()
2497 clk_disable_unprepare(nau8825->mclk); in nau8825_configure_sysclk()
2498 nau8825->mclk_freq = 0; in nau8825_configure_sysclk()
2508 nau8825_sema_acquire(nau8825, 3 * HZ); in nau8825_configure_sysclk()
2517 nau8825_sema_release(nau8825); in nau8825_configure_sysclk()
2519 ret = nau8825_mclk_prepare(nau8825, freq); in nau8825_configure_sysclk()
2530 nau8825_sema_acquire(nau8825, 3 * HZ); in nau8825_configure_sysclk()
2542 nau8825_sema_release(nau8825); in nau8825_configure_sysclk()
2544 if (nau8825->mclk_freq) { in nau8825_configure_sysclk()
2545 clk_disable_unprepare(nau8825->mclk); in nau8825_configure_sysclk()
2546 nau8825->mclk_freq = 0; in nau8825_configure_sysclk()
2556 nau8825_sema_acquire(nau8825, 3 * HZ); in nau8825_configure_sysclk()
2568 nau8825_sema_release(nau8825); in nau8825_configure_sysclk()
2570 if (nau8825->mclk_freq) { in nau8825_configure_sysclk()
2571 clk_disable_unprepare(nau8825->mclk); in nau8825_configure_sysclk()
2572 nau8825->mclk_freq = 0; in nau8825_configure_sysclk()
2577 dev_err(nau8825->dev, "Invalid clock id (%d)\n", clk_id); in nau8825_configure_sysclk()
2581 dev_dbg(nau8825->dev, "Sysclk is %dHz and clock id is %d\n", freq, in nau8825_configure_sysclk()
2589 struct nau8825 *nau8825 = snd_soc_component_get_drvdata(component); in nau8825_set_sysclk() local
2591 return nau8825_configure_sysclk(nau8825, clk_id, freq); in nau8825_set_sysclk()
2594 static int nau8825_resume_setup(struct nau8825 *nau8825) in nau8825_resume_setup() argument
2596 struct regmap *regmap = nau8825->regmap; in nau8825_resume_setup()
2599 nau8825_configure_sysclk(nau8825, NAU8825_CLK_DIS, 0); in nau8825_resume_setup()
2622 struct nau8825 *nau8825 = snd_soc_component_get_drvdata(component); in nau8825_set_bias_level() local
2634 if (nau8825->mclk_freq) { in nau8825_set_bias_level()
2635 ret = clk_prepare_enable(nau8825->mclk); in nau8825_set_bias_level()
2637 dev_err(nau8825->dev, "Unable to prepare component mclk\n"); in nau8825_set_bias_level()
2642 nau8825_resume_setup(nau8825); in nau8825_set_bias_level()
2649 regmap_update_bits(nau8825->regmap, NAU8825_REG_MIC_BIAS, in nau8825_set_bias_level()
2652 regmap_update_bits(nau8825->regmap, in nau8825_set_bias_level()
2655 nau8825_xtalk_cancel(nau8825); in nau8825_set_bias_level()
2659 regmap_write(nau8825->regmap, in nau8825_set_bias_level()
2662 regmap_update_bits(nau8825->regmap, NAU8825_REG_ENA_CTRL, in nau8825_set_bias_level()
2664 if (nau8825->mclk_freq) in nau8825_set_bias_level()
2665 clk_disable_unprepare(nau8825->mclk); in nau8825_set_bias_level()
2673 struct nau8825 *nau8825 = snd_soc_component_get_drvdata(component); in nau8825_suspend() local
2675 disable_irq(nau8825->irq); in nau8825_suspend()
2678 snd_soc_dapm_disable_pin(nau8825->dapm, "SAR"); in nau8825_suspend()
2679 snd_soc_dapm_disable_pin(nau8825->dapm, "MICBIAS"); in nau8825_suspend()
2680 snd_soc_dapm_sync(nau8825->dapm); in nau8825_suspend()
2681 regcache_cache_only(nau8825->regmap, true); in nau8825_suspend()
2682 regcache_mark_dirty(nau8825->regmap); in nau8825_suspend()
2689 struct nau8825 *nau8825 = snd_soc_component_get_drvdata(component); in nau8825_resume() local
2692 regcache_cache_only(nau8825->regmap, false); in nau8825_resume()
2693 regcache_sync(nau8825->regmap); in nau8825_resume()
2694 nau8825->xtalk_protect = true; in nau8825_resume()
2695 ret = nau8825_sema_acquire(nau8825, 0); in nau8825_resume()
2697 nau8825->xtalk_protect = false; in nau8825_resume()
2698 enable_irq(nau8825->irq); in nau8825_resume()
2736 static void nau8825_print_device_properties(struct nau8825 *nau8825) in nau8825_print_device_properties() argument
2739 struct device *dev = nau8825->dev; in nau8825_print_device_properties()
2741 dev_dbg(dev, "jkdet-enable: %d\n", nau8825->jkdet_enable); in nau8825_print_device_properties()
2742 dev_dbg(dev, "jkdet-pull-enable: %d\n", nau8825->jkdet_pull_enable); in nau8825_print_device_properties()
2743 dev_dbg(dev, "jkdet-pull-up: %d\n", nau8825->jkdet_pull_up); in nau8825_print_device_properties()
2744 dev_dbg(dev, "jkdet-polarity: %d\n", nau8825->jkdet_polarity); in nau8825_print_device_properties()
2745 dev_dbg(dev, "micbias-voltage: %d\n", nau8825->micbias_voltage); in nau8825_print_device_properties()
2746 dev_dbg(dev, "vref-impedance: %d\n", nau8825->vref_impedance); in nau8825_print_device_properties()
2748 dev_dbg(dev, "sar-threshold-num: %d\n", nau8825->sar_threshold_num); in nau8825_print_device_properties()
2749 for (i = 0; i < nau8825->sar_threshold_num; i++) in nau8825_print_device_properties()
2751 nau8825->sar_threshold[i]); in nau8825_print_device_properties()
2753 dev_dbg(dev, "sar-hysteresis: %d\n", nau8825->sar_hysteresis); in nau8825_print_device_properties()
2754 dev_dbg(dev, "sar-voltage: %d\n", nau8825->sar_voltage); in nau8825_print_device_properties()
2755 dev_dbg(dev, "sar-compare-time: %d\n", nau8825->sar_compare_time); in nau8825_print_device_properties()
2756 dev_dbg(dev, "sar-sampling-time: %d\n", nau8825->sar_sampling_time); in nau8825_print_device_properties()
2757 dev_dbg(dev, "short-key-debounce: %d\n", nau8825->key_debounce); in nau8825_print_device_properties()
2759 nau8825->jack_insert_debounce); in nau8825_print_device_properties()
2761 nau8825->jack_eject_debounce); in nau8825_print_device_properties()
2763 nau8825->xtalk_enable); in nau8825_print_device_properties()
2764 dev_dbg(dev, "adcout-drive-strong: %d\n", nau8825->adcout_ds); in nau8825_print_device_properties()
2765 dev_dbg(dev, "adc-delay-ms: %d\n", nau8825->adc_delay); in nau8825_print_device_properties()
2769 struct nau8825 *nau8825) { in nau8825_read_device_properties() argument
2772 nau8825->jkdet_enable = device_property_read_bool(dev, in nau8825_read_device_properties()
2774 nau8825->jkdet_pull_enable = device_property_read_bool(dev, in nau8825_read_device_properties()
2776 nau8825->jkdet_pull_up = device_property_read_bool(dev, in nau8825_read_device_properties()
2779 &nau8825->jkdet_polarity); in nau8825_read_device_properties()
2781 nau8825->jkdet_polarity = 1; in nau8825_read_device_properties()
2783 &nau8825->micbias_voltage); in nau8825_read_device_properties()
2785 nau8825->micbias_voltage = 6; in nau8825_read_device_properties()
2787 &nau8825->vref_impedance); in nau8825_read_device_properties()
2789 nau8825->vref_impedance = 2; in nau8825_read_device_properties()
2791 &nau8825->sar_threshold_num); in nau8825_read_device_properties()
2793 nau8825->sar_threshold_num = 4; in nau8825_read_device_properties()
2795 nau8825->sar_threshold, nau8825->sar_threshold_num); in nau8825_read_device_properties()
2797 nau8825->sar_threshold[0] = 0x08; in nau8825_read_device_properties()
2798 nau8825->sar_threshold[1] = 0x12; in nau8825_read_device_properties()
2799 nau8825->sar_threshold[2] = 0x26; in nau8825_read_device_properties()
2800 nau8825->sar_threshold[3] = 0x73; in nau8825_read_device_properties()
2803 &nau8825->sar_hysteresis); in nau8825_read_device_properties()
2805 nau8825->sar_hysteresis = 0; in nau8825_read_device_properties()
2807 &nau8825->sar_voltage); in nau8825_read_device_properties()
2809 nau8825->sar_voltage = 6; in nau8825_read_device_properties()
2811 &nau8825->sar_compare_time); in nau8825_read_device_properties()
2813 nau8825->sar_compare_time = 1; in nau8825_read_device_properties()
2815 &nau8825->sar_sampling_time); in nau8825_read_device_properties()
2817 nau8825->sar_sampling_time = 1; in nau8825_read_device_properties()
2819 &nau8825->key_debounce); in nau8825_read_device_properties()
2821 nau8825->key_debounce = 3; in nau8825_read_device_properties()
2823 &nau8825->jack_insert_debounce); in nau8825_read_device_properties()
2825 nau8825->jack_insert_debounce = 7; in nau8825_read_device_properties()
2827 &nau8825->jack_eject_debounce); in nau8825_read_device_properties()
2829 nau8825->jack_eject_debounce = 0; in nau8825_read_device_properties()
2830 nau8825->xtalk_enable = device_property_read_bool(dev, in nau8825_read_device_properties()
2832 nau8825->adcout_ds = device_property_read_bool(dev, "nuvoton,adcout-drive-strong"); in nau8825_read_device_properties()
2833 ret = device_property_read_u32(dev, "nuvoton,adc-delay-ms", &nau8825->adc_delay); in nau8825_read_device_properties()
2835 nau8825->adc_delay = 125; in nau8825_read_device_properties()
2836 if (nau8825->adc_delay < 125 || nau8825->adc_delay > 500) in nau8825_read_device_properties()
2839 nau8825->mclk = devm_clk_get_optional(dev, "mclk"); in nau8825_read_device_properties()
2840 if (IS_ERR(nau8825->mclk)) in nau8825_read_device_properties()
2841 return PTR_ERR(nau8825->mclk); in nau8825_read_device_properties()
2842 if (!nau8825->mclk) in nau8825_read_device_properties()
2849 static int nau8825_setup_irq(struct nau8825 *nau8825) in nau8825_setup_irq() argument
2853 ret = devm_request_threaded_irq(nau8825->dev, nau8825->irq, NULL, in nau8825_setup_irq()
2855 "nau8825", nau8825); in nau8825_setup_irq()
2858 dev_err(nau8825->dev, "Cannot request irq %d (%d)\n", in nau8825_setup_irq()
2859 nau8825->irq, ret); in nau8825_setup_irq()
2869 struct nau8825 *nau8825 = dev_get_platdata(&i2c->dev); in nau8825_i2c_probe() local
2872 if (!nau8825) { in nau8825_i2c_probe()
2873 nau8825 = devm_kzalloc(dev, sizeof(*nau8825), GFP_KERNEL); in nau8825_i2c_probe()
2874 if (!nau8825) in nau8825_i2c_probe()
2876 ret = nau8825_read_device_properties(dev, nau8825); in nau8825_i2c_probe()
2881 i2c_set_clientdata(i2c, nau8825); in nau8825_i2c_probe()
2883 nau8825->regmap = devm_regmap_init_i2c(i2c, &nau8825_regmap_config); in nau8825_i2c_probe()
2884 if (IS_ERR(nau8825->regmap)) in nau8825_i2c_probe()
2885 return PTR_ERR(nau8825->regmap); in nau8825_i2c_probe()
2886 nau8825->dev = dev; in nau8825_i2c_probe()
2887 nau8825->irq = i2c->irq; in nau8825_i2c_probe()
2891 nau8825->xtalk_state = NAU8825_XTALK_DONE; in nau8825_i2c_probe()
2892 nau8825->xtalk_protect = false; in nau8825_i2c_probe()
2893 nau8825->xtalk_baktab_initialized = false; in nau8825_i2c_probe()
2894 sema_init(&nau8825->xtalk_sem, 1); in nau8825_i2c_probe()
2895 INIT_WORK(&nau8825->xtalk_work, nau8825_xtalk_work); in nau8825_i2c_probe()
2897 nau8825_print_device_properties(nau8825); in nau8825_i2c_probe()
2899 nau8825_reset_chip(nau8825->regmap); in nau8825_i2c_probe()
2900 ret = regmap_read(nau8825->regmap, NAU8825_REG_I2C_DEVICE_ID, &value); in nau8825_i2c_probe()
2902 dev_err(dev, "Failed to read device id from the NAU8825: %d\n", in nau8825_i2c_probe()
2906 nau8825->sw_id = value & NAU8825_SOFTWARE_ID_MASK; in nau8825_i2c_probe()
2907 switch (nau8825->sw_id) { in nau8825_i2c_probe()
2911 ret = regmap_register_patch(nau8825->regmap, nau8825_regmap_patch, in nau8825_i2c_probe()
2919 dev_err(dev, "Not a NAU8825 chip\n"); in nau8825_i2c_probe()
2923 nau8825_init_regs(nau8825); in nau8825_i2c_probe()
2926 nau8825_setup_irq(nau8825); in nau8825_i2c_probe()
2937 { "nau8825" },
2944 { .compatible = "nuvoton,nau8825", },
2960 .name = "nau8825",
2970 MODULE_DESCRIPTION("ASoC nau8825 driver");