From: Nicolas Ferre <nicolas.ferre@atmel.com>
To: "avictor.za@gmail.com" <avictor.za@gmail.com>,
linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org, Fabian Godehardt <fg@emlix.com>
Subject: Re: [PATCH] AT91: SAM9G45 - add a separate clock entry for every single TC block
Date: Wed, 08 Sep 2010 11:00:40 +0200 [thread overview]
Message-ID: <4C8750B8.6000107@atmel.com> (raw)
In-Reply-To: <AANLkTin+vCsG3FUvX6DTUfFe7ZJpbkYyqw_TLvH9ujrJ@mail.gmail.com>
Le 07/09/2010 21:42, avictor.za@gmail.com :
> hi,
>
>> +/* One additional fake clock for second TC block */
>> +static struct clk tcb1_clk = {
>> + .name = "tcb1_clk",
>> + .pmc_mask = 0,
>> + .type = CLK_TYPE_PERIPHERAL,
>> + .parent = &tcb0_clk,
>> +};
>> +
>
> Looking at this again... since type is CLK_TYPE_PERIPHERAL, when you
> call clk_register() the "parent" is changed to the master clock.
>
> Which means, then later you call clk_enable() the "pmc_mask" is still
> 0, so 0 gets written (in pmc_periph_mode) to AT91_PMC_PCER. So the
> TCB clock won't be enabled.
>
> Or am I missing something?
You are absolutely right!
What do you think about this modification of clk_register() function?
--- a/arch/arm/mach-at91/clock.c
+++ b/arch/arm/mach-at91/clock.c
@@ -501,7 +501,8 @@ postcore_initcall(at91_clk_debugfs_init);
int __init clk_register(struct clk *clk)
{
if (clk_is_peripheral(clk)) {
- clk->parent = &mck;
+ if (!clk->parent)
+ clk->parent = &mck;
clk->mode = pmc_periph_mode;
list_add_tail(&clk->node, &clocks);
}
It is a very little modification which implements what I had in mind
while creating a kind of "child peripheral" clock.
Best regards,
--
Nicolas Ferre
next prev parent reply other threads:[~2010-09-08 9:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <201009060548.18521.fg@emlix.com>
2010-09-06 11:23 ` Nicolas Ferre
2010-09-06 21:07 ` avictor.za
2010-09-07 19:42 ` avictor.za
2010-09-08 9:00 ` Nicolas Ferre [this message]
2010-09-08 9:50 ` Jean-Christophe PLAGNIOL-VILLARD
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=4C8750B8.6000107@atmel.com \
--to=nicolas.ferre@atmel.com \
--cc=avictor.za@gmail.com \
--cc=fg@emlix.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®