summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpio-altera-a10sr.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2019-01-23 03:00:57 +0300
committerBartosz Golaszewski <bgolaszewski@baylibre.com>2019-01-23 19:24:02 +0300
commit2095a45e345e669ea77a9b34bdd7de5ceb422f93 (patch)
treee9c6caffa5ee814eb7038e59572d6e88febaed41 /drivers/gpio/gpio-altera-a10sr.c
parentf785ffb61605734b518afa766d1b5445e9f38c8d (diff)
downloadlinux-2095a45e345e669ea77a9b34bdd7de5ceb422f93.tar.xz
gpio: altera-a10sr: Set proper output level for direction_output
The altr_a10sr_gpio_direction_output should set proper output level based on the value argument. Fixes: 26a48c4cc2f1 ("gpio: altera-a10sr: Add A10 System Resource Chip GPIO support.") Cc: <stable@vger.kernel.org> Signed-off-by: Axel Lin <axel.lin@ingics.com> Tested by: Thor Thayer <thor.thayer@linux.intel.com> Reviewed by: Thor Thayer <thor.thayer@linux.intel.com> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Diffstat (limited to 'drivers/gpio/gpio-altera-a10sr.c')
-rw-r--r--drivers/gpio/gpio-altera-a10sr.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-altera-a10sr.c b/drivers/gpio/gpio-altera-a10sr.c
index 6b11f1314248..7f9e0304b510 100644
--- a/drivers/gpio/gpio-altera-a10sr.c
+++ b/drivers/gpio/gpio-altera-a10sr.c
@@ -66,8 +66,10 @@ static int altr_a10sr_gpio_direction_input(struct gpio_chip *gc,
static int altr_a10sr_gpio_direction_output(struct gpio_chip *gc,
unsigned int nr, int value)
{
- if (nr <= (ALTR_A10SR_OUT_VALID_RANGE_HI - ALTR_A10SR_LED_VALID_SHIFT))
+ if (nr <= (ALTR_A10SR_OUT_VALID_RANGE_HI - ALTR_A10SR_LED_VALID_SHIFT)) {
+ altr_a10sr_gpio_set(gc, nr, value);
return 0;
+ }
return -EINVAL;
}