From: Jarkko Nikula <jhnikula@gmail.com>
To: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Cc: linux-omap@vger.kernel.org, alsa-devel@vger.kernel.org
Subject: Re: Please help in adding ams-delta support to ASoC
Date: Mon, 8 Jun 2009 09:40:28 +0300 [thread overview]
Message-ID: <20090608094028.415e6ec3.jhnikula@gmail.com> (raw)
In-Reply-To: <200906060028.01600.jkrzyszt@tis.icnet.pl>
On Sat, 6 Jun 2009 00:28:00 +0200
Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> wrote:
> Reviewing the code of different asoc omap drivers and mcbsp
> documentation again and again, several questions comes on mind, like:
>
> 1. What is the default setting for mcbsp master clock source?
> Assuming that default register bit values are 0,
> OMAP_MCBSP_SYSCLK_CLKS_EXT would be default for omap1, and there
> would be no default for others. Sources other than
> OMAP_MCBSP_SYSCLK_CLKS_EXT or OMAP_MCBSP_SYSCLK_CLKS_FCLK require
> setting of CLKSM and/or SCLKME to 1, and both
> OMAP_MCBSP_SYSCLK_CLKS_EXT and OMAP_MCBSP_SYSCLK_CLKS_FCLK require
> additional omap_ctrl_writel() calls on omap2 and higher. Am I missing
> anything?
>
Actually there is no master in such but transfers are operated from
internal bit-clock and frame sync signals which can be delivered either
from outside (this is the typical McBSP slave configuration) or from
internal sample rate generator (SRG) which can use multiple clock
sources.
CLKXM and CLKRM selects the SRG for transfer bit-clock source and FSXM
and FSRM selects the SRG for frame sync source respectively.
Now if above bits are set and McBSP is used in master configuration,
then CLKSM and SCLKME are used to select the SRG input clock. CLKS is
one of those options and OMAP2 and later can use internal FCLK or
external CLKS pin as a CLKS source.
These are best explained in figures 6 and 7 in OMAP5912 McBSP
documentation [1]. It applies to later omaps and IRCC it applies to
1510 as well.
> 2. Why omap asoc drivers, except for omap3pandora, do not call
> snd_soc_dai_set_sysclk(cpu_dai, ...)? Does it mean that osk9512 uses
> default OMAP_MCBSP_SYSCLK_CLKS_EXT? What does it mean for others
> without default?
>
It is used to select SRG input clock when McBSP is master, i.e. when
DAI is configured with SND_SOC_DAIFMT_CBS_CFS so it's null op for
others since they don't use SRG.
> Anyway, we still have at least two potential reasons for my driver
> not working: wrong mcbsp clocks setup or broken mcbsp dma handling.
> My last idea was to create a generic test driver that would not use
> any external clocks, ie configured with OMAP_MCBSP_SYSCLK_CLK and
> SND_SOC_DAIFMT_CBS_CFS, right? That way, it should just work without
> any hardware support except for mcbsp and maybe we could then
> definitelly verify if current mcbsp and dma code works on omap1510 or
> not. Trying to select a template driver to base the test driver on, I
> felt into these troubles with more and more questions coming on mind.
> If you think my idea is worth of trying, could you please look at
> this and give me some hints?
>
This could be a bit risky and can damage your HW since both OMAP and
codec are then driving the bit-clock and FS signals but you could try
to configure McBSP as a master and use the internal clock source as its
input.
Basically it goes with current driver by passing SND_SOC_DAIFMT_CBS_CFS
to snd_soc_dai_set_fmt(cpu_dai, ...) and by setting SRG source clock
and divider:
snd_soc_dai_set_sysclk(cpu_dai, OMAP_MCBSP_SYSCLK_CLK, ...);
snd_soc_dai_set_clkdiv(cpu_dai, OMAP_MCBSP_CLKGDV, divider);
I think internal clock source is the same than CPU clock on 1510 but
this is and exact divider value are not so important here since we only
want to verify is the DMA operating.
If you want to play safe you could try to find out how to mux those
bit-clock and FS pins into GPIO inputs (if this is possible) so then it
should not matter if also McBSP is the DAI master.
So remember, this can be dangerous to your HW :-)
--
Jarkko
1.
http://focus.ti.com/general/docs/litabsmultiplefilelist.tsp?literatureNumber=spru762c
next prev parent reply other threads:[~2009-06-08 6:40 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-26 13:17 Please help in adding ams-delta support to ASoC Janusz Krzysztofik
2009-05-27 5:57 ` Peter Ujfalusi
2009-05-27 13:07 ` Janusz Krzysztofik
2009-06-02 5:47 ` Peter Ujfalusi
2009-06-02 11:38 ` Janusz Krzysztofik
2009-05-27 6:59 ` Jarkko Nikula
2009-05-27 14:33 ` Janusz Krzysztofik
2009-05-27 15:19 ` Jarkko Nikula
2009-05-27 18:58 ` Janusz Krzysztofik
2009-06-01 12:41 ` Janusz Krzysztofik
2009-06-01 18:04 ` Jarkko Nikula
2009-06-02 6:08 ` Peter Ujfalusi
2009-06-02 6:22 ` Jarkko Nikula
2009-06-02 13:35 ` Janusz Krzysztofik
2009-06-02 17:32 ` Jarkko Nikula
2009-06-03 7:24 ` Janusz Krzysztofik
2009-06-05 13:55 ` Jarkko Nikula
2009-06-05 22:28 ` Janusz Krzysztofik
2009-06-05 22:45 ` [alsa-devel] " Mark Brown
2009-06-06 17:42 ` Janusz Krzysztofik
2009-06-07 9:40 ` Mark Brown
2009-06-09 7:12 ` Peter Ujfalusi
2009-06-09 15:17 ` [alsa-devel] " Janusz Krzysztofik
2009-06-10 8:12 ` Peter Ujfalusi
2009-06-10 10:27 ` [alsa-devel] " Janusz Krzysztofik
2009-06-10 10:53 ` Peter Ujfalusi
2009-06-10 12:20 ` Janusz Krzysztofik
2009-06-10 18:05 ` Janusz Krzysztofik
2009-06-10 14:20 ` Janusz Krzysztofik
2009-06-08 6:40 ` Jarkko Nikula [this message]
2009-06-09 15:00 ` Janusz Krzysztofik
2009-06-15 13:22 ` Janusz Krzysztofik
2009-06-15 15:16 ` Jarkko Nikula
2009-06-16 14:43 ` Janusz Krzysztofik
2009-06-17 14:12 ` Progress in adding ams-delta support to ASoC? Janusz Krzysztofik
2009-06-18 9:02 ` Peter Ujfalusi
2009-06-18 7:58 ` Tony Lindgren
2009-06-18 11:51 ` Janusz Krzysztofik
2009-06-18 10:21 ` Tony Lindgren
2009-06-18 6:07 ` Please help in adding ams-delta support to ASoC Jarkko Nikula
2009-06-18 11:40 ` Janusz Krzysztofik
2009-06-19 3:50 ` Arun K S
2009-06-19 11:20 ` Janusz Krzysztofik
2009-06-19 18:55 ` Arun K S
2009-06-22 11:47 ` Jarkko Nikula
2009-06-23 11:58 ` Janusz Krzysztofik
2009-06-02 10:50 ` *SPAM* " Janusz Krzysztofik
2009-06-03 5:28 ` Peter Ujfalusi
2009-06-03 8:28 ` Janusz Krzysztofik
[not found] ` <20090527104711.GA1970@sirena.org.uk>
2009-06-02 7:24 ` Janusz Krzysztofik
2009-06-02 9:37 ` 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=20090608094028.415e6ec3.jhnikula@gmail.com \
--to=jhnikula@gmail.com \
--cc=alsa-devel@vger.kernel.org \
--cc=jkrzyszt@tis.icnet.pl \
--cc=linux-omap@vger.kernel.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