Lines Matching +full:internal +full:- +full:bias +full:- +full:resistor

1 // SPDX-License-Identifier: GPL-2.0
109 #define MICB_VOLTAGE_REGVAL(v) (((v - MICB_MIN_VAL)/MICB_STEP_SIZE) << 3)
283 "vdd-cdc-io",
284 "vdd-cdc-tx-rx-cx",
302 /* Voltage threshold when internal current source of 100uA is used */
304 /* Voltage threshold when microphone bias is ON */
358 if (wcd->micbias_mv) { in pm8916_wcd_analog_micbias_enable()
361 MICB_VOLTAGE_REGVAL(wcd->micbias_mv)); in pm8916_wcd_analog_micbias_enable()
366 if (wcd->micbias_mv >= 2700) in pm8916_wcd_analog_micbias_enable()
394 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in pm8916_wcd_analog_enable_micbias_int()
411 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in pm8916_wcd_analog_enable_micbias1()
415 wcd->micbias1_cap_mode); in pm8916_wcd_analog_enable_micbias1()
422 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in pm8916_wcd_analog_enable_micbias2()
426 wcd->micbias2_cap_mode); in pm8916_wcd_analog_enable_micbias2()
433 struct snd_soc_component *component = priv->component; in pm8916_mbhc_configure_bias()
437 if (!micbias2_enabled) { /* use internal 100uA Current source */ in pm8916_mbhc_configure_bias()
438 /* Enable internal 2.2k Internal Rbias Resistor */ in pm8916_mbhc_configure_bias()
446 /* enable 100uA internal current source */ in pm8916_mbhc_configure_bias()
456 vrefs = &priv->vref_btn_micb[0]; in pm8916_mbhc_configure_bias()
458 vrefs = &priv->vref_btn_cs[0]; in pm8916_mbhc_configure_bias()
479 struct snd_soc_component *component = wcd->component; in pm8916_wcd_setup_mbhc()
490 if (wcd->hphl_jack_type_normally_open) in pm8916_wcd_setup_mbhc()
493 if (wcd->gnd_jack_type_normally_open) in pm8916_wcd_setup_mbhc()
518 if (wcd->mbhc_btn_enabled) in pm8916_wcd_setup_mbhc()
523 wcd->mbhc_btn0_released = false; in pm8916_wcd_setup_mbhc()
524 wcd->detect_accessory_type = true; in pm8916_wcd_setup_mbhc()
532 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in pm8916_wcd_analog_enable_micbias_int2()
555 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in pm8916_wcd_analog_enable_adc()
559 if (w->reg == CDC_A_TX_1_EN) in pm8916_wcd_analog_enable_adc()
566 if (w->reg == CDC_A_TX_2_EN) in pm8916_wcd_analog_enable_adc()
578 switch (w->reg) { in pm8916_wcd_analog_enable_adc()
601 switch (w->reg) { in pm8916_wcd_analog_enable_adc()
628 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in pm8916_wcd_analog_enable_spk_pa()
650 snd_soc_component_update_bits(component, w->reg, in pm8916_wcd_analog_enable_spk_pa()
675 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in pm8916_wcd_analog_enable_ear_pa()
720 struct pm8916_wcd_analog_priv *priv = dev_get_drvdata(component->dev); in pm8916_wcd_analog_probe()
723 err = regulator_bulk_enable(ARRAY_SIZE(priv->supplies), priv->supplies); in pm8916_wcd_analog_probe()
725 dev_err(component->dev, "failed to enable regulators (%d)\n", err); in pm8916_wcd_analog_probe()
730 dev_get_regmap(component->dev->parent, NULL)); in pm8916_wcd_analog_probe()
732 priv->pmic_rev = snd_soc_component_read(component, CDC_D_REVISION1); in pm8916_wcd_analog_probe()
733 priv->codec_version = snd_soc_component_read(component, CDC_D_PERPH_SUBTYPE); in pm8916_wcd_analog_probe()
735 dev_info(component->dev, "PMIC REV: %d\t CODEC Version: %d\n", in pm8916_wcd_analog_probe()
736 priv->pmic_rev, priv->codec_version); in pm8916_wcd_analog_probe()
745 priv->component = component; in pm8916_wcd_analog_probe()
758 struct pm8916_wcd_analog_priv *priv = dev_get_drvdata(component->dev); in pm8916_wcd_analog_remove()
763 regulator_bulk_disable(ARRAY_SIZE(priv->supplies), in pm8916_wcd_analog_remove()
764 priv->supplies); in pm8916_wcd_analog_remove()
851 {"MIC_BIAS1", NULL, "vdd-micbias"},
852 {"MIC_BIAS2", NULL, "vdd-micbias"},
854 {"MIC BIAS External1", NULL, "MIC_BIAS1"},
855 {"MIC BIAS Internal1", NULL, "MIC_BIAS1"},
856 {"MIC BIAS External2", NULL, "MIC_BIAS2"},
857 {"MIC BIAS Internal2", NULL, "MIC_BIAS2"},
858 {"MIC BIAS Internal3", NULL, "MIC_BIAS1"},
904 SND_SOC_DAPM_REGULATOR_SUPPLY("vdd-micbias", 0, 0),
918 SND_SOC_DAPM_SUPPLY("MIC BIAS External1", SND_SOC_NOPM, 0, 0, NULL, 0),
919 SND_SOC_DAPM_SUPPLY("MIC BIAS External2", SND_SOC_NOPM, 0, 0, NULL, 0),
921 SND_SOC_DAPM_SUPPLY("MIC BIAS Internal1", CDC_A_MICB_1_INT_RBIAS, 7, 0,
924 SND_SOC_DAPM_SUPPLY("MIC BIAS Internal2", CDC_A_MICB_1_INT_RBIAS, 4, 0,
928 SND_SOC_DAPM_SUPPLY("MIC BIAS Internal3", CDC_A_MICB_1_INT_RBIAS, 1, 0,
982 wcd->jack = jack; in pm8916_wcd_analog_set_jack()
991 if (priv->detect_accessory_type) { in mbhc_btn_release_irq_handler()
992 struct snd_soc_component *component = priv->component; in mbhc_btn_release_irq_handler()
996 if ((val != -1) && !(val & CDC_A_MBHC_RESULT_1_BTN_RESULT_MASK)) in mbhc_btn_release_irq_handler()
997 priv->mbhc_btn0_released = true; in mbhc_btn_release_irq_handler()
1000 snd_soc_jack_report(priv->jack, 0, btn_mask); in mbhc_btn_release_irq_handler()
1009 struct snd_soc_component *component = priv->component; in mbhc_btn_press_irq_handler()
1017 snd_soc_jack_report(priv->jack, SND_JACK_BTN_4, btn_mask); in mbhc_btn_press_irq_handler()
1020 snd_soc_jack_report(priv->jack, SND_JACK_BTN_3, btn_mask); in mbhc_btn_press_irq_handler()
1023 snd_soc_jack_report(priv->jack, SND_JACK_BTN_2, btn_mask); in mbhc_btn_press_irq_handler()
1026 snd_soc_jack_report(priv->jack, SND_JACK_BTN_1, btn_mask); in mbhc_btn_press_irq_handler()
1030 if (!priv->detect_accessory_type) in mbhc_btn_press_irq_handler()
1031 snd_soc_jack_report(priv->jack, in mbhc_btn_press_irq_handler()
1035 dev_err(component->dev, in mbhc_btn_press_irq_handler()
1046 struct snd_soc_component *component = priv->component; in pm8916_mbhc_switch_irq_handler()
1074 if (priv->mbhc_btn0_released) in pm8916_mbhc_switch_irq_handler()
1075 snd_soc_jack_report(priv->jack, in pm8916_mbhc_switch_irq_handler()
1078 snd_soc_jack_report(priv->jack, in pm8916_mbhc_switch_irq_handler()
1081 priv->detect_accessory_type = false; in pm8916_mbhc_switch_irq_handler()
1084 snd_soc_jack_report(priv->jack, 0, hs_jack_mask); in pm8916_mbhc_switch_irq_handler()
1085 priv->detect_accessory_type = true; in pm8916_mbhc_switch_irq_handler()
1086 priv->mbhc_btn0_released = false; in pm8916_mbhc_switch_irq_handler()
1137 if (of_property_read_bool(dev->of_node, "qcom,micbias1-ext-cap")) in pm8916_wcd_analog_parse_dt()
1138 priv->micbias1_cap_mode = MICB_1_EN_EXT_BYP_CAP; in pm8916_wcd_analog_parse_dt()
1140 priv->micbias1_cap_mode = MICB_1_EN_NO_EXT_BYP_CAP; in pm8916_wcd_analog_parse_dt()
1142 if (of_property_read_bool(dev->of_node, "qcom,micbias2-ext-cap")) in pm8916_wcd_analog_parse_dt()
1143 priv->micbias2_cap_mode = MICB_1_EN_EXT_BYP_CAP; in pm8916_wcd_analog_parse_dt()
1145 priv->micbias2_cap_mode = MICB_1_EN_NO_EXT_BYP_CAP; in pm8916_wcd_analog_parse_dt()
1147 of_property_read_u32(dev->of_node, "qcom,micbias-lvl", in pm8916_wcd_analog_parse_dt()
1148 &priv->micbias_mv); in pm8916_wcd_analog_parse_dt()
1150 if (of_property_read_bool(dev->of_node, in pm8916_wcd_analog_parse_dt()
1151 "qcom,hphl-jack-type-normally-open")) in pm8916_wcd_analog_parse_dt()
1152 priv->hphl_jack_type_normally_open = true; in pm8916_wcd_analog_parse_dt()
1154 priv->hphl_jack_type_normally_open = false; in pm8916_wcd_analog_parse_dt()
1156 if (of_property_read_bool(dev->of_node, in pm8916_wcd_analog_parse_dt()
1157 "qcom,gnd-jack-type-normally-open")) in pm8916_wcd_analog_parse_dt()
1158 priv->gnd_jack_type_normally_open = true; in pm8916_wcd_analog_parse_dt()
1160 priv->gnd_jack_type_normally_open = false; in pm8916_wcd_analog_parse_dt()
1162 priv->mbhc_btn_enabled = true; in pm8916_wcd_analog_parse_dt()
1163 rval = of_property_read_u32_array(dev->of_node, in pm8916_wcd_analog_parse_dt()
1164 "qcom,mbhc-vthreshold-low", in pm8916_wcd_analog_parse_dt()
1165 &priv->vref_btn_cs[0], in pm8916_wcd_analog_parse_dt()
1168 priv->mbhc_btn_enabled = false; in pm8916_wcd_analog_parse_dt()
1170 rval = of_property_read_u32_array(dev->of_node, in pm8916_wcd_analog_parse_dt()
1171 "qcom,mbhc-vthreshold-high", in pm8916_wcd_analog_parse_dt()
1172 &priv->vref_btn_micb[0], in pm8916_wcd_analog_parse_dt()
1175 priv->mbhc_btn_enabled = false; in pm8916_wcd_analog_parse_dt()
1178 if (!priv->mbhc_btn_enabled) in pm8916_wcd_analog_parse_dt()
1189 struct device *dev = &pdev->dev; in pm8916_wcd_analog_spmi_probe()
1194 return -ENOMEM; in pm8916_wcd_analog_spmi_probe()
1201 priv->supplies[i].supply = supply_names[i]; in pm8916_wcd_analog_spmi_probe()
1203 ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(priv->supplies), in pm8916_wcd_analog_spmi_probe()
1204 priv->supplies); in pm8916_wcd_analog_spmi_probe()
1224 if (priv->mbhc_btn_enabled) { in pm8916_wcd_analog_spmi_probe()
1262 { .compatible = "qcom,pm8916-wcd-analog-codec", },
1270 .name = "qcom,pm8916-wcd-spmi-codec",