ASoC: codecs: wcd-mbhc: cleanup swap_gnd_mic api
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Thu, 27 Mar 2025 10:06:30 +0000 (10:06 +0000)
committerMark Brown <broonie@kernel.org>
Sun, 6 Apr 2025 22:24:45 +0000 (23:24 +0100)
Remove confusing and unused argument in swap_gnd_mic api, the second
argument active is not really used, and always set to true in the mbhc
drivers.

The callback itself is used to toggle the gnd_mic lines when a cross
connection is detected by mbhc circuits, so there is no need of this
argument.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://patch.msgid.link/20250327100633.11530-4-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/wcd-mbhc-v2.c
sound/soc/codecs/wcd-mbhc-v2.h
sound/soc/codecs/wcd937x.c
sound/soc/codecs/wcd938x.c
sound/soc/codecs/wcd939x.c

index d589a212b7688d6e75a13f526649d6ed551ca054..4b7c3d6080a1090d0a3b8f90116c2e2f90a99c13 100644 (file)
@@ -1260,7 +1260,7 @@ correct_plug_type:
                        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;
                                }
                        }
index b977e8f87d7cb733d23ed0c3301896add30d394b..a5d52b9643f58d9bc6445c3fbd468952b89e28b4 100644 (file)
@@ -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;
index dd2045a5d26d23218aa4dae51c6f2ecd8d4e900d..3b1a1518e7647366b4de0e90828b8d97b82c5bd5 100644 (file)
@@ -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;
index 1ae498c323912ed799dcc033e7777936d90c9284..d03ed9cfa5306bfc331d918e5e479025fe8caab0 100644 (file)
@@ -3230,7 +3230,7 @@ static void wcd938x_dt_parse_micbias_info(struct device *dev, struct wcd938x_pri
                dev_info(dev, "%s: Micbias4 DT property not found\n", __func__);
 }
 
-static bool wcd938x_swap_gnd_mic(struct snd_soc_component *component, bool active)
+static bool wcd938x_swap_gnd_mic(struct snd_soc_component *component)
 {
        int value;
 
index 0a87a79772da6c0ed3c7dd7d098e949b9cead2a4..16c670e00aa886d9cb3b4dde5e7cdf621d373ac3 100644 (file)
@@ -3215,7 +3215,7 @@ static void wcd939x_dt_parse_micbias_info(struct device *dev, struct wcd939x_pri
 }
 
 #if IS_ENABLED(CONFIG_TYPEC)
-static bool wcd939x_swap_gnd_mic(struct snd_soc_component *component, bool active)
+static bool wcd939x_swap_gnd_mic(struct snd_soc_component *component)
 {
        struct wcd939x_priv *wcd939x = snd_soc_component_get_drvdata(component);