Enable buttons GPIO passthrough

Wang, Kuiying kuiying.wang at intel.com
Thu Jan 17 01:30:12 AEDT 2019


Hi Joel,
Do agree to use proposal #1? (extend "passthrough" to the "direction" property of gpio, use  "value" to control it be disabled/enabled.)

All,
Any other comments?

Thanks,
Kwin.


-----Original Message-----
From: Linus Walleij [mailto:linus.walleij at linaro.org] 
Sent: Tuesday, January 15, 2019 8:10 PM
To: Wang, Kuiying <kuiying.wang at intel.com>
Cc: Andrew Jeffery <andrew at aj.id.au>; Thomas Petazzoni <thomas.petazzoni at bootlin.com>; Joel Stanley <joel at jms.id.au>; open list:GPIO SUBSYSTEM <linux-gpio at vger.kernel.org>; Andrew Geissler <geissonator at gmail.com>; OpenBMC Maillist <openbmc at lists.ozlabs.org>; Mauery, Vernon <vernon.mauery at intel.com>; Feist, James <james.feist at intel.com>; Yoo, Jae Hyun <jae.hyun.yoo at intel.com>
Subject: Re: Enable buttons GPIO passthrough

Hi Kwin,

> Based on pinmux to do passthrough is too complex and no reference,

Don't let that discourage you! We are some of the world's most important software engineers in the kernel, and we don't just do the simple stuff, like filling in the blanks guided by previous example, we do the really complicated stuff of inventing the frameworks.

> I have another 2 simple proposals to do button GPIO passthrough as following:
> 1. extend "passthrough" to the "direction" property of gpio, use 
> "value" to control it be disabled/enabled.

This is what I described in my first reply. A .set_config() option.
But it still needs to patch the DT bindings for generic pin config and add a globally uniquie enumerator for this config to pinconf-generic.h since GPIO is reusing these generics, so begin with that in any case.

> 2. extend "value" property of gpio to support the third value "2", 
> which means pass-through is enabled, otherwise passthrough is disabled.

No, sorry, this is the wrong idea.

.set_value() sets the GPIO line as high or low, it is essentially boolean and it is an integer only for historical reasons.

.set_config() is what we use to set up debounce or open drain and such electronic configurations on GPIO lines, and this should be done there, unless Andrew prefers that it is gets done in the pin control driver.

Yours,
Linus Walleij


More information about the openbmc mailing list