From: Michal Simek <michal.simek@xilinx.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/4] gpio: xilinx: Swap xilinx_gpio_get_function with xilinx_gpio_get_value
Date: Mon, 23 Jul 2018 13:43:35 +0200 [thread overview]
Message-ID: <1c6189d7420589a5138275aeab0ee72b34d975ff.1532346215.git.michal.simek@xilinx.com> (raw)
In-Reply-To: <61f5486be81d3a2e9170aa7c383de68b78b944cb.1532346215.git.michal.simek@xilinx.com>
Exchange two functions to avoid function declaration for next patch.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---
drivers/gpio/xilinx_gpio.c | 38 +++++++++++++++++++-------------------
1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/drivers/gpio/xilinx_gpio.c b/drivers/gpio/xilinx_gpio.c
index 8ce08d80f491..4da9ae114d87 100644
--- a/drivers/gpio/xilinx_gpio.c
+++ b/drivers/gpio/xilinx_gpio.c
@@ -410,25 +410,6 @@ static int xilinx_gpio_set_value(struct udevice *dev, unsigned offset,
return val;
};
-static int xilinx_gpio_get_value(struct udevice *dev, unsigned offset)
-{
- struct xilinx_gpio_platdata *platdata = dev_get_platdata(dev);
- int val, ret;
- u32 bank, pin;
-
- ret = xilinx_gpio_get_bank_pin(offset, &bank, &pin, dev);
- if (ret)
- return ret;
-
- debug("%s: regs: %lx, gpio: %x, bank %x, pin %x\n", __func__,
- (ulong)platdata->regs, offset, bank, pin);
-
- val = readl(&platdata->regs->gpiodata + bank * 2);
- val = !!(val & (1 << pin));
-
- return val;
-};
-
static int xilinx_gpio_get_function(struct udevice *dev, unsigned offset)
{
struct xilinx_gpio_platdata *platdata = dev_get_platdata(dev);
@@ -457,6 +438,25 @@ static int xilinx_gpio_get_function(struct udevice *dev, unsigned offset)
return val;
}
+static int xilinx_gpio_get_value(struct udevice *dev, unsigned offset)
+{
+ struct xilinx_gpio_platdata *platdata = dev_get_platdata(dev);
+ int val, ret;
+ u32 bank, pin;
+
+ ret = xilinx_gpio_get_bank_pin(offset, &bank, &pin, dev);
+ if (ret)
+ return ret;
+
+ debug("%s: regs: %lx, gpio: %x, bank %x, pin %x\n", __func__,
+ (ulong)platdata->regs, offset, bank, pin);
+
+ val = readl(&platdata->regs->gpiodata + bank * 2);
+ val = !!(val & (1 << pin));
+
+ return val;
+};
+
static int xilinx_gpio_direction_output(struct udevice *dev, unsigned offset,
int value)
{
--
1.9.1
next prev parent reply other threads:[~2018-07-23 11:43 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-23 11:43 [U-Boot] [PATCH 1/4] gpio: xilinx: Find out bank before use in xilinx_gpio_get_function() Michal Simek
2018-07-23 11:43 ` Michal Simek [this message]
2018-07-23 11:43 ` [U-Boot] [PATCH 3/4] gpio: xilinx: Not read output values via regs Michal Simek
2018-07-23 18:42 ` Stefan Herbrechtsmeier
2018-07-24 10:31 ` Michal Simek
2018-07-24 19:56 ` Stefan Herbrechtsmeier
2018-07-25 6:39 ` Michal Simek
2018-07-25 18:21 ` Stefan Herbrechtsmeier
2018-07-26 8:41 ` Michal Simek
2018-07-26 19:46 ` Stefan Herbrechtsmeier
2018-07-27 7:05 ` Michal Simek
2018-07-27 8:41 ` Stefan Herbrechtsmeier
2018-07-30 12:40 ` Michal Simek
2018-07-30 13:32 ` Stefan Herbrechtsmeier
2018-07-30 14:10 ` Michal Simek
2018-07-30 19:34 ` Stefan Herbrechtsmeier
2018-08-01 18:36 ` Stefan Herbrechtsmeier
2018-08-02 12:56 ` Michal Simek
2018-07-23 11:43 ` [U-Boot] [PATCH 4/4] gpio: xilinx: Remove !DM driver Michal Simek
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=1c6189d7420589a5138275aeab0ee72b34d975ff.1532346215.git.michal.simek@xilinx.com \
--to=michal.simek@xilinx.com \
--cc=u-boot@lists.denx.de \
/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.