From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 2/4] ARM: AT91: Make gpio mux functions inline
Date: Mon, 8 Sep 2014 15:23:40 +0200 [thread overview]
Message-ID: <1410182622-22876-3-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1410182622-22876-1-git-send-email-s.hauer@pengutronix.de>
Otherwise we get a unused function warning each time mach/gpio.h
is included.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/mach-at91/at91sam926x_lowlevel_init.c | 1 -
arch/arm/mach-at91/include/mach/gpio.h | 42 ++++++++++++--------------
2 files changed, 19 insertions(+), 24 deletions(-)
diff --git a/arch/arm/mach-at91/at91sam926x_lowlevel_init.c b/arch/arm/mach-at91/at91sam926x_lowlevel_init.c
index 59ea83e..6452bdd 100644
--- a/arch/arm/mach-at91/at91sam926x_lowlevel_init.c
+++ b/arch/arm/mach-at91/at91sam926x_lowlevel_init.c
@@ -25,7 +25,6 @@
#include <init.h>
#include <sizes.h>
-#define __gpio_init inline
#include "gpio.h"
static void inline access_sdram(void)
diff --git a/arch/arm/mach-at91/include/mach/gpio.h b/arch/arm/mach-at91/include/mach/gpio.h
index 6a6b9cd..4e9d686 100644
--- a/arch/arm/mach-at91/include/mach/gpio.h
+++ b/arch/arm/mach-at91/include/mach/gpio.h
@@ -9,10 +9,6 @@
#include <asm-generic/gpio.h>
-#ifndef __gpio_init
-#define __gpio_init
-#endif
-
#define MAX_NB_GPIO_PER_BANK 32
static inline unsigned pin_to_bank(unsigned pin)
@@ -30,32 +26,32 @@ static inline unsigned pin_to_mask(unsigned pin)
return 1 << pin_to_bank_offset(pin);
}
-static __gpio_init void at91_mux_disable_interrupt(void __iomem *pio, unsigned mask)
+static inline void at91_mux_disable_interrupt(void __iomem *pio, unsigned mask)
{
__raw_writel(mask, pio + PIO_IDR);
}
-static __gpio_init void at91_mux_set_pullup(void __iomem *pio, unsigned mask, bool on)
+static inline void at91_mux_set_pullup(void __iomem *pio, unsigned mask, bool on)
{
__raw_writel(mask, pio + (on ? PIO_PUER : PIO_PUDR));
}
-static __gpio_init void at91_mux_set_multidrive(void __iomem *pio, unsigned mask, bool on)
+static inline void at91_mux_set_multidrive(void __iomem *pio, unsigned mask, bool on)
{
__raw_writel(mask, pio + (on ? PIO_MDER : PIO_MDDR));
}
-static __gpio_init void at91_mux_set_A_periph(void __iomem *pio, unsigned mask)
+static inline void at91_mux_set_A_periph(void __iomem *pio, unsigned mask)
{
__raw_writel(mask, pio + PIO_ASR);
}
-static __gpio_init void at91_mux_set_B_periph(void __iomem *pio, unsigned mask)
+static inline void at91_mux_set_B_periph(void __iomem *pio, unsigned mask)
{
__raw_writel(mask, pio + PIO_BSR);
}
-static __gpio_init void at91_mux_pio3_set_A_periph(void __iomem *pio, unsigned mask)
+static inline void at91_mux_pio3_set_A_periph(void __iomem *pio, unsigned mask)
{
__raw_writel(__raw_readl(pio + PIO_ABCDSR1) & ~mask,
@@ -64,7 +60,7 @@ static __gpio_init void at91_mux_pio3_set_A_periph(void __iomem *pio, unsigned m
pio + PIO_ABCDSR2);
}
-static __gpio_init void at91_mux_pio3_set_B_periph(void __iomem *pio, unsigned mask)
+static inline void at91_mux_pio3_set_B_periph(void __iomem *pio, unsigned mask)
{
__raw_writel(__raw_readl(pio + PIO_ABCDSR1) | mask,
pio + PIO_ABCDSR1);
@@ -72,31 +68,31 @@ static __gpio_init void at91_mux_pio3_set_B_periph(void __iomem *pio, unsigned m
pio + PIO_ABCDSR2);
}
-static __gpio_init void at91_mux_pio3_set_C_periph(void __iomem *pio, unsigned mask)
+static inline void at91_mux_pio3_set_C_periph(void __iomem *pio, unsigned mask)
{
__raw_writel(__raw_readl(pio + PIO_ABCDSR1) & ~mask, pio + PIO_ABCDSR1);
__raw_writel(__raw_readl(pio + PIO_ABCDSR2) | mask, pio + PIO_ABCDSR2);
}
-static __gpio_init void at91_mux_pio3_set_D_periph(void __iomem *pio, unsigned mask)
+static inline void at91_mux_pio3_set_D_periph(void __iomem *pio, unsigned mask)
{
__raw_writel(__raw_readl(pio + PIO_ABCDSR1) | mask, pio + PIO_ABCDSR1);
__raw_writel(__raw_readl(pio + PIO_ABCDSR2) | mask, pio + PIO_ABCDSR2);
}
-static __gpio_init void at91_mux_set_deglitch(void __iomem *pio, unsigned mask, bool is_on)
+static inline void at91_mux_set_deglitch(void __iomem *pio, unsigned mask, bool is_on)
{
__raw_writel(mask, pio + (is_on ? PIO_IFER : PIO_IFDR));
}
-static __gpio_init void at91_mux_pio3_set_deglitch(void __iomem *pio, unsigned mask, bool is_on)
+static inline void at91_mux_pio3_set_deglitch(void __iomem *pio, unsigned mask, bool is_on)
{
if (is_on)
__raw_writel(mask, pio + PIO_IFSCDR);
at91_mux_set_deglitch(pio, mask, is_on);
}
-static __gpio_init void at91_mux_pio3_set_debounce(void __iomem *pio, unsigned mask,
+static inline void at91_mux_pio3_set_debounce(void __iomem *pio, unsigned mask,
bool is_on, u32 div)
{
if (is_on) {
@@ -108,38 +104,38 @@ static __gpio_init void at91_mux_pio3_set_debounce(void __iomem *pio, unsigned m
}
}
-static __gpio_init void at91_mux_pio3_set_pulldown(void __iomem *pio, unsigned mask, bool is_on)
+static inline void at91_mux_pio3_set_pulldown(void __iomem *pio, unsigned mask, bool is_on)
{
__raw_writel(mask, pio + (is_on ? PIO_PPDER : PIO_PPDDR));
}
-static __gpio_init void at91_mux_pio3_disable_schmitt_trig(void __iomem *pio, unsigned mask)
+static inline void at91_mux_pio3_disable_schmitt_trig(void __iomem *pio, unsigned mask)
{
__raw_writel(__raw_readl(pio + PIO_SCHMITT) | mask, pio + PIO_SCHMITT);
}
-static __gpio_init void at91_mux_gpio_disable(void __iomem *pio, unsigned mask)
+static inline void at91_mux_gpio_disable(void __iomem *pio, unsigned mask)
{
__raw_writel(mask, pio + PIO_PDR);
}
-static __gpio_init void at91_mux_gpio_enable(void __iomem *pio, unsigned mask)
+static inline void at91_mux_gpio_enable(void __iomem *pio, unsigned mask)
{
__raw_writel(mask, pio + PIO_PER);
}
-static __gpio_init void at91_mux_gpio_input(void __iomem *pio, unsigned mask, bool input)
+static inline void at91_mux_gpio_input(void __iomem *pio, unsigned mask, bool input)
{
__raw_writel(mask, pio + (input ? PIO_ODR : PIO_OER));
}
-static __gpio_init void at91_mux_gpio_set(void __iomem *pio, unsigned mask,
+static inline void at91_mux_gpio_set(void __iomem *pio, unsigned mask,
int value)
{
__raw_writel(mask, pio + (value ? PIO_SODR : PIO_CODR));
}
-static __gpio_init int at91_mux_gpio_get(void __iomem *pio, unsigned mask)
+static inline int at91_mux_gpio_get(void __iomem *pio, unsigned mask)
{
u32 pdsr;
--
2.1.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2014-09-08 13:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-08 13:23 AT91 pinctrl/gpio fixes Sascha Hauer
2014-09-08 13:23 ` [PATCH 1/4] ARM: AT91: Add missing include Sascha Hauer
2014-09-08 13:23 ` Sascha Hauer [this message]
2014-09-08 13:23 ` [PATCH 3/4] pinctrl: AT91: Only use of_alias_get_id when probed from devicetree Sascha Hauer
2014-09-08 13:23 ` [PATCH 4/4] pinctrl: AT91: use alias_idx to calculate the base gpio number Sascha Hauer
2014-09-08 13:36 ` AT91 pinctrl/gpio fixes Raphaël Poggi
2014-09-09 8:19 ` Sascha Hauer
2014-09-09 8:47 ` Raphaël Poggi
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=1410182622-22876-3-git-send-email-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox