linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gpio: bcm281xx: Fix parameter name for GPIO_CONTROL macro
@ 2014-01-22  0:10 Markus Mayer
  2014-01-23  8:20 ` Linus Walleij
  0 siblings, 1 reply; 2+ messages in thread
From: Markus Mayer @ 2014-01-22  0:10 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Linaro Patches, Linux GPIO List, Linux Kernel Mailing List,
	Tim Kryger, Markus Mayer

The GPIO_CONTROL macro returns the control register offset when given a
GPIO number.

Update the argument name in the macro to reflect that it takes in a
GPIO number and not a bank.

Signed-off-by: Markus Mayer <markus.mayer@linaro.org>
Reviewed-by: Tim Kryger <tim.kryger@linaro.org>
---
 drivers/gpio/gpio-bcm-kona.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-bcm-kona.c b/drivers/gpio/gpio-bcm-kona.c
index 233d088..93a5b01 100644
--- a/drivers/gpio/gpio-bcm-kona.c
+++ b/drivers/gpio/gpio-bcm-kona.c
@@ -28,6 +28,10 @@
 #define GPIO_BANK(gpio)				((gpio) >> 5)
 #define GPIO_BIT(gpio)				((gpio) & (GPIO_PER_BANK - 1))
 
+/* There is a GPIO control register for each GPIO */
+#define GPIO_CONTROL(gpio)			(0x00000100 + ((gpio) << 2))
+
+/* The remaining registers are per GPIO bank */
 #define GPIO_OUT_STATUS(bank)			(0x00000000 + ((bank) << 2))
 #define GPIO_IN_STATUS(bank)			(0x00000020 + ((bank) << 2))
 #define GPIO_OUT_SET(bank)			(0x00000040 + ((bank) << 2))
@@ -35,7 +39,6 @@
 #define GPIO_INT_STATUS(bank)			(0x00000080 + ((bank) << 2))
 #define GPIO_INT_MASK(bank)			(0x000000a0 + ((bank) << 2))
 #define GPIO_INT_MSKCLR(bank)			(0x000000c0 + ((bank) << 2))
-#define GPIO_CONTROL(bank)			(0x00000100 + ((bank) << 2))
 #define GPIO_PWD_STATUS(bank)			(0x00000500 + ((bank) << 2))
 
 #define GPIO_GPPWR_OFFSET			0x00000520
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] gpio: bcm281xx: Fix parameter name for GPIO_CONTROL macro
  2014-01-22  0:10 [PATCH] gpio: bcm281xx: Fix parameter name for GPIO_CONTROL macro Markus Mayer
@ 2014-01-23  8:20 ` Linus Walleij
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2014-01-23  8:20 UTC (permalink / raw)
  To: Markus Mayer
  Cc: Linaro Patches, Linux GPIO List, Linux Kernel Mailing List, Tim Kryger

On Wed, Jan 22, 2014 at 1:10 AM, Markus Mayer <markus.mayer@linaro.org> wrote:

> The GPIO_CONTROL macro returns the control register offset when given a
> GPIO number.
>
> Update the argument name in the macro to reflect that it takes in a
> GPIO number and not a bank.
>
> Signed-off-by: Markus Mayer <markus.mayer@linaro.org>
> Reviewed-by: Tim Kryger <tim.kryger@linaro.org>
(...)
> +/* There is a GPIO control register for each GPIO */
> +#define GPIO_CONTROL(gpio)                     (0x00000100 + ((gpio) << 2))

Technically I prefer naming this parameter "offset" rather than
"gpio" as it is the offset of a GPIO line in *this* very GPIO
HW block rather than a GPIO number from the global
GPIO number space.

But it's no big deal, so patch applied.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-01-23  8:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-22  0:10 [PATCH] gpio: bcm281xx: Fix parameter name for GPIO_CONTROL macro Markus Mayer
2014-01-23  8:20 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).