From 5f47c9f404c0a5ad530b5ecc07342ea64636cf89 Mon Sep 17 00:00:00 2001 From: XiaoTan Luo Date: Thu, 16 Sep 2021 15:36:39 +0800 Subject: [PATCH] UPSTREAM: ASoC: hdmi-codec: Use set_jack ops to set jack Use set_jack ops to set jack so machine drivers do not need to includehdmi-codec.h explicitly. Signed-off-by: Cheng-Yi Chiang Reviewed-by: Tzung-Bi Shih Link:https://lore.kernel.org/r/20200922062316.1172935-1-cychiang@chromium.org Signed-off-by: Mark Brown (cherry picked from commit 55c5cc63ab3277aa20637dc20f6528987ac23743) Change-Id: I5717c3e47ac9a8feb05b830b159c9ac9224f4136 Signed-off-by: XiaoTan Luo --- include/sound/hdmi-codec.h | 3 --- sound/soc/codecs/hdmi-codec.c | 12 ++++-------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/include/sound/hdmi-codec.h b/include/sound/hdmi-codec.h index 0ee30ad26788..8506cee97d25 100644 --- a/include/sound/hdmi-codec.h +++ b/include/sound/hdmi-codec.h @@ -128,9 +128,6 @@ struct hdmi_codec_pdata { struct snd_soc_component; struct snd_soc_jack; -int hdmi_codec_set_jack_detect(struct snd_soc_component *component, - struct snd_soc_jack *jack); - #define HDMI_CODEC_DRV_NAME "hdmi-audio-codec" #endif /* __HDMI_CODEC_H__ */ diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c index 6bc4b1627445..c46cb441076f 100644 --- a/sound/soc/codecs/hdmi-codec.c +++ b/sound/soc/codecs/hdmi-codec.c @@ -773,13 +773,9 @@ static void plugged_cb(struct device *dev, bool plugged) hdmi_codec_jack_report(hcp, 0); } -/** - * hdmi_codec_set_jack_detect - register HDMI plugged callback - * @component: the hdmi-codec instance - * @jack: ASoC jack to report (dis)connection events on - */ -int hdmi_codec_set_jack_detect(struct snd_soc_component *component, - struct snd_soc_jack *jack) +static int hdmi_codec_set_jack(struct snd_soc_component *component, + struct snd_soc_jack *jack, + void *data) { struct hdmi_codec_priv *hcp = snd_soc_component_get_drvdata(component); int ret = -EOPNOTSUPP; @@ -795,7 +791,6 @@ int hdmi_codec_set_jack_detect(struct snd_soc_component *component, } return ret; } -EXPORT_SYMBOL_GPL(hdmi_codec_set_jack_detect); static const struct snd_soc_dai_driver hdmi_i2s_dai = { .name = "i2s-hifi", @@ -848,6 +843,7 @@ static const struct snd_soc_component_driver hdmi_driver = { .use_pmdown_time = 1, .endianness = 1, .non_legacy_dai_naming = 1, + .set_jack = hdmi_codec_set_jack, }; static int hdmi_codec_probe(struct platform_device *pdev)