From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Message-ID: <9e4733910809160537s67812bf5x3d4d46a384f8237f@mail.gmail.com> Date: Tue, 16 Sep 2008 08:37:55 -0400 From: "Jon Smirl" To: avorontsov@ru.mvista.com Subject: Re: demuxing irqs In-Reply-To: <20080916121740.GA9970@oksana.dev.rtsoft.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 References: <9e4733910809131206j125e7e25of07c19028ac07339@mail.gmail.com> <9e4733910809131554mb0c6660r3bcc993bb2ca082d@mail.gmail.com> <9e4733910809131623pe990495l96b31bd546d9fa6b@mail.gmail.com> <9e4733910809140706i599d70b2q12d3582c7a95498c@mail.gmail.com> <9e4733910809141625u3cd94e7jf05584031be7c1d9@mail.gmail.com> <9e4733910809142006x350e96abs6af304d8807ccd67@mail.gmail.com> <20080916121740.GA9970@oksana.dev.rtsoft.ru> Cc: linuxppc-dev , Roland Dreier List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Tue, Sep 16, 2008 at 8:17 AM, Anton Vorontsov wrote: > Hi Jon, > > On Sun, Sep 14, 2008 at 11:06:23PM -0400, Jon Smirl wrote: >> I have demultiplexing the GPIO interrupts working well enough to make >> my hardware work. But now I've discovered that these interrupts can't >> do what I need. >> >> Anton, Grant - are either of you interested in this code? It's not >> finished but the main ideas are in place. > > I think there is a small issue that ruins the whole approach.. :-/ > >> --- a/arch/powerpc/include/asm/gpio.h >> +++ b/arch/powerpc/include/asm/gpio.h >> @@ -38,17 +38,14 @@ static inline int gpio_cansleep(unsigned int gpio) >> return __gpio_cansleep(gpio); >> } >> >> -/* >> - * Not implemented, yet. >> - */ >> -static inline int gpio_to_irq(unsigned int gpio) >> +static inline unsigned int gpio_to_irq(unsigned int gpio) >> { >> - return -ENOSYS; >> + return gpio; > > "GPIO 0" is valid gpio, but "IRQ 0" isn't valid virq. So you > can't do 1:1 mapping. :-( I changed the GPIO numbers inside of Linux to match the virqs. ofchip->gc.base = IRQ_GPIO_WKUP(0); > > -- > Anton Vorontsov > email: cbouatmailru@gmail.com > irc://irc.freenode.net/bd2 > -- Jon Smirl jonsmirl@gmail.com