[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4656BEB6164FC34F8171C6538F1A595B2E982BFA@SHSMSX101.ccr.corp.intel.com>
Date: Sat, 6 Sep 2014 10:47:01 +0000
From: "Chen, Alvin" <alvin.chen@...el.com>
To: Sebastian Andrzej Siewior <sebastian@...akpoint.cc>,
Arnd Bergmann <arnd@...db.de>
CC: Linus Walleij <linus.walleij@...aro.org>,
Alexandre Courbot <gnurou@...il.com>,
Grant Likely <grant.likely@...aro.org>,
Rob Herring <robh+dt@...nel.org>,
atull <atull@...nsource.altera.com>,
"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"Ong, Boon Leong" <boon.leong.ong@...el.com>,
"Kweh, Hock Leong" <hock.leong.kweh@...el.com>,
Darren Hart <dvhart@...ux.intel.com>,
"Westerberg, Mika" <mika.westerberg@...el.com>,
"Shevchenko, Andriy" <andriy.shevchenko@...el.com>
Subject: RE: [PATCH 1/3 v2] GPIO: gpio-dwapb: Enable platform driver binding
to MFD driver
> > >
> > > - irq_set_chained_handler(irq, dwapb_irq_handler);
> > > - irq_set_handler_data(irq, gpio);
> > > + if (!pp->irq_shared) {
> > > + irq_set_chained_handler(pp->irq, dwapb_irq_handler);
> > > + irq_set_handler_data(pp->irq, gpio);
> > > + } else {
> > > + /*
> > > + * Request a shared IRQ since where MFD would have devices
> > > + * using the same irq pin
> > > + */
> > > + err = devm_request_irq(gpio->dev, pp->irq,
> > > + dwapb_irq_handler_mfd,
> > > + IRQF_SHARED, "gpio-dwapb-mfd", gpio);
> > > + if (err) {
> > > + dev_err(gpio->dev, "error requesting IRQ\n");
> > > + irq_domain_remove(gpio->domain);
> > > + gpio->domain = NULL;
> > > + return;
> > > + }
> > > + }
> > >
> >
> > I think this need some better documentation. Why is it safe to use
> > devm_request_irq rather than irq_set_chained_handler here?
>
> Usually it is preferred to use irq_set_chained_handler() for the chained handler
> so the handler does not show up in /proc/interrupts.
> This requires an exclusive non-shared handler which is not the case on the intel
> platform. So they have to use devm_request_irq() instead.
>
Yes, for Intel Quark, it has a single PCI function exporting a GPIO and I2C controller, and
the irq is shared by GPIO and I2C, so we need shared irq as the comments said.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists