From: Thomas Gleixner Subject: Re: [PATCH v3 06/16] irqchip: add sl28cpld interrupt controller support Date: Mon, 27 Apr 2020 13:40:18 +0200 Message-ID: <87pnbtqhr1.fsf@nanos.tec.linutronix.de> References: <20200423174543.17161-1-michael@walle.cc> <20200423174543.17161-7-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-7-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: > This patch adds support for the interrupt controller inside the sl28 git grep 'This patch' Documentation/process/ > CPLD management controller. > > +static int sl28cpld_intc_probe(struct platform_device *pdev) > +{ > + struct sl28cpld_intc *irqchip; > + struct resource *res; > + unsigned int irq; > + int ret; > + > + if (!pdev->dev.parent) > + return -ENODEV; > + > + irqchip = devm_kzalloc(&pdev->dev, sizeof(*irqchip), GFP_KERNEL); > + if (!irqchip) > + return -ENOMEM; > + > + irqchip->regmap = dev_get_regmap(pdev->dev.parent, NULL); > + if (!irqchip->regmap) > + return -ENODEV; > + > + irq = platform_get_irq(pdev, 0); > + if (irq < 0) > + return irq; > + > + res = platform_get_resource(pdev, IORESOURCE_REG, 0); > + if (!res) > + return -EINVAL; > + > + irqchip->chip.name = "sl28cpld-intc"; > + irqchip->chip.irqs = sl28cpld_irqs; > + irqchip->chip.num_irqs = ARRAY_SIZE(sl28cpld_irqs); > + irqchip->chip.num_regs = 1; > + irqchip->chip.status_base = res->start + INTC_IP; > + irqchip->chip.mask_base = res->start + INTC_IE; > + irqchip->chip.mask_invert = true, > + irqchip->chip.ack_base = res->start + INTC_IP; > + > + ret = devm_regmap_add_irq_chip(&pdev->dev, irqchip->regmap, irq, > + IRQF_SHARED | IRQF_ONESHOT, 0, What's the point of IRQF_SHARED | IRQF_ONESHOT here? > + &irqchip->chip, &irqchip->irq_data); Thanks, tglx