From mboxrd@z Thu Jan 1 00:00:00 1970 From: Grant Likely Subject: Re: [PATCH 3/5] gpio/omap: Add DT support to GPIO driver Date: Tue, 11 Jun 2013 22:25:49 +0100 Message-ID: <20130611212550.03A823E0D8D@localhost> References: <1329321854-24490-1-git-send-email-b-cousson@ti.com> <515319D5.20105@wwwdotorg.org> <5155C902.7080207@wwwdotorg.org> <5165CB9D.1090202@wwwdotorg.org> <51671D7B.5060303@wwwdotorg.org> <51673D70.3010503@wwwdotorg.org> <516C31C3.9040505@wwwdotorg.org> <516C7C43.3040105@wwwdotorg.org> <516C8760.2050500@ti.com> <516D9B05.1000501@wwwdotorg.org> <516DA60A.5070000@ti.com> <516DCC A8.3070108@wwwdotorg.org> <516DDB4D.9020500@ti.com> <517AF22 C.9090901@ti.com> Return-path: In-Reply-To: <517AF22C.9090901@ti.com> Sender: linux-omap-owner@vger.kernel.org To: Jon Hunter , Linus Walleij Cc: Javier Martinez Canillas , Stephen Warren , Alexandre Courbot , Stephen Warren , Kevin Hilman , "devicetree-discuss@lists.ozlabs.org" , "linux-omap@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" List-Id: devicetree@vger.kernel.org On Fri, 26 Apr 2013 16:31:24 -0500, Jon Hunter wrote: > > On 04/26/2013 02:31 AM, Linus Walleij wrote: > > On Wed, Apr 17, 2013 at 2:41 AM, Javier Martinez Canillas > > wrote: > > > > So: > > > >> +static int omap_gpio_irq_domain_xlate(struct irq_domain *d, > >> + struct device_node *ctrlr, > >> + const u32 *intspec, unsigned int intsize, > >> + irq_hw_number_t *out_hwirq, > >> + unsigned int *out_type) > >> +{ > >> + int ret; > >> + struct gpio_bank *bank = d->host_data; > >> + int gpio = bank->chip.base + intspec[0]; > >> + > >> + if (WARN_ON(intsize < 2)) > >> + return -EINVAL; > >> + > >> + ret = gpio_request_one(gpio, GPIOF_IN, ctrlr->full_name); > >> + if (ret) > >> + return ret; > > > > So how to figure out if a device is already requesting this GPIO > > on some orthogonal axis? > > I really don't think that is necessary. Hopefully, my other email [1] > elaborates on why. Let me know if this makes sense. I would agree here. If the irq specified happens to be a GPIO; then the onus is on the GPIO/IRQ controller driver to make sure that GPIO is actually set up to work as an IRQ. g.