From e98ea774c8d210364379329f042e7596f83ecc58 Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Thu, 26 Apr 2012 23:57:25 +0200 Subject: pinctrl/nomadik: basic Nomadik pinctrl interface This adds a scratch pin control interface to the Nomadik pinctrl driver, and defines the pins and groups in the DB8500 ASIC. We define GPIO ranges to cover the pins exposed. The DB8500 has more pins than this but we restrict the driver to the pins that can be controlled from the combined GPIO and pin control hardware to begin with. ChangeLog v1->v2: - Base on the latest pinctrl development from pinctrl-mergebase-20120418 so we can get rid of legacy group count mechanism. Also drop the range checks for group index, this is handled by the core now. Acked-by: Stephen Warren Signed-off-by: Linus Walleij --- arch/arm/mach-ux500/Kconfig | 3 +++ arch/arm/mach-ux500/cpu-db8500.c | 1 + arch/arm/mach-ux500/devices-common.h | 12 ++++++++++++ 3 files changed, 16 insertions(+) (limited to 'arch/arm/mach-ux500') diff --git a/arch/arm/mach-ux500/Kconfig b/arch/arm/mach-ux500/Kconfig index ef7099e..4adb493 100644 --- a/arch/arm/mach-ux500/Kconfig +++ b/arch/arm/mach-ux500/Kconfig @@ -9,6 +9,8 @@ config UX500_SOC_COMMON select ARM_ERRATA_754322 select ARM_ERRATA_764369 select CACHE_L2X0 + select PINCTRL + select PINCTRL_NOMADIK config UX500_SOC_DB5500 bool @@ -20,6 +22,7 @@ config UX500_SOC_DB8500 select REGULATOR select REGULATOR_DB8500_PRCMU select CPU_FREQ_TABLE if CPU_FREQ + select PINCTRL_DB8500 menu "Ux500 target platform (boards)" diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c index 9bd8163..d992d2b 100644 --- a/arch/arm/mach-ux500/cpu-db8500.c +++ b/arch/arm/mach-ux500/cpu-db8500.c @@ -141,6 +141,7 @@ static void __init db8500_add_gpios(struct device *parent) dbx500_add_gpios(parent, ARRAY_AND_SIZE(db8500_gpio_base), IRQ_DB8500_GPIO0, &pdata); + dbx500_add_pinctrl(parent, "pinctrl-db8500"); } static int usb_db8500_rx_dma_cfg[] = { diff --git a/arch/arm/mach-ux500/devices-common.h b/arch/arm/mach-ux500/devices-common.h index 39c74ec..939f750 100644 --- a/arch/arm/mach-ux500/devices-common.h +++ b/arch/arm/mach-ux500/devices-common.h @@ -93,4 +93,16 @@ struct nmk_gpio_platform_data; void dbx500_add_gpios(struct device *parent, resource_size_t *base, int num, int irq, struct nmk_gpio_platform_data *pdata); +static inline void +dbx500_add_pinctrl(struct device *parent, const char *name) +{ + struct platform_device_info pdevinfo = { + .parent = parent, + .name = name, + .id = -1, + }; + + platform_device_register_full(&pdevinfo); +} + #endif -- cgit v1.1