Skip to content

Commit

Permalink
Merge branch 'gpio/next' of git://git.secretlab.ca/git/linux-2.6
Browse files Browse the repository at this point in the history
* 'gpio/next' of git://git.secretlab.ca/git/linux-2.6: (61 commits)
  gpio/mxc/mxs: fix build error introduced by the irq_gc_ack() renaming
  mcp23s08: add i2c support
  mcp23s08: isolate spi specific parts
  mcp23s08: get rid of setup/teardown callbacks
  gpio/tegra: dt: add binding for gpio polarity
  mcp23s08: remove unused work queue
  gpio/da9052: remove a redundant assignment for gpio->da9052
  gpio/mxc: add device tree probe support
  ARM: mxc: use ARCH_NR_GPIOS to define gpio number
  gpio/mxc: get rid of the uses of cpu_is_mx()
  gpio/mxc: add missing initialization of basic_mmio_gpio shadow variables
  gpio: Move mpc5200 gpio driver to drivers/gpio
  GPIO: DA9052 GPIO module v3
  gpio/tegra: Use engineering names in DT compatible property
  of/gpio: Add new method for getting gpios under different property names
  gpio/dt: Refine GPIO device tree binding
  gpio/ml-ioh: fix off-by-one for displaying variable i in dev_err
  gpio/pca953x: Deprecate meaningless device-tree bindings
  gpio/pca953x: Remove dynamic platform data pointer
  gpio/pca953x: Fix IRQ support.
  ...
  • Loading branch information
Linus Torvalds committed Jul 22, 2011
2 parents ece236c + 591567a commit c7c8518
Show file tree
Hide file tree
Showing 137 changed files with 2,291 additions and 1,917 deletions.
22 changes: 22 additions & 0 deletions Documentation/devicetree/bindings/gpio/fsl-imx-gpio.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
* Freescale i.MX/MXC GPIO controller

Required properties:
- compatible : Should be "fsl,<soc>-gpio"
- reg : Address and length of the register set for the device
- interrupts : Should be the port interrupt shared by all 32 pins, if
one number. If two numbers, the first one is the interrupt shared
by low 16 pins and the second one is for high 16 pins.
- gpio-controller : Marks the device node as a gpio controller.
- #gpio-cells : Should be two. The first cell is the pin number and
the second cell is used to specify optional parameters (currently
unused).

Example:

gpio0: gpio@73f84000 {
compatible = "fsl,imx51-gpio", "fsl,imx31-gpio";
reg = <0x73f84000 0x4000>;
interrupts = <50 51>;
gpio-controller;
#gpio-cells = <2>;
};
46 changes: 37 additions & 9 deletions Documentation/devicetree/bindings/gpio/gpio.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,45 @@ Specifying GPIO information for devices
1) gpios property
-----------------

Nodes that makes use of GPIOs should define them using `gpios' property,
format of which is: <&gpio-controller1-phandle gpio1-specifier
&gpio-controller2-phandle gpio2-specifier
0 /* holes are permitted, means no GPIO 3 */
&gpio-controller4-phandle gpio4-specifier
...>;
Nodes that makes use of GPIOs should specify them using one or more
properties, each containing a 'gpio-list':

Note that gpio-specifier length is controller dependent.
gpio-list ::= <single-gpio> [gpio-list]
single-gpio ::= <gpio-phandle> <gpio-specifier>
gpio-phandle : phandle to gpio controller node
gpio-specifier : Array of #gpio-cells specifying specific gpio
(controller specific)

GPIO properties should be named "[<name>-]gpios". Exact
meaning of each gpios property must be documented in the device tree
binding for each device.

For example, the following could be used to describe gpios pins to use
as chip select lines; with chip selects 0, 1 and 3 populated, and chip
select 2 left empty:

gpio1: gpio1 {
gpio-controller
#gpio-cells = <2>;
};
gpio2: gpio2 {
gpio-controller
#gpio-cells = <1>;
};
[...]
chipsel-gpios = <&gpio1 12 0>,
<&gpio1 13 0>,
<0>, /* holes are permitted, means no GPIO 2 */
<&gpio2 2>;

Note that gpio-specifier length is controller dependent. In the
above example, &gpio1 uses 2 cells to specify a gpio, while &gpio2
only uses one.

gpio-specifier may encode: bank, pin position inside the bank,
whether pin is open-drain and whether pin is logically inverted.
Exact meaning of each specifier cell is controller specific, and must
be documented in the device tree binding for the device.

Example of the node using GPIOs:

Expand All @@ -28,8 +56,8 @@ and empty GPIO flags as accepted by the "qe_pio_e" gpio-controller.
2) gpio-controller nodes
------------------------

Every GPIO controller node must have #gpio-cells property defined,
this information will be used to translate gpio-specifiers.
Every GPIO controller node must both an empty "gpio-controller"
property, and have #gpio-cells contain the size of the gpio-specifier.

Example of two SOC GPIO banks defined as gpio-controller nodes:

Expand Down
8 changes: 8 additions & 0 deletions Documentation/devicetree/bindings/gpio/gpio_nvidia.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
NVIDIA Tegra 2 GPIO controller

Required properties:
- compatible : "nvidia,tegra20-gpio"
- #gpio-cells : Should be two. The first cell is the pin number and the
second cell is used to specify optional parameters:
- bit 0 specifies polarity (0 for normal, 1 for inverted)
- gpio-controller : Marks the device node as a GPIO controller.
2 changes: 1 addition & 1 deletion arch/arm/mach-ep93xx/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Makefile for the linux kernel.
#
obj-y := core.o clock.o dma-m2p.o gpio.o
obj-y := core.o clock.o dma-m2p.o
obj-m :=
obj-n :=
obj- :=
Expand Down
27 changes: 20 additions & 7 deletions arch/arm/mach-ep93xx/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,10 @@ struct sys_timer ep93xx_timer = {
/*************************************************************************
* EP93xx IRQ handling
*************************************************************************/
extern void ep93xx_gpio_init_irq(void);

void __init ep93xx_init_irq(void)
{
vic_init(EP93XX_VIC1_BASE, 0, EP93XX_VIC1_VALID_IRQ_MASK, 0);
vic_init(EP93XX_VIC2_BASE, 32, EP93XX_VIC2_VALID_IRQ_MASK, 0);

ep93xx_gpio_init_irq();
}


Expand Down Expand Up @@ -240,6 +236,24 @@ unsigned int ep93xx_chip_revision(void)
return v;
}

/*************************************************************************
* EP93xx GPIO
*************************************************************************/
static struct resource ep93xx_gpio_resource[] = {
{
.start = EP93XX_GPIO_PHYS_BASE,
.end = EP93XX_GPIO_PHYS_BASE + 0xcc - 1,
.flags = IORESOURCE_MEM,
},
};

static struct platform_device ep93xx_gpio_device = {
.name = "gpio-ep93xx",
.id = -1,
.num_resources = ARRAY_SIZE(ep93xx_gpio_resource),
.resource = ep93xx_gpio_resource,
};

/*************************************************************************
* EP93xx peripheral handling
*************************************************************************/
Expand Down Expand Up @@ -870,14 +884,13 @@ void __init ep93xx_register_ac97(void)
platform_device_register(&ep93xx_pcm_device);
}

extern void ep93xx_gpio_init(void);

void __init ep93xx_init_devices(void)
{
/* Disallow access to MaverickCrunch initially */
ep93xx_devcfg_clear_bits(EP93XX_SYSCON_DEVCFG_CPENA);

ep93xx_gpio_init();
/* Get the GPIO working early, other devices need it */
platform_device_register(&ep93xx_gpio_device);

amba_device_register(&uart1_device, &iomem_resource);
amba_device_register(&uart2_device, &iomem_resource);
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@

#define EP93XX_SECURITY_BASE EP93XX_APB_IOMEM(0x00030000)

#define EP93XX_GPIO_PHYS_BASE EP93XX_APB_PHYS(0x00040000)
#define EP93XX_GPIO_BASE EP93XX_APB_IOMEM(0x00040000)
#define EP93XX_GPIO_REG(x) (EP93XX_GPIO_BASE + (x))
#define EP93XX_GPIO_F_INT_STATUS EP93XX_GPIO_REG(0x5c)
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-imx/mach-apf9328.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ static struct platform_device *devices[] __initdata = {

static void __init apf9328_init(void)
{
imx1_soc_init();

mxc_gpio_setup_multiple_pins(apf9328_pins,
ARRAY_SIZE(apf9328_pins),
"APF9328");
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-imx/mach-armadillo5x0.c
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,8 @@ static struct platform_device *devices[] __initdata = {
*/
static void __init armadillo5x0_init(void)
{
imx31_soc_init();

mxc_iomux_setup_multiple_pins(armadillo5x0_pins,
ARRAY_SIZE(armadillo5x0_pins), "armadillo5x0");

Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-imx/mach-bug.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ static const unsigned int bug_pins[] __initconst = {

static void __init bug_board_init(void)
{
imx31_soc_init();

mxc_iomux_setup_multiple_pins(bug_pins,
ARRAY_SIZE(bug_pins), "uart-4");
imx31_add_imx_uart4(&uart_pdata);
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-imx/mach-cpuimx27.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@ __setup("otg_mode=", eukrea_cpuimx27_otg_mode);

static void __init eukrea_cpuimx27_init(void)
{
imx27_soc_init();

mxc_gpio_setup_multiple_pins(eukrea_cpuimx27_pins,
ARRAY_SIZE(eukrea_cpuimx27_pins), "CPUIMX27");

Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-imx/mach-cpuimx35.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ __setup("otg_mode=", eukrea_cpuimx35_otg_mode);
*/
static void __init eukrea_cpuimx35_init(void)
{
imx35_soc_init();

mxc_iomux_v3_setup_multiple_pads(eukrea_cpuimx35_pads,
ARRAY_SIZE(eukrea_cpuimx35_pads));

Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-imx/mach-eukrea_cpuimx25.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ __setup("otg_mode=", eukrea_cpuimx25_otg_mode);

static void __init eukrea_cpuimx25_init(void)
{
imx25_soc_init();

if (mxc_iomux_v3_setup_multiple_pads(eukrea_cpuimx25_pads,
ARRAY_SIZE(eukrea_cpuimx25_pads)))
printk(KERN_ERR "error setting cpuimx25 pads !\n");
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-imx/mach-imx27_visstrim_m10.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ static void __init visstrim_m10_board_init(void)
{
int ret;

imx27_soc_init();

ret = mxc_gpio_setup_multiple_pins(visstrim_m10_pins,
ARRAY_SIZE(visstrim_m10_pins), "VISSTRIM_M10");
if (ret)
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-imx/mach-imx27ipcam.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ static const int mx27ipcam_pins[] __initconst = {

static void __init mx27ipcam_init(void)
{
imx27_soc_init();

mxc_gpio_setup_multiple_pins(mx27ipcam_pins, ARRAY_SIZE(mx27ipcam_pins),
"mx27ipcam");

Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-imx/mach-imx27lite.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ static const struct imxuart_platform_data uart_pdata __initconst = {

static void __init mx27lite_init(void)
{
imx27_soc_init();

mxc_gpio_setup_multiple_pins(mx27lite_pins, ARRAY_SIZE(mx27lite_pins),
"imx27lite");
imx27_add_imx_uart0(&uart_pdata);
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-imx/mach-kzm_arm11_01.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@ static int kzm_pins[] __initdata = {
*/
static void __init kzm_board_init(void)
{
imx31_soc_init();

mxc_iomux_setup_multiple_pins(kzm_pins,
ARRAY_SIZE(kzm_pins), "kzm");
kzm_init_ext_uart();
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-imx/mach-mx1ads.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ static struct i2c_board_info mx1ads_i2c_devices[] = {
*/
static void __init mx1ads_init(void)
{
imx1_soc_init();

mxc_gpio_setup_multiple_pins(mx1ads_pins,
ARRAY_SIZE(mx1ads_pins), "mx1ads");

Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-imx/mach-mx21ads.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,8 @@ static struct platform_device *platform_devices[] __initdata = {

static void __init mx21ads_board_init(void)
{
imx21_soc_init();

mxc_gpio_setup_multiple_pins(mx21ads_pins, ARRAY_SIZE(mx21ads_pins),
"mx21ads");

Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-imx/mach-mx25_3ds.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ static const struct esdhc_platform_data mx25pdk_esdhc_pdata __initconst = {

static void __init mx25pdk_init(void)
{
imx25_soc_init();

mxc_iomux_v3_setup_multiple_pads(mx25pdk_pads,
ARRAY_SIZE(mx25pdk_pads));

Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-imx/mach-mx27_3ds.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,8 @@ static const struct imxi2c_platform_data mx27_3ds_i2c0_data __initconst = {

static void __init mx27pdk_init(void)
{
imx27_soc_init();

mxc_gpio_setup_multiple_pins(mx27pdk_pins, ARRAY_SIZE(mx27pdk_pins),
"mx27pdk");
mx27_3ds_sdhc1_enable_level_translator();
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-imx/mach-mx27ads.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,8 @@ static const struct imxuart_platform_data uart_pdata __initconst = {

static void __init mx27ads_board_init(void)
{
imx27_soc_init();

mxc_gpio_setup_multiple_pins(mx27ads_pins, ARRAY_SIZE(mx27ads_pins),
"mx27ads");

Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-imx/mach-mx31_3ds.c
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,8 @@ static void __init mx31_3ds_init(void)
{
int ret;

imx31_soc_init();

mxc_iomux_setup_multiple_pins(mx31_3ds_pins, ARRAY_SIZE(mx31_3ds_pins),
"mx31_3ds");

Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-imx/mach-mx31ads.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,8 @@ static void __init mx31ads_init_irq(void)

static void __init mx31ads_init(void)
{
imx31_soc_init();

mxc_init_extuart();
mxc_init_imx_uart();
mxc_init_i2c();
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-imx/mach-mx31lilly.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,8 @@ core_param(mx31lilly_baseboard, mx31lilly_baseboard, int, 0444);

static void __init mx31lilly_board_init(void)
{
imx31_soc_init();

switch (mx31lilly_baseboard) {
case MX31LILLY_NOBOARD:
break;
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-imx/mach-mx31lite.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,8 @@ static void __init mx31lite_init(void)
{
int ret;

imx31_soc_init();

switch (mx31lite_baseboard) {
case MX31LITE_NOBOARD:
break;
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-imx/mach-mx31moboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,8 @@ core_param(mx31moboard_baseboard, mx31moboard_baseboard, int, 0444);
*/
static void __init mx31moboard_init(void)
{
imx31_soc_init();

mxc_iomux_setup_multiple_pins(moboard_pins, ARRAY_SIZE(moboard_pins),
"moboard");

Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-imx/mach-mx35_3ds.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ static const struct imxi2c_platform_data mx35_3ds_i2c0_data __initconst = {
*/
static void __init mx35_3ds_init(void)
{
imx35_soc_init();

mxc_iomux_v3_setup_multiple_pads(mx35pdk_pads, ARRAY_SIZE(mx35pdk_pads));

imx35_add_fec(NULL);
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-imx/mach-mxt_td60.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ static const struct imxuart_platform_data uart_pdata __initconst = {

static void __init mxt_td60_board_init(void)
{
imx27_soc_init();

mxc_gpio_setup_multiple_pins(mxt_td60_pins, ARRAY_SIZE(mxt_td60_pins),
"MXT_TD60");

Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-imx/mach-pca100.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,8 @@ static void __init pca100_init(void)
{
int ret;

imx27_soc_init();

/* SSI unit */
mxc_audmux_v1_configure_port(MX27_AUDMUX_HPCR1_SSI0,
MXC_AUDMUX_V1_PCR_SYN | /* 4wire mode */
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-imx/mach-pcm037.c
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,8 @@ static void __init pcm037_init(void)
{
int ret;

imx31_soc_init();

mxc_iomux_set_gpr(MUX_PGP_UH2, 1);

mxc_iomux_setup_multiple_pins(pcm037_pins, ARRAY_SIZE(pcm037_pins),
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-imx/mach-pcm038.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ static const struct mxc_usbh_platform_data usbh2_pdata __initconst = {

static void __init pcm038_init(void)
{
imx27_soc_init();

mxc_gpio_setup_multiple_pins(pcm038_pins, ARRAY_SIZE(pcm038_pins),
"PCM038");

Expand Down
Loading

0 comments on commit c7c8518

Please sign in to comment.