From: nsekhar@ti.com (Sekhar Nori)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: davinci: da850: Fix pwm name matching
Date: Mon, 31 Oct 2016 15:48:15 +0530 [thread overview]
Message-ID: <b4f6970b-5723-d1ed-088e-3c07129a005f@ti.com> (raw)
In-Reply-To: <1477418044-24603-1-git-send-email-david@lechnology.com>
On Tuesday 25 October 2016 11:24 PM, David Lechner wrote:
> This fixes pwm name matching for DA850 familiy devices. When using device
> tree, the da850_auxdata_lookup[] table caused pwm devices to have the exact
> same name, which caused errors when trying to register the devices.
>
> The names for clock matching in da850_clks[] also have to be updated to
> to exactly match in order for the clock lookup to work correctly.
>
> Signed-off-by: David Lechner <david@lechnology.com>
> ---
>
> Tested working on LEGO MINDSTORMS EV3.
>
>
> arch/arm/mach-davinci/da850.c | 10 +++++++---
> arch/arm/mach-davinci/da8xx-dt.c | 10 +++++-----
> 2 files changed, 12 insertions(+), 8 deletions(-)
>
> diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c
> index ed3d0e9..6b78a8f 100644
> --- a/arch/arm/mach-davinci/da850.c
> +++ b/arch/arm/mach-davinci/da850.c
> @@ -510,9 +510,13 @@ static struct clk_lookup da850_clks[] = {
> CLK("vpif", NULL, &vpif_clk),
> CLK("ahci_da850", NULL, &sata_clk),
> CLK("davinci-rproc.0", NULL, &dsp_clk),
> - CLK("ehrpwm", "fck", &ehrpwm_clk),
> - CLK("ehrpwm", "tbclk", &ehrpwm_tbclk),
> - CLK("ecap", "fck", &ecap_clk),
> + CLK("ehrpwm.0", "fck", &ehrpwm_clk),
> + CLK("ehrpwm.0", "tbclk", &ehrpwm_tbclk),
> + CLK("ehrpwm.1", "fck", &ehrpwm_clk),
> + CLK("ehrpwm.1", "tbclk", &ehrpwm_tbclk),
> + CLK("ecap.0", "fck", &ecap_clk),
> + CLK("ecap.1", "fck", &ecap_clk),
> + CLK("ecap.2", "fck", &ecap_clk),
This has exposed a limitation of DaVinci clock framework. The struct clk
are stored as a linked list themselves. So a node repeating in the table
above will create a loop in the linked list. This is easily seen on the
LCDK board. davinci_clk_disable_unused() never returns. PWMs are unused
on that board.
There is no "simple" solution to this AFAICS. One solution is to
separate the iterator from the clock hardware structure and use struct
clk_hw available in struct clk_lookup.
Or move DaVinci to common clock framework. This is of course preferred
but much more involved as all 6 supported SoCs have to be moved together.
Thanks,
Sekhar
next prev parent reply other threads:[~2016-10-31 10:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-25 17:54 [PATCH] ARM: davinci: da850: Fix pwm name matching David Lechner
2016-10-26 10:37 ` Sekhar Nori
2016-10-26 16:02 ` Kevin Hilman
2016-10-26 18:03 ` Sekhar Nori
2016-10-31 10:18 ` Sekhar Nori [this message]
2016-10-31 14:48 ` David Lechner
2016-11-01 10:31 ` Sekhar Nori
2016-11-03 4:20 ` David Lechner
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=b4f6970b-5723-d1ed-088e-3c07129a005f@ti.com \
--to=nsekhar@ti.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