From: Sonic Zhang <sonic.adi@gmail.com>
To: Linus Walleij <linus.walleij@linaro.org>,
Grant Likely <grant.likely@linaro.org>,
Steven Miao <realmz6@gmail.com>,
Stephen Warren <swarren@wwwdotorg.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
<adi-buildroot-devel@lists.sourceforge.net>,
Sonic Zhang <sonic.zhang@analog.com>
Subject: [PATCH 3/3 v3] blackfin: pinctrl-adi2: Enable PINCTRL framework for BF54x and BF60x.
Date: Wed, 21 Aug 2013 14:30:07 +0800 [thread overview]
Message-ID: <1377066607-19061-3-git-send-email-sonic.adi@gmail.com> (raw)
In-Reply-To: <1377066607-19061-1-git-send-email-sonic.adi@gmail.com>
From: Sonic Zhang <sonic.zhang@analog.com>
- Remove unused macro MAX_RESOURCES
- Override blackfin legacy peripheral pinmux request and free APIs by
devm_pinctrl_get_select_default() to init the peripheral portmux setting.
v2-chagnes:
- Move pinctrl soc data out of blackfin arch folder.
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
---
arch/blackfin/Kconfig | 4 ++++
arch/blackfin/include/asm/portmux.h | 19 +++++++++++++++++--
arch/blackfin/mach-bf548/include/mach/portmux.h | 2 --
arch/blackfin/mach-bf609/include/mach/portmux.h | 2 --
4 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig
index 9eff25b..ed7157f 100644
--- a/arch/blackfin/Kconfig
+++ b/arch/blackfin/Kconfig
@@ -324,6 +324,10 @@ config GPIO_ADI
def_bool y
depends on (BF51x || BF52x || BF53x || BF538 || BF539 || BF561)
+config PINCTRL
+ def_bool y
+ depends on BF54x || BF60x
+
config MEM_MT48LC64M4A2FB_7E
bool
depends on (BFIN533_STAMP)
diff --git a/arch/blackfin/include/asm/portmux.h b/arch/blackfin/include/asm/portmux.h
index 9b1e2c3..7aa2043 100644
--- a/arch/blackfin/include/asm/portmux.h
+++ b/arch/blackfin/include/asm/portmux.h
@@ -17,14 +17,29 @@
#define P_MAYSHARE 0x2000
#define P_DONTCARE 0x1000
-
+#ifdef CONFIG_PINCTRL
+#include <asm/irq_handler.h>
+
+#define gpio_pint_regs bfin_pint_regs
+#define adi_internal_set_wake bfin_internal_set_wake
+
+#define peripheral_request(per, label) 0
+#define peripheral_free(per)
+#define peripheral_request_list(per, label) \
+ (pdev ? (IS_ERR(devm_pinctrl_get_select_default(&pdev->dev)) \
+ ? -EINVAL : 0) : 0)
+#define peripheral_free_list(per)
+#else
int peripheral_request(unsigned short per, const char *label);
void peripheral_free(unsigned short per);
int peripheral_request_list(const unsigned short per[], const char *label);
void peripheral_free_list(const unsigned short per[]);
+#endif
-#include <asm/gpio.h>
+#include <linux/err.h>
+#include <linux/pinctrl/pinctrl.h>
#include <mach/portmux.h>
+#include <linux/gpio.h>
#ifndef P_SPORT2_TFS
#define P_SPORT2_TFS P_UNDEF
diff --git a/arch/blackfin/mach-bf548/include/mach/portmux.h b/arch/blackfin/mach-bf548/include/mach/portmux.h
index e222462..d9f8632 100644
--- a/arch/blackfin/mach-bf548/include/mach/portmux.h
+++ b/arch/blackfin/mach-bf548/include/mach/portmux.h
@@ -7,8 +7,6 @@
#ifndef _MACH_PORTMUX_H_
#define _MACH_PORTMUX_H_
-#define MAX_RESOURCES MAX_BLACKFIN_GPIOS
-
#define P_SPORT2_TFS (P_DEFINED | P_IDENT(GPIO_PA0) | P_FUNCT(0))
#define P_SPORT2_DTSEC (P_DEFINED | P_IDENT(GPIO_PA1) | P_FUNCT(0))
#define P_SPORT2_DTPRI (P_DEFINED | P_IDENT(GPIO_PA2) | P_FUNCT(0))
diff --git a/arch/blackfin/mach-bf609/include/mach/portmux.h b/arch/blackfin/mach-bf609/include/mach/portmux.h
index 2e1a51c..fe34191 100644
--- a/arch/blackfin/mach-bf609/include/mach/portmux.h
+++ b/arch/blackfin/mach-bf609/include/mach/portmux.h
@@ -7,8 +7,6 @@
#ifndef _MACH_PORTMUX_H_
#define _MACH_PORTMUX_H_
-#define MAX_RESOURCES MAX_BLACKFIN_GPIOS
-
/* EMAC RMII Port Mux */
#define P_MII0_MDC (P_DEFINED | P_IDENT(GPIO_PC6) | P_FUNCT(0))
#define P_MII0_MDIO (P_DEFINED | P_IDENT(GPIO_PC7) | P_FUNCT(0))
--
1.8.2.3
next prev parent reply other threads:[~2013-08-21 6:24 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-21 6:30 [PATCH 1/3 v3] pinctrl: ADI PIN control driver for the GPIO controller on bf54x and bf60x Sonic Zhang
2013-08-21 6:30 ` [PATCH 2/3 v3] blackfin: gpio: Remove none gpio lib code Sonic Zhang
2013-08-21 6:30 ` Sonic Zhang [this message]
2013-08-21 18:45 ` [PATCH 1/3 v3] pinctrl: ADI PIN control driver for the GPIO controller on bf54x and bf60x Stephen Warren
2013-08-22 7:07 ` Sonic Zhang
2013-08-22 20:48 ` Stephen Warren
2013-08-27 9:30 ` Sonic Zhang
2013-08-27 21:39 ` Stephen Warren
2013-08-28 3:56 ` Sonic Zhang
2013-08-28 14:23 ` Stephen Warren
2013-08-29 9:18 ` Sonic Zhang
2013-08-29 8:19 ` Linus Walleij
2013-08-29 9:36 ` Sonic Zhang
2013-08-30 8:43 ` Linus Walleij
2013-08-29 8:06 ` Linus Walleij
2013-08-29 8:12 ` Linus Walleij
2013-08-29 9:31 ` Sonic Zhang
2013-08-30 8:40 ` Linus Walleij
2013-08-29 8:02 ` Linus Walleij
2013-08-29 9:17 ` Sonic Zhang
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=1377066607-19061-3-git-send-email-sonic.adi@gmail.com \
--to=sonic.adi@gmail.com \
--cc=adi-buildroot-devel@lists.sourceforge.net \
--cc=grant.likely@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=realmz6@gmail.com \
--cc=sonic.zhang@analog.com \
--cc=swarren@wwwdotorg.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
Powered by JetHome