From: Thierry Reding <thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
Cc: Peter De Schrijver
<pdeschrijver-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
Prashant Gaikwad
<pgaikwad-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 3/3] clk: tegra: Properly setup PWM clock on Tegra30
Date: Wed, 30 Oct 2013 23:54:44 +0100 [thread overview]
Message-ID: <20131030225443.GB6939@mithrandir> (raw)
In-Reply-To: <52717C4F.6000202-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 3317 bytes --]
On Wed, Oct 30, 2013 at 03:38:23PM -0600, Stephen Warren wrote:
> On 10/30/2013 03:00 PM, Thierry Reding wrote:
> > On Tue, Oct 29, 2013 at 01:45:38PM -0600, Stephen Warren wrote:
> >> On 10/29/2013 09:51 AM, Thierry Reding wrote:
> >>> The clock for the PWM controller is slightly different from
> >>> other peripheral clocks on Tegra30. The clock source mux field
> >>> start at bit position 28 rather than 30.
>
> >>> diff --git a/drivers/clk/tegra/clk-tegra30.c
> >>> b/drivers/clk/tegra/clk-tegra30.c
> >>
> >>> @@ -836,7 +837,6 @@ static struct tegra_clk
> >>> tegra30_clks[tegra_clk_max] __initdata = { [tegra_clk_extern1]
> >>> = { .dt_id = TEGRA30_CLK_EXTERN1, .present = true },
> >>> [tegra_clk_extern2] = { .dt_id = TEGRA30_CLK_EXTERN2, .present
> >>> = true }, [tegra_clk_extern3] = { .dt_id = TEGRA30_CLK_EXTERN3,
> >>> .present = true }, - [tegra_clk_pwm] = { .dt_id =
> >>> TEGRA30_CLK_PWM, .present = true },
> >>
> >> I think you still need an entry in this table; isn't it used by
> >> the DT->internal clock ID translation function?
> >
> > As far as I can tell, this is used by the generic code to
> > determine which of the generic clocks to register. If
> > TEGRA30_CLK_PWM is kept within this list, tegra_periph_clk_init()
> > will register the clock a second time.
> >
> >> Either way, it seems like this patch might want to add a
> >> tegra_clk_pwm_tegra30 so that the common C files can still
> >> implement this clock, just with different parameters?
> >
> > That's pretty much what this patch does, isn't it? It adds a
> > custom entry for the PWM clock to the Tegra30-specific
> > tegra_periph_clk_list and keeps the common one from being
> > registered by dropping the entry from tegra30_clks.
>
> I was hoping for the new clock that gets added to be added to the
> common file that defines the common clocks rather than to be added to
> the Tegra30-specific files. However, I suppose if it really is a
> Tegra30-specific clock, then keeping it isolated to the
> Tegra30-specific file might make sense.
>
> That said, I wonder if we can't keep the PWM clock definition in the
> common file, and just make it a bit parameterized? Perhaps that
> defeats the purpose of a common definition though.
>
> > The same is already done on Tegra20, where the PWM clock is
> > similarly weird.
>
> OK, perhaps that's reasonable precedent for this then.
>
> > On Tegra114 and Tegra124 the clock is still weird, but it can be
> > tweaked into behaving more commonly by lying about the actual
> > position and size of the mux field.
>
> That doesn't sound good... What if someone actually wants to use the
> correct position/size (e.g. use mux options that presumably can't be
> selected now we've lied)? We really shouldn't lie about things.
Perhaps I've misinterpreted the code. At least comparing to the register
definitions the field should still be 3 bits wide, but the code clamps
it to the upper 2, which makes it compatible with the regular peripheral
clocks. The mux options that are left out are apparently very uncommonly
used (PLLC2 and PLLC3).
I suppose it's always possible that the register definition is wrong or
there was perhaps another good reason to do it this way? Maybe Peter
knows.
Thierry
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2013-10-30 22:54 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-29 15:51 [PATCH 1/3] clk: tegra114: Initialize clocks needed for HDMI Thierry Reding
[not found] ` <1383061872-27899-1-git-send-email-treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-10-29 15:51 ` [PATCH 2/3] clk: tegra: Initialize secondary gr3d clock on Tegra30 Thierry Reding
2013-10-29 15:51 ` [PATCH 3/3] clk: tegra: Properly setup PWM " Thierry Reding
[not found] ` <1383061872-27899-3-git-send-email-treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-10-29 19:45 ` Stephen Warren
[not found] ` <52701062.30405-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-10-30 21:00 ` Thierry Reding
2013-10-30 21:38 ` Stephen Warren
[not found] ` <52717C4F.6000202-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-10-30 22:54 ` Thierry Reding [this message]
2013-10-31 15:39 ` Peter De Schrijver
[not found] ` <20131031153923.GW22111-Rysk9IDjsxmJz7etNGeUX8VPkgjIgRvpAL8bYrjMMd8@public.gmane.org>
2013-11-01 9:38 ` Thierry Reding
[not found] ` <20131101093840.GF27864-AwZRO8vwLAwmlAP/+Wk3EA@public.gmane.org>
2013-11-01 16:47 ` Peter De Schrijver
[not found] ` <20131101164709.GA22111-Rysk9IDjsxmJz7etNGeUX8VPkgjIgRvpAL8bYrjMMd8@public.gmane.org>
2013-11-04 8:41 ` Thierry Reding
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=20131030225443.GB6939@mithrandir \
--to=thierry.reding-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=pdeschrijver-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=pgaikwad-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.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