From: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
To: Mike Frysinger <vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
uclinux-dist-devel-ZG0+EudsQA8dtHy/vicBwGD2FQJk+8+b@public.gmane.org,
device-drivers-devel-ZG0+EudsQA8dtHy/vicBwGD2FQJk+8+b@public.gmane.org,
Michael Hennerich
<michael.hennerich-OyLXuOCK7orQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH] i2c: add irq_flags to board info
Date: Mon, 18 Oct 2010 10:36:10 +0200 [thread overview]
Message-ID: <20101018103610.77b7e605@endymion.delvare> (raw)
In-Reply-To: <1287359019-1476-1-git-send-email-vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
Hi Mike,
On Sun, 17 Oct 2010 19:43:39 -0400, Mike Frysinger wrote:
> From: Michael Hennerich <michael.hennerich-OyLXuOCK7orQT0dZR+AlfA@public.gmane.org>
>
> These flags can be optionally defined - slave drivers may use them as
> flags argument for request_irq(). In case they are left uninitialized
> they will default to zero, and therefore shouldn't cause problems.
>
> This allows us to avoid having to add dedicated platform init code just
> to call set_irq_type()
Do you have examples of this? Can we see a preview of the amount of
cleanups this patch would allow?
> -- which doesn't work very well when coupled with
> module drivers.
I don't quite get what you mean here.
> It also matches behavior of some other frameworks like
> IDE and UIO.
This is certainly a good point.
>
> Signed-off-by: Michael Hennerich <michael.hennerich-OyLXuOCK7orQT0dZR+AlfA@public.gmane.org>
> Signed-off-by: Mike Frysinger <vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
> ---
> drivers/i2c/i2c-core.c | 1 +
> include/linux/i2c.h | 4 ++++
> 2 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
> index bea4c50..830528f 100644
> --- a/drivers/i2c/i2c-core.c
> +++ b/drivers/i2c/i2c-core.c
> @@ -540,6 +540,7 @@ i2c_new_device(struct i2c_adapter *adap, struct i2c_board_info const *info)
> client->flags = info->flags;
> client->addr = info->addr;
> client->irq = info->irq;
> + client->irq_flags = info->irq_flags;
>
> strlcpy(client->name, info->type, sizeof(client->name));
>
> diff --git a/include/linux/i2c.h b/include/linux/i2c.h
> index 4bae0b7..e6248c1 100644
> --- a/include/linux/i2c.h
> +++ b/include/linux/i2c.h
> @@ -189,6 +189,7 @@ struct i2c_driver {
> * @driver: device's driver, hence pointer to access routines
> * @dev: Driver model device node for the slave.
> * @irq: indicates the IRQ generated by this device (if any)
> + * @irq_flags: The flags passed to request_irq()
> * @detected: member of an i2c_driver.clients list or i2c-core's
> * userspace_devices list
> *
> @@ -206,6 +207,7 @@ struct i2c_client {
> struct i2c_driver *driver; /* and our access routines */
> struct device dev; /* the device structure */
> int irq; /* irq issued by device */
> + unsigned long irq_flags; /* flags used by the irq */
> struct list_head detected;
> };
> #define to_i2c_client(d) container_of(d, struct i2c_client, dev)
> @@ -237,6 +239,7 @@ static inline void i2c_set_clientdata(struct i2c_client *dev, void *data)
> * @archdata: copied into i2c_client.dev.archdata
> * @of_node: pointer to OpenFirmware device node
> * @irq: stored in i2c_client.irq
> + * @irq_flags: The flags passed to request_irq() for i2c_client.irq
> *
> * I2C doesn't actually support hardware probing, although controllers and
> * devices may be able to use I2C_SMBUS_QUICK to tell whether or not there's
> @@ -259,6 +262,7 @@ struct i2c_board_info {
> struct device_node *of_node;
> #endif
> int irq;
> + unsigned long irq_flags;
> };
>
> /**
--
Jean Delvare
next prev parent reply other threads:[~2010-10-18 8:36 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-17 23:43 [PATCH] i2c: add irq_flags to board info Mike Frysinger
[not found] ` <1287359019-1476-1-git-send-email-vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2010-10-18 8:36 ` Jean Delvare [this message]
[not found] ` <20101018103610.77b7e605-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
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
[not found] ` <544AC56F16B56944AEC3BD4E3D5917713094520FA6-gpnycfiEEVR7xzP2fcxY8GoKb0G9Rp+C@public.gmane.org>
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:46 ` Hennerich, Michael
2010-10-18 19:51 ` [Device-drivers-devel] " Mike Frysinger
[not found] ` <AANLkTi=fAYqxsGre9kOt9Z8nDXZ9JFjZtKUiMrE3Qn9b-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-10-25 0:45 ` Ben Dooks
[not found] ` <20101025004541.GD21564-SMNkleLxa3Z6Wcw2j4pizdi2O/JbrIOy@public.gmane.org>
2010-10-25 14:12 ` Jonathan Cameron
2011-01-07 1:33 ` Mike Frysinger
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=20101018103610.77b7e605@endymion.delvare \
--to=khali-puyad+kwke1g9huczpvpmw@public.gmane.org \
--cc=device-drivers-devel-ZG0+EudsQA8dtHy/vicBwGD2FQJk+8+b@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=michael.hennerich-OyLXuOCK7orQT0dZR+AlfA@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox