From 4c2448e31d8ae83aea40411c9e2580d9a972ef56 Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Fri, 28 Jul 2023 10:38:05 -0400 Subject: [PATCH] Fixes for 4.14 Signed-off-by: Sasha Levin --- ...ke-tps68470_gpio_output-always-set-t.patch | 50 +++++++++++++++++++ queue-4.14/series | 1 + 2 files changed, 51 insertions(+) create mode 100644 queue-4.14/gpio-tps68470-make-tps68470_gpio_output-always-set-t.patch diff --git a/queue-4.14/gpio-tps68470-make-tps68470_gpio_output-always-set-t.patch b/queue-4.14/gpio-tps68470-make-tps68470_gpio_output-always-set-t.patch new file mode 100644 index 00000000000..167d613bf5a --- /dev/null +++ b/queue-4.14/gpio-tps68470-make-tps68470_gpio_output-always-set-t.patch @@ -0,0 +1,50 @@ +From bbe8f5f418dae4233d4fb3c8f23418b188576e0c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 10 Jul 2023 14:34:25 +0200 +Subject: gpio: tps68470: Make tps68470_gpio_output() always set the initial + value + +From: Hans de Goede + +[ Upstream commit 5a7adc6c1069ce31ef4f606ae9c05592c80a6ab5 ] + +Make tps68470_gpio_output() call tps68470_gpio_set() for output-only pins +too, so that the initial value passed to gpiod_direction_output() is +honored for these pins too. + +Fixes: 275b13a65547 ("gpio: Add support for TPS68470 GPIOs") +Reviewed-by: Andy Shevchenko +Reviewed-by: Daniel Scally +Tested-by: Daniel Scally +Reviewed-by: Sakari Ailus +Signed-off-by: Hans de Goede +Signed-off-by: Bartosz Golaszewski +Signed-off-by: Sasha Levin +--- + drivers/gpio/gpio-tps68470.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/gpio/gpio-tps68470.c b/drivers/gpio/gpio-tps68470.c +index fa2662f8b0268..773c7426fd227 100644 +--- a/drivers/gpio/gpio-tps68470.c ++++ b/drivers/gpio/gpio-tps68470.c +@@ -99,13 +99,13 @@ static int tps68470_gpio_output(struct gpio_chip *gc, unsigned int offset, + struct tps68470_gpio_data *tps68470_gpio = gpiochip_get_data(gc); + struct regmap *regmap = tps68470_gpio->tps68470_regmap; + ++ /* Set the initial value */ ++ tps68470_gpio_set(gc, offset, value); ++ + /* rest are always outputs */ + if (offset >= TPS68470_N_REGULAR_GPIO) + return 0; + +- /* Set the initial value */ +- tps68470_gpio_set(gc, offset, value); +- + return regmap_update_bits(regmap, TPS68470_GPIO_CTL_REG_A(offset), + TPS68470_GPIO_MODE_MASK, + TPS68470_GPIO_MODE_OUT_CMOS); +-- +2.39.2 + diff --git a/queue-4.14/series b/queue-4.14/series index a41ff4a248b..827edf8eeae 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -144,3 +144,4 @@ netfilter-nf_tables-fix-spurious-set-element-inserti.patch tcp-annotate-data-races-around-rskq_defer_accept.patch tcp-annotate-data-races-around-tp-notsent_lowat.patch tcp-annotate-data-races-around-fastopenq.max_qlen.patch +gpio-tps68470-make-tps68470_gpio_output-always-set-t.patch -- 2.47.3