Unverified Commit f4f20f7a authored by Mark Brown's avatar Mark Brown
Browse files

ASoC: wcd938x: enable t14s audio headset

Merge series from srinivas.kandagatla@linaro.org:

On Lenovo ThinkPad T14s, the headset is connected via a HiFi Switch to
support CTIA and OMTP headsets. This switch is used to minimise pop and
click during headset type switching.

This patchset adds required bindings and changes to codec and dts to
tnable the regulator required to power this switch along with wiring up
gpio that control the headset switching.

Without this patchset, there will be lots of noise on headset and mic
will not we functional.
parents 8e5e0e71 eec611d2
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -23,9 +23,15 @@ properties:
      - qcom,wcd9380-codec
      - qcom,wcd9385-codec

  mux-controls:
    description: A reference to the audio mux switch for
      switching CTIA/OMTP Headset types
    maxItems: 1

  us-euro-gpios:
    description: GPIO spec for swapping gnd and mic segments
    maxItems: 1
    deprecated: true

required:
  - compatible
+1 −0
Original line number Diff line number Diff line
@@ -2239,6 +2239,7 @@ config SND_SOC_WCD938X
	tristate
	depends on SOUNDWIRE || !SOUNDWIRE
	select SND_SOC_WCD_CLASSH
	select MULTIPLEXER

config SND_SOC_WCD938X_SDW
	tristate "WCD9380/WCD9385 Codec - SDW"
+1 −1
Original line number Diff line number Diff line
@@ -1260,7 +1260,7 @@ static void wcd_correct_swch_plug(struct work_struct *work)
			if (pt_gnd_mic_swap_cnt == mbhc->swap_thr) {
				/* US_EU gpio present, flip switch */
				if (mbhc->cfg->swap_gnd_mic) {
					if (mbhc->cfg->swap_gnd_mic(component, true))
					if (mbhc->cfg->swap_gnd_mic(component))
						continue;
				}
			}
+1 −1
Original line number Diff line number Diff line
@@ -194,7 +194,7 @@ struct wcd_mbhc_config {
	int num_btn;
	bool mono_stero_detection;
	bool typec_analog_mux;
	bool (*swap_gnd_mic)(struct snd_soc_component *component, bool active);
	bool (*swap_gnd_mic)(struct snd_soc_component *component);
	bool hs_ext_micbias;
	bool gnd_det_en;
	uint32_t linein_th;
+1 −1
Original line number Diff line number Diff line
@@ -2656,7 +2656,7 @@ static void wcd937x_dt_parse_micbias_info(struct device *dev, struct wcd937x_pri
		dev_warn(dev, "Micbias3 DT property not found\n");
}

static bool wcd937x_swap_gnd_mic(struct snd_soc_component *component, bool active)
static bool wcd937x_swap_gnd_mic(struct snd_soc_component *component)
{
	int value;
	struct wcd937x_priv *wcd937x;
Loading