linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Anton Vorontsov <avorontsov@ru.mvista.com>
To: "Steven A. Falco" <sfalco@harris.com>
Cc: "linuxppc-dev@ozlabs.org" <linuxppc-dev@ozlabs.org>
Subject: Re: pca9539 I2C gpio expander
Date: Wed, 15 Oct 2008 01:21:47 +0400	[thread overview]
Message-ID: <20081014212147.GA7483@oksana.dev.rtsoft.ru> (raw)
In-Reply-To: <48F4E091.7080105@harris.com>

On Tue, Oct 14, 2008 at 02:10:25PM -0400, Steven A. Falco wrote:
> I am attempting to use a pca9539 I2C gpio driver on a PPC440EPx board.  The
> driver is "drivers/gpio/pca953x.c".  I've added an entry to the .dts file:
> 
> IIC0: i2c@ef600700 {
> 	compatible = "ibm,iic-440epx", "ibm,iic";
> 	...
> 	pca9539@76 {
> 		compatible = "ti,pca9539";
> 		reg = <76>;
> 	};
> };
> 
> of_register_i2c_devices sees this entry and calls i2c_new_device.
> i2c_new_device copies info->platform_data to client->dev.platform_data, but
> I think that this structure is empty (at least I don't see where
> of_register_i2c_devices would set it).

Currently there is no way to pass platform_data to I2C devices
(using device tree, that is). This is known limitation.

> pca953x_probe is eventually called, but it expects to find its "lowest gpio
> number" in client->dev.platform_data->gpio_base, which has not been set.  So
> pca953x_probe returns -ENODEV.
> 
> I don't understand where the disconnect is.  Should I be able to use the
> pca953x.c driver, or is it somehow incompatible?
> 
> If it is incompatible, is there a strategy for making it compatible?

We should write OF bindings for that driver. Unfortunately
this isn't easy for I2C devices, since they don't (and probably
should not) know anything about OF...

I have some ideas on how to teach all the I2C GPIO drivers
about the OF (without actually showing them any OF details).
I'll post it soon.

-- 
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2

      reply	other threads:[~2008-10-14 21:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-14 18:10 pca9539 I2C gpio expander Steven A. Falco
2008-10-14 21:21 ` Anton Vorontsov [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=20081014212147.GA7483@oksana.dev.rtsoft.ru \
    --to=avorontsov@ru.mvista.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=sfalco@harris.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).