Lines Matching +full:vdd +full:- +full:micbias +full:- +full:supply
1 // SPDX-License-Identifier: GPL-2.0
110 #define MICB_VOLTAGE_REGVAL(v) (((v - MICB_MIN_VAL)/MICB_STEP_SIZE) << 3)
284 "vdd-cdc-io",
285 "vdd-cdc-tx-rx-cx",
359 if (wcd->micbias_mv) { in pm8916_wcd_analog_micbias_enable()
362 MICB_VOLTAGE_REGVAL(wcd->micbias_mv)); in pm8916_wcd_analog_micbias_enable()
364 * Special headset needs MICBIAS as 2.7V so wait for in pm8916_wcd_analog_micbias_enable()
365 * 50 msec for the MICBIAS to reach 2.7 volts. in pm8916_wcd_analog_micbias_enable()
367 if (wcd->micbias_mv >= 2700) in pm8916_wcd_analog_micbias_enable()
395 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in pm8916_wcd_analog_enable_micbias_int()
412 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in pm8916_wcd_analog_enable_micbias1()
416 wcd->micbias1_cap_mode); in pm8916_wcd_analog_enable_micbias1()
423 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in pm8916_wcd_analog_enable_micbias2()
427 wcd->micbias2_cap_mode); in pm8916_wcd_analog_enable_micbias2()
434 struct snd_soc_component *component = priv->component; in pm8916_mbhc_configure_bias()
457 vrefs = &priv->vref_btn_micb[0]; in pm8916_mbhc_configure_bias()
459 vrefs = &priv->vref_btn_cs[0]; in pm8916_mbhc_configure_bias()
480 struct snd_soc_component *component = wcd->component; in pm8916_wcd_setup_mbhc()
491 if (wcd->hphl_jack_type_normally_open) in pm8916_wcd_setup_mbhc()
494 if (wcd->gnd_jack_type_normally_open) in pm8916_wcd_setup_mbhc()
519 if (wcd->mbhc_btn_enabled) in pm8916_wcd_setup_mbhc()
524 wcd->mbhc_btn0_released = false; in pm8916_wcd_setup_mbhc()
525 wcd->detect_accessory_type = true; in pm8916_wcd_setup_mbhc()
533 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in pm8916_wcd_analog_enable_micbias_int2()
556 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in pm8916_wcd_analog_enable_adc()
560 if (w->reg == CDC_A_TX_1_EN) in pm8916_wcd_analog_enable_adc()
567 if (w->reg == CDC_A_TX_2_EN) in pm8916_wcd_analog_enable_adc()
579 switch (w->reg) { in pm8916_wcd_analog_enable_adc()
602 switch (w->reg) { in pm8916_wcd_analog_enable_adc()
629 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in pm8916_wcd_analog_enable_spk_pa()
651 snd_soc_component_update_bits(component, w->reg, in pm8916_wcd_analog_enable_spk_pa()
676 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in pm8916_wcd_analog_enable_ear_pa()
721 struct pm8916_wcd_analog_priv *priv = dev_get_drvdata(component->dev); in pm8916_wcd_analog_probe()
724 err = regulator_bulk_enable(ARRAY_SIZE(priv->supplies), priv->supplies); in pm8916_wcd_analog_probe()
726 dev_err(component->dev, "failed to enable regulators (%d)\n", err); in pm8916_wcd_analog_probe()
731 dev_get_regmap(component->dev->parent, NULL)); in pm8916_wcd_analog_probe()
733 priv->pmic_rev = snd_soc_component_read(component, CDC_D_REVISION1); in pm8916_wcd_analog_probe()
734 priv->codec_version = snd_soc_component_read(component, CDC_D_PERPH_SUBTYPE); in pm8916_wcd_analog_probe()
736 dev_info(component->dev, "PMIC REV: %d\t CODEC Version: %d\n", in pm8916_wcd_analog_probe()
737 priv->pmic_rev, priv->codec_version); in pm8916_wcd_analog_probe()
746 priv->component = component; in pm8916_wcd_analog_probe()
759 struct pm8916_wcd_analog_priv *priv = dev_get_drvdata(component->dev); in pm8916_wcd_analog_remove()
764 regulator_bulk_disable(ARRAY_SIZE(priv->supplies), in pm8916_wcd_analog_remove()
765 priv->supplies); in pm8916_wcd_analog_remove()
852 {"MIC_BIAS1", NULL, "vdd-micbias"},
853 {"MIC_BIAS2", NULL, "vdd-micbias"},
904 SND_SOC_DAPM_REGULATOR_SUPPLY("vdd-micbias", 0, 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()
1138 if (of_property_read_bool(dev->of_node, "qcom,micbias1-ext-cap")) in pm8916_wcd_analog_parse_dt()
1139 priv->micbias1_cap_mode = MICB_1_EN_EXT_BYP_CAP; in pm8916_wcd_analog_parse_dt()
1141 priv->micbias1_cap_mode = MICB_1_EN_NO_EXT_BYP_CAP; in pm8916_wcd_analog_parse_dt()
1143 if (of_property_read_bool(dev->of_node, "qcom,micbias2-ext-cap")) in pm8916_wcd_analog_parse_dt()
1144 priv->micbias2_cap_mode = MICB_1_EN_EXT_BYP_CAP; in pm8916_wcd_analog_parse_dt()
1146 priv->micbias2_cap_mode = MICB_1_EN_NO_EXT_BYP_CAP; in pm8916_wcd_analog_parse_dt()
1148 of_property_read_u32(dev->of_node, "qcom,micbias-lvl", in pm8916_wcd_analog_parse_dt()
1149 &priv->micbias_mv); in pm8916_wcd_analog_parse_dt()
1151 if (of_property_read_bool(dev->of_node, in pm8916_wcd_analog_parse_dt()
1152 "qcom,hphl-jack-type-normally-open")) in pm8916_wcd_analog_parse_dt()
1153 priv->hphl_jack_type_normally_open = true; in pm8916_wcd_analog_parse_dt()
1155 priv->hphl_jack_type_normally_open = false; in pm8916_wcd_analog_parse_dt()
1157 if (of_property_read_bool(dev->of_node, in pm8916_wcd_analog_parse_dt()
1158 "qcom,gnd-jack-type-normally-open")) in pm8916_wcd_analog_parse_dt()
1159 priv->gnd_jack_type_normally_open = true; in pm8916_wcd_analog_parse_dt()
1161 priv->gnd_jack_type_normally_open = false; in pm8916_wcd_analog_parse_dt()
1163 priv->mbhc_btn_enabled = true; in pm8916_wcd_analog_parse_dt()
1164 rval = of_property_read_u32_array(dev->of_node, in pm8916_wcd_analog_parse_dt()
1165 "qcom,mbhc-vthreshold-low", in pm8916_wcd_analog_parse_dt()
1166 &priv->vref_btn_cs[0], in pm8916_wcd_analog_parse_dt()
1169 priv->mbhc_btn_enabled = false; in pm8916_wcd_analog_parse_dt()
1171 rval = of_property_read_u32_array(dev->of_node, in pm8916_wcd_analog_parse_dt()
1172 "qcom,mbhc-vthreshold-high", in pm8916_wcd_analog_parse_dt()
1173 &priv->vref_btn_micb[0], in pm8916_wcd_analog_parse_dt()
1176 priv->mbhc_btn_enabled = false; in pm8916_wcd_analog_parse_dt()
1179 if (!priv->mbhc_btn_enabled) in pm8916_wcd_analog_parse_dt()
1190 struct device *dev = &pdev->dev; in pm8916_wcd_analog_spmi_probe()
1195 return -ENOMEM; in pm8916_wcd_analog_spmi_probe()
1201 priv->mclk = devm_clk_get(dev, "mclk"); in pm8916_wcd_analog_spmi_probe()
1202 if (IS_ERR(priv->mclk)) { in pm8916_wcd_analog_spmi_probe()
1204 return PTR_ERR(priv->mclk); in pm8916_wcd_analog_spmi_probe()
1208 priv->supplies[i].supply = supply_names[i]; in pm8916_wcd_analog_spmi_probe()
1210 ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(priv->supplies), in pm8916_wcd_analog_spmi_probe()
1211 priv->supplies); in pm8916_wcd_analog_spmi_probe()
1217 ret = clk_prepare_enable(priv->mclk); in pm8916_wcd_analog_spmi_probe()
1235 if (priv->mbhc_btn_enabled) { in pm8916_wcd_analog_spmi_probe()
1271 struct pm8916_wcd_analog_priv *priv = dev_get_drvdata(&pdev->dev); in pm8916_wcd_analog_spmi_remove()
1273 clk_disable_unprepare(priv->mclk); in pm8916_wcd_analog_spmi_remove()
1279 { .compatible = "qcom,pm8916-wcd-analog-codec", },
1287 .name = "qcom,pm8916-wcd-spmi-codec",