Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@nokia.com>
To: ext Joonyoung Shim <jy0922.shim@samsung.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"broonie@opensource.wolfsonmicro.com"
	<broonie@opensource.wolfsonmicro.com>,
	"kyungmin.park@samsung.com" <kyungmin.park@samsung.com>,
	"bhmin@samsung.com" <bhmin@samsung.com>
Subject: Re: [PATCH v2 1/1] ASoC: TWL4030: Add support Voice DAI
Date: Mon, 20 Apr 2009 14:15:27 +0300	[thread overview]
Message-ID: <200904201415.27956.peter.ujfalusi@nokia.com> (raw)
In-Reply-To: <49EC4CAF.5090106@samsung.com>

On Monday 20 April 2009 13:21:35 ext Joonyoung Shim wrote:
> Add Voice DAI to support the PCM voice interface of the twl4030 codec.
>

This does look good.

>
> +	/* clock inversion */
> +	switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
> +	case SND_SOC_DAIFMT_IB_NF:
> +		format &= ~(TWL4030_VIF_FORMAT);
> +		break;
> +	case SND_SOC_DAIFMT_NB_IF:
> +		format |= TWL4030_VIF_FORMAT;
> +		break;
> +	default:
> +		return -EINVAL;
> +	}

I think here it would be better to use:
switch (fmt & (SND_SOC_DAIFMT_FORMAT_MASK |
			 SND_SOC_DAIFMT_INV_MASK)) {
case (SND_SOC_DAIFMT_DSP_A|SND_SOC_DAIFMT_IB_NF):
	format &= ~(TWL4030_VIF_FORMAT);
	break;
case (SND_SOC_DAIFMT_DSP_A|SND_SOC_DAIFMT_NB_IF):
	format |= TWL4030_VIF_FORMAT;
	break;
default:
	return -EINVAL;
}

or:
if ((fm & SND_SOC_DAIFMT_FORMAT_MASK) != SND_SOC_DAIFMT_DSP_A)
	/* Only DSP_A mode is supported for the Voice interface */
	return -EINVAL;

Just rule out any misconfiguration attempt and also act like an interface 
documentation on what format is supported in Voice mode

But even without this, I think this patch looks OK,

---
Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>

      parent reply	other threads:[~2009-04-20 11:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-20 10:21 [PATCH v2 1/1] ASoC: TWL4030: Add support Voice DAI Joonyoung Shim
2009-04-20 10:47 ` Mark Brown
2009-04-20 11:15 ` Peter Ujfalusi [this message]

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=200904201415.27956.peter.ujfalusi@nokia.com \
    --to=peter.ujfalusi@nokia.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=bhmin@samsung.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=jy0922.shim@samsung.com \
    --cc=kyungmin.park@samsung.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