From: Thomas Gleixner Subject: Re: [PATCH v3 11/16] gpio: add support for the sl28cpld GPIO controller Date: Mon, 27 Apr 2020 13:45:00 +0200 Message-ID: <87k121qhj7.fsf@nanos.tec.linutronix.de> References: <20200423174543.17161-1-michael@walle.cc> <20200423174543.17161-12-michael@walle.cc> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20200423174543.17161-12-michael@walle.cc> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane-mx.org@lists.infradead.org To: Andy Shevchenko , linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, linux-pwm@vger.kernel.org, linux-watchdog@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Marc Zyngier , Jean Delvare , Jason Cooper , Greg Kroah-Hartman , Shawn Guo , Linus Walleij , Li Yang , Bartosz Golaszewski , Michael Walle , Rob Herring , Thierry Reding , Mark Brown , Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= , Wim Van Sebroeck , Lee Jones , Guenter Roeck List-Id: linux-pwm@vger.kernel.org Michael Walle writes: > +struct sl28cpld_gpio { > + struct regmap_irq_chip irq_chip; > + struct regmap_irq_chip_data *irq_data; > +}; > + > +static const struct regmap_irq sl28cpld_gpio_irqs[] = { > + REGMAP_IRQ_REG_LINE(0, 8), > + REGMAP_IRQ_REG_LINE(1, 8), > + REGMAP_IRQ_REG_LINE(2, 8), > + REGMAP_IRQ_REG_LINE(3, 8), > + REGMAP_IRQ_REG_LINE(4, 8), > + REGMAP_IRQ_REG_LINE(5, 8), > + REGMAP_IRQ_REG_LINE(6, 8), > + REGMAP_IRQ_REG_LINE(7, 8), > +}; This is exactly the same as the one in the irq chip patch. > +static int sl28cpld_gpio_irq_init(struct device *dev, > + struct sl28cpld_gpio *gpio, > + struct regmap *regmap, unsigned int base, > + int irq) > +{ > + struct regmap_irq_chip *irq_chip = &gpio->irq_chip; > + > + irq_chip->name = "sl28cpld-gpio-irq", > + irq_chip->irqs = sl28cpld_gpio_irqs; > + irq_chip->num_irqs = ARRAY_SIZE(sl28cpld_gpio_irqs); > + irq_chip->num_regs = 1; > + irq_chip->status_base = base + GPIO_REG_IP; > + irq_chip->mask_base = base + GPIO_REG_IE; > + irq_chip->mask_invert = true, > + irq_chip->ack_base = base + GPIO_REG_IP; > + > + return devm_regmap_add_irq_chip_np(dev, dev_of_node(dev), regmap, > + irq, IRQF_SHARED | IRQF_ONESHOT, 0, > + irq_chip, &gpio->irq_data); > +} And this looks pretty familiar as well. What's the point of duplicating that code? Thanks, tglx