devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@secretlab.ca>
To: Bongkyu Kim <bongkyu.kim@lge.com>, Rob Herring <robherring2@gmail.com>
Cc: devicetree-discuss@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] of/i2c: support more interrupt specifiers
Date: Mon, 26 Nov 2012 14:08:28 +0000	[thread overview]
Message-ID: <20121126140828.555CF3E196F@localhost> (raw)
In-Reply-To: <50B2F9FF.9070308@lge.com>

On Mon, 26 Nov 2012 14:11:27 +0900, Bongkyu Kim <bongkyu.kim@lge.com> wrote:
> On 11/21/2012 10:41 PM, Rob Herring wrote:
> > On 11/21/2012 02:58 AM, Bongkyu Kim wrote:
> >> This patch supports more interrupt specifiers for i2c client.
> > 
> > Why?
> > 
> 
> If we are registering a device has 2 interrupts like the below,
> 	i2c@f9968000 {
> 		lsm330_acc@1D {
> 			compatible = "ST,lsm330_acc",
> 			/* #interrupt-cells = <2> */
> 			interrupts = <73 0x2 65 0x2>,
> 		};
> 	};
> 
> we can't use second irq(65) in a driver because of mapping first
> interrupt only.
> If second irq(65) is mapped, we can use by gpio_to_irq() function at a
> driver.
> So, I think that all interrupt specifiers should be parsed and mapped
> if DT's interrupts property is allowed several interrupt specifiers.

This doesn't look like a very good idea. If more than one interrupt is
provided, then each should be entirely parsed in the driver's .probe() or
in of_i2c_register_devices(), not split across the two. Using
gpio_to_irq() to fetch an irq number that was already calculated and
then thrown away is a bizarre back way of going about it. Plus it is
error-probe because nothing will check that the gpio and interrupts
properties agree.

Either the driver should do all the parsing of 2nd and subsequent irqs,
or the i2c subsystem should be extended to support multiple irq
resources.

g.

      reply	other threads:[~2012-11-26 14:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-21  8:58 [PATCH] of/i2c: support more interrupt specifiers Bongkyu Kim
2012-11-21 13:41 ` Rob Herring
     [not found]   ` <50ACD9F2.40207-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-11-22  5:50     ` 김봉규
2012-11-26  5:11   ` Bongkyu Kim
2012-11-26 14:08     ` Grant Likely [this message]

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=20121126140828.555CF3E196F@localhost \
    --to=grant.likely@secretlab.ca \
    --cc=bongkyu.kim@lge.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robherring2@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).