Skip to contentSkip to conversation

Patch "pinctrl: armada-37xx: Fix direction_output() callback behavior" has been added to the 4.14-stable tree

PATCH [email protected] 1 participant 1 message Dec 11, 2017

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

pinctrl: armada-37xx: Fix direction_output() callback behavior

to the 4.14-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
pinctrl-armada-37xx-fix-direction_output-callback-behavior.patch
and it can be found in the queue-4.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 6702abb3bf2394f250af0ee04070227bb5dda788 Mon Sep 17 00:00:00 2001

From: Gregory CLEMENT <[email protected]>
Date: Tue, 14 Nov 2017 17:51:50 +0100
Subject: pinctrl: armada-37xx: Fix direction_output() callback behavior

From: Gregory CLEMENT <[email protected]>

commit 6702abb3bf2394f250af0ee04070227bb5dda788 upstream.

The direction_output callback of the gpio_chip structure is supposed to set the output direction but also to set the value of the gpio. For the armada-37xx driver this callback acted as the gpio_set_direction callback for the pinctrl.

This patch fixes the behavior of the direction_output callback by also applying the value received as parameter.

Fixes 5715092a458c ("pinctrl: armada-37xx: Add gpio support")
---
 drivers/pinctrl/mvebu/pinctrl-armada-37xx.c |   13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
drivers/pinctrl/mvebu/pinctrl-armada-37xx.c +11 -2
@@ -408,12 +408,21 @@ static int armada_37xx_gpio_direction_ou
 {
 	struct armada_37xx_pinctrl *info = gpiochip_get_data(chip);
 	unsigned int reg = OUTPUT_EN;
-	unsigned int mask;
+	unsigned int mask, val, ret;
 
 	armada_37xx_update_reg(&reg, offset);
 	mask = BIT(offset);
 
-	return regmap_update_bits(info->regmap, reg, mask, mask);
+	ret = regmap_update_bits(info->regmap, reg, mask, mask);
+
+	if (ret)
+		return ret;
+
+	reg = OUTPUT_VAL;
+	val = value ? mask : 0;
+	regmap_update_bits(info->regmap, reg, mask, val);
+
+	return 0;
 }
 
 static int armada_37xx_gpio_get(struct gpio_chip *chip, unsigned int offset)

Patches currently in stable-queue which might be from [email protected] are

queue-4.14/pinctrl-armada-37xx-fix-direction_output-callback-behavior.patch