sb/intel/common/gpio: Only set one bit at time
Make sure to set only one bit instead of arbitrary bits set in argument. Change-Id: I39426193d15d8581f79bc2a45c0edb53b19a2cd3 Signed-off-by: Patrick Rudolph <siro@das-labor.org> Reviewed-on: https://review.coreboot.org/20707 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
parent
87863fd692
commit
0e4f83e7b0
|
@ -142,7 +142,8 @@ void set_gpio(int gpio_num, int value)
|
|||
|
||||
config = inl(gpio_base + gpio_reg_offsets[index]);
|
||||
config &= ~(1 << bit);
|
||||
config |= value << bit;
|
||||
if (value != 0)
|
||||
config |= (1 << bit);
|
||||
outl(config, gpio_base + gpio_reg_offsets[index]);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue