devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pawel Moll <pawel.moll@arm.com>
To: Jacek Anaszewski <j.anaszewski@samsung.com>
Cc: Mark Rutland <Mark.Rutland@arm.com>,
	"swarren@wwwdotorg.org" <swarren@wwwdotorg.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	Jonathan Cameron <jic23@kernel.org>,
	"maxime.ripard@free-electrons.com"
	<maxime.ripard@free-electrons.com>,
	"lars@metafoo.de" <lars@metafoo.de>,
	"l.czerwinski@samsung.com" <l.czerwinski@samsung.com>,
	"rob.herring@calxeda.com" <rob.herring@calxeda.com>,
	"ian.campbell@citrix.com" <ian.campbell@citrix.com>,
	"s.nawrocki@samsung.com" <s.nawrocki@samsung.com>,
	Wolfram Sang <wsa@the-dreams.de>,
	linux-i2c@vger.kernel.org
Subject: Re: passing two interrupts two an I2C driver
Date: Wed, 21 Aug 2013 13:37:04 +0100	[thread overview]
Message-ID: <1377088624.10707.23.camel@hornet> (raw)
In-Reply-To: <5214AA52.2060209@samsung.com>

[resending, this time really copying Wolfram and linux-i2c...]

On Wed, 2013-08-21 at 12:53 +0100, Jacek Anaszewski wrote:
>  From what I've figured out in order to obtain the interrupt id
> by name the function
> 
> platform_get_irq_by_name(struct platform_device *dev, const char *name)
> 
> has to be exploited. Unfortunately required platform_device structure
> is not available in the struct i2c_client

Well, platform devices belong to platform bus, nothing to do with I2C.
Platform devices are associated with an array of named resources and the
code creating such devices from the DT nodes (of_device_alloc()) do the
necessary magic.

>  that is passed to the
> probe function of an i2c driver. Is there some different way to parse
> the interrupt-names property from the I2C driver?

Interesting. Very interesting indeed. It seems (at least at the first
sight) that I2C framework assumes that only one interrupt can be
generated by a I2C device:

struct i2c_client {                                                                         
[...]
        int irq;                        /* irq issued by device         */                  
[...]
};                                                                               

So let me ask such question... If Device Tree didn't exist, how would
you make drive such device? I guess it would require some custom code,
as struct i2c_board_info has single int irq as well... If this is the
case, you could parse the irq properties in a similar way as done in
of_irq_to_resource() in drivers/of/irq.c. Doesn't like the optimal
solution, though...

I've copied Wolfram and the I2C mailing list in hope of them shedding
some light at the matter.

Pawel




  parent reply	other threads:[~2013-08-21 12:37 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <520E3B8F.9010800@samsung.com>
     [not found] ` <520E7417.3090606@wwwdotorg.org>
2013-08-19  8:42   ` passing two interrupts two an I2C driver Mark Rutland
2013-08-19 16:09     ` Stephen Warren
2013-08-20  8:44       ` Mark Rutland
2013-08-20 16:25         ` Stephen Warren
2013-08-21  8:54           ` Mark Rutland
2013-08-22 12:45             ` Rob Herring
2013-08-22 20:26               ` Stephen Warren
2013-08-21 11:53     ` Jacek Anaszewski
2013-08-21 12:34       ` Pawel Moll
2013-08-21 12:37       ` Pawel Moll [this message]
2013-08-21 17:54         ` Mark Brown
2013-08-22  9:23           ` Pawel Moll
2013-08-22 11:26             ` Mark Brown
2013-08-22 11:44               ` Pawel Moll
2013-08-22 13:19                 ` 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=1377088624.10707.23.camel@hornet \
    --to=pawel.moll@arm.com \
    --cc=Mark.Rutland@arm.com \
    --cc=devicetree@vger.kernel.org \
    --cc=ian.campbell@citrix.com \
    --cc=j.anaszewski@samsung.com \
    --cc=jic23@kernel.org \
    --cc=l.czerwinski@samsung.com \
    --cc=lars@metafoo.de \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=maxime.ripard@free-electrons.com \
    --cc=rob.herring@calxeda.com \
    --cc=s.nawrocki@samsung.com \
    --cc=swarren@wwwdotorg.org \
    --cc=wsa@the-dreams.de \
    /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).