From 80bc5ae9733c2ae71a13db819f9368191cc19d6f Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Tue, 11 Oct 2022 14:29:41 +0200 Subject: bcma: support SPROM rev 11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rev 11 works fine for me to set the MAC address of gmac0 and gmac1 in the D-Link DWL-8610AP. Cc: Rafał Miłecki Signed-off-by: Linus Walleij Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20221011122941.2053705-1-linus.walleij@linaro.org --- drivers/bcma/sprom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/bcma') diff --git a/drivers/bcma/sprom.c b/drivers/bcma/sprom.c index 3da01f173c63..e668ad7963fc 100644 --- a/drivers/bcma/sprom.c +++ b/drivers/bcma/sprom.c @@ -165,7 +165,7 @@ static int bcma_sprom_valid(struct bcma_bus *bus, const u16 *sprom, return err; revision = sprom[words - 1] & SSB_SPROM_REVISION_REV; - if (revision != 8 && revision != 9 && revision != 10) { + if (revision < 8 || revision > 11) { pr_err("Unsupported SPROM revision: %d\n", revision); return -ENOENT; } -- cgit v1.2.3 From 55549d6a3052990e65727bfec158e1b0e7cec4e4 Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Wed, 12 Oct 2022 21:23:48 +0200 Subject: bcma: gpio: Convert to immutable gpio irqchip MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This switches the BCMA gpio irqchip to be immutable. The GPIO subsystem plays tricks on the irqchip structures, and we're fixing it one driver at a time. See merge commit 4bde53ab3370 ("Merge branch irq/gpio-immutable into irq/irqchip-next") for all the details. Tested on the D-Link DWL-6810AP. Cc: Marc Zyngier Cc: Bartosz Golaszewski Cc: Rafał Miłecki Signed-off-by: Linus Walleij Acked-by: Marc Zyngier Reviewed-by: Bartosz Golaszewski Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20221012192348.2234478-1-linus.walleij@linaro.org --- drivers/bcma/driver_gpio.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'drivers/bcma') diff --git a/drivers/bcma/driver_gpio.c b/drivers/bcma/driver_gpio.c index fac8ff983aec..eff6fc330632 100644 --- a/drivers/bcma/driver_gpio.c +++ b/drivers/bcma/driver_gpio.c @@ -82,6 +82,7 @@ static void bcma_gpio_irq_unmask(struct irq_data *d) int gpio = irqd_to_hwirq(d); u32 val = bcma_chipco_gpio_in(cc, BIT(gpio)); + gpiochip_enable_irq(gc, gpio); bcma_chipco_gpio_polarity(cc, BIT(gpio), val); bcma_chipco_gpio_intmask(cc, BIT(gpio), BIT(gpio)); } @@ -93,12 +94,15 @@ static void bcma_gpio_irq_mask(struct irq_data *d) int gpio = irqd_to_hwirq(d); bcma_chipco_gpio_intmask(cc, BIT(gpio), 0); + gpiochip_disable_irq(gc, gpio); } -static struct irq_chip bcma_gpio_irq_chip = { +static const struct irq_chip bcma_gpio_irq_chip = { .name = "BCMA-GPIO", .irq_mask = bcma_gpio_irq_mask, .irq_unmask = bcma_gpio_irq_unmask, + .flags = IRQCHIP_IMMUTABLE, + GPIOCHIP_IRQ_RESOURCE_HELPERS, }; static irqreturn_t bcma_gpio_irq_handler(int irq, void *dev_id) @@ -139,7 +143,7 @@ static int bcma_gpio_irq_init(struct bcma_drv_cc *cc) bcma_chipco_gpio_intmask(cc, ~0, 0); bcma_cc_set32(cc, BCMA_CC_IRQMASK, BCMA_CC_IRQ_GPIO); - girq->chip = &bcma_gpio_irq_chip; + gpio_irq_chip_set_chip(girq, &bcma_gpio_irq_chip); /* This will let us handle the parent IRQ in the driver */ girq->parent_handler = NULL; girq->num_parents = 0; -- cgit v1.2.3