Lines Matching +full:adc +full:- +full:channel +full:- +full:clk +full:- +full:src

1 // SPDX-License-Identifier: GPL-2.0-only
3 // nau8821.c -- Nuvoton NAU88L21 audio codec driver
7 // Co-author: Seven Lee <[email protected]>
11 #include <linux/clk.h>
32 static int quirk_override = -1;
34 MODULE_PARM_DESC(quirk, "Board-specific quirk override");
79 /* ratio for input clk freq */
104 { 64, 2 }, /* OSR 64, SRC 1/4 */
105 { 256, 0 }, /* OSR 256, SRC 1 */
106 { 128, 1 }, /* OSR 128, SRC 1/2 */
108 { 32, 3 }, /* OSR 32, SRC 1/8 */
112 { 32, 3 }, /* OSR 32, SRC 1/8 */
113 { 64, 2 }, /* OSR 64, SRC 1/4 */
114 { 128, 1 }, /* OSR 128, SRC 1/2 */
115 { 256, 0 }, /* OSR 256, SRC 1 */
124 { 0, 0x0 }, /*SPEED 1, SRC 1 */
125 { 1, 0x1 }, /*SPEED 2, SRC 1/2 */
126 { 2, 0x2 }, /*SPEED 4, SRC 1/4 */
127 { 3, 0x3 }, /*SPEED 8, SRC 1/8 */
285 struct soc_bytes_ext *params = (void *)kcontrol->private_value; in nau8821_biq_coeff_get()
287 if (!component->regmap) in nau8821_biq_coeff_get()
288 return -EINVAL; in nau8821_biq_coeff_get()
290 return regmap_raw_read(component->regmap, NAU8821_R21_BIQ0_COF1, in nau8821_biq_coeff_get()
291 ucontrol->value.bytes.data, params->max); in nau8821_biq_coeff_get()
298 struct soc_bytes_ext *params = (void *)kcontrol->private_value; in nau8821_biq_coeff_put()
302 if (!component->regmap) in nau8821_biq_coeff_put()
303 return -EINVAL; in nau8821_biq_coeff_put()
305 data = kmemdup(ucontrol->value.bytes.data, in nau8821_biq_coeff_put()
306 params->max, GFP_KERNEL | GFP_DMA); in nau8821_biq_coeff_put()
308 return -ENOMEM; in nau8821_biq_coeff_put()
310 ret = regmap_raw_write(component->regmap, NAU8821_R21_BIQ0_COF1, in nau8821_biq_coeff_put()
311 data, params->max); in nau8821_biq_coeff_put()
410 static const DECLARE_TLV_DB_MINMAX_MUTE(adc_vol_tlv, -6600, 2400);
411 static const DECLARE_TLV_DB_MINMAX_MUTE(sidetone_vol_tlv, -4200, 0);
412 static const DECLARE_TLV_DB_MINMAX(hp_vol_tlv, -900, 0);
413 static const DECLARE_TLV_DB_SCALE(playback_vol_tlv, -6600, 50, 1);
414 static const DECLARE_TLV_DB_MINMAX(fepga_gain_tlv, -100, 3600);
415 static const DECLARE_TLV_DB_MINMAX_MUTE(crosstalk_vol_tlv, -7000, 2400);
416 static const DECLARE_TLV_DB_MINMAX(drc_knee4_tlv, -9800, -3500);
417 static const DECLARE_TLV_DB_MINMAX(drc_knee3_tlv, -8100, -1800);
436 SOC_SINGLE_TLV("ADC DRC KNEE4", NAU8821_R37_ADC_DRC_KNEE_IP34,
438 SOC_SINGLE_TLV("ADC DRC KNEE3", NAU8821_R37_ADC_DRC_KNEE_IP34,
441 SOC_ENUM("ADC DRC Noise Gate", nau8821_adc_drc_noise_gate_enum),
442 SOC_ENUM("ADC DRC Expansion Slope", nau8821_adc_drc_expansion_slope_enum),
443 SOC_ENUM("ADC DRC Lower Region", nau8821_adc_drc_lower_region_enum),
444 SOC_ENUM("ADC DRC Higher Region", nau8821_higher_region_enum),
445 SOC_ENUM("ADC DRC Limiter Slope", nau8821_limiter_slope_enum),
446 SOC_ENUM("ADC DRC Peak Detection Attack Time", nau8821_detection_attack_time_enum),
447 SOC_ENUM("ADC DRC Peak Detection Release Time", nau8821_detection_release_time_enum),
448 SOC_ENUM("ADC DRC Attack Time", nau8821_attack_time_enum),
449 SOC_ENUM("ADC DRC Decay Time", nau8821_decay_time_enum),
453 SOC_ENUM("ADC Decimation Rate", nau8821_adc_decimation_enum),
457 SOC_SINGLE("ADC Phase Switch", NAU8821_R1B_TDM_CTRL,
469 snd_soc_dapm_to_component(w->dapm); in dmic_clock_control()
471 int i, speed_selection = -1, clk_adc_src, clk_adc; in dmic_clock_control()
474 /* The DMIC clock is gotten from adc clock divided by in dmic_clock_control()
476 * less than nau8821->dmic_clk_threshold. in dmic_clock_control()
478 regmap_read(nau8821->regmap, NAU8821_R03_CLK_DIVIDER, in dmic_clock_control()
482 clk_adc = (nau8821->fs * 256) >> clk_adc_src; in dmic_clock_control()
486 nau8821->dmic_clk_threshold) { in dmic_clock_control()
491 return -EINVAL; in dmic_clock_control()
493 dev_dbg(nau8821->dev, in dmic_clock_control()
495 clk_adc, nau8821->dmic_clk_threshold, in dmic_clock_control()
497 regmap_update_bits(nau8821->regmap, NAU8821_R13_DMIC_CTRL, in dmic_clock_control()
508 snd_soc_dapm_to_component(w->dapm); in nau8821_left_adc_event()
513 msleep(nau8821->adc_delay); in nau8821_left_adc_event()
518 return -EINVAL; in nau8821_left_adc_event()
528 snd_soc_dapm_to_component(w->dapm); in nau8821_right_adc_event()
533 msleep(nau8821->adc_delay); in nau8821_right_adc_event()
538 return -EINVAL; in nau8821_right_adc_event()
548 snd_soc_dapm_to_component(w->dapm); in nau8821_pump_event()
556 regmap_update_bits(nau8821->regmap, NAU8821_R80_CHARGE_PUMP, in nau8821_pump_event()
560 regmap_update_bits(nau8821->regmap, NAU8821_R80_CHARGE_PUMP, in nau8821_pump_event()
564 return -EINVAL; in nau8821_pump_event()
574 snd_soc_dapm_to_component(w->dapm); in nau8821_output_dac_event()
580 regmap_update_bits(nau8821->regmap, NAU8821_R66_BIAS_ADJ, in nau8821_output_dac_event()
584 regmap_update_bits(nau8821->regmap, NAU8821_R66_BIAS_ADJ, in nau8821_output_dac_event()
588 return -EINVAL; in nau8821_output_dac_event()
598 snd_soc_dapm_to_component(w->dapm); in system_clock_control()
602 dev_dbg(nau8821->dev, "system clock control : POWER OFF\n"); in system_clock_control()
608 if (nau8821_is_jack_inserted(nau8821->regmap)) { in system_clock_control()
621 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in nau8821_left_fepga_event()
624 if (!nau8821->left_input_single_end) in nau8821_left_fepga_event()
629 regmap_update_bits(nau8821->regmap, NAU8821_R77_FEPGA, in nau8821_left_fepga_event()
632 regmap_update_bits(nau8821->regmap, NAU8821_R76_BOOST, in nau8821_left_fepga_event()
636 regmap_update_bits(nau8821->regmap, NAU8821_R77_FEPGA, in nau8821_left_fepga_event()
638 regmap_update_bits(nau8821->regmap, NAU8821_R76_BOOST, in nau8821_left_fepga_event()
659 /* single-ended design only on the left */
723 /* HPOL/R are ungrounded by disabling 16 Ohm pull-downs on playback */
806 regmap_read(nau8821->regmap, NAU8821_R2C_DAC_CTRL1, &osr); in nau8821_get_osr()
812 regmap_read(nau8821->regmap, NAU8821_R2B_ADC_RATE, &osr); in nau8821_get_osr()
823 struct snd_soc_component *component = dai->component; in nau8821_dai_startup()
827 osr = nau8821_get_osr(nau8821, substream->stream); in nau8821_dai_startup()
828 if (!osr || !osr->osr) in nau8821_dai_startup()
829 return -EINVAL; in nau8821_dai_startup()
831 return snd_pcm_hw_constraint_minmax(substream->runtime, in nau8821_dai_startup()
833 0, CLK_DA_AD_MAX / osr->osr); in nau8821_dai_startup()
839 struct snd_soc_component *component = dai->component; in nau8821_hw_params()
844 nau8821->fs = params_rate(params); in nau8821_hw_params()
846 * DAC or ADC clock frequency is defined as Over Sampling Rate (OSR) in nau8821_hw_params()
851 osr = nau8821_get_osr(nau8821, substream->stream); in nau8821_hw_params()
852 if (!osr || !osr->osr) in nau8821_hw_params()
853 return -EINVAL; in nau8821_hw_params()
854 if (nau8821->fs * osr->osr > CLK_DA_AD_MAX) in nau8821_hw_params()
855 return -EINVAL; in nau8821_hw_params()
856 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) in nau8821_hw_params()
857 regmap_update_bits(nau8821->regmap, NAU8821_R03_CLK_DIVIDER, in nau8821_hw_params()
859 osr->clk_src << NAU8821_CLK_DAC_SRC_SFT); in nau8821_hw_params()
861 regmap_update_bits(nau8821->regmap, NAU8821_R03_CLK_DIVIDER, in nau8821_hw_params()
863 osr->clk_src << NAU8821_CLK_ADC_SRC_SFT); in nau8821_hw_params()
866 regmap_read(nau8821->regmap, NAU8821_R1D_I2S_PCM_CTRL2, &ctrl_val); in nau8821_hw_params()
869 bclk_fs = snd_soc_params_to_bclk(params) / nau8821->fs; in nau8821_hw_params()
877 return -EINVAL; in nau8821_hw_params()
879 regmap_update_bits(nau8821->regmap, NAU8821_R1D_I2S_PCM_CTRL2, in nau8821_hw_params()
898 return -EINVAL; in nau8821_hw_params()
901 regmap_update_bits(nau8821->regmap, NAU8821_R1C_I2S_PCM_CTRL1, in nau8821_hw_params()
909 struct snd_soc_component *component = codec_dai->component; in nau8821_set_dai_fmt()
920 return -EINVAL; in nau8821_set_dai_fmt()
930 return -EINVAL; in nau8821_set_dai_fmt()
951 return -EINVAL; in nau8821_set_dai_fmt()
954 regmap_update_bits(nau8821->regmap, NAU8821_R1C_I2S_PCM_CTRL1, in nau8821_set_dai_fmt()
957 regmap_update_bits(nau8821->regmap, NAU8821_R1D_I2S_PCM_CTRL2, in nau8821_set_dai_fmt()
966 struct snd_soc_component *component = dai->component; in nau8821_digital_mute()
973 return regmap_update_bits(nau8821->regmap, in nau8821_digital_mute()
1028 /* Reset the intrruption status from rightmost bit if the corres- in nau8821_int_status_clear_all()
1042 struct snd_soc_dapm_context *dapm = nau8821->dapm; in nau8821_eject_jack()
1043 struct regmap *regmap = nau8821->regmap; in nau8821_eject_jack()
1058 /* Enable the insertion interruption, disable the ejection inter- in nau8821_eject_jack()
1059 * ruption, and then bypass de-bounce circuit. in nau8821_eject_jack()
1064 /* Mask unneeded IRQs: 1 - disable, 0 - enable */ in nau8821_eject_jack()
1073 if (dapm->bias_level < SND_SOC_BIAS_PREPARE) in nau8821_eject_jack()
1076 /* Recover to normal channel input */ in nau8821_eject_jack()
1079 if (nau8821->key_enable) { in nau8821_eject_jack()
1099 struct snd_soc_dapm_context *dapm = nau8821->dapm; in nau8821_jdet_work()
1101 struct regmap *regmap = nau8821->regmap; in nau8821_jdet_work()
1111 dev_dbg(nau8821->dev, "Headset connected\n"); in nau8821_jdet_work()
1117 /* Latch Right Channel Analog data in nau8821_jdet_work()
1118 * input into the Right Channel Filter in nau8821_jdet_work()
1122 if (nau8821->key_enable) { in nau8821_jdet_work()
1132 snd_soc_dapm_sync(nau8821->dapm); in nau8821_jdet_work()
1135 dev_dbg(nau8821->dev, "Headphone connected\n"); in nau8821_jdet_work()
1141 snd_soc_jack_report(nau8821->jack, event, event_mask); in nau8821_jdet_work()
1147 struct regmap *regmap = nau8821->regmap; in nau8821_setup_inserted_irq()
1150 if (nau8821->dapm->bias_level < SND_SOC_BIAS_PREPARE) in nau8821_setup_inserted_irq()
1163 /* Not bypass de-bounce circuit */ in nau8821_setup_inserted_irq()
1176 struct regmap *regmap = nau8821->regmap; in nau8821_interrupt()
1180 dev_err(nau8821->dev, "failed to read irq status\n"); in nau8821_interrupt()
1184 dev_dbg(nau8821->dev, "IRQ %d\n", active_irq); in nau8821_interrupt()
1206 cancel_work_sync(&nau8821->jdet_work); in nau8821_interrupt()
1207 schedule_work(&nau8821->jdet_work); in nau8821_interrupt()
1219 dev_warn(nau8821->dev, in nau8821_interrupt()
1231 snd_soc_jack_report(nau8821->jack, event, event_mask); in nau8821_interrupt()
1256 nau8821->dapm = dapm; in nau8821_component_probe()
1262 * nau8821_calc_fll_param - Calculate FLL parameters.
1278 * dividing freq_in by 1, 2, 4, or 8 using FLL pre-scalar. in nau8821_calc_fll_param()
1287 return -EINVAL; in nau8821_calc_fll_param()
1288 fll_param->clk_ref_div = fll_pre_scalar[i].val; in nau8821_calc_fll_param()
1296 return -EINVAL; in nau8821_calc_fll_param()
1297 fll_param->ratio = fll_ratio[i].val; in nau8821_calc_fll_param()
1300 * FDCO must be within the 90MHz - 100MHz or the FFL cannot be in nau8821_calc_fll_param()
1315 return -EINVAL; in nau8821_calc_fll_param()
1316 fll_param->mclk_src = mclk_src_scaling[fvco_sel].val; in nau8821_calc_fll_param()
1318 /* Calculate the FLL 10-bit integer input and the FLL 24-bit fractional in nau8821_calc_fll_param()
1321 fvco = div_u64(fvco_max << 24, fref * fll_param->ratio); in nau8821_calc_fll_param()
1322 fll_param->fll_int = (fvco >> 24) & 0x3ff; in nau8821_calc_fll_param()
1323 fll_param->fll_frac = fvco & 0xffffff; in nau8821_calc_fll_param()
1331 struct regmap *regmap = nau8821->regmap; in nau8821_fll_apply()
1335 NAU8821_CLK_SRC_MCLK | fll_param->mclk_src); in nau8821_fll_apply()
1339 fll_param->ratio | (0x6 << NAU8821_ICTRL_LATCH_SFT)); in nau8821_fll_apply()
1340 /* FLL 24-bit fractional input */ in nau8821_fll_apply()
1342 (fll_param->fll_frac >> 16) & 0xff); in nau8821_fll_apply()
1343 regmap_write(regmap, NAU8821_R0B_FLL8, fll_param->fll_frac & 0xffff); in nau8821_fll_apply()
1344 /* FLL 10-bit integer input */ in nau8821_fll_apply()
1346 NAU8821_FLL_INTEGER_MASK, fll_param->fll_int); in nau8821_fll_apply()
1347 /* FLL pre-scaler */ in nau8821_fll_apply()
1351 (fll_param->clk_ref_div << NAU8821_FLL_REF_DIV_SFT)); in nau8821_fll_apply()
1355 /* Disable free-running mode */ in nau8821_fll_apply()
1358 if (fll_param->fll_frac) { in nau8821_fll_apply()
1379 * nau8821_set_fll - FLL configuration of nau8821
1401 dev_err(nau8821->dev, in nau8821_set_fll()
1406 dev_dbg(nau8821->dev, in nau8821_set_fll()
1408 fll_param->mclk_src, fll_param->ratio, fll_param->fll_frac, in nau8821_set_fll()
1409 fll_param->fll_int, fll_param->clk_ref_div); in nau8821_set_fll()
1413 regmap_update_bits(nau8821->regmap, NAU8821_R03_CLK_DIVIDER, in nau8821_set_fll()
1433 struct regmap *regmap = nau8821->regmap; in nau8821_configure_sysclk()
1498 dev_err(nau8821->dev, "Invalid clock id (%d)\n", clk_id); in nau8821_configure_sysclk()
1499 return -EINVAL; in nau8821_configure_sysclk()
1501 nau8821->clk_id = clk_id; in nau8821_configure_sysclk()
1502 dev_dbg(nau8821->dev, "Sysclk is %dHz and clock id is %d\n", freq, in nau8821_configure_sysclk()
1503 nau8821->clk_id); in nau8821_configure_sysclk()
1518 struct regmap *regmap = nau8821->regmap; in nau8821_resume_setup()
1522 if (nau8821->irq) { in nau8821_resume_setup()
1527 * bypass de-bounce circuit. in nau8821_resume_setup()
1545 struct regmap *regmap = nau8821->regmap; in nau8821_set_bias_level()
1565 if (nau8821->irq) { in nau8821_set_bias_level()
1593 if (nau8821->irq) in nau8821_suspend()
1594 disable_irq(nau8821->irq); in nau8821_suspend()
1598 snd_soc_dapm_sync(nau8821->dapm); in nau8821_suspend()
1599 regcache_cache_only(nau8821->regmap, true); in nau8821_suspend()
1600 regcache_mark_dirty(nau8821->regmap); in nau8821_suspend()
1609 regcache_cache_only(nau8821->regmap, false); in nau8821_resume()
1610 regcache_sync(nau8821->regmap); in nau8821_resume()
1611 if (nau8821->irq) in nau8821_resume()
1612 enable_irq(nau8821->irq); in nau8821_resume()
1637 * nau8821_enable_jack_detect - Specify a jack for event reporting
1652 nau8821->jack = jack; in nau8821_enable_jack_detect()
1654 INIT_WORK(&nau8821->jdet_work, nau8821_jdet_work); in nau8821_enable_jack_detect()
1655 ret = devm_request_threaded_irq(nau8821->dev, nau8821->irq, NULL, in nau8821_enable_jack_detect()
1659 dev_err(nau8821->dev, "Cannot request irq %d (%d)\n", in nau8821_enable_jack_detect()
1660 nau8821->irq, ret); in nau8821_enable_jack_detect()
1676 struct device *dev = nau8821->dev; in nau8821_print_device_properties()
1678 dev_dbg(dev, "jkdet-enable: %d\n", nau8821->jkdet_enable); in nau8821_print_device_properties()
1679 dev_dbg(dev, "jkdet-pull-enable: %d\n", nau8821->jkdet_pull_enable); in nau8821_print_device_properties()
1680 dev_dbg(dev, "jkdet-pull-up: %d\n", nau8821->jkdet_pull_up); in nau8821_print_device_properties()
1681 dev_dbg(dev, "jkdet-polarity: %d\n", nau8821->jkdet_polarity); in nau8821_print_device_properties()
1682 dev_dbg(dev, "micbias-voltage: %d\n", nau8821->micbias_voltage); in nau8821_print_device_properties()
1683 dev_dbg(dev, "vref-impedance: %d\n", nau8821->vref_impedance); in nau8821_print_device_properties()
1684 dev_dbg(dev, "jack-insert-debounce: %d\n", in nau8821_print_device_properties()
1685 nau8821->jack_insert_debounce); in nau8821_print_device_properties()
1686 dev_dbg(dev, "jack-eject-debounce: %d\n", in nau8821_print_device_properties()
1687 nau8821->jack_eject_debounce); in nau8821_print_device_properties()
1688 dev_dbg(dev, "dmic-clk-threshold: %d\n", in nau8821_print_device_properties()
1689 nau8821->dmic_clk_threshold); in nau8821_print_device_properties()
1690 dev_dbg(dev, "key_enable: %d\n", nau8821->key_enable); in nau8821_print_device_properties()
1691 dev_dbg(dev, "adc-delay-ms: %d\n", nau8821->adc_delay); in nau8821_print_device_properties()
1699 nau8821->jkdet_enable = device_property_read_bool(dev, in nau8821_read_device_properties()
1700 "nuvoton,jkdet-enable"); in nau8821_read_device_properties()
1701 nau8821->jkdet_pull_enable = device_property_read_bool(dev, in nau8821_read_device_properties()
1702 "nuvoton,jkdet-pull-enable"); in nau8821_read_device_properties()
1703 nau8821->jkdet_pull_up = device_property_read_bool(dev, in nau8821_read_device_properties()
1704 "nuvoton,jkdet-pull-up"); in nau8821_read_device_properties()
1705 nau8821->key_enable = device_property_read_bool(dev, in nau8821_read_device_properties()
1706 "nuvoton,key-enable"); in nau8821_read_device_properties()
1707 nau8821->left_input_single_end = device_property_read_bool(dev, in nau8821_read_device_properties()
1708 "nuvoton,left-input-single-end"); in nau8821_read_device_properties()
1709 ret = device_property_read_u32(dev, "nuvoton,jkdet-polarity", in nau8821_read_device_properties()
1710 &nau8821->jkdet_polarity); in nau8821_read_device_properties()
1712 nau8821->jkdet_polarity = 1; in nau8821_read_device_properties()
1713 ret = device_property_read_u32(dev, "nuvoton,micbias-voltage", in nau8821_read_device_properties()
1714 &nau8821->micbias_voltage); in nau8821_read_device_properties()
1716 nau8821->micbias_voltage = 6; in nau8821_read_device_properties()
1717 ret = device_property_read_u32(dev, "nuvoton,vref-impedance", in nau8821_read_device_properties()
1718 &nau8821->vref_impedance); in nau8821_read_device_properties()
1720 nau8821->vref_impedance = 2; in nau8821_read_device_properties()
1721 ret = device_property_read_u32(dev, "nuvoton,jack-insert-debounce", in nau8821_read_device_properties()
1722 &nau8821->jack_insert_debounce); in nau8821_read_device_properties()
1724 nau8821->jack_insert_debounce = 7; in nau8821_read_device_properties()
1725 ret = device_property_read_u32(dev, "nuvoton,jack-eject-debounce", in nau8821_read_device_properties()
1726 &nau8821->jack_eject_debounce); in nau8821_read_device_properties()
1728 nau8821->jack_eject_debounce = 0; in nau8821_read_device_properties()
1729 ret = device_property_read_u32(dev, "nuvoton,dmic-clk-threshold", in nau8821_read_device_properties()
1730 &nau8821->dmic_clk_threshold); in nau8821_read_device_properties()
1732 nau8821->dmic_clk_threshold = 3072000; in nau8821_read_device_properties()
1733 ret = device_property_read_u32(dev, "nuvoton,dmic-slew-rate", in nau8821_read_device_properties()
1734 &nau8821->dmic_slew_rate); in nau8821_read_device_properties()
1736 nau8821->dmic_slew_rate = 0; in nau8821_read_device_properties()
1737 ret = device_property_read_u32(dev, "nuvoton,adc-delay-ms", in nau8821_read_device_properties()
1738 &nau8821->adc_delay); in nau8821_read_device_properties()
1740 nau8821->adc_delay = 125; in nau8821_read_device_properties()
1741 if (nau8821->adc_delay < 125 || nau8821->adc_delay > 500) in nau8821_read_device_properties()
1749 struct regmap *regmap = nau8821->regmap; in nau8821_init_regs()
1763 (nau8821->vref_impedance << NAU8821_BIAS_VMID_SEL_SFT) | in nau8821_init_regs()
1794 NAU8821_MICBIAS_VOLTAGE_MASK, nau8821->micbias_voltage); in nau8821_init_regs()
1803 NAU8821_DMIC_SLEW_MASK, nau8821->dmic_slew_rate << in nau8821_init_regs()
1805 if (nau8821->left_input_single_end) { in nau8821_init_regs()
1815 struct regmap *regmap = nau8821->regmap; in nau8821_setup_irq()
1820 nau8821->jkdet_enable ? 0 : NAU8821_JKDET_OUTPUT_EN); in nau8821_setup_irq()
1823 nau8821->jkdet_pull_enable ? 0 : NAU8821_JKDET_PULL_EN); in nau8821_setup_irq()
1826 nau8821->jkdet_pull_up ? NAU8821_JKDET_PULL_UP : 0); in nau8821_setup_irq()
1829 /* jkdet_polarity - 1 is for active-low */ in nau8821_setup_irq()
1830 nau8821->jkdet_polarity ? 0 : NAU8821_JACK_POLARITY); in nau8821_setup_irq()
1833 nau8821->jack_insert_debounce << in nau8821_setup_irq()
1837 nau8821->jack_eject_debounce << in nau8821_setup_irq()
1845 /* Mask unneeded IRQs: 1 - disable, 0 - enable */ in nau8821_setup_irq()
1854 /* Positivo CW14Q01P-V2 */
1857 DMI_MATCH(DMI_BOARD_NAME, "CW14Q01P-V2"),
1868 if (quirk_override != -1) { in nau8821_check_quirks()
1875 nau8821_quirk = (unsigned long)dmi_id->driver_data; in nau8821_check_quirks()
1880 struct device *dev = &i2c->dev; in nau8821_i2c_probe()
1881 struct nau8821 *nau8821 = dev_get_platdata(&i2c->dev); in nau8821_i2c_probe()
1887 return -ENOMEM; in nau8821_i2c_probe()
1892 nau8821->regmap = devm_regmap_init_i2c(i2c, &nau8821_regmap_config); in nau8821_i2c_probe()
1893 if (IS_ERR(nau8821->regmap)) in nau8821_i2c_probe()
1894 return PTR_ERR(nau8821->regmap); in nau8821_i2c_probe()
1896 nau8821->dev = dev; in nau8821_i2c_probe()
1897 nau8821->irq = i2c->irq; in nau8821_i2c_probe()
1902 nau8821->jkdet_polarity = 0; in nau8821_i2c_probe()
1906 nau8821_reset_chip(nau8821->regmap); in nau8821_i2c_probe()
1907 ret = regmap_read(nau8821->regmap, NAU8821_R58_I2C_DEVICE_ID, &value); in nau8821_i2c_probe()
1914 if (i2c->irq) in nau8821_i2c_probe()
1917 ret = devm_snd_soc_register_component(&i2c->dev, in nau8821_i2c_probe()