All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frank Mandarino <fmandarino@endrelia.com>
To: Sedji Gaouaou <sedji.gaouaou@atmel.com>,
	Mark Brown <broonie@sirena.org.uk>
Cc: alsa-devel@alsa-project.org
Subject: Re: ALSA:AT91SAM9G20: Add support(DAI) for wolfson8731
Date: Wed, 17 Sep 2008 11:06:54 -0400	[thread overview]
Message-ID: <48D11D0E.90701@endrelia.com> (raw)
In-Reply-To: <20080917110530.GA7679@sirena.org.uk>

Mark Brown wrote:

> The only major issue I see with the patch is a documentation one: it's
> not clear to me reading the code how the atmel_ssc DAI driver relates to
> the existing at91_ssc driver.  It may be that this is something that's
> obvious to someone familiar with the at91 hardware but just looking at
> the code it's not clear to me what the difference is between the two and
> when each should be used.  
> 
> Looking at the code they appear to be similar to the point where they
> should be the same driver but it's entirely possible that I'm missing
> something here.  I've CCed in Frank Mandarino who did the existing AT91
> support.  If they should be separate drivers then some comments should
> be added in the driver and the Kconfig help text explaning the
> situation.

I agree that the drivers should be combined.  Unfortunately, at this
time I am unable to contribute to this effort.

>> +/*
>> + * Record SSC clock dividers for use in hw_params().
>> + */
>> +static int atmel_ssc_set_dai_clkdiv(struct snd_soc_dai *cpu_dai,
>> +	int div_id, int div)
>> +{
>> +	struct atmel_ssc_info *ssc_p = &ssc_info[cpu_dai->id];
>> +
>> +	switch (div_id) {
>> +	case AT91SSC_CMR_DIV:
>> +		/*
>> +		 * The same master clock divider is used for both
>> +		 * transmit and receive, so if a value has already
>> +		 * been set, it must match this value.
>> +		 */
>> +		if (ssc_p->cmr_div == 0)
>> +			ssc_p->cmr_div = div;
>> +		else
>> +			if (div != ssc_p->cmr_div)
>> +				return -EBUSY;
>> +		break;
> 
> What happens if the user wants to change the master clock divider at
> runtime - for example, when changing sample rates?

This is code from at91-ssc.c.  I really didn't consider the case of
changing the sample rate on an open substream.  This logic could be
updated to allow the new divider value if there is only one substream open.

> 
>> +		start_event = channels == 1
>> +				? 4
>> +				: 7;
> 
> This would be much clearer if it were expanded into multiple statements.

This was a little clearer in at91-ssc.c:

                start_event = channels == 1
                                ? AT91_SSC_START_FALLING_RF
                                : AT91_SSC_START_EDGE_RF;

Perhaps these constant definitions are no longer available it the latest
kernel.  Are there updated definitions to use instead of magic numbers?

Also, I'm fine with using multiple statements if that helps readability.

> 
>> +#ifdef CONFIG_PM
>> +#define atmel_ssc_suspend	NULL
>> +#define atmel_ssc_resume	NULL
>> +#else
>> +#define atmel_ssc_suspend	NULL
>> +#define atmel_ssc_resume	NULL
>> +#endif
> 
> These may as well be removed - if someone implements suspend/resume
> support they can add them then then.

Is there a reason that suspend/resume was removed?  It is really
important for embedded systems.

Regards,
../fam
-- 
Frank Mandarino                                fmandarino(a)endrelia.com
Endrelia Technologies Inc.
Toronto, Ontario, Canada

  reply	other threads:[~2008-09-17 15:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-17  9:51 ALSA:AT91SAM9G20: Add support(DAI) for wolfson8731 Sedji Gaouaou
2008-09-17 11:05 ` Mark Brown
2008-09-17 15:06   ` Frank Mandarino [this message]
2008-09-17 15:21     ` Mark Brown
2008-09-17 15:23     ` Sedji Gaouaou
2008-09-17 15:30       ` Mark Brown
2008-09-17 16:30         ` Sedji Gaouaou
2008-09-17 16:35           ` Mark Brown
     [not found]             ` <BAY110-W332FD6EFAA8BBE246EDD7DC94F0@phx.gbl>
2008-09-18  9:21               ` Does LKML accept non-ASOC audio driver? Mark Brown
     [not found]                 ` <BAY110-W448DBD74086F0CC723FA67C94F0@phx.gbl>
2008-09-18 10:17                   ` Mark Brown
     [not found]                     ` <BAY110-W35E0C694DFC04076A4E353C94F0@phx.gbl>
2008-09-18 11:33                       ` 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=48D11D0E.90701@endrelia.com \
    --to=fmandarino@endrelia.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@sirena.org.uk \
    --cc=sedji.gaouaou@atmel.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 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.