diff options
| author | Charles Boyer <Charles.Boyer@fii-usa.com> | 2022-02-09 17:32:22 +0300 |
|---|---|---|
| committer | Charles Boyer <Charles.Boyer@fii-usa.com> | 2022-04-21 21:37:36 +0300 |
| commit | d7d3423ca60a040efcd61db301eea48c5f6635f4 (patch) | |
| tree | 7e2cc147f52905789f9012f58b08f267052f0e51 /meta-openembedded/meta-python/recipes-devtools/python | |
| parent | 65ab13e0ec825b88e8fb32195127dee1cba2d579 (diff) | |
| download | openbmc-d7d3423ca60a040efcd61db301eea48c5f6635f4.tar.xz | |
meta-fii: meta-kudo: Use GPIO line names instead of number
Replaces hard-coded GPIO throughout the Kudo layer with a reference
to its line name from DTS.
The process to dynamically obtain the GPIO number for Get is added
to kudo-lib.sh,
1. Use `gpiofind <Line Name>` to obtain gpiochip# and pin#
2. If the gpiochip# exceeds the number of GPIO banks of Nuvoton,
then it is an I/O Expander.
a. Use `gpiodetect` and extract the I2C bus-addr
b. Obtain GPIO base value from sysfs using bus-addr
c. The GPIO number is then the (base + pin#)
3. If the gpiochip# is within Nuvoton GPIO banks, then calculate
the GPIO number as ((gpiochip#)*32 + pin#)
Then the GPIO number can be used in the export to obtain the value.
Tested with Nuvoton:
- Can read/set Nuvoton GPIO with defined line names
- Can read/set GPIO from I/O Expanders with defined line names
Signed-off-by: Charles Boyer <Charles.Boyer@fii-usa.com>
Change-Id: I651c0707a8bbc170d3c5a5fc261e5f9c62453e9f
Diffstat (limited to 'meta-openembedded/meta-python/recipes-devtools/python')
0 files changed, 0 insertions, 0 deletions
