public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Anton Vorontsov <cbou@mail.ru>
To: linux-kernel@vger.kernel.org, kernel-discuss@handhelds.org
Subject: Re: [PATCH 2/7] [RFC] Common power driver for Linux gadgets
Date: Tue, 17 Apr 2007 00:43:32 +0400	[thread overview]
Message-ID: <20070416204332.GA4978@zarina> (raw)
In-Reply-To: <20070416201615.GB19713@flint.arm.linux.org.uk>

On Mon, Apr 16, 2007 at 09:16:15PM +0100, Russell King wrote:
> On Fri, Apr 13, 2007 at 05:50:01PM +0400, Anton Vorontsov wrote:
> > +/*
> > + * include/linux/ioport.h does not provide flags for generic IRQ trigger
> > + * types. So, we're using "ISA PnP IRQ specific bits", and converting them.
> > + */
> > +static unsigned int get_irq_flags(struct resource *res)
> > +{
> > +	unsigned int flags = IRQF_DISABLED;
> > +
> > +	if (res->flags & IORESOURCE_IRQ_HIGHEDGE)
> > +		flags |= IRQF_TRIGGER_RISING;
> > +	if (res->flags & IORESOURCE_IRQ_LOWEDGE)
> > +		flags |= IRQF_TRIGGER_FALLING;
> > +	if (res->flags & IORESOURCE_IRQ_HIGHLEVEL)
> > +		flags |= IRQF_TRIGGER_HIGH;
> > +	if (res->flags & IORESOURCE_IRQ_LOWLEVEL)
> > +		flags |= IRQF_TRIGGER_LOW;
> > +	if (res->flags & IORESOURCE_IRQ_SHAREABLE)
> > +		flags |= IRQF_SHARED;
> > +
> > +	return flags;
> > +}
> 
> Eww.  The IORESOURCE IRQ bits are intentionally chosen to be the same as
> the IRQF bits:

> include/linux/interrupt.h:
> /*
>  * These correspond to the IORESOURCE_IRQ_* defines in

Yeah, few days ago I noticed it myself, already fixed it in my tree.
Thanks anyway.

>  * linux/ioport.h to select the interrupt line behaviour.  When
>  * requesting an interrupt without specifying a IRQF_TRIGGER, the
>  * setting should be assumed to be "as already configured", which
>  * may be as per machine or firmware initialisation.
>  */
> 
> The exception is IRQF_SHARED which should be a _driver_ choice not a
> _platform_ choice, and therefore makes no sense in your "get_irq_flags"
> definition.

Ugh, I see...

> Plus, if we ever did want to introduce such a function, it should be
> a generic thing, not specific to some random power subsystem de jour.
> 
> -- 
> Russell King
>  Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
>  maintainer of:
> 

Thanks for comments.

-- 
Anton Vorontsov
email: cbou@mail.ru
backup email: ya-cbou@yandex.ru
irc://irc.freenode.org/bd2

  reply	other threads:[~2007-04-16 20:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-11 23:24 [PATCH 2/7] [RFC] Common power driver for Linux gadgets Anton Vorontsov
2007-04-13 13:50 ` Anton Vorontsov
2007-04-16 20:16   ` Russell King
2007-04-16 20:43     ` Anton Vorontsov [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-04-13  6:06 David Brownell
2007-04-13  7:36 ` Anton Vorontsov
2007-04-13  8:42   ` David Brownell
2007-04-13  9:52     ` Anton Vorontsov
2007-04-13 10:25       ` David Brownell
2007-04-13 11:30         ` Anton Vorontsov
2007-05-07  1:39 ` David Brownell
2007-05-07  2:40   ` Anton Vorontsov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070416204332.GA4978@zarina \
    --to=cbou@mail.ru \
    --cc=kernel-discuss@handhelds.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox