813a95e5b4
With this, five platforms are moving to the relatively new pinctrl subsystem for their pin management, replacing the older soc specific in-kernel interfaces with common code. There is quite a bit of net addition of code for each platform being added to the pinctrl subsystem. but the payback comes later when adding new boards can be done by only providing new device trees instead. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAABAgAGBQJPuw1/AAoJEIwa5zzehBx3wbsP/RFCYzMVyz85BNLQuRyY9eO2 GCRWd0Vvy3fIfypiPdHdhkq6nIU/JnxgsfBbKX9FvWqvxXi96Ojh13KSIhSI1rQ9 t14VyuwUXaS3leeCyKxhNF1vRscz2iyEGXJqp+XEN4ckf2nrQCpKBiY5Eg9sH6/J fvYgSBY9Lf9nFAn+/wqSKIfdvw7H0NXwUdsLvNU0uCwvrSG929bTxx2AnHX00TdJ qf4XLhmatMg1uwdUgL/99ZxxgHlj6o55u7S6aRhUWXNXCimV6uEZ1F35ET37b+x3 YUltBCIaXjFR7iwNHmkkl42d8uyfkBznB555sY5qS3G/uF5Ma1R5I7fv8EIEy+2w bVHsva4lj1yFazic6m8yKTET4i8n6OPiKVNqGnDsp2yb6WzOGSliKdr0Jlo1oNG2 gS69LcDZxCkXrqEq0Ht8uUoCo9TWei+qhJ6ZOJ1Z3+9ZyFq1iRTKgPVxyA5VaHaB wwBbqKrohAwuExY8/gkAj6SYqBOF3l/J8QSB2JjXyj4trLC5UMq+l3L4cIWyMRPc fil83hV6460CiIBoKcsnV9hDUS0oh74mv52zHo0Xj73qABqZ4dcrpHVayWjtMtpl Z+tUpvD1rMQ+E0gdXDrwMrwILVyCDsBvpFKF4avnujDJ4WmyywtKZ+xvnpMd73VZ YrI/+XQsMT8ZfVkkj54D =HIfz -----END PGP SIGNATURE----- Merge tag 'pinctrl' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc Pull arm soc-specific pinctrl changes from Olof Johansson: "With this, five platforms are moving to the relatively new pinctrl subsystem for their pin management, replacing the older soc specific in-kernel interfaces with common code. There is quite a bit of net addition of code for each platform being added to the pinctrl subsystem. But the payback comes later when adding new boards can be done by only providing new device trees instead." Fix up trivial conflicts in arch/arm/mach-ux500/{Makefile,board-mop500.c} * tag 'pinctrl' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (61 commits) mtd: nand: gpmi: fix compile error caused by pinctrl call ARM: PRIMA2: select PINCTRL and PINCTRL_SIRF in Kconfig ARM: nomadik: enable PINCTRL_NOMADIK where needed ARM: mxs: enable pinctrl support video: mxsfb: adopt pinctrl support ASoC: mxs-saif: adopt pinctrl support i2c: mxs: adopt pinctrl support mtd: nand: gpmi: adopt pinctrl support mmc: mxs-mmc: adopt pinctrl support serial: mxs-auart: adopt pinctrl support serial: amba-pl011: adopt pinctrl support spi/imx: adopt pinctrl support i2c: imx: adopt pinctrl support can: flexcan: adopt pinctrl support net: fec: adopt pinctrl support ARM: ux500: switch MSP to using pinctrl for pins ARM: ux500: alter MSP registration to return a device pointer ARM: ux500: switch to using pinctrl for uart0 ARM: ux500: delete custom pin control system ARM: ux500: switch over to Nomadik pinctrl driver ...
106 lines
2.6 KiB
C
106 lines
2.6 KiB
C
/*
|
|
* Copyright (C) ST-Ericsson SA 2010
|
|
*
|
|
* Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson
|
|
* License terms: GNU General Public License (GPL), version 2.
|
|
*/
|
|
|
|
#ifndef __DEVICES_COMMON_H
|
|
#define __DEVICES_COMMON_H
|
|
|
|
#include <linux/platform_device.h>
|
|
#include <linux/dma-mapping.h>
|
|
#include <linux/sys_soc.h>
|
|
#include <linux/amba/bus.h>
|
|
#include <plat/i2c.h>
|
|
|
|
struct spi_master_cntlr;
|
|
|
|
static inline struct amba_device *
|
|
dbx500_add_msp_spi(struct device *parent, const char *name,
|
|
resource_size_t base, int irq,
|
|
struct spi_master_cntlr *pdata)
|
|
{
|
|
return amba_ahb_device_add(parent, name, base, SZ_4K, irq, 0,
|
|
pdata, 0);
|
|
}
|
|
|
|
static inline struct amba_device *
|
|
dbx500_add_spi(struct device *parent, const char *name, resource_size_t base,
|
|
int irq, struct spi_master_cntlr *pdata,
|
|
u32 periphid)
|
|
{
|
|
return amba_ahb_device_add(parent, name, base, SZ_4K, irq, 0,
|
|
pdata, periphid);
|
|
}
|
|
|
|
struct mmci_platform_data;
|
|
|
|
static inline struct amba_device *
|
|
dbx500_add_sdi(struct device *parent, const char *name, resource_size_t base,
|
|
int irq, struct mmci_platform_data *pdata, u32 periphid)
|
|
{
|
|
return amba_ahb_device_add(parent, name, base, SZ_4K, irq, 0,
|
|
pdata, periphid);
|
|
}
|
|
|
|
struct amba_pl011_data;
|
|
|
|
static inline struct amba_device *
|
|
dbx500_add_uart(struct device *parent, const char *name, resource_size_t base,
|
|
int irq, struct amba_pl011_data *pdata)
|
|
{
|
|
return amba_ahb_device_add(parent, name, base, SZ_4K, irq, 0, pdata, 0);
|
|
}
|
|
|
|
struct nmk_i2c_controller;
|
|
|
|
static inline struct platform_device *
|
|
dbx500_add_i2c(struct device *parent, int id, resource_size_t base, int irq,
|
|
struct nmk_i2c_controller *data)
|
|
{
|
|
struct resource res[] = {
|
|
DEFINE_RES_MEM(base, SZ_4K),
|
|
DEFINE_RES_IRQ(irq),
|
|
};
|
|
|
|
struct platform_device_info pdevinfo = {
|
|
.parent = parent,
|
|
.name = "nmk-i2c",
|
|
.id = id,
|
|
.res = res,
|
|
.num_res = ARRAY_SIZE(res),
|
|
.data = data,
|
|
.size_data = sizeof(*data),
|
|
.dma_mask = DMA_BIT_MASK(32),
|
|
};
|
|
|
|
return platform_device_register_full(&pdevinfo);
|
|
}
|
|
|
|
static inline struct amba_device *
|
|
dbx500_add_rtc(struct device *parent, resource_size_t base, int irq)
|
|
{
|
|
return amba_apb_device_add(parent, "rtc-pl031", base, SZ_4K, irq,
|
|
0, NULL, 0);
|
|
}
|
|
|
|
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
|