From: Arnaud Pouliquen <arnaud.pouliquen@st.com>
To: Jyri Sarha <jsarha@ti.com>,
"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>
Cc: Jean-Francois Moine <moinejf@free.fr>,
Lars-Peter Clausen <lars@metafoo.de>,
Russell King - ARM Linux <linux@arm.linux.org.uk>,
Philipp Zabel <p.zabel@pengutronix.de>,
David Airlie <airlied@linux.ie>,
Liam Girdwood <lgirdwood@gmail.com>, Takashi Iwai <tiwai@suse.de>,
Mark Brown <broonie@kernel.org>,
Benjamin Gaignard <benjamin.gaignard@linaro.org>
Subject: Re: [RFC v2 3/6] ASoC: core: add code to complete dai init after pcm creation
Date: Mon, 15 Feb 2016 11:39:13 +0100 [thread overview]
Message-ID: <56C1AAD1.1040609@st.com> (raw)
In-Reply-To: <56B4723B.4000505@ti.com>
On 02/05/2016 10:58 AM, Jyri Sarha wrote:
> On 01/22/16 19:48, Arnaud Pouliquen wrote:
>> Some Controls defined in DAI need to be associated to PCM device (e.g. IEC60958).
>>
>> This allows to perform post initialization in DAI after PCM device creation.
>>
>
> Sorry for my late reaction to this series (I was on vacation)...
Same issue for me last week ;-)
>
> I do not follow why you need this? The rest of the codecs create their
> mixer elements in static struct snd_soc_codec_driver's probe-callback. I
> can not see why it could not be used with hdmi-codec (then again I have
> not tried it).
Some controls like 'IEC958 Playback Default' can need to be indexed on
the PCM device. As example on my board i have a SPDIF and a HDMI out.
Both handle IEC60958. Today, there is not way (or as said, i miss
something) to get PCM device information at DAI level to be able to
index on PCM device.
Aim of this patch is to allow to perform post DAI initialization on PCM
device creation, with PCM runtime information.
>
> I'll try to test the patches that affects my Beaglebone-black hdmia
> audio series anyway, I just need to rebase my branch in order to apply
> this patch. For some reason "ASoc: hdmi-codec: add IEC control." did not
> apply out of the box either...
>
> Best regards,
> Jyri
>
>> Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
>> ---
>> include/sound/soc-dai.h | 7 +++++++
>> sound/soc/soc-core.c | 14 ++++++++++++++
>> 2 files changed, 21 insertions(+)
>>
>> diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
>> index 964b7de..6969c83 100644
>> --- a/include/sound/soc-dai.h
>> +++ b/include/sound/soc-dai.h
>> @@ -205,6 +205,13 @@ struct snd_soc_dai_ops {
>> */
>> snd_pcm_sframes_t (*delay)(struct snd_pcm_substream *,
>> struct snd_soc_dai *);
>> +
>> + /*
>> + * function called by soc_probe_link_dais to post initialize DAI
>> + * after pcm device creation.
>> + * As example, can be used to link a controls to the pcm device
>> + */
>> + int (*pcm_new)(struct snd_soc_pcm_runtime *, struct snd_soc_dai *);
>> };
>>
>> /*
>> diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
>> index 790ee2b..cf1d312 100644
>> --- a/sound/soc/soc-core.c
>> +++ b/sound/soc/soc-core.c
>> @@ -1587,6 +1587,7 @@ static int soc_probe_link_dais(struct snd_soc_card *card,
>> {
>> struct snd_soc_dai_link *dai_link = rtd->dai_link;
>> struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
>> + const struct snd_soc_dai_ops *ops;
>> int i, ret;
>>
>> dev_dbg(card->dev, "ASoC: probe %s dai link %d late %d\n",
>> @@ -1662,6 +1663,19 @@ static int soc_probe_link_dais(struct snd_soc_card *card,
>> }
>> }
>>
>> + for (i = 0; i < rtd->num_codecs; i++) {
>> + ops = rtd->codec_dais[i]->driver->ops;
>> + if (ops->pcm_new)
>> + ret = ops->pcm_new(rtd, rtd->codec_dais[i]);
>> + if (ret)
>> + return ret;
>> + }
>> + ops = cpu_dai->driver->ops;
>> + if (ops->pcm_new)
>> + ret = ops->pcm_new(rtd, rtd->codec_dais[i]);
>> + if (ret)
>> + return ret;
>> +
>> return 0;
>> }
>>
>>
>
next prev parent reply other threads:[~2016-02-15 10:39 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-22 17:48 [RFC v2 0/6] sti: add audio interface to the hdmi driver Arnaud Pouliquen
2016-01-22 17:48 ` [RFC v2 1/6] video: hdmi: add helper function for N and CTS Arnaud Pouliquen
2016-02-18 14:20 ` Philipp Zabel
2016-02-19 8:20 ` Arnaud Pouliquen
2016-01-22 17:48 ` [RFC v2 2/6] ALSA: pcm: add IEC958 channel status control helper Arnaud Pouliquen
2016-02-16 20:17 ` Jyri Sarha
2016-02-17 8:37 ` Arnaud Pouliquen
2016-02-17 0:31 ` Russell King - ARM Linux
2016-02-17 9:07 ` Arnaud Pouliquen
2016-01-22 17:48 ` [RFC v2 3/6] ASoC: core: add code to complete dai init after pcm creation Arnaud Pouliquen
2016-02-05 9:58 ` Jyri Sarha
2016-02-15 10:39 ` Arnaud Pouliquen [this message]
2016-01-22 17:48 ` [RFC v2 4/6] drm: sti: Add ASoC generic hdmi codec support Arnaud Pouliquen
2016-01-22 17:48 ` [RFC v2 5/6] ASoc: hdmi-codec: add IEC control Arnaud Pouliquen
2016-02-06 19:29 ` Jyri Sarha
2016-02-15 10:51 ` Arnaud Pouliquen
2016-02-16 20:16 ` Jyri Sarha
2016-01-22 17:48 ` [RFC v2 6/6] ARM: DT: b2120: add audio HDMI dai link in audio card Arnaud Pouliquen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56C1AAD1.1040609@st.com \
--to=arnaud.pouliquen@st.com \
--cc=airlied@linux.ie \
--cc=alsa-devel@alsa-project.org \
--cc=benjamin.gaignard@linaro.org \
--cc=broonie@kernel.org \
--cc=jsarha@ti.com \
--cc=lars@metafoo.de \
--cc=lgirdwood@gmail.com \
--cc=linux@arm.linux.org.uk \
--cc=moinejf@free.fr \
--cc=p.zabel@pengutronix.de \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.