All of lore.kernel.org
 help / color / mirror / Atom feed
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 2/6] ALSA: pcm: add IEC958 channel status control helper
Date: Wed, 17 Feb 2016 09:37:44 +0100	[thread overview]
Message-ID: <56C43158.6000409@st.com> (raw)
In-Reply-To: <56C383D0.4040201@ti.com>



On 02/16/2016 09:17 PM, Jyri Sarha wrote:
> On 01/22/16 19:48, Arnaud Pouliquen wrote:
>> Add IEC958 channel status helper that creates control to handle the
>> IEC60958 status bits.
>>
>> Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
>> ---
>>   include/sound/pcm_iec958.h | 16 ++++++++
>>   sound/core/pcm_iec958.c    | 99 ++++++++++++++++++++++++++++++++++++++++++++++
>>   2 files changed, 115 insertions(+)
>>
>> diff --git a/include/sound/pcm_iec958.h b/include/sound/pcm_iec958.h
>> index 36f023a..7453ace 100644
>> --- a/include/sound/pcm_iec958.h
>> +++ b/include/sound/pcm_iec958.h
>> @@ -3,9 +3,25 @@
>>
>>   #include <linux/types.h>
>>
>> +/*
>> + * IEC 60958 controls parameters
>> + * Describes channel status and associated callback
>> + */
>> +struct snd_pcm_iec958_params {
>> +	/* call when control is updated by user */
>> +	int (*ctrl_set)(void *pdata, u8 *status, u8 len);
>> +
>> +	struct snd_aes_iec958 *iec;
>> +	void *pdata; /* user private data to retrieve context */
>> +	struct mutex *mutex; /* use to avoid race condition */
>> +};
>> +
>>   int snd_pcm_create_iec958_consumer(struct snd_pcm_runtime *runtime, u8 *cs,
>>   	size_t len);
>>
>>   int snd_pcm_create_iec958_consumer_hw_params(struct snd_pcm_hw_params *params,
>>   					     u8 *cs, size_t len);
>> +
>> +int snd_pcm_create_iec958_ctl(struct snd_pcm *pcm,
>> +			      struct snd_pcm_iec958_params *params, int stream);
>>   #endif
>> diff --git a/sound/core/pcm_iec958.c b/sound/core/pcm_iec958.c
>> index c9f8b66..8dd0415 100644
>> --- a/sound/core/pcm_iec958.c
>> +++ b/sound/core/pcm_iec958.c
>> @@ -7,11 +7,87 @@
>>    */
>>   #include <linux/export.h>
>>   #include <linux/types.h>
>> +#include <linux/wait.h>
>>   #include <sound/asoundef.h>
>> +#include <sound/control.h>
>>   #include <sound/pcm.h>
>>   #include <sound/pcm_params.h>
>>   #include <sound/pcm_iec958.h>
>>
>> +int snd_pcm_iec958_info(struct snd_kcontrol *kcontrol,
>> +			struct snd_ctl_elem_info *uinfo)
>> +{
>> +	uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958;
>> +	uinfo->count = 1;
>> +	return 0;
>> +}
>> +
>> +static int snd_pcm_iec958_get(struct snd_kcontrol *kcontrol,
>> +			      struct snd_ctl_elem_value *uctl)
>> +{
>> +	struct snd_pcm_iec958_params *params = snd_kcontrol_chip(kcontrol);
>> +
>> +	if (params->mutex)
>> +		mutex_unlock(params->mutex);
> 
> This here should be mutex_lock().
oops... Seems that i need to enable some debug configs in my environment...
My apologize for this copy/past and thanks for the test!
Anyway i need to perform further tests before deliver as patches instead
of rfc.
But i prefer to wait a decision on the HDMI codec before finalizing it.

  reply	other threads:[~2016-02-17  8:37 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 [this message]
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
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=56C43158.6000409@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.