Skip to content

Commit

Permalink
ARM: imx: move registration of gpios to plat-mxc/gpio.c
Browse files Browse the repository at this point in the history
This finally gets rid of mach-imx/devices.c.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
  • Loading branch information
Uwe Kleine-König committed Nov 17, 2010
1 parent 3a6f52a commit e9f0baf
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 126 deletions.
2 changes: 0 additions & 2 deletions arch/arm/mach-imx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

# Object file lists.

obj-y := devices.o

obj-$(CONFIG_IMX_HAVE_DMA_V1) += dma-v1.o

obj-$(CONFIG_ARCH_MX1) += clock-imx1.o mm-imx1.o
Expand Down
124 changes: 0 additions & 124 deletions arch/arm/mach-imx/devices.c

This file was deleted.

59 changes: 59 additions & 0 deletions arch/arm/plat-mxc/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,3 +349,62 @@ int __init mxc_gpio_init(struct mxc_gpio_port *port, int cnt)

return 0;
}

#define DEFINE_IMX_GPIO_PORT_IRQ(soc, n, _irq) \
{ \
.chip.label = "gpio-" #n, \
.irq = _irq, \
.base = soc ## _IO_ADDRESS(soc ## _GPIO_BASE_ADDR + \
(n) * SZ_256), \
.virtual_irq_start = MXC_GPIO_IRQ_START + (n) * 32, \
}

#define DEFINE_IMX_GPIO_PORT(soc, n) \
DEFINE_IMX_GPIO_PORT_IRQ(soc, n, 0)

#define DEFINE_REGISTER_FUNCTION(prefix) \
int __init prefix ## _register_gpios(void) \
{ \
return mxc_gpio_init(prefix ## _gpio_ports, \
ARRAY_SIZE(prefix ## _gpio_ports)); \
}

#if defined(CONFIG_SOC_IMX1)
static struct mxc_gpio_port imx1_gpio_ports[] = {
DEFINE_IMX_GPIO_PORT_IRQ(MX1, 0, MX1_GPIO_INT_PORTA),
DEFINE_IMX_GPIO_PORT_IRQ(MX1, 1, MX1_GPIO_INT_PORTB),
DEFINE_IMX_GPIO_PORT_IRQ(MX1, 2, MX1_GPIO_INT_PORTC),
DEFINE_IMX_GPIO_PORT_IRQ(MX1, 3, MX1_GPIO_INT_PORTD),
};

DEFINE_REGISTER_FUNCTION(imx1)

#endif /* if defined(CONFIG_SOC_IMX1) */

#if defined(CONFIG_SOC_IMX21)
static struct mxc_gpio_port imx21_gpio_ports[] = {
DEFINE_IMX_GPIO_PORT_IRQ(MX21, 0, MX21_INT_GPIO),
DEFINE_IMX_GPIO_PORT(MX21, 1),
DEFINE_IMX_GPIO_PORT(MX21, 2),
DEFINE_IMX_GPIO_PORT(MX21, 3),
DEFINE_IMX_GPIO_PORT(MX21, 4),
DEFINE_IMX_GPIO_PORT(MX21, 5),
};

DEFINE_REGISTER_FUNCTION(imx21)

#endif /* if defined(CONFIG_SOC_IMX21) */

#if defined(CONFIG_SOC_IMX27)
static struct mxc_gpio_port imx27_gpio_ports[] = {
DEFINE_IMX_GPIO_PORT_IRQ(MX27, 0, MX27_INT_GPIO),
DEFINE_IMX_GPIO_PORT(MX27, 1),
DEFINE_IMX_GPIO_PORT(MX27, 2),
DEFINE_IMX_GPIO_PORT(MX27, 3),
DEFINE_IMX_GPIO_PORT(MX27, 4),
DEFINE_IMX_GPIO_PORT(MX27, 5),
};

DEFINE_REGISTER_FUNCTION(imx27)

#endif /* if defined(CONFIG_SOC_IMX27) */

0 comments on commit e9f0baf

Please sign in to comment.