From: Peter Ujfalusi <peter.ujfalusi@nokia.com>
To: ext Paul Walmsley <paul@pwsan.com>
Cc: "linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
Jarkko Nikula <jhnikula@gmail.com>
Subject: Re: [PATCH 07/10] OMAP: McBSP: implement functional clock switching via clock framework
Date: Tue, 5 Oct 2010 11:35:36 +0300 [thread overview]
Message-ID: <201010051135.36436.peter.ujfalusi@nokia.com> (raw)
In-Reply-To: <20101001213531.1408.87922.stgit@twilight.localdomain>
Hello,
I have only one question...
On Saturday 02 October 2010 00:35:32 ext Paul Walmsley wrote:
...
> +/* McBSP CLKS source switching function */
> +
> +int omap2_mcbsp_set_clks_src(u8 id, u8 fck_src_id)
> +{
> + struct omap_mcbsp *mcbsp;
> + struct clk *fck_src;
> + char *fck_src_name;
> + int r;
> +
> + if (!omap_mcbsp_check_valid_id(id)) {
> + pr_err("%s: Invalid id (%d)\n", __func__, id + 1);
> + return -EINVAL;
> + }
> + mcbsp = id_to_mcbsp_ptr(id);
> +
> + if (fck_src_id == MCBSP_CLKS_PAD_SRC)
> + fck_src_name = "pad_fck";
> + else if (fck_src_id == MCBSP_CLKS_PRCM_SRC)
> + fck_src_name = "prcm_fck";
> + else
> + return -EINVAL;
> +
> + fck_src = clk_get(mcbsp->dev, fck_src_name);
> + if (IS_ERR_OR_NULL(fck_src)) {
> + pr_err("omap-mcbsp: %s: could not clk_get() %s\n", "clks",
> + fck_src_name);
> + return -EINVAL;
> + }
> +
> + clk_disable(mcbsp->fclk);
> +
> + r = clk_set_parent(mcbsp->fclk, fck_src);
> + if (IS_ERR_VALUE(r)) {
> + pr_err("omap-mcbsp: %s: could not clk_set_parent() to %s\n",
> + "clks", fck_src_name);
> + clk_put(fck_src);
> + return -EINVAL;
> + }
> +
> + clk_enable(mcbsp->fclk);
> +
> + clk_put(fck_src);
> +
> + return 0;
> +}
> +EXPORT_SYMBOL(omap2_mcbsp_set_clks_src);
...
> static int omap_mcbsp_dai_set_dai_sysclk(struct snd_soc_dai *cpu_dai,
> int clk_id, unsigned int freq,
> int dir)
> {
> struct omap_mcbsp_data *mcbsp_data = to_mcbsp(cpu_dai->private_data);
> struct omap_mcbsp_reg_cfg *regs = &mcbsp_data->regs;
> - struct omap_mcbsp_platform_data *pdata = cpu_dai->dev->platform_data;
> int err = 0;
>
> /* The McBSP signal muxing functions are only available on McBSP1 */
> @@ -685,8 +630,20 @@ static int omap_mcbsp_dai_set_dai_sysclk(struct
> snd_soc_dai *cpu_dai, regs->srgr2 |= CLKSM;
> break;
> case OMAP_MCBSP_SYSCLK_CLKS_FCLK:
> + if (cpu_class_is_omap1()) {
> + err = -EINVAL;
> + break;
> + }
> + err = omap2_mcbsp_set_clks_src(mcbsp_data->bus_id,
> + MCBSP_CLKS_PRCM_SRC);
> + break;
> case OMAP_MCBSP_SYSCLK_CLKS_EXT:
> - err = omap_mcbsp_dai_set_clks_src(mcbsp_data, clk_id);
> + if (cpu_class_is_omap1()) {
> + err = 0;
> + break;
> + }
> + err = omap2_mcbsp_set_clks_src(mcbsp_data->bus_id,
> + MCBSP_CLKS_PAD_SRC);
> break;
>
> case OMAP_MCBSP_SYSCLK_CLKX_EXT:
What is the fclk source by default.
What I mean is that most of the machine drivers are not calling the
snd_soc_dai_set_sysclk for the cpu_dai.
It has been by default to prcm_fclk (core_96 or per_96).
Is this still the case after this series?
Do we need to go through the ASoC machine drivers, and need to select explicitly
the prcm_fclk from now on?
--
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
WARNING: multiple messages have this Message-ID (diff)
From: peter.ujfalusi@nokia.com (Peter Ujfalusi)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 07/10] OMAP: McBSP: implement functional clock switching via clock framework
Date: Tue, 5 Oct 2010 11:35:36 +0300 [thread overview]
Message-ID: <201010051135.36436.peter.ujfalusi@nokia.com> (raw)
In-Reply-To: <20101001213531.1408.87922.stgit@twilight.localdomain>
Hello,
I have only one question...
On Saturday 02 October 2010 00:35:32 ext Paul Walmsley wrote:
...
> +/* McBSP CLKS source switching function */
> +
> +int omap2_mcbsp_set_clks_src(u8 id, u8 fck_src_id)
> +{
> + struct omap_mcbsp *mcbsp;
> + struct clk *fck_src;
> + char *fck_src_name;
> + int r;
> +
> + if (!omap_mcbsp_check_valid_id(id)) {
> + pr_err("%s: Invalid id (%d)\n", __func__, id + 1);
> + return -EINVAL;
> + }
> + mcbsp = id_to_mcbsp_ptr(id);
> +
> + if (fck_src_id == MCBSP_CLKS_PAD_SRC)
> + fck_src_name = "pad_fck";
> + else if (fck_src_id == MCBSP_CLKS_PRCM_SRC)
> + fck_src_name = "prcm_fck";
> + else
> + return -EINVAL;
> +
> + fck_src = clk_get(mcbsp->dev, fck_src_name);
> + if (IS_ERR_OR_NULL(fck_src)) {
> + pr_err("omap-mcbsp: %s: could not clk_get() %s\n", "clks",
> + fck_src_name);
> + return -EINVAL;
> + }
> +
> + clk_disable(mcbsp->fclk);
> +
> + r = clk_set_parent(mcbsp->fclk, fck_src);
> + if (IS_ERR_VALUE(r)) {
> + pr_err("omap-mcbsp: %s: could not clk_set_parent() to %s\n",
> + "clks", fck_src_name);
> + clk_put(fck_src);
> + return -EINVAL;
> + }
> +
> + clk_enable(mcbsp->fclk);
> +
> + clk_put(fck_src);
> +
> + return 0;
> +}
> +EXPORT_SYMBOL(omap2_mcbsp_set_clks_src);
...
> static int omap_mcbsp_dai_set_dai_sysclk(struct snd_soc_dai *cpu_dai,
> int clk_id, unsigned int freq,
> int dir)
> {
> struct omap_mcbsp_data *mcbsp_data = to_mcbsp(cpu_dai->private_data);
> struct omap_mcbsp_reg_cfg *regs = &mcbsp_data->regs;
> - struct omap_mcbsp_platform_data *pdata = cpu_dai->dev->platform_data;
> int err = 0;
>
> /* The McBSP signal muxing functions are only available on McBSP1 */
> @@ -685,8 +630,20 @@ static int omap_mcbsp_dai_set_dai_sysclk(struct
> snd_soc_dai *cpu_dai, regs->srgr2 |= CLKSM;
> break;
> case OMAP_MCBSP_SYSCLK_CLKS_FCLK:
> + if (cpu_class_is_omap1()) {
> + err = -EINVAL;
> + break;
> + }
> + err = omap2_mcbsp_set_clks_src(mcbsp_data->bus_id,
> + MCBSP_CLKS_PRCM_SRC);
> + break;
> case OMAP_MCBSP_SYSCLK_CLKS_EXT:
> - err = omap_mcbsp_dai_set_clks_src(mcbsp_data, clk_id);
> + if (cpu_class_is_omap1()) {
> + err = 0;
> + break;
> + }
> + err = omap2_mcbsp_set_clks_src(mcbsp_data->bus_id,
> + MCBSP_CLKS_PAD_SRC);
> break;
>
> case OMAP_MCBSP_SYSCLK_CLKX_EXT:
What is the fclk source by default.
What I mean is that most of the machine drivers are not calling the
snd_soc_dai_set_sysclk for the cpu_dai.
It has been by default to prcm_fclk (core_96 or per_96).
Is this still the case after this series?
Do we need to go through the ASoC machine drivers, and need to select explicitly
the prcm_fclk from now on?
--
P?ter
next prev parent reply other threads:[~2010-10-05 8:35 UTC|newest]
Thread overview: 86+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-01 21:34 [PATCH 00/10] OMAP: SCM/McBSP/clock: branch integration patches for 2.6.37 Paul Walmsley
2010-10-01 21:34 ` Paul Walmsley
2010-10-01 21:34 ` [PATCH 01/10] OMAP2+: Kconfig: disallow builds for boards that don't use the currently-selected SoC Paul Walmsley
2010-10-01 21:34 ` Paul Walmsley
2010-10-04 4:21 ` Varadarajan, Charulatha
2010-10-04 4:21 ` Varadarajan, Charulatha
2010-10-04 5:45 ` Paul Walmsley
2010-10-04 5:45 ` Paul Walmsley
2010-10-01 21:34 ` [PATCH 02/10] OMAP2420: CTRL: fix OMAP242X_CTRL_REGADDR macro Paul Walmsley
2010-10-01 21:34 ` Paul Walmsley
2010-10-01 21:34 ` [PATCH 03/10] OMAP2420: clock: add MCBSP_CLKS node and clkdev aliases Paul Walmsley
2010-10-01 21:34 ` Paul Walmsley
2010-10-01 21:35 ` [PATCH 04/10] OMAP2430: " Paul Walmsley
2010-10-01 21:35 ` Paul Walmsley
2010-10-01 21:35 ` [PATCH 05/10] OMAP3xxx: clock: add clkdev aliases for McBSP fclk source switching Paul Walmsley
2010-10-01 21:35 ` Paul Walmsley
2010-10-01 21:35 ` [PATCH 06/10] OMAP: McBSP: implement McBSP CLKR and FSR signal muxing via mach-omap2/mcbsp.c Paul Walmsley
2010-10-01 21:35 ` Paul Walmsley
2010-10-01 21:35 ` [PATCH 07/10] OMAP: McBSP: implement functional clock switching via clock framework Paul Walmsley
2010-10-01 21:35 ` Paul Walmsley
2010-10-05 8:35 ` Peter Ujfalusi [this message]
2010-10-05 8:35 ` Peter Ujfalusi
2010-10-05 9:57 ` Paul Walmsley
2010-10-05 9:57 ` Paul Walmsley
2010-10-01 21:35 ` [PATCH 08/10] OMAP: split plat-omap/common.c Paul Walmsley
2010-10-01 21:35 ` Paul Walmsley
2010-10-04 5:34 ` Shilimkar, Santosh
2010-10-04 5:34 ` Shilimkar, Santosh
2010-10-04 6:56 ` Felipe Balbi
2010-10-04 6:56 ` Felipe Balbi
2010-10-04 7:00 ` Felipe Balbi
2010-10-04 7:00 ` Felipe Balbi
2010-10-04 7:28 ` Shilimkar, Santosh
2010-10-04 7:28 ` Shilimkar, Santosh
2010-10-04 18:21 ` Tony Lindgren
2010-10-04 18:21 ` Tony Lindgren
2010-10-04 19:32 ` Paul Walmsley
2010-10-04 19:32 ` Paul Walmsley
2010-10-05 4:37 ` Shilimkar, Santosh
2010-10-05 4:37 ` Shilimkar, Santosh
2010-10-05 4:55 ` Paul Walmsley
2010-10-05 4:55 ` Paul Walmsley
2010-10-05 5:19 ` Shilimkar, Santosh
2010-10-05 5:19 ` Shilimkar, Santosh
2010-10-04 5:38 ` Varadarajan, Charulatha
2010-10-04 5:38 ` Varadarajan, Charulatha
2010-10-04 6:03 ` Paul Walmsley
2010-10-04 6:03 ` Paul Walmsley
2010-10-04 8:28 ` Varadarajan, Charulatha
2010-10-04 8:28 ` Varadarajan, Charulatha
2010-10-04 18:27 ` Tony Lindgren
2010-10-04 18:27 ` Tony Lindgren
2010-10-04 19:24 ` Paul Walmsley
2010-10-04 19:24 ` Paul Walmsley
2010-10-04 9:08 ` Cousson, Benoit
2010-10-04 9:08 ` Cousson, Benoit
2010-10-04 9:35 ` DebBarma, Tarun Kanti
2010-10-04 9:35 ` DebBarma, Tarun Kanti
2010-10-04 9:54 ` Cousson, Benoit
2010-10-04 9:54 ` Cousson, Benoit
2010-10-04 19:15 ` Paul Walmsley
2010-10-04 19:15 ` Paul Walmsley
2010-10-04 19:26 ` Paul Walmsley
2010-10-04 19:26 ` Paul Walmsley
2010-10-05 11:00 ` Sergei Shtylyov
2010-10-05 11:00 ` Sergei Shtylyov
2010-10-05 15:07 ` Paul Walmsley
2010-10-05 15:07 ` Paul Walmsley
2010-10-01 21:35 ` [PATCH 09/10] OMAP: control: move plat-omap/control.h to mach-omap2/control.h Paul Walmsley
2010-10-01 21:35 ` Paul Walmsley
2010-10-01 21:35 ` [PATCH 10/10] OMAP2+: clock: reduce the amount of standard debugging while disabling unused clocks Paul Walmsley
2010-10-01 21:35 ` Paul Walmsley
2010-10-05 12:52 ` [PATCH 00/10] OMAP: SCM/McBSP/clock: branch integration patches for 2.6.37 Jarkko Nikula
2010-10-05 12:52 ` Jarkko Nikula
2010-10-05 18:40 ` Tony Lindgren
2010-10-05 18:40 ` Tony Lindgren
2010-10-06 5:42 ` Peter Ujfalusi
2010-10-06 5:42 ` Peter Ujfalusi
2010-10-06 14:48 ` Tony Lindgren
2010-10-06 14:48 ` Tony Lindgren
2010-10-06 15:08 ` Liam Girdwood
2010-10-06 15:08 ` Liam Girdwood
2010-10-06 18:57 ` Paul Walmsley
2010-10-06 18:57 ` Paul Walmsley
2010-10-06 16:33 ` Mark Brown
2010-10-06 16:33 ` 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=201010051135.36436.peter.ujfalusi@nokia.com \
--to=peter.ujfalusi@nokia.com \
--cc=jhnikula@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=paul@pwsan.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.