Query on pinctrl usage for DT nodes
From: Manjunathappa, Prakash <hidden>
Date: 2013-05-21 14:16:58
Also in:
linux-devicetree
Hi, On Tue, Apr 23, 2013 at 23:47:54, Tony Lindgren wrote:
* Peter Ujfalusi [off-list ref] [130423 00:47]:quoted
On 04/16/2013 11:32 PM, Tony Lindgren wrote:quoted
* Peter Ujfalusi [off-list ref] [130415 01:30]:quoted
On 04/10/2013 10:34 PM, Tony Lindgren wrote:quoted
Yeah how about just change the pintctrl-single,bits register naming to be register + bit? Something like 0xdeadbeef.0 and 0xdeadbeef.1 and so on.Something like this might work I think. It is going to be a bit tricky IMHO since we might need span out new 'register' every time a device requests for a new pinctrl-single,bits for already used register in the pinctrl-single,bit-per-mux area. In this way we still can make sure that certain bit are only used by a single driver.OK. If it's one bit per mux type register we should be able to create the right amount of entries based on the submask in pinctrs-single,bit?Right now it seams to be true that we have one bit per mux (in DEVCONF0 on OMAP3 for example). So that would work fine, but There could be different registers around with more than one bit per mux.Yes you are right, we should cover that case too. But maybe we can wait until we have such an example :)quoted
Another way to deal with this is to: in case of pinctrl-single,bit-per-mux we assume one bit per mux and create entries based on the pinctrl-single,function-mask's bits. In case we have more than one bit for the mux in the register we could have optional property stating the number of different muxes handled by the register.Yes that's doable.quoted
One bit per mux type: control_devconf0: pinmux at 48002274 { compatible = "pinctrl-single"; reg = <0x48002274 4>; /* Single register */ #address-cells = <1>; #size-cells = <0>; pinctrl-single,bit-per-mux; pinctrl-single,register-width = <32>; pinctrl-single,function-mask = <0x5F>; }; Results six entries.Yup, I think this is the way to go for now, see below..quoted
control_devconf0: pinmux at 48002274 { compatible = "pinctrl-single"; reg = <0x48002274 4>; /* Single register */ #address-cells = <1>; #size-cells = <0>; pinctrl-single,bit-per-mux; pinctrl-single,functions-in-register = <3>; pinctrl-single,register-width = <32>; pinctrl-single,function-mask = <0x5F>; }; Will results three entries...but let's not add this. The reason why I'd like to postpone adding pinctrl-single,functions-in-register is because we may be able to do it automatically.
I have posted patch to take care of this: http://davinci-linux-open-source.1494791.n2.nabble.com/PATCH-0-3-pinctrl-pinctrl-single-Add-full-fledge-support-to-configure-multiple-pins-of-different-mods-tt7583066.html Please review this solution. Thanks, Prakash