Message ID | 2480893.UEqfxe8meR@phil |
---|---|
State | Superseded, archived |
Headers | show |
On Tue, May 27, 2014 at 3:09 PM, Heiko Stübner <heiko@sntech.de> wrote: > Am Dienstag, 27. Mai 2014, 09:27:36 schrieb Ivan T. Ivanov: >> From: "Ivan T. Ivanov" <iivanov@mm-sol.com> >> >> Add "power-source" property to generic options used for DT parsing files. >> This enables drivers, which use generic pin configurations, to get the >> value passed to this property. > > I think the main problem here is, that pinconf-generic.h defines the power- > source as having a "custom format". With DT as a hardware description, > implementaton specific values do not work well - instead it should have a > regular unit-value. > > For the power-source I think volts could work well - as this is the main use- > case for pinctrl I know. The regulator-binding uses microvolts, maybe it would > be good use a similar unit. (...) > pcfg_1v8 { > power-source = <1800000>; > }; I don't think this is what it's meant for actually. In this case the thing would be modeled as a regulator rather than some pin control option I guess? I think it's more like a selector, such as found on old amplifiers, input source A, B or C? So it's just some discrete number. Then we don't know which voltage comes from power source A, B, C. Yours, Linus Walleij -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Am Mittwoch, 28. Mai 2014, 10:15:43 schrieb Linus Walleij: > On Tue, May 27, 2014 at 3:09 PM, Heiko Stübner <heiko@sntech.de> wrote: > > Am Dienstag, 27. Mai 2014, 09:27:36 schrieb Ivan T. Ivanov: > >> From: "Ivan T. Ivanov" <iivanov@mm-sol.com> > >> > >> Add "power-source" property to generic options used for DT parsing files. > >> This enables drivers, which use generic pin configurations, to get the > >> value passed to this property. > > > > I think the main problem here is, that pinconf-generic.h defines the > > power- > > source as having a "custom format". With DT as a hardware description, > > implementaton specific values do not work well - instead it should have a > > regular unit-value. > > > > For the power-source I think volts could work well - as this is the main > > use- case for pinctrl I know. The regulator-binding uses microvolts, > > maybe it would be good use a similar unit. > > (...) > > > pcfg_1v8 { > > > > power-source = <1800000>; > > > > }; > > I don't think this is what it's meant for actually. In this case the thing > would be modeled as a regulator rather than some pin control option I > guess? > > I think it's more like a selector, such as found on old amplifiers, > input source A, B or C? So it's just some discrete number. as I said, you know this better than me ;-) I was thinking more of these io-voltages, where one can select between say 1.8 and 3.3V for the pins. I have this somewhere on my todo list for the rockchips too. So essentially the pinctrl driver [as it is a pin-group specific setting] should just export regulators for these voltage settings, without touching the pinconfig itself, right? Thanks Heiko -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Wed, May 28, 2014 at 10:36 AM, Heiko Stübner <heiko@sntech.de> wrote: > Am Mittwoch, 28. Mai 2014, 10:15:43 schrieb Linus Walleij: >> On Tue, May 27, 2014 at 3:09 PM, Heiko Stübner <heiko@sntech.de> wrote: >> > Am Dienstag, 27. Mai 2014, 09:27:36 schrieb Ivan T. Ivanov: >> >> From: "Ivan T. Ivanov" <iivanov@mm-sol.com> >> >> >> >> Add "power-source" property to generic options used for DT parsing files. >> >> This enables drivers, which use generic pin configurations, to get the >> >> value passed to this property. >> > >> > I think the main problem here is, that pinconf-generic.h defines the >> > power- >> > source as having a "custom format". With DT as a hardware description, >> > implementaton specific values do not work well - instead it should have a >> > regular unit-value. >> > >> > For the power-source I think volts could work well - as this is the main >> > use- case for pinctrl I know. The regulator-binding uses microvolts, >> > maybe it would be good use a similar unit. >> >> (...) >> >> > pcfg_1v8 { >> > >> > power-source = <1800000>; >> > >> > }; >> >> I don't think this is what it's meant for actually. In this case the thing >> would be modeled as a regulator rather than some pin control option I >> guess? >> >> I think it's more like a selector, such as found on old amplifiers, >> input source A, B or C? So it's just some discrete number. > > as I said, you know this better than me ;-) > > I was thinking more of these io-voltages, where one can select between say 1.8 > and 3.3V for the pins. > > I have this somewhere on my todo list for the rockchips too. > > So essentially the pinctrl driver [as it is a pin-group specific setting] > should just export regulators for these voltage settings, without touching the > pinconfig itself, right? Hm hm hm. I am a bit in the blue actually. I think we need to have a discussion with Mark Brown on how to handle this. We have previously had the case of MMC/SD level-shifters, where a certain setting gives a certain level of signals out, and another setting gives another level. Like two discrete levels. So we modeled that as a regulator provider inside the pin control driver eventually, see sh-pfc/pfc-sh73a0.c But this is different: it is the power of the pin itself. I can think of a "padring regulator" hooking in as part of the pin state but have no clear idea on how to actually do that. We need some coding I think. Yours, Linus Walleij -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Wed, 2014-05-28 at 10:48 +0200, Linus Walleij wrote: > On Wed, May 28, 2014 at 10:36 AM, Heiko Stübner <heiko@sntech.de> wrote: > > Am Mittwoch, 28. Mai 2014, 10:15:43 schrieb Linus Walleij: > >> On Tue, May 27, 2014 at 3:09 PM, Heiko Stübner <heiko@sntech.de> wrote: > >> > Am Dienstag, 27. Mai 2014, 09:27:36 schrieb Ivan T. Ivanov: > >> >> From: "Ivan T. Ivanov" <iivanov@mm-sol.com> > >> >> > >> >> Add "power-source" property to generic options used for DT parsing files. > >> >> This enables drivers, which use generic pin configurations, to get the > >> >> value passed to this property. > >> > > >> > I think the main problem here is, that pinconf-generic.h defines the > >> > power- > >> > source as having a "custom format". With DT as a hardware description, > >> > implementaton specific values do not work well - instead it should have a > >> > regular unit-value. > >> > > >> > For the power-source I think volts could work well - as this is the main > >> > use- case for pinctrl I know. The regulator-binding uses microvolts, > >> > maybe it would be good use a similar unit. > >> > >> (...) > >> > >> > pcfg_1v8 { > >> > > >> > power-source = <1800000>; > >> > > >> > }; > >> > >> I don't think this is what it's meant for actually. In this case the thing > >> would be modeled as a regulator rather than some pin control option I > >> guess? > >> > >> I think it's more like a selector, such as found on old amplifiers, > >> input source A, B or C? So it's just some discrete number. > > > > as I said, you know this better than me ;-) > > > > I was thinking more of these io-voltages, where one can select between say 1.8 > > and 3.3V for the pins. > > > > I have this somewhere on my todo list for the rockchips too. > > > > So essentially the pinctrl driver [as it is a pin-group specific setting] > > should just export regulators for these voltage settings, without touching the > > pinconfig itself, right? > > Hm hm hm. > > I am a bit in the blue actually. > > I think we need to have a discussion with Mark Brown on how to > handle this. > > We have previously had the case of MMC/SD level-shifters, where > a certain setting gives a certain level of signals out, and another setting > gives another level. Like two discrete levels. > > So we modeled that as a regulator provider inside the pin control > driver eventually, see sh-pfc/pfc-sh73a0.c > > But this is different: it is the power of the pin itself. > > I can think of a "padring regulator" hooking in as part of the pin state > but have no clear idea on how to actually do that. We need some > coding I think. > In my case this is just a switch, which can select from different power sources and these sources are external from the chip. So I can't know a priory what the levels are and hard code them inside the driver. Thanks, Ivan -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Am Freitag, 30. Mai 2014, 10:41:31 schrieb Ivan T. Ivanov: > On Wed, 2014-05-28 at 10:48 +0200, Linus Walleij wrote: > > On Wed, May 28, 2014 at 10:36 AM, Heiko Stübner <heiko@sntech.de> wrote: > > > Am Mittwoch, 28. Mai 2014, 10:15:43 schrieb Linus Walleij: > > >> On Tue, May 27, 2014 at 3:09 PM, Heiko Stübner <heiko@sntech.de> wrote: > > >> > Am Dienstag, 27. Mai 2014, 09:27:36 schrieb Ivan T. Ivanov: > > >> >> From: "Ivan T. Ivanov" <iivanov@mm-sol.com> > > >> >> > > >> >> Add "power-source" property to generic options used for DT parsing > > >> >> files. > > >> >> This enables drivers, which use generic pin configurations, to get > > >> >> the > > >> >> value passed to this property. > > >> > > > >> > I think the main problem here is, that pinconf-generic.h defines the > > >> > power- > > >> > source as having a "custom format". With DT as a hardware > > >> > description, > > >> > implementaton specific values do not work well - instead it should > > >> > have a > > >> > regular unit-value. > > >> > > > >> > For the power-source I think volts could work well - as this is the > > >> > main > > >> > use- case for pinctrl I know. The regulator-binding uses microvolts, > > >> > maybe it would be good use a similar unit. > > >> > > >> (...) > > >> > > >> > pcfg_1v8 { > > >> > > > >> > power-source = <1800000>; > > >> > > > >> > }; > > >> > > >> I don't think this is what it's meant for actually. In this case the > > >> thing > > >> would be modeled as a regulator rather than some pin control option I > > >> guess? > > >> > > >> I think it's more like a selector, such as found on old amplifiers, > > >> input source A, B or C? So it's just some discrete number. > > > > > > as I said, you know this better than me ;-) > > > > > > I was thinking more of these io-voltages, where one can select between > > > say 1.8 and 3.3V for the pins. > > > > > > I have this somewhere on my todo list for the rockchips too. > > > > > > So essentially the pinctrl driver [as it is a pin-group specific > > > setting] > > > should just export regulators for these voltage settings, without > > > touching the pinconfig itself, right? > > > > Hm hm hm. > > > > I am a bit in the blue actually. > > > > I think we need to have a discussion with Mark Brown on how to > > handle this. > > > > We have previously had the case of MMC/SD level-shifters, where > > a certain setting gives a certain level of signals out, and another > > setting > > gives another level. Like two discrete levels. > > > > So we modeled that as a regulator provider inside the pin control > > driver eventually, see sh-pfc/pfc-sh73a0.c > > > > But this is different: it is the power of the pin itself. > > > > I can think of a "padring regulator" hooking in as part of the pin state > > but have no clear idea on how to actually do that. We need some > > coding I think. > > In my case this is just a switch, which can select from different power > sources and these sources are external from the chip. So I can't know > a priory what the levels are and hard code them inside the driver. Yep, that is exactly what Linus described as use-case too ... I was simply thinking in the wrong direction :-) Heiko -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
--- a/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt +++ b/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt @@ -156,6 +156,7 @@ input-disable - disable input on pin (no effect on output) input-schmitt-enable - enable schmitt-trigger mode input-schmitt-disable - disable schmitt-trigger mode input-debounce - debounce mode with debound time X +power-source - set power supply to X microvolts low-power-enable - enable low power mode low-power-disable - disable low power mode output-low - set the pin to output mode with low level