mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-03-11 18:30:54 +07:00
ASoC: hdmi-codec: ELD control corresponds to the PCM stream
Current hdmi-codec driver is using hdmi_controls for "ELD" control.
But, hdmi-codec driver might be used from many HDMIs. Thus, we need
to correspond device number, otherwise we will receive below error.
xxx: control x❌x:ELD:x is already present
This patch registers ELD control in .pcm_new by using
.device = rtd->pcm->device to corresponding to PCM stream.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
[Takashi: use snd_ctl_new1()/snd_ctl_add()]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
5771a8c088
commit
ecbb1b8d97
@ -399,18 +399,6 @@ static int hdmi_codec_chmap_ctl_get(struct snd_kcontrol *kcontrol,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static const struct snd_kcontrol_new hdmi_controls[] = {
|
|
||||||
{
|
|
||||||
.access = SNDRV_CTL_ELEM_ACCESS_READ |
|
|
||||||
SNDRV_CTL_ELEM_ACCESS_VOLATILE,
|
|
||||||
.iface = SNDRV_CTL_ELEM_IFACE_PCM,
|
|
||||||
.name = "ELD",
|
|
||||||
.info = hdmi_eld_ctl_info,
|
|
||||||
.get = hdmi_eld_ctl_get,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
static int hdmi_codec_new_stream(struct snd_pcm_substream *substream,
|
static int hdmi_codec_new_stream(struct snd_pcm_substream *substream,
|
||||||
struct snd_soc_dai *dai)
|
struct snd_soc_dai *dai)
|
||||||
{
|
{
|
||||||
@ -668,6 +656,16 @@ static int hdmi_codec_pcm_new(struct snd_soc_pcm_runtime *rtd,
|
|||||||
{
|
{
|
||||||
struct snd_soc_dai_driver *drv = dai->driver;
|
struct snd_soc_dai_driver *drv = dai->driver;
|
||||||
struct hdmi_codec_priv *hcp = snd_soc_dai_get_drvdata(dai);
|
struct hdmi_codec_priv *hcp = snd_soc_dai_get_drvdata(dai);
|
||||||
|
struct snd_kcontrol *kctl;
|
||||||
|
struct snd_kcontrol_new hdmi_eld_ctl = {
|
||||||
|
.access = SNDRV_CTL_ELEM_ACCESS_READ |
|
||||||
|
SNDRV_CTL_ELEM_ACCESS_VOLATILE,
|
||||||
|
.iface = SNDRV_CTL_ELEM_IFACE_PCM,
|
||||||
|
.name = "ELD",
|
||||||
|
.info = hdmi_eld_ctl_info,
|
||||||
|
.get = hdmi_eld_ctl_get,
|
||||||
|
.device = rtd->pcm->device,
|
||||||
|
};
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
dev_dbg(dai->dev, "%s()\n", __func__);
|
dev_dbg(dai->dev, "%s()\n", __func__);
|
||||||
@ -686,7 +684,12 @@ static int hdmi_codec_pcm_new(struct snd_soc_pcm_runtime *rtd,
|
|||||||
hcp->chmap_info->chmap = hdmi_codec_stereo_chmaps;
|
hcp->chmap_info->chmap = hdmi_codec_stereo_chmaps;
|
||||||
hcp->chmap_idx = HDMI_CODEC_CHMAP_IDX_UNKNOWN;
|
hcp->chmap_idx = HDMI_CODEC_CHMAP_IDX_UNKNOWN;
|
||||||
|
|
||||||
return 0;
|
/* add ELD ctl with the device number corresponding to the PCM stream */
|
||||||
|
kctl = snd_ctl_new1(&hdmi_eld_ctl, dai->component);
|
||||||
|
if (!kctl)
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
|
return snd_ctl_add(rtd->card->snd_card, kctl);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct snd_soc_dai_driver hdmi_i2s_dai = {
|
static struct snd_soc_dai_driver hdmi_i2s_dai = {
|
||||||
@ -732,8 +735,6 @@ static int hdmi_of_xlate_dai_id(struct snd_soc_component *component,
|
|||||||
|
|
||||||
static struct snd_soc_codec_driver hdmi_codec = {
|
static struct snd_soc_codec_driver hdmi_codec = {
|
||||||
.component_driver = {
|
.component_driver = {
|
||||||
.controls = hdmi_controls,
|
|
||||||
.num_controls = ARRAY_SIZE(hdmi_controls),
|
|
||||||
.dapm_widgets = hdmi_widgets,
|
.dapm_widgets = hdmi_widgets,
|
||||||
.num_dapm_widgets = ARRAY_SIZE(hdmi_widgets),
|
.num_dapm_widgets = ARRAY_SIZE(hdmi_widgets),
|
||||||
.dapm_routes = hdmi_routes,
|
.dapm_routes = hdmi_routes,
|
||||||
|
Loading…
Reference in New Issue
Block a user