mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-08 10:39:08 +00:00
drivers: gpio: keep output value for input on sandbox
For testing purposes keep the output value when switching to input. This allows us to manipulate the input value via the gpio command. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Philippe Reynes <philippe.reynes@softathome.com>
This commit is contained in:
parent
39916bb45f
commit
7cd96a4728
1 changed files with 9 additions and 1 deletions
|
@ -185,7 +185,15 @@ static int sb_gpio_set_dir_flags(struct udevice *dev, unsigned int offset,
|
|||
|
||||
dir_flags = get_gpio_dir_flags(dev, offset);
|
||||
|
||||
*dir_flags = flags;
|
||||
/*
|
||||
* For testing purposes keep the output value when switching to input.
|
||||
* This allows us to manipulate the input value via the gpio command.
|
||||
*/
|
||||
if (flags & GPIOD_IS_IN)
|
||||
*dir_flags = (flags & ~GPIOD_IS_OUT_ACTIVE) |
|
||||
(*dir_flags & GPIOD_IS_OUT_ACTIVE);
|
||||
else
|
||||
*dir_flags = flags;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue