drivers: gpio_sx1509b: correct handling of initialized output
The data_first flag was intended to be set when the configuration requires setting the output value before setting the direction. Respect the intent. Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This commit is contained in:
parent
56a098338f
commit
e83c9cc262
1 changed files with 2 additions and 0 deletions
|
|
@ -179,8 +179,10 @@ static int sx1509b_config(struct device *dev,
|
|||
pins->dir &= ~BIT(pin);
|
||||
if ((flags & GPIO_OUTPUT_INIT_LOW) != 0) {
|
||||
pins->data &= ~BIT(pin);
|
||||
data_first = true;
|
||||
} else if ((flags & GPIO_OUTPUT_INIT_HIGH) != 0) {
|
||||
pins->data |= BIT(pin);
|
||||
data_first = true;
|
||||
}
|
||||
} else {
|
||||
pins->dir |= BIT(pin);
|
||||
|
|
|
|||
Loading…
Reference in a new issue