From: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
To: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
Cc: Zubair Lutfullah Kakakhel
<Zubair.Kakakhel-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>,
wim-IQzOog9fTRqzQB+pC5nmwQ@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
paul-icTtO2rgO2OTuSrc4Mpeew@public.gmane.org
Subject: Re: [PATCH 1/2] dt: watchdog: Add DT binding documentation for jz47xx watchdog timer
Date: Tue, 27 Jan 2015 23:36:36 +0100 [thread overview]
Message-ID: <2960717.ZtXrNMeS1F@wuerfel> (raw)
In-Reply-To: <20150127221909.GA21671-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
On Tuesday 27 January 2015 14:19:09 Guenter Roeck wrote:
> On Tue, Jan 27, 2015 at 10:29:49PM +0100, Arnd Bergmann wrote:
> > On Tuesday 27 January 2015 12:52:29 Guenter Roeck wrote:
> > > Driver does this (today):
> > >
> > > drvdata->rtc_clk = clk_get(&pdev->dev, "rtc");
> > >
> > > Isn't that the name to use ? Just wondering.
> >
> > Just because the driver uses it at the moment does not mean it's the name
> > that the IP block uses.
> >
> > clk_get() has the unpleasant property of doing fuzzy matching
> > on the name that is passed. It first tries to use the string
> > as the name of the clock input of the device, but if that is
> > not there, it falls back to looking for a global clk with a con_id.
> >
> > In DT, we only support the first kind, but if a driver currently
> > uses the second, you get the wrong name.
> >
> > Looking at arch/mips/jz4740/clock.c now, this seems to be exactly
> > what is going on here: there is no clkdev_add call to associate
> > the device clocks, so it can only match a global clock entry.
> >
> Me confused :-(.
>
> Does that mean the driver needs to be fixed, that the DT property
> needs to change (to what ?), or both ?
Both.
The jz47xx clock driver should register a clkdev lookup table with
proper clock input names for each clock that is referenced by a
device, and then the drivers can use the right names.
In a lot of cases, the best name for a clock is no name so you
just use an anonymous clock like
clk = clk_get(dev, NULL);
but this still requires a clock lookup table.
Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2015-01-27 22:36 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-27 15:11 [PATCH 0/2] watchdog: jz4740: Add DT support Zubair Lutfullah Kakakhel
2015-01-27 15:11 ` [PATCH 1/2] dt: watchdog: Add DT binding documentation for jz47xx watchdog timer Zubair Lutfullah Kakakhel
[not found] ` <1422371490-44402-2-git-send-email-Zubair.Kakakhel-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
2015-01-27 16:30 ` Guenter Roeck
2015-01-27 20:16 ` Arnd Bergmann
2015-01-27 20:52 ` Guenter Roeck
2015-01-27 21:29 ` Arnd Bergmann
2015-01-27 22:19 ` Guenter Roeck
[not found] ` <20150127221909.GA21671-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2015-01-27 22:36 ` Arnd Bergmann [this message]
2015-01-27 22:42 ` Arnd Bergmann
2015-01-28 10:27 ` Zubair Lutfullah Kakakhel
2015-01-28 11:23 ` Arnd Bergmann
[not found] ` <1422371490-44402-1-git-send-email-Zubair.Kakakhel-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
2015-01-27 15:11 ` [PATCH 2/2] watchdog: jz4740: Add DT support Zubair Lutfullah Kakakhel
[not found] ` <1422371490-44402-3-git-send-email-Zubair.Kakakhel-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
2015-01-27 16:31 ` Guenter Roeck
2015-01-27 20:15 ` Arnd Bergmann
2015-01-27 20:54 ` Guenter Roeck
[not found] ` <20150127205430.GB6983-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2015-01-27 21:23 ` Arnd Bergmann
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=2960717.ZtXrNMeS1F@wuerfel \
--to=arnd-r2ngtmty4d4@public.gmane.org \
--cc=Zubair.Kakakhel-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-watchdog-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=paul-icTtO2rgO2OTuSrc4Mpeew@public.gmane.org \
--cc=wim-IQzOog9fTRqzQB+pC5nmwQ@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;
as well as URLs for NNTP newsgroup(s).