All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Péter Ujfalusi" <peter.ujfalusi@ti.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Liam Girdwood <lrg@ti.com>, Tony Lindgren <tony@atomide.com>,
	alsa-devel@alsa-project.org, linux-omap@vger.kernel.org,
	Benoit Cousson <b-cousson@ti.com>
Subject: Re: Re: [PATCH v3 2/5] ASoC: OMAP4: omap-dmic: Initial support for OMAP DMIC
Date: Mon, 28 Nov 2011 09:49:19 +0200	[thread overview]
Message-ID: <2729071.3pgFW4tmaY@barack> (raw)
In-Reply-To: <20111127195040.GC25598@opensource.wolfsonmicro.com>

On Sunday 27 November 2011 19:50:41 Mark Brown wrote:
> On Fri, Nov 25, 2011 at 02:20:33PM +0200, Peter Ujfalusi wrote:
> > +	/*
> > +	 * 192KHz rate is only supported with 19.2MHz/3.84MHz clock
> > +	 * configuration. The same clock configuration allows 96KHz sampling
> > +	 * rate as well. omap_dmic_select_divider() function configures the
> > +	 * dividers for 96KHz, if the current stream is running in 192KHz we
> > +	 * can change the divider value, while respecting the machine driver
> > +	 * requested clock configuration.
> > +	 */
> > +	if (params_rate(params) == 192000) {
> > +		if (dmic->fclk_freq == 19200000 && dmic->clk_div == 0x1) {
> > +			dmic->clk_div = 0x6;
> > +		} else {
> > +			dev_err(dmic->dev,
> > +				"invalid clock configuration for 192KHz\n");
> > +			return -EINVAL;
> > +		}
> > +	}
> 
> So what happens if the user starts recording at 192kHz then goes back to
> 96kHz?  This all feels a bit clunky and fragile.

I expect another HW param calls. The stream is stopped, and I reconfigure the 
divider for 96KHz (I will not change the divider here, since the stream is 
96KHz). I don't see any issue here.

The comment explains the situation, and the reasoning behind of this check, 
and divider reconfiguration.

> It seems like the
> neatest solution here is to just record the desired DMICCLK rate when
> the user sets it and then apply it here rather than doing this patching
> later on.

I'm applying the divider in omap_dmic_dai_prepare callback.

--
Péter
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2011-11-28  7:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-25 12:20 [PATCH v3 0/5] Support for OMAP4 Digital Microphone interface Peter Ujfalusi
2011-11-25 12:20 ` [PATCH v3 1/5] OMAP4: hwmod: Add names for DMIC memory address space Peter Ujfalusi
2011-11-25 12:20 ` [PATCH v3 2/5] ASoC: OMAP4: omap-dmic: Initial support for OMAP DMIC Peter Ujfalusi
2011-11-27 19:50   ` Mark Brown
2011-11-28  7:49     ` Péter Ujfalusi [this message]
2011-11-28 11:44       ` Mark Brown
2011-11-28 13:39         ` Re: " Péter Ujfalusi
2011-11-25 12:20 ` [PATCH v3 3/5] OMAP4: devices: Register OMAP4 DMIC platform device Peter Ujfalusi
2011-11-25 12:20 ` [PATCH v3 4/5] OMAP4: board-4430sdp: Register platform device for digimic codec Peter Ujfalusi
2011-11-25 12:20 ` [PATCH v3 5/5] ASoC: sdp4430: Add support for digital microphones Peter Ujfalusi

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=2729071.3pgFW4tmaY@barack \
    --to=peter.ujfalusi@ti.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=b-cousson@ti.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=lrg@ti.com \
    --cc=tony@atomide.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.