From: broonie@opensource.wolfsonmicro.com (Mark Brown)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 02/10] ASoc: mxs: add mxs-saif driver
Date: Sun, 10 Jul 2011 17:34:02 +0900 [thread overview]
Message-ID: <20110710083359.GB23199@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <CAA+hA=S0HTqNt+OxprdaqZMF8_9NF8G54UKJprcWc2DCbGf0xA@mail.gmail.com>
On Sun, Jul 10, 2011 at 04:17:13PM +0800, Dong Aisheng wrote:
> 2011/7/9 Mark Brown <broonie@opensource.wolfsonmicro.com>:
> > On Fri, Jul 08, 2011 at 11:59:42PM +0800, Dong Aisheng wrote:
> >> + ? ? switch (clk_id) {
> >> + ? ? case MXS_SAIF_SYS_CLK:
> >> + ? ? ? ? ? ? clk_set_rate(saif->clk, freq);
> >> + ? ? ? ? ? ? clk_enable(saif->clk);
> > How would one turn this clock off?
> Currenty simply enable clock always.
If that's what you're doing you should enable the clock when the device
is probed and disable it when the device is removed. These repeated
enables will mean that you're constantly leaking references.
> The problem is that the codec may use the MCLK supplied by SAIF as its
> system clock for normal operations such as i2c r/w.
That may be true for your particular system but it is not going to be
true in general - most devices can handle having their MCLK removed.
> If we disable it after playback or capture. The automatic dapm
> operations of codec may fail on i2c r/w. Will check if dapm has any
> machnism to avoid this.
> Can you share your experience ont this issue?
You should ideally let the machine driver or other system integration
code control if the clock is constantly enabled, or at the very least
control it from the probe and remove.
> >> +static irqreturn_t mxs_saif_irq(int irq, void *dev_id)
> >> +{
> >> + ? ? struct mxs_saif *saif = dev_id;
> >> +
> >> + ? ? if (saif->fifo_err_counter++ % 100 == 0)
> >
> > The rate limit looks awfully suspicious...
> Originally it's just for printing less error messages when the issue happens.
> I could remove the rate limit.
Please do so.
> >> + ? ? clk_set_rate(saif->clk, 12000000);
> >> + ? ? clk_enable(saif->clk);
> > How did you pick this clock rate and why does it need to be set? ?It's
> > not an obvious audio rate...
> It's initial clock rate for normal operations of codecs based on MCLK.
> We found the default MCLK ouput(only about 7.3Khz) can not work for codecs like
> sgtl5000 for its initialization since its clock range is 8Mhz~27Mhz.
> So we set a common working clock 12Mhz here.
> Maybe i should try to set it elsewhere or just set it via platform data.
This is the same issue as the above one with repeated enables? You
should delegate the rate selection and ideally also the enable control
to the machine driver, it can set something in its probe() function.
next prev parent reply other threads:[~2011-07-10 8:34 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-08 15:59 [PATCH 00/10] ARM: mxs: add audio support Dong Aisheng
2011-07-08 15:59 ` [PATCH 01/10] ASoc: mxs: add mxs-pcm driver Dong Aisheng
2011-07-09 2:33 ` Mark Brown
2011-07-10 6:28 ` Dong Aisheng
2011-07-10 8:21 ` Mark Brown
2011-07-08 15:59 ` [PATCH 02/10] ASoc: mxs: add mxs-saif driver Dong Aisheng
2011-07-08 16:19 ` Sascha Hauer
2011-07-08 17:10 ` Wolfram Sang
2011-07-08 18:35 ` Dong Aisheng
2011-07-09 2:52 ` Mark Brown
2011-07-10 8:17 ` Dong Aisheng
2011-07-10 8:34 ` Mark Brown [this message]
2011-07-10 8:58 ` Dong Aisheng
2011-07-10 9:26 ` Mark Brown
2011-07-10 11:59 ` Dong Aisheng
2011-07-11 10:00 ` Wolfram Sang
2011-07-13 3:28 ` Dong Aisheng-B29396
2011-07-08 15:59 ` [PATCH 03/10] ASoc: mxs: add mxs-sgtl5000 machine driver Dong Aisheng
2011-07-09 3:00 ` Mark Brown
2011-07-10 8:36 ` Dong Aisheng
2011-07-10 8:40 ` Mark Brown
2011-07-08 15:59 ` [PATCH 04/10] ASoc: mxs: add asoc configuration files Dong Aisheng
2011-07-09 3:01 ` Mark Brown
2011-07-10 8:37 ` Dong Aisheng
2011-07-08 15:59 ` [PATCH 05/10] ARM: mxs: add saif clock Dong Aisheng
2011-07-08 15:59 ` [PATCH 06/10] ARM: mxs: add saif device Dong Aisheng
2011-07-08 15:59 ` [PATCH 07/10] ARM: mxs: add sgtl5000 i2c device Dong Aisheng
2011-07-08 15:59 ` [PATCH 08/10] ARM: mxs: add mxs-sgtl5000 device Dong Aisheng
2011-07-08 15:59 ` [PATCH 09/10] ARM: mxs: correct the using of frac div for saif Dong Aisheng
2011-07-08 15:59 ` [PATCH 10/10] ARM: mxs-dma: include <linux/dmaengine.h> Dong Aisheng
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=20110710083359.GB23199@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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).