Thread (8 messages) 8 messages, 3 authors, 2015-08-13

Re: [PATCH v2] bcma: switch GPIO portions to use GPIOLIB_IRQCHIP

From: Hauke Mehrtens <hauke@hauke-m.de>
Date: 2015-08-02 18:28:57

On 08/02/2015 08:00 PM, Hauke Mehrtens wrote:
From: Linus Walleij <redacted>

This switches the BCMA GPIO driver to use GPIOLIB_IRQCHIP to
handle its interrupts instead of rolling its own copy of the
irqdomain handling etc.

Signed-off-by: Linus Walleij <redacted>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---

I fixed some bugs in the original patch, some of them are compile 
errors and others caused some runtime problems. This patch worked on my 
BCM4708 based device, I was able to receive an IRQ for a GPIO change 
(button press).

I think this should go through the wireless tree.

@Linus could you please check if the changes I did are correct?

 drivers/bcma/Kconfig                        |   2 +-
 drivers/bcma/driver_gpio.c                  | 105 ++++++++++++----------------
 include/linux/bcma/bcma_driver_chipcommon.h |   1 -
 3 files changed, 44 insertions(+), 64 deletions(-)
.....
quoted hunk ↗ jump to hunk
@@ -218,9 +190,18 @@ int bcma_gpio_init(struct bcma_drv_cc *cc)
 	chip->set		= bcma_gpio_set_value;
 	chip->direction_input	= bcma_gpio_direction_input;
 	chip->direction_output	= bcma_gpio_direction_output;
-#if IS_BUILTIN(CONFIG_BCM47XX) || IS_BUILTIN(CONFIG_ARCH_BCM_5301X)
-	chip->to_irq		= bcma_gpio_to_irq;
-#endif
+	chip->owner		= THIS_MODULE;
+	switch (bus->hosttype) {
+	case BCMA_HOSTTYPE_PCI:
+		chip->dev	= &bus->host_pci->dev;
+		break;
+	case BCMA_HOSTTYPE_SOC:
+		chip->dev	= &bus->host_pdev->dev;
+		break;
+	case BCMA_HOSTTYPE_SDIO:
+		chip->dev	= &bus->host_sdio->dev;
+		break;
+	}
I will replace this part with a call to the newly introduced function
bcma_bus_get_host_dev() in a new version of this patch.

This function was introduced in "bcma: fix access to host_pdev for PCIe
devices"

.....
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help