From: Axel Lin <axel.lin@ingics.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>,
Alexandre Courbot <gnurou@gmail.com>,
linux-gpio@vger.kernel.org, Axel Lin <axel.lin@ingics.com>
Subject: [PATCH RFT] gpio: exar: Set proper output level in exar_direction_output
Date: Sun, 26 Feb 2017 22:36:58 +0800 [thread overview]
Message-ID: <20170226143658.24036-1-axel.lin@ingics.com> (raw)
Current code does not set output level in exar_direction_output, fix it.
Also move the direction_output/direction_input code block to avoid forward
declaration for exar_set_value().
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
Hi Sudip,
I don't have this h/w, so please review and test if this patch works.
thanks,
Axel
drivers/gpio/gpio-exar.c | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/drivers/gpio/gpio-exar.c b/drivers/gpio/gpio-exar.c
index 05c8946..0810767 100644
--- a/drivers/gpio/gpio-exar.c
+++ b/drivers/gpio/gpio-exar.c
@@ -59,17 +59,6 @@ static int exar_set_direction(struct gpio_chip *chip, int direction,
return 0;
}
-static int exar_direction_output(struct gpio_chip *chip, unsigned int offset,
- int value)
-{
- return exar_set_direction(chip, 0, offset);
-}
-
-static int exar_direction_input(struct gpio_chip *chip, unsigned int offset)
-{
- return exar_set_direction(chip, 1, offset);
-}
-
static int exar_get(struct gpio_chip *chip, unsigned int reg)
{
struct exar_gpio_chip *exar_gpio = gpiochip_get_data(chip);
@@ -116,6 +105,18 @@ static void exar_set_value(struct gpio_chip *chip, unsigned int offset,
exar_update(chip, addr, value, offset % 8);
}
+static int exar_direction_output(struct gpio_chip *chip, unsigned int offset,
+ int value)
+{
+ exar_set_value(chip, offset, value);
+ return exar_set_direction(chip, 0, offset);
+}
+
+static int exar_direction_input(struct gpio_chip *chip, unsigned int offset)
+{
+ return exar_set_direction(chip, 1, offset);
+}
+
static int gpio_exar_probe(struct platform_device *pdev)
{
struct pci_dev *pcidev = platform_get_drvdata(pdev);
--
2.9.3
next reply other threads:[~2017-02-26 14:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-26 14:36 Axel Lin [this message]
2017-03-14 13:56 ` [PATCH RFT] gpio: exar: Set proper output level in exar_direction_output Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170226143658.24036-1-axel.lin@ingics.com \
--to=axel.lin@ingics.com \
--cc=gnurou@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=sudip.mukherjee@codethink.co.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.