From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [PATCH 1/2] dt: watchdog: Add DT binding documentation for jz47xx watchdog timer Date: Tue, 27 Jan 2015 23:36:36 +0100 Message-ID: <2960717.ZtXrNMeS1F@wuerfel> References: <1422371490-44402-1-git-send-email-Zubair.Kakakhel@imgtec.com> <16185448.sH4QMJhjYS@wuerfel> <20150127221909.GA21671@roeck-us.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Return-path: In-Reply-To: <20150127221909.GA21671-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org> Sender: linux-watchdog-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Guenter Roeck Cc: Zubair Lutfullah Kakakhel , 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 List-Id: devicetree@vger.kernel.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