All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Mack <daniel@caiaq.de>
To: Mark Brown <broonie@sirena.org.uk>
Cc: alsa-devel@alsa-project.org
Subject: Re: [PATCH] cs4270: add support for slave mode	configurations
Date: Wed, 25 Feb 2009 16:45:41 +0100	[thread overview]
Message-ID: <20090225154541.GF11203@buzzloop.caiaq.de> (raw)
In-Reply-To: <20090225153444.GC31637@sirena.org.uk>

On Wed, Feb 25, 2009 at 03:34:45PM +0000, Mark Brown wrote:
> On Wed, Feb 25, 2009 at 02:37:21PM +0100, Daniel Mack wrote:
> 
> >  	reg = snd_soc_read(codec, CS4270_MODE);
> >  	reg &= ~(CS4270_MODE_SPEED_MASK | CS4270_MODE_DIV_MASK);
> > -	reg |= cs4270_mode_ratios[i].speed_mode | cs4270_mode_ratios[i].mclk;
> > +	reg |= cs4270_mode_ratios[i].mclk;
> > +
> > +	if (cs4270->slave_mode)
> > +		reg |= CS4270_MODE_SLAVE;
> > +	else
> > +		reg |= cs4270_mode_ratios[i].speed_mode;
> 
> Shouldn't this be clearing MODE_SLAVE if it's in master mode? 

MODE_SLAVE is unset by the CS4270_MODE_SPEED_MASK mask:

#define CS4270_MODE_SPEED_MASK	0x30
#define CS4270_MODE_SLAVE	0x30

> Since
> we're doing a read/modify/write here it'd probably just be as easy to
> set or clear the bit when setting the DAI format rather than storing the
> data and setting it here.

I though so too, but the problem is that the bits that select the speed
mode are the same that select the slave mode. Hence, if I write to the
register in set_dai_fmt(), I'd have to add a special case in the other
part again. Doing it this looked much cleaner to me. Does that make
sense?

Daniel

  reply	other threads:[~2009-02-25 15:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-25 13:37 [PATCH] cs4270: add support for slave mode configurations Daniel Mack
2009-02-25 15:34 ` Mark Brown
2009-02-25 15:45   ` Daniel Mack [this message]
2009-02-25 15:48     ` Mark Brown
2009-02-27 21:51 ` Timur Tabi
2009-02-28 12:13   ` Daniel Mack
2009-02-28 16:32     ` Timur Tabi
2009-02-28 17:47       ` Daniel Mack
2009-03-01  1:09         ` Timur Tabi
2009-02-28 12:21   ` [PATCH] fix typo and removed unneeded switch case Daniel Mack
2009-03-01  1:11     ` Timur Tabi
2009-03-02 14:38       ` 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=20090225154541.GF11203@buzzloop.caiaq.de \
    --to=daniel@caiaq.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@sirena.org.uk \
    /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.