Lines Matching +full:4 +full:- +full:pole

1 // SPDX-License-Identifier: GPL-2.0
26 #define MBHC_BUTTON_RELEASE_DET BIT(4)
41 #define ANA_CLK_CTL_SPKR_CLK_EN_MASK BIT(4)
42 #define ANA_CLK_CTL_SPKR_CLK_EN BIT(4)
51 #define DIG_CLK_CTL_TXD_CLK_EN BIT(4)
102 #define MICB_1_EN_PULL_UP_EN_MASK BIT(4)
109 #define MICB_VOLTAGE_REGVAL(v) (((v - MICB_MIN_VAL)/MICB_STEP_SIZE) << 3)
131 #define MICB_1_INT_TX2_INT_RBIAS_EN_MASK BIT(4)
132 #define MICB_1_INT_TX2_INT_RBIAS_EN_ENABLE BIT(4)
158 #define CDC_A_MBHC_DET_CTL_MIC_CLAMP_CTL_AUTO BIT(4)
160 #define CDC_A_MBHC_DET_CTL_MIC_CLAMP_CTL_MASK GENMASK(4, 3)
165 #define CDC_A_PLUG_TYPE_MASK GENMASK(4, 3)
166 #define CDC_A_HPHL_PLUG_TYPE_NO BIT(4)
173 #define CDC_A_MBHC_FSM_CTL_BTN_ISRC_CTRL_I_100UA (0x3 << 4)
174 #define CDC_A_MBHC_FSM_CTL_BTN_ISRC_CTRL_MASK GENMASK(6, 4)
177 #define CDC_A_MBHC_DBNC_TIMER_INSREM_DBNC_T_256_MS (0x9 << 4)
184 #define CDC_A_MBHC_BTN_VREF_FINE_MASK GENMASK(4, 2)
190 #define CDC_A_MBHC_RESULT_1_BTN_RESULT_MASK GENMASK(4, 0)
236 #define SPKR_DAC_CTL_DAC_RESET_MASK BIT(4)
283 "vdd-cdc-io",
284 "vdd-cdc-tx-rx-cx",
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()
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()
562 init_bit_shift = 4; 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"},
884 SND_SOC_DAPM_SUPPLY("EAR CP", CDC_A_NCP_EN, 4, 0, NULL, 0),
890 SND_SOC_DAPM_PGA("HPHR PA", CDC_A_RX_HPH_CNP_EN, 4, 0, NULL, 0),
904 SND_SOC_DAPM_REGULATOR_SUPPLY("vdd-micbias", 0, 0),
924 SND_SOC_DAPM_SUPPLY("MIC BIAS Internal2", CDC_A_MICB_1_INT_RBIAS, 4, 0,
956 SND_SOC_DAPM_SUPPLY("SPKR_CLK", CDC_D_CDC_ANA_CLK_CTL, 4, 0, NULL, 0),
965 SND_SOC_DAPM_SUPPLY("TXD_CLK", CDC_D_CDC_DIG_CLK_CTL, 4, 0, NULL, 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()
1070 * insert event then its a 3 pole headphone else if 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()
1112 .channels_max = 4,
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",