diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-11-01 23:11:00 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-11-01 23:11:00 -0400 |
commit | 952414505f55afe5cd6dc004765076aa22b3ed7e (patch) | |
tree | eba11ed702ae02fea7f1a0d422346454fc98296f /drivers/gpio/gpio-mxc.c | |
parent | 68e24ba70465b82ad24e0774ceab5360180d4627 (diff) | |
parent | 3e965b176341b78620f7404fd8b7f9a0d061f8a2 (diff) |
Merge branch 'next/cleanup' of git://git.linaro.org/people/arnd/arm-soc
* 'next/cleanup' of git://git.linaro.org/people/arnd/arm-soc: (125 commits)
ARM: mach-mxs: fix machines' initializers order
mmc: mxcmmc: explicitly includes mach/hardware.h
arm/imx: explicitly includes mach/hardware.h in pm-imx27.c
arm/imx: remove mx27_setup_weimcs() from mx27.h
arm/imx: explicitly includes mach/hardware.h in mach-kzm_arm11_01.c
arm/imx: remove mx31_setup_weimcs() from mx31.h
ARM: tegra: devices.c should include devices.h
ARM: tegra: cpu-tegra: unexport two functions
ARM: tegra: cpu-tegra: sparse type fix
ARM: tegra: dma: staticify some tables and functions
ARM: tegra: tegra2_clocks: don't export some tables
ARM: tegra: tegra_powergate_is_powered should be static
ARM: tegra: tegra_rtc_read_ms should be static
ARM: tegra: tegra_init_cache should be static
ARM: tegra: pcie: 0 -> NULL changes
ARM: tegra: pcie: include board.h
ARM: tegra: pcie: don't cast __iomem pointers
ARM: tegra: tegra2_clocks: 0 -> NULL changes
ARM: tegra: tegra2_clocks: don't cast __iomem pointers
ARM: tegra: timer: don't cast __iomem pointers
...
Fix up trivial conflicts in
arch/arm/mach-omap2/Makefile,
arch/arm/mach-u300/{Makefile.boot,core.c}
arch/arm/plat-{mxc,omap}/devices.c
Diffstat (limited to 'drivers/gpio/gpio-mxc.c')
-rw-r--r-- | drivers/gpio/gpio-mxc.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c index 82f7b65baf72..b81c98992114 100644 --- a/drivers/gpio/gpio-mxc.c +++ b/drivers/gpio/gpio-mxc.c | |||
@@ -32,6 +32,8 @@ | |||
32 | #include <asm-generic/bug.h> | 32 | #include <asm-generic/bug.h> |
33 | #include <asm/mach/irq.h> | 33 | #include <asm/mach/irq.h> |
34 | 34 | ||
35 | #define irq_to_gpio(irq) ((irq) - MXC_GPIO_IRQ_START) | ||
36 | |||
35 | enum mxc_gpio_hwtype { | 37 | enum mxc_gpio_hwtype { |
36 | IMX1_GPIO, /* runs on i.mx1 */ | 38 | IMX1_GPIO, /* runs on i.mx1 */ |
37 | IMX21_GPIO, /* runs on i.mx21 and i.mx27 */ | 39 | IMX21_GPIO, /* runs on i.mx21 and i.mx27 */ |
@@ -343,6 +345,15 @@ static void __devinit mxc_gpio_get_hw(struct platform_device *pdev) | |||
343 | mxc_gpio_hwtype = hwtype; | 345 | mxc_gpio_hwtype = hwtype; |
344 | } | 346 | } |
345 | 347 | ||
348 | static int mxc_gpio_to_irq(struct gpio_chip *gc, unsigned offset) | ||
349 | { | ||
350 | struct bgpio_chip *bgc = to_bgpio_chip(gc); | ||
351 | struct mxc_gpio_port *port = | ||
352 | container_of(bgc, struct mxc_gpio_port, bgc); | ||
353 | |||
354 | return port->virtual_irq_start + offset; | ||
355 | } | ||
356 | |||
346 | static int __devinit mxc_gpio_probe(struct platform_device *pdev) | 357 | static int __devinit mxc_gpio_probe(struct platform_device *pdev) |
347 | { | 358 | { |
348 | struct device_node *np = pdev->dev.of_node; | 359 | struct device_node *np = pdev->dev.of_node; |
@@ -409,6 +420,7 @@ static int __devinit mxc_gpio_probe(struct platform_device *pdev) | |||
409 | if (err) | 420 | if (err) |
410 | goto out_iounmap; | 421 | goto out_iounmap; |
411 | 422 | ||
423 | port->bgc.gc.to_irq = mxc_gpio_to_irq; | ||
412 | port->bgc.gc.base = pdev->id * 32; | 424 | port->bgc.gc.base = pdev->id * 32; |
413 | port->bgc.dir = port->bgc.read_reg(port->bgc.reg_dir); | 425 | port->bgc.dir = port->bgc.read_reg(port->bgc.reg_dir); |
414 | port->bgc.data = port->bgc.read_reg(port->bgc.reg_set); | 426 | port->bgc.data = port->bgc.read_reg(port->bgc.reg_set); |