Enable buttons GPIO passthrough
Linus Walleij
linus.walleij at linaro.org
Tue Jan 15 23:09:44 AEDT 2019
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