Revert "gpiolib: cdev: Ignore reconfiguration without direction"
This reverts commit e527ce3745
.
This commit is contained in:
parent
d9a5f63b5f
commit
0f1229f8a4
1 changed files with 5 additions and 8 deletions
|
@ -1110,18 +1110,15 @@ static long linereq_set_config_unlocked(struct linereq *lr,
|
||||||
for (i = 0; i < lr->num_lines; i++) {
|
for (i = 0; i < lr->num_lines; i++) {
|
||||||
desc = lr->lines[i].desc;
|
desc = lr->lines[i].desc;
|
||||||
flags = gpio_v2_line_config_flags(lc, i);
|
flags = gpio_v2_line_config_flags(lc, i);
|
||||||
/*
|
|
||||||
* Lines not explicitly reconfigured as input or output
|
|
||||||
* are left unchanged.
|
|
||||||
*/
|
|
||||||
if (!(flags & GPIO_V2_LINE_DIRECTION_FLAGS))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
polarity_change =
|
polarity_change =
|
||||||
(!!test_bit(FLAG_ACTIVE_LOW, &desc->flags) !=
|
(!!test_bit(FLAG_ACTIVE_LOW, &desc->flags) !=
|
||||||
((flags & GPIO_V2_LINE_FLAG_ACTIVE_LOW) != 0));
|
((flags & GPIO_V2_LINE_FLAG_ACTIVE_LOW) != 0));
|
||||||
|
|
||||||
gpio_v2_line_config_flags_to_desc_flags(flags, &desc->flags);
|
gpio_v2_line_config_flags_to_desc_flags(flags, &desc->flags);
|
||||||
|
/*
|
||||||
|
* Lines have to be requested explicitly for input
|
||||||
|
* or output, else the line will be treated "as is".
|
||||||
|
*/
|
||||||
if (flags & GPIO_V2_LINE_FLAG_OUTPUT) {
|
if (flags & GPIO_V2_LINE_FLAG_OUTPUT) {
|
||||||
int val = gpio_v2_line_config_output_value(lc, i);
|
int val = gpio_v2_line_config_output_value(lc, i);
|
||||||
|
|
||||||
|
@ -1129,7 +1126,7 @@ static long linereq_set_config_unlocked(struct linereq *lr,
|
||||||
ret = gpiod_direction_output(desc, val);
|
ret = gpiod_direction_output(desc, val);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
} else {
|
} else if (flags & GPIO_V2_LINE_FLAG_INPUT) {
|
||||||
ret = gpiod_direction_input(desc);
|
ret = gpiod_direction_input(desc);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Add table
Reference in a new issue