alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Arnaud Pouliquen <arnaud.pouliquen@st.com>
To: Mark Brown <broonie@kernel.org>
Cc: alsa-devel@alsa-project.org, lgirdwood@gmail.com
Subject: Re: [PATCH v2 3/9] ASoC: sti: Add CPU DAI driver for playback
Date: Tue, 26 May 2015 15:51:55 +0200	[thread overview]
Message-ID: <55647A7B.2050400@st.com> (raw)
In-Reply-To: <20150525123745.GO21391@sirena.org.uk>



On 05/25/2015 02:37 PM, Mark Brown wrote:
> On Mon, May 18, 2015 at 02:12:50PM +0200, Arnaud Pouliquen wrote:
>
>> Add code to manage Uniperipheral player IP instances.
>> These DAIs are dedicated to playback and support I2S and IEC mode.
>
> There's some small things below but the main thing is that I'm still
> unclear about the driver internal abstraction layers.  Perhaps that will
> become obvious later in the series...
Abstraction layers are used to have same interface for uniperiph player 
and uniperiph reader DAIs.
I think there are two points to discuss before i rework it:

1) Are you still ok that i keep 2 separate files for player and reader 
IP management?
Just for remind here is discussion started on V1 patch set:

Arnaud: I splitted reader and player code,because it is 2 different IPs 
with some specific features and behavior ( clock, master/slave mode, 
IEC, standby ...).  From my point of view is is more clear like this, 
but It is feasible to merge both code adding conditions on direction in 
most functions. Please tell me what you prefer.
I case of merge i suppose that the best is to not define uniperif_ops 
struct but externalize functions...

Marc: That's reasonable, we just shouldn't be seeing large chunks of 
obvious code duplication.

First I just see that i proposed to remove uniperif_ops, I forgot...my 
apologize
Then to complete discussion, I'm aware that code seems similar regarding 
patches 3 and 4 with some duplications.
but patches 8 & 9 add controls on uniperiph player, that make add 
differences.
I also plan to re-implement the standby mode available only on uniperif 
player IP (after driver acceptation). This specific mode will allows to 
to keep player on to send silence on bus when PCM stream is stopped.

2) If both files are kept what could be done is to:
- suppress sti_platform_dai structure and call directly functions
- use directly snd_soc_dai_ops in to replace uniperif_ops and keep 
common functions in sti_platform.c
This could be ok for you?


>> +static void uni_player_set_channel_status(struct uniperif *player,
>> +					  struct snd_pcm_runtime *runtime)
>> +{
>> +	int n;
>> +	unsigned int status;
>> +
>> +	/*
>> +	 * Some AVRs and TVs require the channel status to contain a correct
>> +	 * sampling frequency. If no sample rate is already specified, then
>> +	 * set one.
>> +	 */
>
> Please take a look at Russell King's patch "sound/core: add IEC958
> channel status helper" (currently in review though I'd expect it to hit
> -next the next time it's built) - it does this (or most of it anyway) in
> a factored out function that can be shared between drivers.
>
I will check Russell King's code, and try to use helper functions.
>
>> +	switch (player->daifmt & SND_SOC_DAIFMT_INV_MASK) {
>> +	case SND_SOC_DAIFMT_IB_IF:
>> +	case SND_SOC_DAIFMT_NB_IF:
>> +		SET_UNIPERIF_I2S_FMT_LR_POL_HIG(player);
>> +		break;
>
> I didn't spot the code where the inverted and normal bit clock
> polarities are handled?
>
yes missing, i will rework this...
Just a question what do you consider as normal clock?
data output on rising edge?

  reply	other threads:[~2015-05-26 13:51 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-18 12:12 [PATCH v2 0/9] asoc: Add audio for sti platforms Arnaud Pouliquen
2015-05-18 12:12 ` [PATCH v2 1/9] ASoC: sti: add binding for ASoc driver Arnaud Pouliquen
2015-05-22 12:43   ` Mark Brown
2015-05-22 13:24     ` Arnaud Pouliquen
2015-05-25 12:14       ` Mark Brown
2015-05-18 12:12 ` [PATCH v2 2/9] ASoC: sti: Add uniperipheral header file Arnaud Pouliquen
2015-05-18 12:12 ` [PATCH v2 3/9] ASoC: sti: Add CPU DAI driver for playback Arnaud Pouliquen
2015-05-25 12:37   ` Mark Brown
2015-05-26 13:51     ` Arnaud Pouliquen [this message]
2015-05-18 12:12 ` [PATCH v2 4/9] ASoC: sti: Add CPU DAI driver for capture Arnaud Pouliquen
2015-05-25 12:39   ` Mark Brown
2015-05-18 12:12 ` [PATCH v2 5/9] ASoC: sti: Add platform driver Arnaud Pouliquen
2015-05-25 12:50   ` Mark Brown
2015-05-27  8:48     ` Arnaud Pouliquen
2015-05-27 12:06       ` Lars-Peter Clausen
2015-05-18 12:12 ` [PATCH v2 6/9] ASoC: Add ability to build sti drivers Arnaud Pouliquen
2015-05-25 12:50   ` Mark Brown
2015-05-18 12:12 ` [PATCH v2 7/9] ASoC: Codec: Add sti platform codec Arnaud Pouliquen
2015-05-25 13:01   ` Mark Brown
2015-06-01 17:41     ` Arnaud Pouliquen
2015-06-02 19:12       ` Mark Brown
2015-05-18 12:12 ` [PATCH v2 8/9] ASoC: sti: Add clock adjustement control Arnaud Pouliquen
2015-05-25 14:37   ` Mark Brown
2015-05-18 12:12 ` [PATCH v2 9/9] ASoC: sti: Add IEC control Arnaud Pouliquen
2015-05-25 14:36   ` Mark Brown

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=55647A7B.2050400@st.com \
    --to=arnaud.pouliquen@st.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).