gpio: sandbox: Rename GPIO dir_flags to flags

Adjust the terminology in this driver to reflect that fact that all flags
are handled, not just direction flags.

Create a new access function to get the full GPIO state, not just the
direction flags. Drop the static invalid_dir_flags since we can rely on a
segfault if something is wrong.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
This commit is contained in:
Simon Glass 2021-02-04 21:21:59 -07:00 committed by Tom Rini
parent c0c1e62c6e
commit a03a0aa7e8
3 changed files with 47 additions and 39 deletions

View file

@ -69,17 +69,17 @@ int sandbox_gpio_set_direction(struct udevice *dev, unsigned int offset,
* @param offset GPIO offset within bank
* @return dir_flags: bitfield accesses by GPIOD_ defines
*/
ulong sandbox_gpio_get_dir_flags(struct udevice *dev, unsigned int offset);
ulong sandbox_gpio_get_flags(struct udevice *dev, unsigned int offset);
/**
* Set the simulated flags of a GPIO (used only in sandbox test code)
*
* @param dev device to use
* @param offset GPIO offset within bank
* @param flags dir_flags: bitfield accesses by GPIOD_ defines
* @param flags bitfield accesses by GPIOD_ defines
* @return -1 on error, 0 if ok
*/
int sandbox_gpio_set_dir_flags(struct udevice *dev, unsigned int offset,
ulong flags);
int sandbox_gpio_set_flags(struct udevice *dev, unsigned int offset,
ulong flags);
#endif