diff options
author | Simon Glass <sjg@chromium.org> | 2021-02-04 21:22:09 -0700 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-03-03 15:40:47 -0500 |
commit | 8a45b2205749252f61d26508d5de9dcce020b2ef (patch) | |
tree | fac56f635fb7a10236dd41868a0b1629184ab39c /drivers/core/device.c | |
parent | be04f1ab4291c724a65d86a743b8b7938f15a54c (diff) |
gpio: Add a way to read 3-way strapping pins
Using the internal vs. external pull resistors it is possible to get
27 different combinations from 3 strapping pins. Add an implementation
of this.
This involves updating the sandbox GPIO driver to model external and
(weaker) internal pull resistors. The get_value() method now takes account
of what is driving a pin:
sandbox: GPIOD_EXT_DRIVEN - in which case GPIO_EXT_HIGH provides the
value
outside source - in which case GPIO_EXT_PULL_UP/DOWN indicates the
external state and we work the final state using those flags and
the internal GPIOD_PULL_UP/DOWN flags
Of course the outside source does not really exist in sandbox. We are just
modelling it for test purpose.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/core/device.c')
0 files changed, 0 insertions, 0 deletions