Commit 55c5cc63 authored by Cheng-Yi Chiang's avatar Cheng-Yi Chiang Committed by Mark Brown

ASoC: hdmi-codec: Use set_jack ops to set jack

Use set_jack ops to set jack so machine drivers do not need to include
hdmi-codec.h explicitly.
Signed-off-by: default avatarCheng-Yi Chiang <cychiang@chromium.org>
Reviewed-by: default avatarTzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200922062316.1172935-1-cychiang@chromium.orgSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 376dd57d
...@@ -117,9 +117,6 @@ struct hdmi_codec_pdata { ...@@ -117,9 +117,6 @@ struct hdmi_codec_pdata {
struct snd_soc_component; struct snd_soc_component;
struct snd_soc_jack; 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" #define HDMI_CODEC_DRV_NAME "hdmi-audio-codec"
#endif /* __HDMI_CODEC_H__ */ #endif /* __HDMI_CODEC_H__ */
...@@ -698,13 +698,9 @@ static void plugged_cb(struct device *dev, bool plugged) ...@@ -698,13 +698,9 @@ static void plugged_cb(struct device *dev, bool plugged)
hdmi_codec_jack_report(hcp, 0); hdmi_codec_jack_report(hcp, 0);
} }
/** static int hdmi_codec_set_jack(struct snd_soc_component *component,
* hdmi_codec_set_jack_detect - register HDMI plugged callback struct snd_soc_jack *jack,
* @component: the hdmi-codec instance void *data)
* @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)
{ {
struct hdmi_codec_priv *hcp = snd_soc_component_get_drvdata(component); struct hdmi_codec_priv *hcp = snd_soc_component_get_drvdata(component);
int ret = -EOPNOTSUPP; int ret = -EOPNOTSUPP;
...@@ -720,7 +716,6 @@ int hdmi_codec_set_jack_detect(struct snd_soc_component *component, ...@@ -720,7 +716,6 @@ int hdmi_codec_set_jack_detect(struct snd_soc_component *component,
} }
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(hdmi_codec_set_jack_detect);
static int hdmi_dai_spdif_probe(struct snd_soc_dai *dai) static int hdmi_dai_spdif_probe(struct snd_soc_dai *dai)
{ {
...@@ -806,6 +801,7 @@ static const struct snd_soc_component_driver hdmi_driver = { ...@@ -806,6 +801,7 @@ static const struct snd_soc_component_driver hdmi_driver = {
.use_pmdown_time = 1, .use_pmdown_time = 1,
.endianness = 1, .endianness = 1,
.non_legacy_dai_naming = 1, .non_legacy_dai_naming = 1,
.set_jack = hdmi_codec_set_jack,
}; };
static int hdmi_codec_probe(struct platform_device *pdev) static int hdmi_codec_probe(struct platform_device *pdev)
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include <linux/of_gpio.h> #include <linux/of_gpio.h>
#include <sound/soc.h> #include <sound/soc.h>
#include <sound/jack.h> #include <sound/jack.h>
#include <sound/hdmi-codec.h>
#include "../../codecs/rt5645.h" #include "../../codecs/rt5645.h"
#define MCLK_FOR_CODECS 12288000 #define MCLK_FOR_CODECS 12288000
...@@ -154,8 +153,8 @@ static int mt8173_rt5650_hdmi_init(struct snd_soc_pcm_runtime *rtd) ...@@ -154,8 +153,8 @@ static int mt8173_rt5650_hdmi_init(struct snd_soc_pcm_runtime *rtd)
if (ret) if (ret)
return ret; return ret;
return hdmi_codec_set_jack_detect(asoc_rtd_to_codec(rtd, 0)->component, return snd_soc_component_set_jack(asoc_rtd_to_codec(rtd, 0)->component,
&mt8173_rt5650_hdmi_jack); &mt8173_rt5650_hdmi_jack, NULL);
} }
enum { enum {
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/of_device.h> #include <linux/of_device.h>
#include <linux/pinctrl/consumer.h> #include <linux/pinctrl/consumer.h>
#include <sound/hdmi-codec.h>
#include <sound/jack.h> #include <sound/jack.h>
#include <sound/pcm_params.h> #include <sound/pcm_params.h>
#include <sound/soc.h> #include <sound/soc.h>
...@@ -375,8 +374,8 @@ static int mt8183_da7219_max98357_hdmi_init(struct snd_soc_pcm_runtime *rtd) ...@@ -375,8 +374,8 @@ static int mt8183_da7219_max98357_hdmi_init(struct snd_soc_pcm_runtime *rtd)
if (ret) if (ret)
return ret; return ret;
return hdmi_codec_set_jack_detect(asoc_rtd_to_codec(rtd, 0)->component, return snd_soc_component_set_jack(asoc_rtd_to_codec(rtd, 0)->component,
&priv->hdmi_jack); &priv->hdmi_jack, NULL);
} }
static struct snd_soc_dai_link mt8183_da7219_dai_links[] = { static struct snd_soc_dai_link mt8183_da7219_dai_links[] = {
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/of_device.h> #include <linux/of_device.h>
#include <linux/pinctrl/consumer.h> #include <linux/pinctrl/consumer.h>
#include <sound/hdmi-codec.h>
#include <sound/jack.h> #include <sound/jack.h>
#include <sound/pcm_params.h> #include <sound/pcm_params.h>
#include <sound/soc.h> #include <sound/soc.h>
...@@ -350,8 +349,8 @@ mt8183_mt6358_ts3a227_max98357_hdmi_init(struct snd_soc_pcm_runtime *rtd) ...@@ -350,8 +349,8 @@ mt8183_mt6358_ts3a227_max98357_hdmi_init(struct snd_soc_pcm_runtime *rtd)
if (ret) if (ret)
return ret; return ret;
return hdmi_codec_set_jack_detect(asoc_rtd_to_codec(rtd, 0)->component, return snd_soc_component_set_jack(asoc_rtd_to_codec(rtd, 0)->component,
&priv->hdmi_jack); &priv->hdmi_jack, NULL);
} }
static struct snd_soc_dai_link mt8183_mt6358_ts3a227_dai_links[] = { static struct snd_soc_dai_link mt8183_mt6358_ts3a227_dai_links[] = {
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include <linux/gpio.h> #include <linux/gpio.h>
#include <linux/of_gpio.h> #include <linux/of_gpio.h>
#include <sound/core.h> #include <sound/core.h>
#include <sound/hdmi-codec.h>
#include <sound/jack.h> #include <sound/jack.h>
#include <sound/pcm.h> #include <sound/pcm.h>
#include <sound/pcm_params.h> #include <sound/pcm_params.h>
...@@ -238,7 +237,7 @@ static int rk_hdmi_init(struct snd_soc_pcm_runtime *runtime) ...@@ -238,7 +237,7 @@ static int rk_hdmi_init(struct snd_soc_pcm_runtime *runtime)
return ret; return ret;
} }
return hdmi_codec_set_jack_detect(component, &rk_hdmi_jack); return snd_soc_component_set_jack(component, &rk_hdmi_jack, NULL);
} }
/* max98090 dai_link */ /* max98090 dai_link */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment