Skip to contentSkip to conversation

Make mach/gpio.h optional

PATCH In review Rob Herring 7 participants 26 messages Sep 6, 2012 – Sep 14, 2012

Subsystems (19)
lore
Share & tools
lore
#0 lore raw

v2 cover Make mach/gpio.h optional

From: Rob Herring <[email protected]>

This is series makes mach/gpio.h optional like we have done for other mach headers in preparation for multi-platform kernel images.

This version does not add any includes of mach/gpio.h. For orion and shmobile, the mach/gpio.h headers are renamed to platform specific names. I've dropped pxa, omap and at91 from this series until better clean-up is done. omap and at91 have clean-ups in the works. I included some of the pxa clean-ups I did, but this series is not dependent on them.

This is build tested on all ARM defconfigs.

The series plus multi-platform support is available here:

git://sources.calxeda.com/kernel/linux.git multi-plat

Rob

Rob Herring (6):
usb: pxa27x_udc: remove IRQ_USB define
net: pxaficp_ir: add irq resources
ARM: pxa: use gpio_to_irq for sharppm_sl
ARM: shmobile: move custom gpio functions to sh-gpio.h
ARM: orion: move custom gpio functions to orion-gpio.h
ARM: make mach/gpio.h headers optional

 arch/arm/Kconfig                               |   21 ++++++++
 arch/arm/include/asm/gpio.h                    |    2 +
 arch/arm/mach-dove/include/mach/gpio.h         |    9 ----
 arch/arm/mach-dove/irq.c                       |    1 +
 arch/arm/mach-dove/mpp.c                       |    1 +
 arch/arm/mach-ep93xx/include/mach/gpio.h       |    1 -
 arch/arm/mach-highbank/include/mach/gpio.h     |    1 -
 arch/arm/mach-ixp4xx/include/mach/gpio.h       |    2 -
 arch/arm/mach-kirkwood/include/mach/gpio.h     |    9 ----
 arch/arm/mach-kirkwood/irq.c                   |    1 +
 arch/arm/mach-kirkwood/rd88f6192-nas-setup.c   |    1 +
 arch/arm/mach-msm/include/mach/gpio.h          |    1 -
 arch/arm/mach-mv78xx0/irq.c                    |    1 +
 arch/arm/mach-mxs/include/mach/gpio.h          |    1 -
 arch/arm/mach-nomadik/include/mach/gpio.h      |    4 --
 arch/arm/mach-orion5x/d2net-setup.c            |    1 +
 arch/arm/mach-orion5x/dns323-setup.c           |    1 +
 arch/arm/mach-orion5x/include/mach/gpio.h      |    9 ----
 arch/arm/mach-orion5x/irq.c                    |    1 +
 arch/arm/mach-orion5x/net2big-setup.c          |    1 +
 arch/arm/mach-picoxcell/include/mach/gpio.h    |    1 -
 arch/arm/mach-pxa/devices.c                    |   15 ++++++
 arch/arm/mach-pxa/sharpsl_pm.c                 |   30 +++++++-----
 arch/arm/mach-realview/include/mach/gpio.h     |    1 -
 arch/arm/mach-shmobile/board-ap4evb.c          |    2 +
 arch/arm/mach-shmobile/board-armadillo800eva.c |    2 +
 arch/arm/mach-shmobile/board-g4evm.c           |    2 +
 arch/arm/mach-shmobile/board-mackerel.c        |    2 +
 arch/arm/mach-shmobile/include/mach/gpio.h     |   62 ------------------------
 arch/arm/mach-shmobile/pfc-r8a7740.c           |    2 +-
 arch/arm/mach-shmobile/pfc-r8a7779.c           |    2 +-
 arch/arm/mach-shmobile/pfc-sh7367.c            |    2 +-
 arch/arm/mach-shmobile/pfc-sh7372.c            |    2 +-
 arch/arm/mach-shmobile/pfc-sh7377.c            |    2 +-
 arch/arm/mach-shmobile/pfc-sh73a0.c            |    2 +-
 arch/arm/mach-shmobile/sh-gpio.h               |   48 ++++++++++++++++++
 arch/arm/mach-spear13xx/include/mach/gpio.h    |   19 --------
 arch/arm/mach-spear3xx/include/mach/gpio.h     |   19 --------
 arch/arm/mach-spear6xx/include/mach/gpio.h     |   19 --------
 arch/arm/mach-tegra/include/mach/gpio.h        |    1 -
 arch/arm/mach-u300/include/mach/gpio.h         |    1 -
 arch/arm/mach-ux500/include/mach/gpio.h        |    5 --
 arch/arm/mach-versatile/include/mach/gpio.h    |    1 -
 arch/arm/mach-vexpress/include/mach/gpio.h     |    1 -
 arch/arm/mach-vt8500/include/mach/gpio.h       |    1 -
 arch/arm/plat-mxc/include/mach/gpio.h          |    1 -
 arch/arm/plat-orion/include/plat/gpio.h        |   37 --------------
 arch/arm/plat-orion/include/plat/orion-gpio.h  |   37 ++++++++++++++
 arch/arm/plat-orion/mpp.c                      |    1 +
 arch/arm/plat-spear/include/plat/gpio.h        |    1 -
 drivers/net/irda/pxaficp_ir.c                  |   28 ++++++-----
 drivers/sh/pfc/gpio.c                          |    1 +
 drivers/usb/gadget/pxa27x_udc.c                |    2 +-
 53 files changed, 183 insertions(+), 238 deletions(-)
 delete mode 100644 arch/arm/mach-dove/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-ep93xx/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-highbank/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-ixp4xx/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-kirkwood/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-msm/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-mxs/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-nomadik/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-orion5x/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-picoxcell/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-realview/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-shmobile/include/mach/gpio.h
 create mode 100644 arch/arm/mach-shmobile/sh-gpio.h
 delete mode 100644 arch/arm/mach-spear13xx/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-spear3xx/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-spear6xx/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-tegra/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-u300/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-ux500/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-versatile/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-vexpress/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-vt8500/include/mach/gpio.h
 delete mode 100644 arch/arm/plat-mxc/include/mach/gpio.h
 delete mode 100644 arch/arm/plat-orion/include/plat/gpio.h
 create mode 100644 arch/arm/plat-orion/include/plat/orion-gpio.h
 delete mode 100644 arch/arm/plat-spear/include/plat/gpio.h
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v2 1/6 usb: pxa27x_udc: remove IRQ_USB define

From: Rob Herring <[email protected]>

IRQ_USB was implicitly included by gpio.h. Use the existing variable instead of IRQ_USB.

Cc Eric Miao <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
---
 drivers/usb/gadget/pxa27x_udc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/gadget/pxa27x_udc.c +1 -1
index 644b430..7a8713c 100644
@@ -2508,7 +2508,7 @@ static int __init pxa_udc_probe(struct platform_device *pdev)
 			IRQF_SHARED, driver_name, udc);
 	if (retval != 0) {
 		dev_err(udc->dev, "%s: can't get irq %i, err %d\n",
-			driver_name, IRQ_USB, retval);
+			driver_name, udc->irq, retval);
 		goto err_irq;
 	}
 	retval = usb_add_gadget_udc(&pdev->dev, &udc->gadget);
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH v2 1/6 usb: pxa27x_udc: remove IRQ_USB define

Quoted 8 lines · Rob Herring

From: Rob Herring <[email protected]>

IRQ_USB was implicitly included by gpio.h. Use the existing variable instead of IRQ_USB.

Cc Eric Miao <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>

Greg, guess this can go through the ARM tree.

Quoted 20 lines
---
 drivers/usb/gadget/pxa27x_udc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/gadget/pxa27x_udc.c +1 -2
index 644b430..7a8713c 100644
@@ -2508,7 +2508,7 @@ static int __init pxa_udc_probe(struct platform_device *pdev)
                        IRQF_SHARED, driver_name, udc);
        if (retval != 0) {
                dev_err(udc->dev, "%s: can't get irq %i, err %d\n",
-                       driver_name, IRQ_USB, retval);
+                       driver_name, udc->irq, retval);
                goto err_irq;
        }
        retval = usb_add_gadget_udc(&pdev->dev, &udc->gadget);
--

1.7.9.5

#3 lore raw

PATCH v2 1/6 usb: pxa27x_udc: remove IRQ_USB define

Quoted 6 lines · Eric Miao
Quoted 5 lines · Rob Herring

From: Rob Herring <[email protected]>

IRQ_USB was implicitly included by gpio.h. Use the existing variable instead of IRQ_USB.

Quoted 7 lines
Quoted 3 lines
Cc Eric Miao <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>

Greg, guess this can go through the ARM tree.

That's fine, but note, I'm not the drivers/usb/gadget maintainer, Felipe needs to know about this as well.

Rob, the tool, scripts/get_maintainer.pl is your friend, please use it :)

greg k-h

#4 lore raw

PATCH v2 2/6 net: pxaficp_ir: add irq resources

In reply to Rob Herring

From: Rob Herring <[email protected]>

In order to remove dependency on mach/irqs.h, add platform device resources for irqs.

Cc Samuel Ortiz <[email protected]>
Cc Eric Miao <[email protected]>
Cc Haojian Zhuang <[email protected]>
Cc netdev at vger.kernel.org
---
 arch/arm/mach-pxa/devices.c   |   15 +++++++++++++++
 drivers/net/irda/pxaficp_ir.c |   28 +++++++++++++++++-----------
 2 files changed, 32 insertions(+), 11 deletions(-)
arch/arm/mach-pxa/devices.c +15 -0
index 166eee5..339eb2a 100644
@@ -384,9 +384,24 @@ struct platform_device pxa_device_asoc_platform = {
 
 static u64 pxaficp_dmamask = ~(u32)0;
 
+static struct resource pxa_ir_resources[] = {
+	[0] = {
+		.start  = IRQ_STUART,
+		.end    = IRQ_STUART,
+		.flags  = IORESOURCE_IRQ,
+	},
+	[1] = {
+		.start  = IRQ_ICP,
+		.end    = IRQ_ICP,
+		.flags  = IORESOURCE_IRQ,
+	},
+};
+
 struct platform_device pxa_device_ficp = {
 	.name		= "pxa2xx-ir",
 	.id		= -1,
+	.num_resources	= ARRAY_SIZE(pxa_ir_resources),
+	.resource	= pxa_ir_resources,
 	.dev		= {
 		.dma_mask = &pxaficp_dmamask,
 		.coherent_dma_mask = 0xffffffff,
drivers/net/irda/pxaficp_ir.c +17 -11
index 8d54767..cb0a5d3 100644
@@ -29,8 +29,8 @@
 
 #include <mach/dma.h>
 #include <mach/irda.h>
-#include <mach/regs-uart.h>
 #include <mach/regs-ost.h>
+#include <mach/regs-uart.h>
 
 #define FICP		__REG(0x40800000)  /* Start of FICP area */
 #define ICCR0		__REG(0x40800000)  /* ICP Control Register 0 */
@@ -112,6 +112,9 @@ struct pxa_irda {
 	int			txdma;
 	int			rxdma;
 
+	int			uart_irq;
+	int			icp_irq;
+
 	struct irlap_cb		*irlap;
 	struct qos_info		qos;
 
@@ -672,19 +675,19 @@ static int pxa_irda_start(struct net_device *dev)
 
 	si->speed = 9600;
 
-	err = request_irq(IRQ_STUART, pxa_irda_sir_irq, 0, dev->name, dev);
+	err = request_irq(si->uart_irq, pxa_irda_sir_irq, 0, dev->name, dev);
 	if (err)
 		goto err_irq1;
 
-	err = request_irq(IRQ_ICP, pxa_irda_fir_irq, 0, dev->name, dev);
+	err = request_irq(si->icp_irq, pxa_irda_fir_irq, 0, dev->name, dev);
 	if (err)
 		goto err_irq2;
 
 	/*
 	 * The interrupt must remain disabled for now.
 	 */
-	disable_irq(IRQ_STUART);
-	disable_irq(IRQ_ICP);
+	disable_irq(si->uart_irq);
+	disable_irq(si->icp_irq);
 
 	err = -EBUSY;
 	si->rxdma = pxa_request_dma("FICP_RX",DMA_PRIO_LOW, pxa_irda_fir_dma_rx_irq, dev);
@@ -720,8 +723,8 @@ static int pxa_irda_start(struct net_device *dev)
 	/*
 	 * Now enable the interrupt and start the queue
 	 */
-	enable_irq(IRQ_STUART);
-	enable_irq(IRQ_ICP);
+	enable_irq(si->uart_irq);
+	enable_irq(si->icp_irq);
 	netif_start_queue(dev);
 
 	printk(KERN_DEBUG "pxa_ir: irda driver opened\n");
@@ -738,9 +741,9 @@ err_dma_rx_buff:
 err_tx_dma:
 	pxa_free_dma(si->rxdma);
 err_rx_dma:
-	free_irq(IRQ_ICP, dev);
+	free_irq(si->icp_irq, dev);
 err_irq2:
-	free_irq(IRQ_STUART, dev);
+	free_irq(si->uart_irq, dev);
 err_irq1:
 
 	return err;
@@ -760,8 +763,8 @@ static int pxa_irda_stop(struct net_device *dev)
 		si->irlap = NULL;
 	}
 
-	free_irq(IRQ_STUART, dev);
-	free_irq(IRQ_ICP, dev);
+	free_irq(si->uart_irq, dev);
+	free_irq(si->icp_irq, dev);
 
 	pxa_free_dma(si->rxdma);
 	pxa_free_dma(si->txdma);
@@ -851,6 +854,9 @@ static int pxa_irda_probe(struct platform_device *pdev)
 	si->dev = &pdev->dev;
 	si->pdata = pdev->dev.platform_data;
 
+	si->uart_irq = platform_get_irq(pdev, 0);
+	si->icp_irq = platform_get_irq(pdev, 1);
+
 	si->sir_clk = clk_get(&pdev->dev, "UARTCLK");
 	si->fir_clk = clk_get(&pdev->dev, "FICPCLK");
 	if (IS_ERR(si->sir_clk) || IS_ERR(si->fir_clk)) {
Signature · 1 line
1.7.9.5
Acked-by on v2 2/6
#6 lore raw

Re: [PATCH v2 2/6] net: pxaficp_ir: add irq resources

In reply to Rob Herring
Quoted 5 lines · Rob Herring

From: Rob Herring <[email protected]>

In order to remove dependency on mach/irqs.h, add platform device resources for irqs.

Looks good to me, we shall have this change landed long before this, thanks Rob

Quoted 134 lines
Cc Samuel Ortiz <[email protected]>
Cc Eric Miao <[email protected]>
Cc Haojian Zhuang <[email protected]>
Cc netdev at vger.kernel.org
---
 arch/arm/mach-pxa/devices.c   |   15 +++++++++++++++
 drivers/net/irda/pxaficp_ir.c |   28 +++++++++++++++++-----------
 2 files changed, 32 insertions(+), 11 deletions(-)
arch/arm/mach-pxa/devices.c +15 -0
index 166eee5..339eb2a 100644
@@ -384,9 +384,24 @@ struct platform_device pxa_device_asoc_platform = {
 
 static u64 pxaficp_dmamask = ~(u32)0;
 
+static struct resource pxa_ir_resources[] = {
+       [0] = {
+               .start  = IRQ_STUART,
+               .end    = IRQ_STUART,
+               .flags  = IORESOURCE_IRQ,
+       },
+       [1] = {
+               .start  = IRQ_ICP,
+               .end    = IRQ_ICP,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
 struct platform_device pxa_device_ficp = {
        .name           = "pxa2xx-ir",
        .id             = -1,
+       .num_resources  = ARRAY_SIZE(pxa_ir_resources),
+       .resource       = pxa_ir_resources,
        .dev            = {
                .dma_mask = &pxaficp_dmamask,
                .coherent_dma_mask = 0xffffffff,
drivers/net/irda/pxaficp_ir.c +17 -12
index 8d54767..cb0a5d3 100644
@@ -29,8 +29,8 @@
 
 #include <mach/dma.h>
 #include <mach/irda.h>
-#include <mach/regs-uart.h>
 #include <mach/regs-ost.h>
+#include <mach/regs-uart.h>
 
 #define FICP           __REG(0x40800000)  /* Start of FICP area */
 #define ICCR0          __REG(0x40800000)  /* ICP Control Register 0 */
@@ -112,6 +112,9 @@ struct pxa_irda {
        int                     txdma;
        int                     rxdma;
 
+       int                     uart_irq;
+       int                     icp_irq;
+
        struct irlap_cb         *irlap;
        struct qos_info         qos;
 
@@ -672,19 +675,19 @@ static int pxa_irda_start(struct net_device *dev)
 
        si->speed = 9600;
 
-       err = request_irq(IRQ_STUART, pxa_irda_sir_irq, 0, dev->name, dev);
+       err = request_irq(si->uart_irq, pxa_irda_sir_irq, 0, dev->name, dev);
        if (err)
                goto err_irq1;
 
-       err = request_irq(IRQ_ICP, pxa_irda_fir_irq, 0, dev->name, dev);
+       err = request_irq(si->icp_irq, pxa_irda_fir_irq, 0, dev->name, dev);
        if (err)
                goto err_irq2;
 
        /*
         * The interrupt must remain disabled for now.
         */
-       disable_irq(IRQ_STUART);
-       disable_irq(IRQ_ICP);
+       disable_irq(si->uart_irq);
+       disable_irq(si->icp_irq);
 
        err = -EBUSY;
        si->rxdma = pxa_request_dma("FICP_RX",DMA_PRIO_LOW, pxa_irda_fir_dma_rx_irq, dev);
@@ -720,8 +723,8 @@ static int pxa_irda_start(struct net_device *dev)
        /*
         * Now enable the interrupt and start the queue
         */
-       enable_irq(IRQ_STUART);
-       enable_irq(IRQ_ICP);
+       enable_irq(si->uart_irq);
+       enable_irq(si->icp_irq);
        netif_start_queue(dev);
 
        printk(KERN_DEBUG "pxa_ir: irda driver opened\n");
@@ -738,9 +741,9 @@ err_dma_rx_buff:
 err_tx_dma:
        pxa_free_dma(si->rxdma);
 err_rx_dma:
-       free_irq(IRQ_ICP, dev);
+       free_irq(si->icp_irq, dev);
 err_irq2:
-       free_irq(IRQ_STUART, dev);
+       free_irq(si->uart_irq, dev);
 err_irq1:
 
        return err;
@@ -760,8 +763,8 @@ static int pxa_irda_stop(struct net_device *dev)
                si->irlap = NULL;
        }
 
-       free_irq(IRQ_STUART, dev);
-       free_irq(IRQ_ICP, dev);
+       free_irq(si->uart_irq, dev);
+       free_irq(si->icp_irq, dev);
 
        pxa_free_dma(si->rxdma);
        pxa_free_dma(si->txdma);
@@ -851,6 +854,9 @@ static int pxa_irda_probe(struct platform_device *pdev)
        si->dev = &pdev->dev;
        si->pdata = pdev->dev.platform_data;
 
+       si->uart_irq = platform_get_irq(pdev, 0);
+       si->icp_irq = platform_get_irq(pdev, 1);
+
        si->sir_clk = clk_get(&pdev->dev, "UARTCLK");
        si->fir_clk = clk_get(&pdev->dev, "FICPCLK");
        if (IS_ERR(si->sir_clk) || IS_ERR(si->fir_clk)) {
--

1.7.9.5

#7 lore raw

PATCH v2 3/6 ARM: pxa: use gpio_to_irq for sharppm_sl

In reply to Rob Herring

From: Rob Herring <[email protected]>

Replace custom PXA_GPIO_TO_IRQ macro with standard gpio_to_irq.

Cc Eric Miao <[email protected]>
Cc Haojian Zhuang <[email protected]>
---
 arch/arm/mach-pxa/sharpsl_pm.c |   30 +++++++++++++++++-------------
 1 file changed, 17 insertions(+), 13 deletions(-)
arch/arm/mach-pxa/sharpsl_pm.c +17 -13
index bdf4cb8..9a154ba 100644
@@ -879,7 +879,7 @@ static const struct platform_suspend_ops sharpsl_pm_ops = {
 
 static int __devinit sharpsl_pm_probe(struct platform_device *pdev)
 {
-	int ret;
+	int ret, irq;
 
 	if (!pdev->dev.platform_data)
 		return -EINVAL;
@@ -907,24 +907,28 @@ static int __devinit sharpsl_pm_probe(struct platform_device *pdev)
 	gpio_direction_input(sharpsl_pm.machinfo->gpio_batlock);
 
 	/* Register interrupt handlers */
-	if (request_irq(PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_acin), sharpsl_ac_isr, IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, "AC Input Detect", sharpsl_ac_isr)) {
-		dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_acin));
+	irq = gpio_to_irq(sharpsl_pm.machinfo->gpio_acin);
+	if (request_irq(irq, sharpsl_ac_isr, IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, "AC Input Detect", sharpsl_ac_isr)) {
+		dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", irq);
 	}
 
-	if (request_irq(PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_batlock), sharpsl_fatal_isr, IRQF_DISABLED | IRQF_TRIGGER_FALLING, "Battery Cover", sharpsl_fatal_isr)) {
-		dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_batlock));
+	irq = gpio_to_irq(sharpsl_pm.machinfo->gpio_batlock);
+	if (request_irq(irq, sharpsl_fatal_isr, IRQF_DISABLED | IRQF_TRIGGER_FALLING, "Battery Cover", sharpsl_fatal_isr)) {
+		dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", irq);
 	}
 
 	if (sharpsl_pm.machinfo->gpio_fatal) {
-		if (request_irq(PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_fatal), sharpsl_fatal_isr, IRQF_DISABLED | IRQF_TRIGGER_FALLING, "Fatal Battery", sharpsl_fatal_isr)) {
-			dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_fatal));
+		irq = gpio_to_irq(sharpsl_pm.machinfo->gpio_fatal);
+		if (request_irq(irq, sharpsl_fatal_isr, IRQF_DISABLED | IRQF_TRIGGER_FALLING, "Fatal Battery", sharpsl_fatal_isr)) {
+			dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", irq);
 		}
 	}
 
 	if (sharpsl_pm.machinfo->batfull_irq) {
 		/* Register interrupt handler. */
-		if (request_irq(PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_batfull), sharpsl_chrg_full_isr, IRQF_DISABLED | IRQF_TRIGGER_RISING, "CO", sharpsl_chrg_full_isr)) {
-			dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_batfull));
+		irq = gpio_to_irq(sharpsl_pm.machinfo->gpio_batfull);
+		if (request_irq(irq, sharpsl_chrg_full_isr, IRQF_DISABLED | IRQF_TRIGGER_RISING, "CO", sharpsl_chrg_full_isr)) {
+			dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", irq);
 		}
 	}
 
@@ -953,14 +957,14 @@ static int sharpsl_pm_remove(struct platform_device *pdev)
 
 	led_trigger_unregister_simple(sharpsl_charge_led_trigger);
 
-	free_irq(PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_acin), sharpsl_ac_isr);
-	free_irq(PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_batlock), sharpsl_fatal_isr);
+	free_irq(gpio_to_irq(sharpsl_pm.machinfo->gpio_acin), sharpsl_ac_isr);
+	free_irq(gpio_to_irq(sharpsl_pm.machinfo->gpio_batlock), sharpsl_fatal_isr);
 
 	if (sharpsl_pm.machinfo->gpio_fatal)
-		free_irq(PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_fatal), sharpsl_fatal_isr);
+		free_irq(gpio_to_irq(sharpsl_pm.machinfo->gpio_fatal), sharpsl_fatal_isr);
 
 	if (sharpsl_pm.machinfo->batfull_irq)
-		free_irq(PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_batfull), sharpsl_chrg_full_isr);
+		free_irq(gpio_to_irq(sharpsl_pm.machinfo->gpio_batfull), sharpsl_chrg_full_isr);
 
 	gpio_free(sharpsl_pm.machinfo->gpio_batlock);
 	gpio_free(sharpsl_pm.machinfo->gpio_batfull);
Signature · 1 line
1.7.9.5
#8 lore raw

PATCH v2 4/6 ARM: shmobile: move custom gpio functions to sh-gpio.h

In reply to Rob Herring

From: Rob Herring <[email protected]>

Move custom shmobile gpio code to a sh-gpio.h to remove the dependency on mach/gpio.h. shmobile always uses gpiolib, so we can remove __GPIOLIB_COMPLEX define from mach/gpio.h.

Cc Paul Mundt <[email protected]>
Cc Magnus Damm <[email protected]>
---
 arch/arm/mach-shmobile/board-ap4evb.c          |    2 +
 arch/arm/mach-shmobile/board-armadillo800eva.c |    2 +
 arch/arm/mach-shmobile/board-g4evm.c           |    2 +
 arch/arm/mach-shmobile/board-mackerel.c        |    2 +
 arch/arm/mach-shmobile/include/mach/gpio.h     |   63 +-----------------------
 arch/arm/mach-shmobile/pfc-r8a7740.c           |    2 +-
 arch/arm/mach-shmobile/pfc-r8a7779.c           |    2 +-
 arch/arm/mach-shmobile/pfc-sh7367.c            |    2 +-
 arch/arm/mach-shmobile/pfc-sh7372.c            |    2 +-
 arch/arm/mach-shmobile/pfc-sh7377.c            |    2 +-
 arch/arm/mach-shmobile/pfc-sh73a0.c            |    2 +-
 arch/arm/mach-shmobile/sh-gpio.h               |   48 ++++++++++++++++++
 drivers/sh/pfc/gpio.c                          |    1 +
 13 files changed, 64 insertions(+), 68 deletions(-)
 create mode 100644 arch/arm/mach-shmobile/sh-gpio.h
arch/arm/mach-shmobile/board-ap4evb.c +2 -0
index f172ca8..c7f164e 100644
@@ -66,6 +66,8 @@
 #include <asm/mach/arch.h>
 #include <asm/setup.h>
 
+#include "sh-gpio.h"
+
 /*
  * Address	Interface		BusWidth	note
  * ------------------------------------------------------------------
arch/arm/mach-shmobile/board-armadillo800eva.c +2 -0
index cf10f92..15ffb4c 100644
@@ -54,6 +54,8 @@
 #include <sound/sh_fsi.h>
 #include <sound/simple_card.h>
 
+#include "sh-gpio.h"
+
 /*
  * CON1		Camera Module
  * CON2		Extension Bus
arch/arm/mach-shmobile/board-g4evm.c +2 -0
index fa5dfc5..eeee12e 100644
@@ -42,6 +42,8 @@
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 
+#include "sh-gpio.h"
+
 /*
  * SDHI
  *
arch/arm/mach-shmobile/board-mackerel.c +2 -0
index 7ea2b31..7654404 100644
@@ -64,6 +64,8 @@
 #include <asm/mach/arch.h>
 #include <asm/mach-types.h>
 
+#include "sh-gpio.h"
+
 /*
  * Address	Interface		BusWidth	note
  * ------------------------------------------------------------------
arch/arm/mach-shmobile/include/mach/gpio.h +1 -62

63 lines not on this page · raw message

arch/arm/mach-shmobile/pfc-r8a7740.c +1 -1
index ce9e7fa..134d1b9 100644
@@ -20,7 +20,7 @@
  */
 #include <linux/init.h>
 #include <linux/kernel.h>
-#include <linux/gpio.h>
+#include <linux/sh_pfc.h>
 #include <mach/r8a7740.h>
 #include <mach/irqs.h>
 
arch/arm/mach-shmobile/pfc-r8a7779.c +1 -1
index d14c9b0..cbc26ba 100644
@@ -19,7 +19,7 @@
  */
 #include <linux/init.h>
 #include <linux/kernel.h>
-#include <linux/gpio.h>
+#include <linux/sh_pfc.h>
 #include <linux/ioport.h>
 #include <mach/r8a7779.h>
 
arch/arm/mach-shmobile/pfc-sh7367.c +1 -1
index e6e5246..c0c137f 100644
@@ -18,7 +18,7 @@
  */
 #include <linux/init.h>
 #include <linux/kernel.h>
-#include <linux/gpio.h>
+#include <linux/sh_pfc.h>
 #include <mach/sh7367.h>
 
 #define CPU_ALL_PORT(fn, pfx, sfx)				\
arch/arm/mach-shmobile/pfc-sh7372.c +1 -1
index 336093f9..7a1525f 100644
@@ -22,7 +22,7 @@
  */
 #include <linux/init.h>
 #include <linux/kernel.h>
-#include <linux/gpio.h>
+#include <linux/sh_pfc.h>
 #include <mach/irqs.h>
 #include <mach/sh7372.h>
 
arch/arm/mach-shmobile/pfc-sh7377.c +1 -1
index 2f10511..f3117f6 100644
@@ -19,7 +19,7 @@
  */
 #include <linux/init.h>
 #include <linux/kernel.h>
-#include <linux/gpio.h>
+#include <linux/sh_pfc.h>
 #include <mach/sh7377.h>
 
 #define CPU_ALL_PORT(fn, pfx, sfx)				\
arch/arm/mach-shmobile/pfc-sh73a0.c +1 -1
index 4a547b8..b442f9d 100644
@@ -20,7 +20,7 @@
  */
 #include <linux/init.h>
 #include <linux/kernel.h>
-#include <linux/gpio.h>
+#include <linux/sh_pfc.h>
 #include <mach/sh73a0.h>
 #include <mach/irqs.h>
 
arch/arm/mach-shmobile/sh-gpio.h new file +48 -0

48 lines not on this page · raw message

drivers/sh/pfc/gpio.c +1 -0
index 62bca98..038fa07 100644
@@ -17,6 +17,7 @@
 #include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/pinctrl/consumer.h>
+#include <linux/sh_pfc.h>
 
 struct sh_pfc_chip {
 	struct sh_pfc		*pfc;
Signature · 1 line
1.7.9.5
#9 lore raw

PATCH v2 5/6 ARM: orion: move custom gpio functions to orion-gpio.h

In reply to Rob Herring

From: Rob Herring <[email protected]>

Move custom orion platforms gpio code to orion-gpio to remove the dependency on mach/gpio.h.

Cc Jason Cooper <[email protected]>
Cc Andrew Lunn <[email protected]>
---
 arch/arm/mach-dove/include/mach/gpio.h        |   10 +------
 arch/arm/mach-dove/irq.c                      |    1 +
 arch/arm/mach-dove/mpp.c                      |    1 +
 arch/arm/mach-kirkwood/include/mach/gpio.h    |   10 +------
 arch/arm/mach-kirkwood/irq.c                  |    1 +
 arch/arm/mach-kirkwood/rd88f6192-nas-setup.c  |    1 +
 arch/arm/mach-mv78xx0/irq.c                   |    1 +
 arch/arm/mach-orion5x/d2net-setup.c           |    1 +
 arch/arm/mach-orion5x/dns323-setup.c          |    1 +
 arch/arm/mach-orion5x/include/mach/gpio.h     |   10 +------
 arch/arm/mach-orion5x/irq.c                   |    1 +
 arch/arm/mach-orion5x/net2big-setup.c         |    1 +
 arch/arm/plat-orion/include/plat/gpio.h       |   37 -------------------------
 arch/arm/plat-orion/include/plat/orion-gpio.h |   37 +++++++++++++++++++++++++
 arch/arm/plat-orion/mpp.c                     |    1 +
 15 files changed, 50 insertions(+), 64 deletions(-)
 delete mode 100644 arch/arm/plat-orion/include/plat/gpio.h
 create mode 100644 arch/arm/plat-orion/include/plat/orion-gpio.h
arch/arm/mach-dove/include/mach/gpio.h +1 -9
index e7e5101..40a8c17 100644
@@ -1,9 +1 @@
-/*
- * arch/arm/mach-dove/include/mach/gpio.h
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#include <plat/gpio.h>
+/* empty */
arch/arm/mach-dove/irq.c +1 -0
index 9bc97a5..186357f 100644
@@ -18,6 +18,7 @@
 #include <asm/mach/irq.h>
 #include <mach/pm.h>
 #include <mach/bridge-regs.h>
+#include <plat/orion-gpio.h>
 #include "common.h"
 
 static void pmu_irq_mask(struct irq_data *d)
arch/arm/mach-dove/mpp.c +1 -0
index 7f70afc..60bd729 100644
@@ -13,6 +13,7 @@
 #include <linux/io.h>
 #include <plat/mpp.h>
 #include <mach/dove.h>
+#include <plat/orion-gpio.h>
 #include "mpp.h"
 
 struct dove_mpp_grp {
arch/arm/mach-kirkwood/include/mach/gpio.h +1 -9
index 84f340b..40a8c17 100644
@@ -1,9 +1 @@
-/*
- * arch/asm-arm/mach-kirkwood/include/mach/gpio.h
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#include <plat/gpio.h>
+/* empty */
arch/arm/mach-kirkwood/irq.c +1 -0
index 720063f..20149a7 100644
@@ -11,6 +11,7 @@
 #include <linux/kernel.h>
 #include <linux/irq.h>
 #include <mach/bridge-regs.h>
+#include <plat/orion-gpio.h>
 #include <plat/irq.h>
 
 static int __initdata gpio0_irqs[4] = {
arch/arm/mach-kirkwood/rd88f6192-nas-setup.c +1 -0
index f742a66..19072c8 100644
@@ -19,6 +19,7 @@
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <mach/kirkwood.h>
+#include <plat/orion-gpio.h>
 #include "common.h"
 
 #define RD88F6192_GPIO_USB_VBUS		10
arch/arm/mach-mv78xx0/irq.c +1 -0
index eff9a75..4d720f2 100644
@@ -11,6 +11,7 @@
 #include <linux/kernel.h>
 #include <linux/irq.h>
 #include <mach/bridge-regs.h>
+#include <plat/orion-gpio.h>
 #include <plat/irq.h>
 #include "common.h"
 
arch/arm/mach-orion5x/d2net-setup.c +1 -0
index d75dcfa..e3629c0 100644
@@ -27,6 +27,7 @@
 #include <asm/mach/arch.h>
 #include <asm/mach/pci.h>
 #include <mach/orion5x.h>
+#include <plat/orion-gpio.h>
 #include "common.h"
 #include "mpp.h"
 
arch/arm/mach-orion5x/dns323-setup.c +1 -0
index d470864..0e19db6 100644
@@ -34,6 +34,7 @@
 #include <asm/mach/pci.h>
 #include <asm/system_info.h>
 #include <mach/orion5x.h>
+#include <plat/orion-gpio.h>
 #include "common.h"
 #include "mpp.h"
 
arch/arm/mach-orion5x/include/mach/gpio.h +1 -9
index a1d0b78..40a8c17 100644
@@ -1,9 +1 @@
-/*
- * arch/arm/mach-orion5x/include/mach/gpio.h
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#include <plat/gpio.h>
+/* empty */
arch/arm/mach-orion5x/irq.c +1 -0
index 17da709..e152641 100644
@@ -13,6 +13,7 @@
 #include <linux/kernel.h>
 #include <linux/irq.h>
 #include <mach/bridge-regs.h>
+#include <plat/orion-gpio.h>
 #include <plat/irq.h>
 
 static int __initdata gpio0_irqs[4] = {
arch/arm/mach-orion5x/net2big-setup.c +1 -0
index 0180c39..3506f16 100644
@@ -25,6 +25,7 @@
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <mach/orion5x.h>
+#include <plat/orion-gpio.h>
 #include "common.h"
 #include "mpp.h"
 
arch/arm/plat-orion/include/plat/gpio.h deleted +0 -37
deleted file mode 100644
index 81c6fc8..0000000
@@ -1,37 +0,0 @@
-/*
- * arch/arm/plat-orion/include/plat/gpio.h
- *
- * Marvell Orion SoC GPIO handling.
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#ifndef __PLAT_GPIO_H
-#define __PLAT_GPIO_H
-
-#include <linux/init.h>
-#include <linux/types.h>
-#include <linux/irqdomain.h>
-/*
- * Orion-specific GPIO API extensions.
- */
-void orion_gpio_set_unused(unsigned pin);
-void orion_gpio_set_blink(unsigned pin, int blink);
-int orion_gpio_led_blink_set(unsigned gpio, int state,
-	unsigned long *delay_on, unsigned long *delay_off);
-
-#define GPIO_INPUT_OK		(1 << 0)
-#define GPIO_OUTPUT_OK		(1 << 1)
-void orion_gpio_set_valid(unsigned pin, int mode);
-
-/* Initialize gpiolib. */
-void __init orion_gpio_init(struct device_node *np,
-			    int gpio_base, int ngpio,
-			    void __iomem *base, int mask_offset,
-			    int secondary_irq_base,
-			    int irq[4]);
-
-void __init orion_gpio_of_init(int irq_gpio_base);
-#endif
arch/arm/plat-orion/include/plat/orion-gpio.h new file +37 -0
new file mode 100644
index 0000000..81c6fc8
@@ -0,0 +1,37 @@
+/*
+ * arch/arm/plat-orion/include/plat/gpio.h
+ *
+ * Marvell Orion SoC GPIO handling.
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#ifndef __PLAT_GPIO_H
+#define __PLAT_GPIO_H
+
+#include <linux/init.h>
+#include <linux/types.h>
+#include <linux/irqdomain.h>
+/*
+ * Orion-specific GPIO API extensions.
+ */
+void orion_gpio_set_unused(unsigned pin);
+void orion_gpio_set_blink(unsigned pin, int blink);
+int orion_gpio_led_blink_set(unsigned gpio, int state,
+	unsigned long *delay_on, unsigned long *delay_off);
+
+#define GPIO_INPUT_OK		(1 << 0)
+#define GPIO_OUTPUT_OK		(1 << 1)
+void orion_gpio_set_valid(unsigned pin, int mode);
+
+/* Initialize gpiolib. */
+void __init orion_gpio_init(struct device_node *np,
+			    int gpio_base, int ngpio,
+			    void __iomem *base, int mask_offset,
+			    int secondary_irq_base,
+			    int irq[4]);
+
+void __init orion_gpio_of_init(int irq_gpio_base);
+#endif
arch/arm/plat-orion/mpp.c +1 -0
index 3b1e17b..c140c2f 100644
@@ -14,6 +14,7 @@
 #include <linux/io.h>
 #include <linux/gpio.h>
 #include <mach/hardware.h>
+#include <plat/gpio.h>
 #include <plat/mpp.h>
 
 /* Address of the ith MPP control register */
Signature · 1 line
1.7.9.5
#10 lore raw

PATCH v2 5/6 ARM: orion: move custom gpio functions to orion-gpio.h

Quoted 9 lines · Rob Herring

From: Rob Herring <[email protected]>

Move custom orion platforms gpio code to orion-gpio to remove the dependency on mach/gpio.h.

Cc Jason Cooper <[email protected]>
Cc Andrew Lunn <[email protected]>

---

...

Quoted 2 lines
 arch/arm/plat-orion/include/plat/gpio.h       |   37 -------------------------
 arch/arm/plat-orion/include/plat/orion-gpio.h |   37 +++++++++++++++++++++++++

...

Quoted 2 lines
 delete mode 100644 arch/arm/plat-orion/include/plat/gpio.h
 create mode 100644 arch/arm/plat-orion/include/plat/orion-gpio.h

This looks like a 100% rename, is that true?

Other than that,

thx,

Jason.

Quoted 260 lines
arch/arm/mach-dove/include/mach/gpio.h +1 -9
index e7e5101..40a8c17 100644
@@ -1,9 +1 @@
-/*
- * arch/arm/mach-dove/include/mach/gpio.h
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#include <plat/gpio.h>
+/* empty */
arch/arm/mach-dove/irq.c +1 -0
index 9bc97a5..186357f 100644
@@ -18,6 +18,7 @@
 #include <asm/mach/irq.h>
 #include <mach/pm.h>
 #include <mach/bridge-regs.h>
+#include <plat/orion-gpio.h>
 #include "common.h"
 
 static void pmu_irq_mask(struct irq_data *d)
arch/arm/mach-dove/mpp.c +1 -0
index 7f70afc..60bd729 100644
@@ -13,6 +13,7 @@
 #include <linux/io.h>
 #include <plat/mpp.h>
 #include <mach/dove.h>
+#include <plat/orion-gpio.h>
 #include "mpp.h"
 
 struct dove_mpp_grp {
arch/arm/mach-kirkwood/include/mach/gpio.h +1 -9
index 84f340b..40a8c17 100644
@@ -1,9 +1 @@
-/*
- * arch/asm-arm/mach-kirkwood/include/mach/gpio.h
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#include <plat/gpio.h>
+/* empty */
arch/arm/mach-kirkwood/irq.c +1 -0
index 720063f..20149a7 100644
@@ -11,6 +11,7 @@
 #include <linux/kernel.h>
 #include <linux/irq.h>
 #include <mach/bridge-regs.h>
+#include <plat/orion-gpio.h>
 #include <plat/irq.h>
 
 static int __initdata gpio0_irqs[4] = {
arch/arm/mach-kirkwood/rd88f6192-nas-setup.c +1 -0
index f742a66..19072c8 100644
@@ -19,6 +19,7 @@
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <mach/kirkwood.h>
+#include <plat/orion-gpio.h>
 #include "common.h"
 
 #define RD88F6192_GPIO_USB_VBUS		10
arch/arm/mach-mv78xx0/irq.c +1 -0
index eff9a75..4d720f2 100644
@@ -11,6 +11,7 @@
 #include <linux/kernel.h>
 #include <linux/irq.h>
 #include <mach/bridge-regs.h>
+#include <plat/orion-gpio.h>
 #include <plat/irq.h>
 #include "common.h"
 
arch/arm/mach-orion5x/d2net-setup.c +1 -0
index d75dcfa..e3629c0 100644
@@ -27,6 +27,7 @@
 #include <asm/mach/arch.h>
 #include <asm/mach/pci.h>
 #include <mach/orion5x.h>
+#include <plat/orion-gpio.h>
 #include "common.h"
 #include "mpp.h"
 
arch/arm/mach-orion5x/dns323-setup.c +1 -0
index d470864..0e19db6 100644
@@ -34,6 +34,7 @@
 #include <asm/mach/pci.h>
 #include <asm/system_info.h>
 #include <mach/orion5x.h>
+#include <plat/orion-gpio.h>
 #include "common.h"
 #include "mpp.h"
 
arch/arm/mach-orion5x/include/mach/gpio.h +1 -9
index a1d0b78..40a8c17 100644
@@ -1,9 +1 @@
-/*
- * arch/arm/mach-orion5x/include/mach/gpio.h
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#include <plat/gpio.h>
+/* empty */
arch/arm/mach-orion5x/irq.c +1 -0
index 17da709..e152641 100644
@@ -13,6 +13,7 @@
 #include <linux/kernel.h>
 #include <linux/irq.h>
 #include <mach/bridge-regs.h>
+#include <plat/orion-gpio.h>
 #include <plat/irq.h>
 
 static int __initdata gpio0_irqs[4] = {
arch/arm/mach-orion5x/net2big-setup.c +1 -0
index 0180c39..3506f16 100644
@@ -25,6 +25,7 @@
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <mach/orion5x.h>
+#include <plat/orion-gpio.h>
 #include "common.h"
 #include "mpp.h"
 
arch/arm/plat-orion/include/plat/gpio.h deleted +0 -37
deleted file mode 100644
index 81c6fc8..0000000
@@ -1,37 +0,0 @@
-/*
- * arch/arm/plat-orion/include/plat/gpio.h
- *
- * Marvell Orion SoC GPIO handling.
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#ifndef __PLAT_GPIO_H
-#define __PLAT_GPIO_H
-
-#include <linux/init.h>
-#include <linux/types.h>
-#include <linux/irqdomain.h>
-/*
- * Orion-specific GPIO API extensions.
- */
-void orion_gpio_set_unused(unsigned pin);
-void orion_gpio_set_blink(unsigned pin, int blink);
-int orion_gpio_led_blink_set(unsigned gpio, int state,
-	unsigned long *delay_on, unsigned long *delay_off);
-
-#define GPIO_INPUT_OK		(1 << 0)
-#define GPIO_OUTPUT_OK		(1 << 1)
-void orion_gpio_set_valid(unsigned pin, int mode);
-
-/* Initialize gpiolib. */
-void __init orion_gpio_init(struct device_node *np,
-			    int gpio_base, int ngpio,
-			    void __iomem *base, int mask_offset,
-			    int secondary_irq_base,
-			    int irq[4]);
-
-void __init orion_gpio_of_init(int irq_gpio_base);
-#endif
arch/arm/plat-orion/include/plat/orion-gpio.h new file +37 -0
new file mode 100644
index 0000000..81c6fc8
@@ -0,0 +1,37 @@
+/*
+ * arch/arm/plat-orion/include/plat/gpio.h
+ *
+ * Marvell Orion SoC GPIO handling.
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#ifndef __PLAT_GPIO_H
+#define __PLAT_GPIO_H
+
+#include <linux/init.h>
+#include <linux/types.h>
+#include <linux/irqdomain.h>
+/*
+ * Orion-specific GPIO API extensions.
+ */
+void orion_gpio_set_unused(unsigned pin);
+void orion_gpio_set_blink(unsigned pin, int blink);
+int orion_gpio_led_blink_set(unsigned gpio, int state,
+	unsigned long *delay_on, unsigned long *delay_off);
+
+#define GPIO_INPUT_OK		(1 << 0)
+#define GPIO_OUTPUT_OK		(1 << 1)
+void orion_gpio_set_valid(unsigned pin, int mode);
+
+/* Initialize gpiolib. */
+void __init orion_gpio_init(struct device_node *np,
+			    int gpio_base, int ngpio,
+			    void __iomem *base, int mask_offset,
+			    int secondary_irq_base,
+			    int irq[4]);
+
+void __init orion_gpio_of_init(int irq_gpio_base);
+#endif
arch/arm/plat-orion/mpp.c +1 -0
index 3b1e17b..c140c2f 100644
@@ -14,6 +14,7 @@
 #include <linux/io.h>
 #include <linux/gpio.h>
 #include <mach/hardware.h>
+#include <plat/gpio.h>
 #include <plat/mpp.h>
 
 /* Address of the ith MPP control register */
Signature · 7 lines
1.7.9.5


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#11 lore raw

PATCH v2 5/6 ARM: orion: move custom gpio functions to orion-gpio.h

In reply to Rob Herring

arch/arm/plat-orion/include/plat/gpio.h line 3

Quoted 9 lines · Rob Herring
arch/arm/plat-orion/include/plat/gpio.h deleted +0 -3
deleted file mode 100644
index 81c6fc8..0000000
@@ -1,37 +0,0 @@
-/*
- * arch/arm/plat-orion/include/plat/gpio.h
- *

You remove the file here

arch/arm/plat-orion/mpp.c line 19

Quoted 11 lines
arch/arm/plat-orion/mpp.c +1 -0
index 3b1e17b..c140c2f 100644
@@ -14,6 +14,7 @@
 #include <linux/io.h>
 #include <linux/gpio.h>
 #include <mach/hardware.h>
+#include <plat/gpio.h>
 #include <plat/mpp.h>
 

and add a new #include here, to the old name, resulting in

arch/arm/plat-orion/mpp.c:17:23: fatal error: plat/gpio.h: No such file or directory

A similar problem happens in plat-orion/irq.c, which has grown a new #include of plat/gpio.h in a different branch that is now in arm-soc.

Arnd

#12 lore raw

PATCH v2 5/6 ARM: orion: move custom gpio functions to orion-gpio.h

Quoted 27 lines · Arnd Bergmann

arch/arm/plat-orion/include/plat/gpio.h line 3

Quoted 9 lines · Rob Herring
arch/arm/plat-orion/include/plat/gpio.h deleted +0 -3
deleted file mode 100644
index 81c6fc8..0000000
@@ -1,37 +0,0 @@
-/*
- * arch/arm/plat-orion/include/plat/gpio.h
- *

You remove the file here

arch/arm/plat-orion/mpp.c line 19

Quoted 11 lines
arch/arm/plat-orion/mpp.c +1 -0
index 3b1e17b..c140c2f 100644
@@ -14,6 +14,7 @@
 #include <linux/io.h>
 #include <linux/gpio.h>
 #include <mach/hardware.h>
+#include <plat/gpio.h>
 #include <plat/mpp.h>
 

and add a new #include here, to the old name, resulting in

Quoted 4 lines

arch/arm/plat-orion/mpp.c:17:23: fatal error: plat/gpio.h: No such file or directory

A similar problem happens in plat-orion/irq.c, which has grown a new #include of plat/gpio.h in a different branch that is now in arm-soc.

It should be orion-gpio.h instead. I have this fixed in my tree.

Rob

#13 lore raw

PATCH v2 5/6 ARM: orion: move custom gpio functions to orion-gpio.h

Quoted 7 lines · Rob Herring
Quoted 4 lines

arch/arm/plat-orion/mpp.c:17:23: fatal error: plat/gpio.h: No such file or directory

A similar problem happens in plat-orion/irq.c, which has grown a new #include of plat/gpio.h in a different branch that is now in arm-soc.

It should be orion-gpio.h instead. I have this fixed in my tree.

I just pulled your multi-plat branch and it still has the broken version.

Arnd

#14 lore raw

PATCH v2 5/6 ARM: orion: move custom gpio functions to orion-gpio.h

Quoted 10 lines · Arnd Bergmann
Quoted 7 lines · Rob Herring
Quoted 4 lines

arch/arm/plat-orion/mpp.c:17:23: fatal error: plat/gpio.h: No such file or directory

A similar problem happens in plat-orion/irq.c, which has grown a new #include of plat/gpio.h in a different branch that is now in arm-soc.

It should be orion-gpio.h instead. I have this fixed in my tree.

I just pulled your multi-plat branch and it still has the broken version.

I hadn't pushed it out, but now it is. It should be close to what I'll send. Primarily I just need to add some acks.

Rob

#15 lore raw

PATCH v2 6/6 ARM: make mach/gpio.h headers optional

In reply to Rob Herring

From: Rob Herring <[email protected]>

Most platforms don't need mach/gpio.h and it prevents multi-platform kernel images. Add CONFIG_NEED_MACH_GPIO_H and make platforns select it if they need gpio.h. This is platforms that define __GPIOLIB_COMPLEX or have lots of implicit includes pulled in by mach/gpio.h.

at91 and omap have gpio clean-up pending and can drop CONFIG_NEED_MACH_GPIO_H once that is in.

---
 arch/arm/Kconfig                            |   21 +++++++++++++++++++++
 arch/arm/include/asm/gpio.h                 |    2 ++
 arch/arm/mach-dove/include/mach/gpio.h      |    1 -
 arch/arm/mach-ep93xx/include/mach/gpio.h    |    1 -
 arch/arm/mach-highbank/include/mach/gpio.h  |    1 -
 arch/arm/mach-ixp4xx/include/mach/gpio.h    |    2 --
 arch/arm/mach-kirkwood/include/mach/gpio.h  |    1 -
 arch/arm/mach-msm/include/mach/gpio.h       |    1 -
 arch/arm/mach-mxs/include/mach/gpio.h       |    1 -
 arch/arm/mach-nomadik/include/mach/gpio.h   |    4 ----
 arch/arm/mach-orion5x/include/mach/gpio.h   |    1 -
 arch/arm/mach-picoxcell/include/mach/gpio.h |    1 -
 arch/arm/mach-realview/include/mach/gpio.h  |    1 -
 arch/arm/mach-shmobile/include/mach/gpio.h  |    1 -
 arch/arm/mach-spear13xx/include/mach/gpio.h |   19 -------------------
 arch/arm/mach-spear3xx/include/mach/gpio.h  |   19 -------------------
 arch/arm/mach-spear6xx/include/mach/gpio.h  |   19 -------------------
 arch/arm/mach-tegra/include/mach/gpio.h     |    1 -
 arch/arm/mach-u300/include/mach/gpio.h      |    1 -
 arch/arm/mach-ux500/include/mach/gpio.h     |    5 -----
 arch/arm/mach-versatile/include/mach/gpio.h |    1 -
 arch/arm/mach-vexpress/include/mach/gpio.h  |    1 -
 arch/arm/mach-vt8500/include/mach/gpio.h    |    1 -
 arch/arm/plat-mxc/include/mach/gpio.h       |    1 -
 arch/arm/plat-spear/include/plat/gpio.h     |    1 -
 25 files changed, 23 insertions(+), 85 deletions(-)
 delete mode 100644 arch/arm/mach-dove/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-ep93xx/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-highbank/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-ixp4xx/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-kirkwood/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-msm/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-mxs/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-nomadik/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-orion5x/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-picoxcell/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-realview/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-shmobile/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-spear13xx/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-spear3xx/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-spear6xx/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-tegra/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-u300/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-ux500/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-versatile/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-vexpress/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-vt8500/include/mach/gpio.h
 delete mode 100644 arch/arm/plat-mxc/include/mach/gpio.h
 delete mode 100644 arch/arm/plat-spear/include/plat/gpio.h
arch/arm/Kconfig +21 -0
index c5f9ae5..4f5652d 100644
@@ -202,6 +202,13 @@ config ARM_PATCH_PHYS_VIRT
 	  this feature (eg, building a kernel for a single machine) and
 	  you need to shrink the kernel to the minimal size.
 
+config NEED_MACH_GPIO_H
+	bool
+	help
+	  Select this when mach/gpio.h is required to provide special
+	  definitions for this platform. The need for mach/gpio.h should
+	  be avoided when possible.
+
 config NEED_MACH_IO_H
 	bool
 	help
@@ -345,6 +352,7 @@ config ARCH_AT91
 	select HAVE_CLK
 	select CLKDEV_LOOKUP
 	select IRQ_DOMAIN
+	select NEED_MACH_GPIO_H
 	select NEED_MACH_IO_H if PCCARD
 	help
 	  This enables support for systems based on Atmel
@@ -523,6 +531,7 @@ config ARCH_IOP32X
 	bool "IOP32x-based"
 	depends on MMU
 	select CPU_XSCALE
+	select NEED_MACH_GPIO_H
 	select NEED_MACH_IO_H
 	select NEED_RET_TO_USER
 	select PLAT_IOP
@@ -536,6 +545,7 @@ config ARCH_IOP33X
 	bool "IOP33x-based"
 	depends on MMU
 	select CPU_XSCALE
+	select NEED_MACH_GPIO_H
 	select NEED_MACH_IO_H
 	select NEED_RET_TO_USER
 	select PLAT_IOP
@@ -645,6 +655,7 @@ config ARCH_MMP
 	select PLAT_PXA
 	select SPARSE_IRQ
 	select GENERIC_ALLOCATOR
+	select NEED_MACH_GPIO_H
 	help
 	  Support for Marvell's PXA168/PXA910(MMP) and MMP2 processor line.
 
@@ -733,6 +744,7 @@ config ARCH_PXA
 	select MULTI_IRQ_HANDLER
 	select ARM_CPU_SUSPEND if PM
 	select HAVE_IDE
+	select NEED_MACH_GPIO_H
 	help
 	  Support for Intel/Marvell's PXA2xx/PXA3xx processor line.
 
@@ -795,6 +807,7 @@ config ARCH_SA1100
 	select CLKDEV_LOOKUP
 	select ARCH_REQUIRE_GPIOLIB
 	select HAVE_IDE
+	select NEED_MACH_GPIO_H
 	select NEED_MACH_MEMORY_H
 	select SPARSE_IRQ
 	help
@@ -810,6 +823,7 @@ config ARCH_S3C24XX
 	select HAVE_S3C2410_I2C if I2C
 	select HAVE_S3C_RTC if RTC_CLASS
 	select HAVE_S3C2410_WATCHDOG if WATCHDOG
+	select NEED_MACH_GPIO_H
 	select NEED_MACH_IO_H
 	help
 	  Samsung S3C2410, S3C2412, S3C2413, S3C2416, S3C2440, S3C2442, S3C2443
@@ -837,6 +851,7 @@ config ARCH_S3C64XX
 	select SAMSUNG_GPIOLIB_4BIT
 	select HAVE_S3C2410_I2C if I2C
 	select HAVE_S3C2410_WATCHDOG if WATCHDOG
+	select NEED_MACH_GPIO_H
 	help
 	  Samsung S3C64XX series based systems
 
@@ -851,6 +866,7 @@ config ARCH_S5P64X0
 	select GENERIC_CLOCKEVENTS
 	select HAVE_S3C2410_I2C if I2C
 	select HAVE_S3C_RTC if RTC_CLASS
+	select NEED_MACH_GPIO_H
 	help
 	  Samsung S5P64X0 CPU based systems, such as the Samsung SMDK6440,
 	  SMDK6450.
@@ -865,6 +881,7 @@ config ARCH_S5PC100
 	select HAVE_S3C2410_I2C if I2C
 	select HAVE_S3C_RTC if RTC_CLASS
 	select HAVE_S3C2410_WATCHDOG if WATCHDOG
+	select NEED_MACH_GPIO_H
 	help
 	  Samsung S5PC100 series based systems
 
@@ -882,6 +899,7 @@ config ARCH_S5PV210
 	select HAVE_S3C2410_I2C if I2C
 	select HAVE_S3C_RTC if RTC_CLASS
 	select HAVE_S3C2410_WATCHDOG if WATCHDOG
+	select NEED_MACH_GPIO_H
 	select NEED_MACH_MEMORY_H
 	help
 	  Samsung S5PV210/S5PC110 series based systems
@@ -899,6 +917,7 @@ config ARCH_EXYNOS
 	select HAVE_S3C_RTC if RTC_CLASS
 	select HAVE_S3C2410_I2C if I2C
 	select HAVE_S3C2410_WATCHDOG if WATCHDOG
+	select NEED_MACH_GPIO_H
 	select NEED_MACH_MEMORY_H
 	help
 	  Support for SAMSUNG's EXYNOS SoCs (EXYNOS4/5)
@@ -971,6 +990,7 @@ config ARCH_DAVINCI
 	select GENERIC_ALLOCATOR
 	select GENERIC_IRQ_CHIP
 	select ARCH_HAS_HOLES_MEMORYMODEL
+	select NEED_MACH_GPIO_H
 	help
 	  Support for TI's DaVinci platform.
 
@@ -983,6 +1003,7 @@ config ARCH_OMAP
 	select CLKSRC_MMIO
 	select GENERIC_CLOCKEVENTS
 	select ARCH_HAS_HOLES_MEMORYMODEL
+	select NEED_MACH_GPIO_H
 	help
 	  Support for TI's OMAP platform (OMAP1/2/3/4).
 
arch/arm/include/asm/gpio.h +2 -0
index c402e9b..477e020 100644
@@ -6,7 +6,9 @@
 #endif
 
 /* not all ARM platforms necessarily support this API ... */
+#ifdef CONFIG_NEED_MACH_GPIO_H
 #include <mach/gpio.h>
+#endif
 
 #ifndef __ARM_GPIOLIB_COMPLEX
 /* Note: this may rely upon the value of ARCH_NR_GPIOS set in mach/gpio.h */
arch/arm/mach-dove/include/mach/gpio.h deleted +0 -1
deleted file mode 100644
index 40a8c17..0000000
@@ -1 +0,0 @@
-/* empty */
arch/arm/mach-ep93xx/include/mach/gpio.h deleted +0 -1
deleted file mode 100644
index 40a8c17..0000000
@@ -1 +0,0 @@
-/* empty */
arch/arm/mach-highbank/include/mach/gpio.h deleted +0 -1
deleted file mode 100644
index 40a8c17..0000000
@@ -1 +0,0 @@
-/* empty */
arch/arm/mach-ixp4xx/include/mach/gpio.h deleted +0 -2
deleted file mode 100644
index ef37f26..0000000
@@ -1,2 +0,0 @@
-/* empty */
-
arch/arm/mach-kirkwood/include/mach/gpio.h deleted +0 -1
deleted file mode 100644
index 40a8c17..0000000
@@ -1 +0,0 @@
-/* empty */
arch/arm/mach-msm/include/mach/gpio.h deleted +0 -1
deleted file mode 100644
index 40a8c17..0000000
@@ -1 +0,0 @@
-/* empty */
arch/arm/mach-mxs/include/mach/gpio.h deleted +0 -1
deleted file mode 100644
index 40a8c17..0000000
@@ -1 +0,0 @@
-/* empty */
arch/arm/mach-nomadik/include/mach/gpio.h deleted +0 -4
deleted file mode 100644
index efdde0a..0000000
@@ -1,4 +0,0 @@
-#ifndef __ASM_ARCH_GPIO_H
-#define __ASM_ARCH_GPIO_H
-
-#endif /* __ASM_ARCH_GPIO_H */
arch/arm/mach-orion5x/include/mach/gpio.h deleted +0 -1
deleted file mode 100644
index 40a8c17..0000000
@@ -1 +0,0 @@
-/* empty */
arch/arm/mach-picoxcell/include/mach/gpio.h deleted +0 -1
deleted file mode 100644
index 40a8c17..0000000
@@ -1 +0,0 @@
-/* empty */
arch/arm/mach-realview/include/mach/gpio.h deleted +0 -1
deleted file mode 100644
index 40a8c17..0000000
@@ -1 +0,0 @@
-/* empty */
arch/arm/mach-shmobile/include/mach/gpio.h deleted +0 -1
deleted file mode 100644
index 40a8c17..0000000
@@ -1 +0,0 @@
-/* empty */
arch/arm/mach-spear13xx/include/mach/gpio.h deleted +0 -19
deleted file mode 100644
index 85f1763..0000000
@@ -1,19 +0,0 @@
-/*
- * arch/arm/mach-spear13xx/include/mach/gpio.h
- *
- * GPIO macros for SPEAr13xx machine family
- *
- * Copyright (C) 2012 ST Microelectronics
- * Viresh Kumar <[email protected]>
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#ifndef __MACH_GPIO_H
-#define __MACH_GPIO_H
-
-#include <plat/gpio.h>
-
-#endif /* __MACH_GPIO_H */
arch/arm/mach-spear3xx/include/mach/gpio.h deleted +0 -19
deleted file mode 100644
index 2ac74c6..0000000
@@ -1,19 +0,0 @@
-/*
- * arch/arm/mach-spear3xx/include/mach/gpio.h
- *
- * GPIO macros for SPEAr3xx machine family
- *
- * Copyright (C) 2009 ST Microelectronics
- * Viresh Kumar<[email protected]>
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#ifndef __MACH_GPIO_H
-#define __MACH_GPIO_H
-
-#include <plat/gpio.h>
-
-#endif /* __MACH_GPIO_H */
arch/arm/mach-spear6xx/include/mach/gpio.h deleted +0 -19
deleted file mode 100644
index d42cefc..0000000
@@ -1,19 +0,0 @@
-/*
- * arch/arm/mach-spear6xx/include/mach/gpio.h
- *
- * GPIO macros for SPEAr6xx machine family
- *
- * Copyright (C) 2009 ST Microelectronics
- * Viresh Kumar <[email protected]>
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#ifndef __MACH_GPIO_H
-#define __MACH_GPIO_H
-
-#include <plat/gpio.h>
-
-#endif /* __MACH_GPIO_H */
arch/arm/mach-tegra/include/mach/gpio.h deleted +0 -1
deleted file mode 100644
index 40a8c17..0000000
@@ -1 +0,0 @@
-/* empty */
arch/arm/mach-u300/include/mach/gpio.h deleted +0 -1
deleted file mode 100644
index 40a8c17..0000000
@@ -1 +0,0 @@
-/* empty */
arch/arm/mach-ux500/include/mach/gpio.h deleted +0 -5
deleted file mode 100644
index c01ef66..0000000
@@ -1,5 +0,0 @@
-#ifndef __ASM_ARCH_GPIO_H
-#define __ASM_ARCH_GPIO_H
-
-
-#endif /* __ASM_ARCH_GPIO_H */
arch/arm/mach-versatile/include/mach/gpio.h deleted +0 -1
deleted file mode 100644
index 40a8c17..0000000
@@ -1 +0,0 @@
-/* empty */
arch/arm/mach-vexpress/include/mach/gpio.h deleted +0 -1
deleted file mode 100644
index 40a8c17..0000000
@@ -1 +0,0 @@
-/* empty */
arch/arm/mach-vt8500/include/mach/gpio.h deleted +0 -1
deleted file mode 100644
index 40a8c17..0000000
@@ -1 +0,0 @@
-/* empty */
arch/arm/plat-mxc/include/mach/gpio.h deleted +0 -1
deleted file mode 100644
index 40a8c17..0000000
@@ -1 +0,0 @@
-/* empty */
arch/arm/plat-spear/include/plat/gpio.h deleted +0 -1
deleted file mode 100644
index 40a8c17..0000000
@@ -1 +0,0 @@
-/* empty */
Signature · 1 line
1.7.9.5
#16 lore raw

PATCH v2 6/6 ARM: make mach/gpio.h headers optional

Quoted 7 lines · Rob Herring

From: Rob Herring <[email protected]>

Most platforms don't need mach/gpio.h and it prevents multi-platform kernel images. Add CONFIG_NEED_MACH_GPIO_H and make platforns select it if they need gpio.h. This is platforms that define __GPIOLIB_COMPLEX or have lots of implicit includes pulled in by mach/gpio.h.

Quoted 5 lines

at91 and omap have gpio clean-up pending and can drop CONFIG_NEED_MACH_GPIO_H once that is in.

For -dove, -kirkwood, and -orion5x,

thx,

Jason.

Quoted 426 lines
---
 arch/arm/Kconfig                            |   21 +++++++++++++++++++++
 arch/arm/include/asm/gpio.h                 |    2 ++
 arch/arm/mach-dove/include/mach/gpio.h      |    1 -
 arch/arm/mach-ep93xx/include/mach/gpio.h    |    1 -
 arch/arm/mach-highbank/include/mach/gpio.h  |    1 -
 arch/arm/mach-ixp4xx/include/mach/gpio.h    |    2 --
 arch/arm/mach-kirkwood/include/mach/gpio.h  |    1 -
 arch/arm/mach-msm/include/mach/gpio.h       |    1 -
 arch/arm/mach-mxs/include/mach/gpio.h       |    1 -
 arch/arm/mach-nomadik/include/mach/gpio.h   |    4 ----
 arch/arm/mach-orion5x/include/mach/gpio.h   |    1 -
 arch/arm/mach-picoxcell/include/mach/gpio.h |    1 -
 arch/arm/mach-realview/include/mach/gpio.h  |    1 -
 arch/arm/mach-shmobile/include/mach/gpio.h  |    1 -
 arch/arm/mach-spear13xx/include/mach/gpio.h |   19 -------------------
 arch/arm/mach-spear3xx/include/mach/gpio.h  |   19 -------------------
 arch/arm/mach-spear6xx/include/mach/gpio.h  |   19 -------------------
 arch/arm/mach-tegra/include/mach/gpio.h     |    1 -
 arch/arm/mach-u300/include/mach/gpio.h      |    1 -
 arch/arm/mach-ux500/include/mach/gpio.h     |    5 -----
 arch/arm/mach-versatile/include/mach/gpio.h |    1 -
 arch/arm/mach-vexpress/include/mach/gpio.h  |    1 -
 arch/arm/mach-vt8500/include/mach/gpio.h    |    1 -
 arch/arm/plat-mxc/include/mach/gpio.h       |    1 -
 arch/arm/plat-spear/include/plat/gpio.h     |    1 -
 25 files changed, 23 insertions(+), 85 deletions(-)
 delete mode 100644 arch/arm/mach-dove/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-ep93xx/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-highbank/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-ixp4xx/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-kirkwood/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-msm/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-mxs/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-nomadik/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-orion5x/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-picoxcell/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-realview/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-shmobile/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-spear13xx/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-spear3xx/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-spear6xx/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-tegra/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-u300/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-ux500/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-versatile/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-vexpress/include/mach/gpio.h
 delete mode 100644 arch/arm/mach-vt8500/include/mach/gpio.h
 delete mode 100644 arch/arm/plat-mxc/include/mach/gpio.h
 delete mode 100644 arch/arm/plat-spear/include/plat/gpio.h
arch/arm/Kconfig +21 -0
index c5f9ae5..4f5652d 100644
@@ -202,6 +202,13 @@ config ARM_PATCH_PHYS_VIRT
 	  this feature (eg, building a kernel for a single machine) and
 	  you need to shrink the kernel to the minimal size.
 
+config NEED_MACH_GPIO_H
+	bool
+	help
+	  Select this when mach/gpio.h is required to provide special
+	  definitions for this platform. The need for mach/gpio.h should
+	  be avoided when possible.
+
 config NEED_MACH_IO_H
 	bool
 	help
@@ -345,6 +352,7 @@ config ARCH_AT91
 	select HAVE_CLK
 	select CLKDEV_LOOKUP
 	select IRQ_DOMAIN
+	select NEED_MACH_GPIO_H
 	select NEED_MACH_IO_H if PCCARD
 	help
 	  This enables support for systems based on Atmel
@@ -523,6 +531,7 @@ config ARCH_IOP32X
 	bool "IOP32x-based"
 	depends on MMU
 	select CPU_XSCALE
+	select NEED_MACH_GPIO_H
 	select NEED_MACH_IO_H
 	select NEED_RET_TO_USER
 	select PLAT_IOP
@@ -536,6 +545,7 @@ config ARCH_IOP33X
 	bool "IOP33x-based"
 	depends on MMU
 	select CPU_XSCALE
+	select NEED_MACH_GPIO_H
 	select NEED_MACH_IO_H
 	select NEED_RET_TO_USER
 	select PLAT_IOP
@@ -645,6 +655,7 @@ config ARCH_MMP
 	select PLAT_PXA
 	select SPARSE_IRQ
 	select GENERIC_ALLOCATOR
+	select NEED_MACH_GPIO_H
 	help
 	  Support for Marvell's PXA168/PXA910(MMP) and MMP2 processor line.
 
@@ -733,6 +744,7 @@ config ARCH_PXA
 	select MULTI_IRQ_HANDLER
 	select ARM_CPU_SUSPEND if PM
 	select HAVE_IDE
+	select NEED_MACH_GPIO_H
 	help
 	  Support for Intel/Marvell's PXA2xx/PXA3xx processor line.
 
@@ -795,6 +807,7 @@ config ARCH_SA1100
 	select CLKDEV_LOOKUP
 	select ARCH_REQUIRE_GPIOLIB
 	select HAVE_IDE
+	select NEED_MACH_GPIO_H
 	select NEED_MACH_MEMORY_H
 	select SPARSE_IRQ
 	help
@@ -810,6 +823,7 @@ config ARCH_S3C24XX
 	select HAVE_S3C2410_I2C if I2C
 	select HAVE_S3C_RTC if RTC_CLASS
 	select HAVE_S3C2410_WATCHDOG if WATCHDOG
+	select NEED_MACH_GPIO_H
 	select NEED_MACH_IO_H
 	help
 	  Samsung S3C2410, S3C2412, S3C2413, S3C2416, S3C2440, S3C2442, S3C2443
@@ -837,6 +851,7 @@ config ARCH_S3C64XX
 	select SAMSUNG_GPIOLIB_4BIT
 	select HAVE_S3C2410_I2C if I2C
 	select HAVE_S3C2410_WATCHDOG if WATCHDOG
+	select NEED_MACH_GPIO_H
 	help
 	  Samsung S3C64XX series based systems
 
@@ -851,6 +866,7 @@ config ARCH_S5P64X0
 	select GENERIC_CLOCKEVENTS
 	select HAVE_S3C2410_I2C if I2C
 	select HAVE_S3C_RTC if RTC_CLASS
+	select NEED_MACH_GPIO_H
 	help
 	  Samsung S5P64X0 CPU based systems, such as the Samsung SMDK6440,
 	  SMDK6450.
@@ -865,6 +881,7 @@ config ARCH_S5PC100
 	select HAVE_S3C2410_I2C if I2C
 	select HAVE_S3C_RTC if RTC_CLASS
 	select HAVE_S3C2410_WATCHDOG if WATCHDOG
+	select NEED_MACH_GPIO_H
 	help
 	  Samsung S5PC100 series based systems
 
@@ -882,6 +899,7 @@ config ARCH_S5PV210
 	select HAVE_S3C2410_I2C if I2C
 	select HAVE_S3C_RTC if RTC_CLASS
 	select HAVE_S3C2410_WATCHDOG if WATCHDOG
+	select NEED_MACH_GPIO_H
 	select NEED_MACH_MEMORY_H
 	help
 	  Samsung S5PV210/S5PC110 series based systems
@@ -899,6 +917,7 @@ config ARCH_EXYNOS
 	select HAVE_S3C_RTC if RTC_CLASS
 	select HAVE_S3C2410_I2C if I2C
 	select HAVE_S3C2410_WATCHDOG if WATCHDOG
+	select NEED_MACH_GPIO_H
 	select NEED_MACH_MEMORY_H
 	help
 	  Support for SAMSUNG's EXYNOS SoCs (EXYNOS4/5)
@@ -971,6 +990,7 @@ config ARCH_DAVINCI
 	select GENERIC_ALLOCATOR
 	select GENERIC_IRQ_CHIP
 	select ARCH_HAS_HOLES_MEMORYMODEL
+	select NEED_MACH_GPIO_H
 	help
 	  Support for TI's DaVinci platform.
 
@@ -983,6 +1003,7 @@ config ARCH_OMAP
 	select CLKSRC_MMIO
 	select GENERIC_CLOCKEVENTS
 	select ARCH_HAS_HOLES_MEMORYMODEL
+	select NEED_MACH_GPIO_H
 	help
 	  Support for TI's OMAP platform (OMAP1/2/3/4).
 
arch/arm/include/asm/gpio.h +2 -0
index c402e9b..477e020 100644
@@ -6,7 +6,9 @@
 #endif
 
 /* not all ARM platforms necessarily support this API ... */
+#ifdef CONFIG_NEED_MACH_GPIO_H
 #include <mach/gpio.h>
+#endif
 
 #ifndef __ARM_GPIOLIB_COMPLEX
 /* Note: this may rely upon the value of ARCH_NR_GPIOS set in mach/gpio.h */
arch/arm/mach-dove/include/mach/gpio.h deleted +0 -1
deleted file mode 100644
index 40a8c17..0000000
@@ -1 +0,0 @@
-/* empty */
arch/arm/mach-ep93xx/include/mach/gpio.h deleted +0 -1
deleted file mode 100644
index 40a8c17..0000000
@@ -1 +0,0 @@
-/* empty */
arch/arm/mach-highbank/include/mach/gpio.h deleted +0 -1
deleted file mode 100644
index 40a8c17..0000000
@@ -1 +0,0 @@
-/* empty */
arch/arm/mach-ixp4xx/include/mach/gpio.h deleted +0 -2
deleted file mode 100644
index ef37f26..0000000
@@ -1,2 +0,0 @@
-/* empty */
-
arch/arm/mach-kirkwood/include/mach/gpio.h deleted +0 -1
deleted file mode 100644
index 40a8c17..0000000
@@ -1 +0,0 @@
-/* empty */
arch/arm/mach-msm/include/mach/gpio.h deleted +0 -1
deleted file mode 100644
index 40a8c17..0000000
@@ -1 +0,0 @@
-/* empty */
arch/arm/mach-mxs/include/mach/gpio.h deleted +0 -1
deleted file mode 100644
index 40a8c17..0000000
@@ -1 +0,0 @@
-/* empty */
arch/arm/mach-nomadik/include/mach/gpio.h deleted +0 -4
deleted file mode 100644
index efdde0a..0000000
@@ -1,4 +0,0 @@
-#ifndef __ASM_ARCH_GPIO_H
-#define __ASM_ARCH_GPIO_H
-
-#endif /* __ASM_ARCH_GPIO_H */
arch/arm/mach-orion5x/include/mach/gpio.h deleted +0 -1
deleted file mode 100644
index 40a8c17..0000000
@@ -1 +0,0 @@
-/* empty */
arch/arm/mach-picoxcell/include/mach/gpio.h deleted +0 -1
deleted file mode 100644
index 40a8c17..0000000
@@ -1 +0,0 @@
-/* empty */
arch/arm/mach-realview/include/mach/gpio.h deleted +0 -1
deleted file mode 100644
index 40a8c17..0000000
@@ -1 +0,0 @@
-/* empty */
arch/arm/mach-shmobile/include/mach/gpio.h deleted +0 -1
deleted file mode 100644
index 40a8c17..0000000
@@ -1 +0,0 @@
-/* empty */
arch/arm/mach-spear13xx/include/mach/gpio.h deleted +0 -19
deleted file mode 100644
index 85f1763..0000000
@@ -1,19 +0,0 @@
-/*
- * arch/arm/mach-spear13xx/include/mach/gpio.h
- *
- * GPIO macros for SPEAr13xx machine family
- *
- * Copyright (C) 2012 ST Microelectronics
- * Viresh Kumar <[email protected]>
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#ifndef __MACH_GPIO_H
-#define __MACH_GPIO_H
-
-#include <plat/gpio.h>
-
-#endif /* __MACH_GPIO_H */
arch/arm/mach-spear3xx/include/mach/gpio.h deleted +0 -19
deleted file mode 100644
index 2ac74c6..0000000
@@ -1,19 +0,0 @@
-/*
- * arch/arm/mach-spear3xx/include/mach/gpio.h
- *
- * GPIO macros for SPEAr3xx machine family
- *
- * Copyright (C) 2009 ST Microelectronics
- * Viresh Kumar<[email protected]>
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#ifndef __MACH_GPIO_H
-#define __MACH_GPIO_H
-
-#include <plat/gpio.h>
-
-#endif /* __MACH_GPIO_H */
arch/arm/mach-spear6xx/include/mach/gpio.h deleted +0 -19
deleted file mode 100644
index d42cefc..0000000
@@ -1,19 +0,0 @@
-/*
- * arch/arm/mach-spear6xx/include/mach/gpio.h
- *
- * GPIO macros for SPEAr6xx machine family
- *
- * Copyright (C) 2009 ST Microelectronics
- * Viresh Kumar <[email protected]>
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#ifndef __MACH_GPIO_H
-#define __MACH_GPIO_H
-
-#include <plat/gpio.h>
-
-#endif /* __MACH_GPIO_H */
arch/arm/mach-tegra/include/mach/gpio.h deleted +0 -1
deleted file mode 100644
index 40a8c17..0000000
@@ -1 +0,0 @@
-/* empty */
arch/arm/mach-u300/include/mach/gpio.h deleted +0 -1
deleted file mode 100644
index 40a8c17..0000000
@@ -1 +0,0 @@
-/* empty */
arch/arm/mach-ux500/include/mach/gpio.h deleted +0 -5
deleted file mode 100644
index c01ef66..0000000
@@ -1,5 +0,0 @@
-#ifndef __ASM_ARCH_GPIO_H
-#define __ASM_ARCH_GPIO_H
-
-
-#endif /* __ASM_ARCH_GPIO_H */
arch/arm/mach-versatile/include/mach/gpio.h deleted +0 -1
deleted file mode 100644
index 40a8c17..0000000
@@ -1 +0,0 @@
-/* empty */
arch/arm/mach-vexpress/include/mach/gpio.h deleted +0 -1
deleted file mode 100644
index 40a8c17..0000000
@@ -1 +0,0 @@
-/* empty */
arch/arm/mach-vt8500/include/mach/gpio.h deleted +0 -1
deleted file mode 100644
index 40a8c17..0000000
@@ -1 +0,0 @@
-/* empty */
arch/arm/plat-mxc/include/mach/gpio.h deleted +0 -1
deleted file mode 100644
index 40a8c17..0000000
@@ -1 +0,0 @@
-/* empty */
arch/arm/plat-spear/include/plat/gpio.h deleted +0 -1
deleted file mode 100644
index 40a8c17..0000000
@@ -1 +0,0 @@
-/* empty */
Signature · 7 lines
1.7.9.5


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#17 lore raw

PATCH v2 6/6 ARM: make mach/gpio.h headers optional

In reply to Rob Herring

arch/arm/mach-ux500/include/mach/gpio.h line 5

Quoted 11 lines · Rob Herring
arch/arm/mach-ux500/include/mach/gpio.h deleted +0 -5
deleted file mode 100644
index c01ef66..0000000
@@ -1,5 +0,0 @@
-#ifndef __ASM_ARCH_GPIO_H
-#define __ASM_ARCH_GPIO_H
-
-
-#endif /* __ASM_ARCH_GPIO_H */

Another one: this file is included by drivers/staging/ste_rmi4/board-mop500-u8500uib-rmi4.c, but that obviously doesn't need it, so the #include needs to be removed.

Arnd

#18 lore raw

PATCH v2 6/6 ARM: make mach/gpio.h headers optional

In reply to Rob Herring
Quoted 7 lines · Rob Herring

From: Rob Herring <[email protected]>

Most platforms don't need mach/gpio.h and it prevents multi-platform kernel images. Add CONFIG_NEED_MACH_GPIO_H and make platforns select it if they need gpio.h. This is platforms that define __GPIOLIB_COMPLEX or have lots of implicit includes pulled in by mach/gpio.h.

Quoted 5 lines

at91 and omap have gpio clean-up pending and can drop CONFIG_NEED_MACH_GPIO_H once that is in.

Didn't I ACK this before? Oh well.

Yours,
Linus Walleij

#19 lore raw

v2 cover Make mach/gpio.h optional

In reply to Rob Herring
Quoted 4 lines · Rob Herring

From: Rob Herring <[email protected]>

This is series makes mach/gpio.h optional like we have done for other mach headers in preparation for multi-platform kernel images.

I like this approach. It's in the spirit of some similar stuff I made a year ago or two.

For all of U300, Nomadik, Ux500, and as GPIO second man.

Yours,
Linus Walleij

#20 lore raw

PATCH 1/1 staging: ste_rmi4: remove gpio.h include

In reply to Rob Herring

From: Rob Herring <[email protected]>

gpio.h is not needed and is going to be removed.

Cc Linus Walleij <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>

---

Here's one more trivial fix in preparation of mach/gpio.h removal. I plan to take this thru arm-soc tree.

Rob

 .../staging/ste_rmi4/board-mop500-u8500uib-rmi4.c  |    1 -
 1 file changed, 1 deletion(-)
drivers/staging/ste_rmi4/board-mop500-u8500uib-rmi4.c +0 -1
index a272e48..47439c3 100644
@@ -5,7 +5,6 @@
 #include <linux/i2c.h>
 #include <linux/gpio.h>
 #include <linux/interrupt.h>
-#include <mach/gpio.h>
 #include <mach/irqs.h>
 #include "synaptics_i2c_rmi4.h"
 
Signature · 1 line
1.7.9.5
#21 lore raw

PATCH 1/1 staging: ste_rmi4: remove gpio.h include

Adding Greg KH's correct email...

Quoted 31 lines · Rob Herring

From: Rob Herring <[email protected]>

gpio.h is not needed and is going to be removed.

Cc Linus Walleij <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>

---

Here's one more trivial fix in preparation of mach/gpio.h removal. I plan to take this thru arm-soc tree.

Rob

 .../staging/ste_rmi4/board-mop500-u8500uib-rmi4.c  |    1 -
 1 file changed, 1 deletion(-)
drivers/staging/ste_rmi4/board-mop500-u8500uib-rmi4.c +0 -1
index a272e48..47439c3 100644
@@ -5,7 +5,6 @@
 #include <linux/i2c.h>
 #include <linux/gpio.h>
 #include <linux/interrupt.h>
-#include <mach/gpio.h>
 #include <mach/irqs.h>
 #include "synaptics_i2c_rmi4.h"
 
#22 lore raw

PATCH 1/1 staging: ste_rmi4: remove gpio.h include

Quoted 11 lines · Rob Herring

Adding Greg KH's correct email...

Quoted 8 lines · Rob Herring

From: Rob Herring <[email protected]>

gpio.h is not needed and is going to be removed.

Cc Linus Walleij <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>

Yours,
Linus Walleij

#23 lore raw

PATCH 1/1 staging: ste_rmi4: remove gpio.h include

In reply to Rob Herring
Quoted 6 lines · Rob Herring

Adding Greg KH's correct email...

Quoted 3 lines · Rob Herring

From: Rob Herring <[email protected]>

gpio.h is not needed and is going to be removed.

Care to send it to me in a format I can apply it in?

thanks,

greg k-h

#24 lore raw

PATCH 1/1 staging: ste_rmi4: remove gpio.h include

Quoted 9 lines · Greg Kroah-Hartman
Quoted 6 lines · Rob Herring

Adding Greg KH's correct email...

Quoted 3 lines · Rob Herring

From: Rob Herring <[email protected]>

gpio.h is not needed and is going to be removed.

Care to send it to me in a format I can apply it in?

As I mentioned, this should go in via the arm-soc tree with rest of the gpio clean-up, so I just need an ack.

Rob

#25 lore raw

PATCH 1/1 staging: ste_rmi4: remove gpio.h include

Quoted 5 lines · Rob Herring
Quoted 4 lines · Greg Kroah-Hartman
Quoted 3 lines · Rob Herring

Adding Greg KH's correct email...

On 09/13/2012 08:07 AM, Rob Herring wrote:

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Quoted 3 lines

From: Rob Herring <[email protected]>

gpio.h is not needed and is going to be removed.

Care to send it to me in a format I can apply it in?

As I mentioned, this should go in via the arm-soc tree with rest of the gpio clean-up, so I just need an ack.