mirror of
https://github.com/torvalds/linux.git
synced 2026-09-26 18:12:03 +02:00
gpio: tps65219: Use the variant-specific direction callback
The TPS65214 template installs its own get_direction callback because
its direction bit is in GENERAL_CONFIG. The shared get and direction
callbacks nevertheless call tps65219_gpio_get_direction() directly and
interpret the unrelated TPS65219 MFP bit.
On TPS65214 this can reject reads from an input and skip the change from
input to output. Call the callback selected by the gpio_chip template
instead.
Fixes: 1b6ab07c0c ("gpio: tps65219: Add support for TI TPS65214 PMIC")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Link: https://patch.msgid.link/20260919171100.90430-3-kmehltretter@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
This commit is contained in:
parent
4cbe530c02
commit
93cf8cedea
|
|
@ -87,7 +87,7 @@ static int tps65219_gpio_get(struct gpio_chip *gc, unsigned int offset)
|
|||
* status bit.
|
||||
*/
|
||||
|
||||
if (tps65219_gpio_get_direction(gc, offset) == GPIO_LINE_DIRECTION_OUT)
|
||||
if (gc->get_direction(gc, offset) == GPIO_LINE_DIRECTION_OUT)
|
||||
return -ENOTSUPP;
|
||||
|
||||
return ret;
|
||||
|
|
@ -176,7 +176,7 @@ static int tps65219_gpio_direction_input(struct gpio_chip *gc, unsigned int offs
|
|||
return -ENOTSUPP;
|
||||
}
|
||||
|
||||
if (tps65219_gpio_get_direction(gc, offset) == GPIO_LINE_DIRECTION_IN)
|
||||
if (gc->get_direction(gc, offset) == GPIO_LINE_DIRECTION_IN)
|
||||
return 0;
|
||||
|
||||
return gpio->change_dir(gc, offset, GPIO_LINE_DIRECTION_IN);
|
||||
|
|
@ -190,7 +190,7 @@ static int tps65219_gpio_direction_output(struct gpio_chip *gc, unsigned int off
|
|||
if (offset != TPS6521X_GPIO0_IDX)
|
||||
return 0;
|
||||
|
||||
if (tps65219_gpio_get_direction(gc, offset) == GPIO_LINE_DIRECTION_OUT)
|
||||
if (gc->get_direction(gc, offset) == GPIO_LINE_DIRECTION_OUT)
|
||||
return 0;
|
||||
|
||||
return gpio->change_dir(gc, offset, GPIO_LINE_DIRECTION_OUT);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user