All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23-KWPb1pKIrIJaa/9Udqfwiw@public.gmane.org>
To: Ben Dooks <ben-i2c-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>
Cc: Mike Frysinger <vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>,
	Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>,
	"Hennerich,
	Michael"
	<Michael.Hennerich-OyLXuOCK7orQT0dZR+AlfA@public.gmane.org>,
	David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>,
	"uclinux-dist-devel-ZG0+EudsQA8dtHy/vicBwGD2FQJk+8+b@public.gmane.org"
	<uclinux-dist-devel-ZG0+EudsQA8dtHy/vicBwGD2FQJk+8+b@public.gmane.org>,
	"linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"device-drivers-devel-ZG0+EudsQA8dtHy/vicBwGD2FQJk+8+b@public.gmane.org"
	<device-drivers-devel-ZG0+EudsQA8dtHy/vicBwGD2FQJk+8+b@public.gmane.org>,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [Device-drivers-devel] [PATCH] i2c: add irq_flags to board info
Date: Mon, 25 Oct 2010 15:12:24 +0100	[thread overview]
Message-ID: <4CC59048.4060600@cam.ac.uk> (raw)
In-Reply-To: <20101025004541.GD21564-SMNkleLxa3Z6Wcw2j4pizdi2O/JbrIOy@public.gmane.org>

On 10/25/10 01:45, Ben Dooks wrote:
> On Mon, Oct 18, 2010 at 03:51:49PM -0400, Mike Frysinger wrote:
>> On Mon, Oct 18, 2010 at 10:33, Jean Delvare wrote:
>>> Why do we have set_irq_type() if we're not supposed to call it? I am
>>> not claiming to be an expert in the area, but it seems totally
>>> reasonable to me that the same piece of code instantiating an I2C
>>> device is also responsible for setting its IRQ type.
>>
>> but we're back to the same issue mentioned earlier -- you cant have a
>> single kernel build with modules supporting multiple drivers
>> simultaneously.  we like to ship development boards with a single
>> kernel build on it with many modules.  then people can pick the addon
>> boards they wish to prototype with at runtime by plugging in the card
>> and loading the module.
> 
> I also dislike set_irq_type() as it doesn't check whether there is anyone
> registered with the interrupt, which means that you could set the irq
> type of someone else's irq.
> 
> I wonder if we should pass a struct resource instead, in case there
> are multiple interrupt sources, as well as having it registered with
> the right resource systems.
> 
Either works as far as I am concerned. Having seen a large set of drivers
using the flags option (posted to linux-iio yesterday) I'm definitely convinced
some means of allowing devices to match what the board config asks for is useful.

I personally prefer the struct resource option as I have multiple drivers in IIO
which have two interrupts and this is the only reason some of them use platform
data.

Thanks,

Jonathan

WARNING: multiple messages have this Message-ID (diff)
From: Jonathan Cameron <jic23@cam.ac.uk>
To: Ben Dooks <ben-i2c@fluff.org>
Cc: Mike Frysinger <vapier@gentoo.org>,
	Jean Delvare <khali@linux-fr.org>,
	"Hennerich, Michael" <Michael.Hennerich@analog.com>,
	David Brownell <david-b@pacbell.net>,
	"uclinux-dist-devel@blackfin.uclinux.org" 
	<uclinux-dist-devel@blackfin.uclinux.org>,
	"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>,
	"device-drivers-devel@blackfin.uclinux.org" 
	<device-drivers-devel@blackfin.uclinux.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [Device-drivers-devel] [PATCH] i2c: add irq_flags to board info
Date: Mon, 25 Oct 2010 15:12:24 +0100	[thread overview]
Message-ID: <4CC59048.4060600@cam.ac.uk> (raw)
In-Reply-To: <20101025004541.GD21564@trinity.fluff.org>

On 10/25/10 01:45, Ben Dooks wrote:
> On Mon, Oct 18, 2010 at 03:51:49PM -0400, Mike Frysinger wrote:
>> On Mon, Oct 18, 2010 at 10:33, Jean Delvare wrote:
>>> Why do we have set_irq_type() if we're not supposed to call it? I am
>>> not claiming to be an expert in the area, but it seems totally
>>> reasonable to me that the same piece of code instantiating an I2C
>>> device is also responsible for setting its IRQ type.
>>
>> but we're back to the same issue mentioned earlier -- you cant have a
>> single kernel build with modules supporting multiple drivers
>> simultaneously.  we like to ship development boards with a single
>> kernel build on it with many modules.  then people can pick the addon
>> boards they wish to prototype with at runtime by plugging in the card
>> and loading the module.
> 
> I also dislike set_irq_type() as it doesn't check whether there is anyone
> registered with the interrupt, which means that you could set the irq
> type of someone else's irq.
> 
> I wonder if we should pass a struct resource instead, in case there
> are multiple interrupt sources, as well as having it registered with
> the right resource systems.
> 
Either works as far as I am concerned. Having seen a large set of drivers
using the flags option (posted to linux-iio yesterday) I'm definitely convinced
some means of allowing devices to match what the board config asks for is useful.

I personally prefer the struct resource option as I have multiple drivers in IIO
which have two interrupts and this is the only reason some of them use platform
data.

Thanks,

Jonathan

  parent reply	other threads:[~2010-10-25 14:12 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-17 23:43 [PATCH] i2c: add irq_flags to board info Mike Frysinger
2010-10-17 23:43 ` Mike Frysinger
     [not found] ` <1287359019-1476-1-git-send-email-vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2010-10-18  8:36   ` Jean Delvare
2010-10-18  8:36     ` Jean Delvare
     [not found]     ` <20101018103610.77b7e605-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2010-10-18  9:55       ` Hennerich, Michael
2010-10-18  9:55         ` Hennerich, Michael
2010-10-18 12:01         ` Jean Delvare
     [not found]           ` <20101018140136.2b44d29e-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2010-10-18 12:31             ` Hennerich, Michael
2010-10-18 12:31               ` Hennerich, Michael
     [not found]               ` <544AC56F16B56944AEC3BD4E3D5917713094520FA6-gpnycfiEEVR7xzP2fcxY8GoKb0G9Rp+C@public.gmane.org>
2010-10-18 14:33                 ` Jean Delvare
2010-10-18 14:33                   ` Jean Delvare
     [not found]                   ` <20101018163357.659efe25-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2010-10-18 15:38                     ` David Brownell
2010-10-18 15:38                       ` David Brownell
2010-10-18 15:46                     ` Hennerich, Michael
2010-10-18 15:46                       ` Hennerich, Michael
2010-10-18 19:51                     ` [Device-drivers-devel] " Mike Frysinger
2010-10-18 19:51                       ` Mike Frysinger
     [not found]                       ` <AANLkTi=fAYqxsGre9kOt9Z8nDXZ9JFjZtKUiMrE3Qn9b-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-10-25  0:45                         ` Ben Dooks
2010-10-25  0:45                           ` Ben Dooks
     [not found]                           ` <20101025004541.GD21564-SMNkleLxa3Z6Wcw2j4pizdi2O/JbrIOy@public.gmane.org>
2010-10-25 14:12                             ` Jonathan Cameron [this message]
2010-10-25 14:12                               ` Jonathan Cameron
2011-01-07  1:33                             ` Mike Frysinger
2011-01-07  1:33                               ` Mike Frysinger
2010-10-20 18:59       ` Mark Brown
2010-10-20 18:59         ` Mark Brown

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=4CC59048.4060600@cam.ac.uk \
    --to=jic23-kwpb1pkirijaa/9udqfwiw@public.gmane.org \
    --cc=Michael.Hennerich-OyLXuOCK7orQT0dZR+AlfA@public.gmane.org \
    --cc=ben-i2c-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org \
    --cc=david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org \
    --cc=device-drivers-devel-ZG0+EudsQA8dtHy/vicBwGD2FQJk+8+b@public.gmane.org \
    --cc=khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=uclinux-dist-devel-ZG0+EudsQA8dtHy/vicBwGD2FQJk+8+b@public.gmane.org \
    --cc=vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.