From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pawel Moll Date: Tue, 03 Mar 2015 10:22:07 +0000 Subject: Re: [PATCH] video: ARM CLCD: Added dt support to set tim2 register Message-Id: <1425378127.3092.38.camel@arm.com> List-Id: References: <1424898082-1522-1-git-send-email-arun.ramamurthy@broadcom.com> <1425312688.3092.10.camel@arm.com> <54F4B583.4000005@broadcom.com> <1425376977.3092.26.camel@arm.com> In-Reply-To: <1425376977.3092.26.camel-5wv7dgnIgG8@public.gmane.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Arun Ramamurthy Cc: Rob Herring , Mark Rutland , Ian Campbell , Kumar Gala , Russell King , Jean-Christophe Plagniol-Villard , Tomi Valkeinen , "devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "linux-fbdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Dmitry Torokhov , Anatol Pomazau , Jonathan Richardson , Scott Branden , Ray Jui , "bcm-kernel-feedback-list-dY08KVG/lbpWk0Htik3J/w@public.gmane.org" On Tue, 2015-03-03 at 10:02 +0000, Pawel Moll wrote: > On Mon, 2015-03-02 at 19:09 +0000, Arun Ramamurthy wrote: > > > The existing bindings intentionally avoided quoting internal registers - > > > they are supposed to describe how the hardware is wired up... > > > > > > So how about something like "arm,pl11x,tft-invert-clac"? Then the driver > > > sets the bit or not, depending on the property existance? > > > > > Sure, I can change it to two properties called arm,pl11x,tft-invert-clac > > and arm,pl11x,tft-clksel. Would that be acceptable? > > That would be fine by me :-) Or (after having a look at the TRM) I should rather say: the invert-clac is fine by me :-) but the tft-clksel doesn't work, I afraid. If I'm not mistaken, there are two problems with it. Number one: it's not TFT-specific, is it? So it certainly should not have the "tft-" bit. Number two: setting this bit says "do not use CLCDCLK for the logic; use HCLK instead", correct? If so, have a look at the clock properties. They say: - clock-names: should contain "clcdclk" and "apb_pclk" - clocks: contains phandle and clock specifier pairs for the entries in the clock-names property. See So if your hardware has the reference clock wired to HCLK, and you defining the clocks as "clcdclk", you are (no offence meant ;-) lying :-) So how about solving the problem by extending the clock-names definition like this (feel free to use own wording): - clock-names: should contain two clocks, either "clcdclk" or "hclk" (depending on which input is to be used as a reference clock by the controller logic) and "apb_pclk" That way you're precisely describing the way the hardware is wired up. And the driver simply tries to get clcdclk first, if it's defined - cool, set clksel to 1, if not - try hclk and set clksel to 0. If neither of them is present - bail out. Does this make any sense? Pawel From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pawel Moll Subject: Re: [PATCH] video: ARM CLCD: Added dt support to set tim2 register Date: Tue, 03 Mar 2015 10:22:07 +0000 Message-ID: <1425378127.3092.38.camel@arm.com> References: <1424898082-1522-1-git-send-email-arun.ramamurthy@broadcom.com> <1425312688.3092.10.camel@arm.com> <54F4B583.4000005@broadcom.com> <1425376977.3092.26.camel@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1425376977.3092.26.camel-5wv7dgnIgG8@public.gmane.org> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Arun Ramamurthy Cc: Rob Herring , Mark Rutland , Ian Campbell , Kumar Gala , Russell King , Jean-Christophe Plagniol-Villard , Tomi Valkeinen , "devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "linux-fbdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Dmitry Torokhov , Anatol Pomazau , Jonathan Richardson , Scott Branden , Ray Jui , "bcm-kernel-feedback-list-dY08KVG/lbpWk0Htik3J/w@public.gmane.org" List-Id: devicetree@vger.kernel.org On Tue, 2015-03-03 at 10:02 +0000, Pawel Moll wrote: > On Mon, 2015-03-02 at 19:09 +0000, Arun Ramamurthy wrote: > > > The existing bindings intentionally avoided quoting internal registers - > > > they are supposed to describe how the hardware is wired up... > > > > > > So how about something like "arm,pl11x,tft-invert-clac"? Then the driver > > > sets the bit or not, depending on the property existance? > > > > > Sure, I can change it to two properties called arm,pl11x,tft-invert-clac > > and arm,pl11x,tft-clksel. Would that be acceptable? > > That would be fine by me :-) Or (after having a look at the TRM) I should rather say: the invert-clac is fine by me :-) but the tft-clksel doesn't work, I afraid. If I'm not mistaken, there are two problems with it. Number one: it's not TFT-specific, is it? So it certainly should not have the "tft-" bit. Number two: setting this bit says "do not use CLCDCLK for the logic; use HCLK instead", correct? If so, have a look at the clock properties. They say: - clock-names: should contain "clcdclk" and "apb_pclk" - clocks: contains phandle and clock specifier pairs for the entries in the clock-names property. See So if your hardware has the reference clock wired to HCLK, and you defining the clocks as "clcdclk", you are (no offence meant ;-) lying :-) So how about solving the problem by extending the clock-names definition like this (feel free to use own wording): - clock-names: should contain two clocks, either "clcdclk" or "hclk" (depending on which input is to be used as a reference clock by the controller logic) and "apb_pclk" That way you're precisely describing the way the hardware is wired up. And the driver simply tries to get clcdclk first, if it's defined - cool, set clksel to 1, if not - try hclk and set clksel to 0. If neither of them is present - bail out. Does this make any sense? Pawel -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756080AbbCCKWO (ORCPT ); Tue, 3 Mar 2015 05:22:14 -0500 Received: from foss.arm.com ([217.140.101.70]:50231 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754488AbbCCKWL (ORCPT ); Tue, 3 Mar 2015 05:22:11 -0500 Message-ID: <1425378127.3092.38.camel@arm.com> Subject: Re: [PATCH] video: ARM CLCD: Added dt support to set tim2 register From: Pawel Moll To: Arun Ramamurthy Cc: Rob Herring , Mark Rutland , Ian Campbell , Kumar Gala , Russell King , Jean-Christophe Plagniol-Villard , Tomi Valkeinen , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-fbdev@vger.kernel.org" , Dmitry Torokhov , Anatol Pomazau , Jonathan Richardson , Scott Branden , Ray Jui , "bcm-kernel-feedback-list@broadcom.com" Date: Tue, 03 Mar 2015 10:22:07 +0000 In-Reply-To: <1425376977.3092.26.camel@arm.com> References: <1424898082-1522-1-git-send-email-arun.ramamurthy@broadcom.com> <1425312688.3092.10.camel@arm.com> <54F4B583.4000005@broadcom.com> <1425376977.3092.26.camel@arm.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.10-0ubuntu1~14.10.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2015-03-03 at 10:02 +0000, Pawel Moll wrote: > On Mon, 2015-03-02 at 19:09 +0000, Arun Ramamurthy wrote: > > > The existing bindings intentionally avoided quoting internal registers - > > > they are supposed to describe how the hardware is wired up... > > > > > > So how about something like "arm,pl11x,tft-invert-clac"? Then the driver > > > sets the bit or not, depending on the property existance? > > > > > Sure, I can change it to two properties called arm,pl11x,tft-invert-clac > > and arm,pl11x,tft-clksel. Would that be acceptable? > > That would be fine by me :-) Or (after having a look at the TRM) I should rather say: the invert-clac is fine by me :-) but the tft-clksel doesn't work, I afraid. If I'm not mistaken, there are two problems with it. Number one: it's not TFT-specific, is it? So it certainly should not have the "tft-" bit. Number two: setting this bit says "do not use CLCDCLK for the logic; use HCLK instead", correct? If so, have a look at the clock properties. They say: - clock-names: should contain "clcdclk" and "apb_pclk" - clocks: contains phandle and clock specifier pairs for the entries in the clock-names property. See So if your hardware has the reference clock wired to HCLK, and you defining the clocks as "clcdclk", you are (no offence meant ;-) lying :-) So how about solving the problem by extending the clock-names definition like this (feel free to use own wording): - clock-names: should contain two clocks, either "clcdclk" or "hclk" (depending on which input is to be used as a reference clock by the controller logic) and "apb_pclk" That way you're precisely describing the way the hardware is wired up. And the driver simply tries to get clcdclk first, if it's defined - cool, set clksel to 1, if not - try hclk and set clksel to 0. If neither of them is present - bail out. Does this make any sense? Pawel