* Re: DT on s3c24xx [not found] <CA+E=qVf4nT5x-fRFBu=Wv_VKUnEMAEP4GgJG8em8NyUFkwtbPg@mail.gmail.com> @ 2014-12-18 7:52 ` Uwe Kleine-König 2014-12-18 8:34 ` Vasily Khoruzhick 0 siblings, 1 reply; 4+ messages in thread From: Uwe Kleine-König @ 2014-12-18 7:52 UTC (permalink / raw) To: Vasily Khoruzhick Cc: arm-linux, Kukjin Kim, linux-samsung-soc, Ben Dooks, Linus Walleij, linux-gpio Hello, [Cc += linusw, linux-gpio] On Wed, Dec 17, 2014 at 10:04:24PM +0300, Vasily Khoruzhick wrote: > I'd like to port several s3c24xx to DT, and I'm stuck with s3c24xx LCD > controller and power drivers for H1940 and RX1950. > > Please see [1]. I want to move this function into another LCD power > driver, but I'm not sure what to do with s3c_gpio_cfgpin(). I need to > change pin function in runtime, and as far as I understand it should > be handled via pinctrl driver somehow. But how? You can pass >1 pinctrl setups to a node: somedevice { pinctrl-names = "default", "foo", "bar"; pinctrl-0 = <&pinctrl_somedevice_default>; pinctrl-1 = <&pinctrl_somedevice_foo>; pinctrl-2 = <&pinctrl_somedevice_bar>; cfg-gpios = <&gpio4 12 3>, <&gpio2 7 5>; }; Then I think you can fiddle with pinctrl_select_state(). For the gpios you can then use the standard gpiod_{request,direction_{in,out}put} combo. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | http://www.pengutronix.de/ | ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: DT on s3c24xx 2014-12-18 7:52 ` DT on s3c24xx Uwe Kleine-König @ 2014-12-18 8:34 ` Vasily Khoruzhick 2014-12-18 13:42 ` Alexandre Courbot 2014-12-18 14:53 ` Linus Walleij 0 siblings, 2 replies; 4+ messages in thread From: Vasily Khoruzhick @ 2014-12-18 8:34 UTC (permalink / raw) To: Uwe Kleine-König Cc: arm-linux, Kukjin Kim, linux-samsung-soc, Ben Dooks, Linus Walleij, linux-gpio On Thu, Dec 18, 2014 at 10:52 AM, Uwe Kleine-König <u.kleine-koenig@pengutronix.de> wrote: > Hello, Hi Uwe, > [Cc += linusw, linux-gpio] > > On Wed, Dec 17, 2014 at 10:04:24PM +0300, Vasily Khoruzhick wrote: >> I'd like to port several s3c24xx to DT, and I'm stuck with s3c24xx LCD >> controller and power drivers for H1940 and RX1950. >> >> Please see [1]. I want to move this function into another LCD power >> driver, but I'm not sure what to do with s3c_gpio_cfgpin(). I need to >> change pin function in runtime, and as far as I understand it should >> be handled via pinctrl driver somehow. But how? > You can pass >1 pinctrl setups to a node: > > somedevice { > pinctrl-names = "default", "foo", "bar"; > pinctrl-0 = <&pinctrl_somedevice_default>; > pinctrl-1 = <&pinctrl_somedevice_foo>; > pinctrl-2 = <&pinctrl_somedevice_bar>; > cfg-gpios = <&gpio4 12 3>, <&gpio2 7 5>; > }; > > Then I think you can fiddle with pinctrl_select_state(). For the gpios > you can then use the standard gpiod_{request,direction_{in,out}put} > combo. Thanks for you response! Can I change pin function after gpio was requested? In low-power state (i.e. when display is disabled) it's gpio driving some level, and in active state it's some LCD controller pin (don't remember which one exactly) Regards, Vasily > > Best regards > Uwe > > -- > Pengutronix e.K. | Uwe Kleine-König | > Industrial Linux Solutions | http://www.pengutronix.de/ | ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: DT on s3c24xx 2014-12-18 8:34 ` Vasily Khoruzhick @ 2014-12-18 13:42 ` Alexandre Courbot 2014-12-18 14:53 ` Linus Walleij 1 sibling, 0 replies; 4+ messages in thread From: Alexandre Courbot @ 2014-12-18 13:42 UTC (permalink / raw) To: Vasily Khoruzhick Cc: Uwe Kleine-König, arm-linux, Kukjin Kim, linux-samsung-soc, Ben Dooks, Linus Walleij, linux-gpio@vger.kernel.org On Thu, Dec 18, 2014 at 5:34 PM, Vasily Khoruzhick <anarsoul@gmail.com> wrote: > On Thu, Dec 18, 2014 at 10:52 AM, Uwe Kleine-König > <u.kleine-koenig@pengutronix.de> wrote: >> Hello, > > Hi Uwe, > >> [Cc += linusw, linux-gpio] >> >> On Wed, Dec 17, 2014 at 10:04:24PM +0300, Vasily Khoruzhick wrote: >>> I'd like to port several s3c24xx to DT, and I'm stuck with s3c24xx LCD >>> controller and power drivers for H1940 and RX1950. >>> >>> Please see [1]. I want to move this function into another LCD power >>> driver, but I'm not sure what to do with s3c_gpio_cfgpin(). I need to >>> change pin function in runtime, and as far as I understand it should >>> be handled via pinctrl driver somehow. But how? >> You can pass >1 pinctrl setups to a node: >> >> somedevice { >> pinctrl-names = "default", "foo", "bar"; >> pinctrl-0 = <&pinctrl_somedevice_default>; >> pinctrl-1 = <&pinctrl_somedevice_foo>; >> pinctrl-2 = <&pinctrl_somedevice_bar>; >> cfg-gpios = <&gpio4 12 3>, <&gpio2 7 5>; >> }; >> >> Then I think you can fiddle with pinctrl_select_state(). For the gpios >> you can then use the standard gpiod_{request,direction_{in,out}put} >> combo. > > Thanks for you response! > > Can I change pin function after gpio was requested? In low-power state > (i.e. when display is disabled) it's gpio driving some level, > and in active state it's some LCD controller pin (don't remember which > one exactly) If your driver can release the GPIO and change the pinctrl when switching to active state (and change the pinctrl again and request the GPIO when switching to low-power state) then this should be doable. I suspect the switch is made by the same driver anyway, isn't it? -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: DT on s3c24xx 2014-12-18 8:34 ` Vasily Khoruzhick 2014-12-18 13:42 ` Alexandre Courbot @ 2014-12-18 14:53 ` Linus Walleij 1 sibling, 0 replies; 4+ messages in thread From: Linus Walleij @ 2014-12-18 14:53 UTC (permalink / raw) To: Vasily Khoruzhick Cc: Uwe Kleine-König, arm-linux, Kukjin Kim, linux-samsung-soc, Ben Dooks, linux-gpio@vger.kernel.org On Thu, Dec 18, 2014 at 9:34 AM, Vasily Khoruzhick <anarsoul@gmail.com> wrote: > Can I change pin function after gpio was requested? In low-power state > (i.e. when display is disabled) it's gpio driving some level, > and in active state it's some LCD controller pin (don't remember which > one exactly) Please read the section named "GPIO mode pitfalls" in Documentation/pinctrl.txt very closely. Two ways: - You can use the GPIO and pin control interface to the same hardware in parallel. There is no blocking this since there is hardware out that that actually allow this. NOT RECOMMENDED. - If the "GPIO mode" mentioned is only about e.g. grounding the pins in a low power state and then not really about using them as GPIO, extend the pin controller to be able to e.g. ground the pins with PIN_CONFIG_OUTPUT or PIN_CONFIG_LOW_POWER_MODE if you use generic bindings. If the usecase is low power, the latter approach is recommended. Yours, Linus Walleij ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-12-18 14:53 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CA+E=qVf4nT5x-fRFBu=Wv_VKUnEMAEP4GgJG8em8NyUFkwtbPg@mail.gmail.com>
2014-12-18 7:52 ` DT on s3c24xx Uwe Kleine-König
2014-12-18 8:34 ` Vasily Khoruzhick
2014-12-18 13:42 ` Alexandre Courbot
2014-12-18 14:53 ` Linus Walleij
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox