* Using archaic I2C with OF
@ 2009-05-01 13:04 Gary Thomas
2009-05-01 14:39 ` Jon Smirl
0 siblings, 1 reply; 8+ messages in thread
From: Gary Thomas @ 2009-05-01 13:04 UTC (permalink / raw)
To: Linux PPC Development
I'd like to use an existing I2C driver (a touchscreen device)
with my 834x based platform. How do I arrange to provide
platform data (i2c_client->dev.platform_data) from my OF world?
--
------------------------------------------------------------
Gary Thomas | Consulting for the
MLB Associates | Embedded world
------------------------------------------------------------
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Using archaic I2C with OF
2009-05-01 13:04 Using archaic I2C with OF Gary Thomas
@ 2009-05-01 14:39 ` Jon Smirl
2009-05-01 14:39 ` Jon Smirl
0 siblings, 1 reply; 8+ messages in thread
From: Jon Smirl @ 2009-05-01 14:39 UTC (permalink / raw)
To: Gary Thomas; +Cc: Linux PPC Development
On Fri, May 1, 2009 at 9:04 AM, Gary Thomas <gary@mlbassoc.com> wrote:
> I'd like to use an existing I2C driver (a touchscreen device)
> with my 834x based platform. =A0How do I arrange to provide
> platform data (i2c_client->dev.platform_data) from my OF world?
It is easier to convert the i2c driver to work in the current model.
--=20
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Using archaic I2C with OF
2009-05-01 14:39 ` Jon Smirl
@ 2009-05-01 14:39 ` Jon Smirl
2009-05-01 14:50 ` Gary Thomas
0 siblings, 1 reply; 8+ messages in thread
From: Jon Smirl @ 2009-05-01 14:39 UTC (permalink / raw)
To: Gary Thomas; +Cc: Linux PPC Development
On Fri, May 1, 2009 at 10:39 AM, Jon Smirl <jonsmirl@gmail.com> wrote:
> On Fri, May 1, 2009 at 9:04 AM, Gary Thomas <gary@mlbassoc.com> wrote:
>> I'd like to use an existing I2C driver (a touchscreen device)
>> with my 834x based platform. =A0How do I arrange to provide
>> platform data (i2c_client->dev.platform_data) from my OF world?
>
> It is easier to convert the i2c driver to work in the current model.
All in-tree drivers have already been converted.
>
> --
> Jon Smirl
> jonsmirl@gmail.com
>
--=20
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Using archaic I2C with OF
2009-05-01 14:39 ` Jon Smirl
@ 2009-05-01 14:50 ` Gary Thomas
2009-05-01 14:55 ` Jon Smirl
0 siblings, 1 reply; 8+ messages in thread
From: Gary Thomas @ 2009-05-01 14:50 UTC (permalink / raw)
To: Jon Smirl; +Cc: Linux PPC Development
Jon Smirl wrote:
> On Fri, May 1, 2009 at 10:39 AM, Jon Smirl <jonsmirl@gmail.com> wrote:
>> On Fri, May 1, 2009 at 9:04 AM, Gary Thomas <gary@mlbassoc.com> wrote:
>>> I'd like to use an existing I2C driver (a touchscreen device)
>>> with my 834x based platform. How do I arrange to provide
>>> platform data (i2c_client->dev.platform_data) from my OF world?
>> It is easier to convert the i2c driver to work in the current model.
>
> All in-tree drivers have already been converted.
I'm looking at drivers/input/touchscreen/tsc2007.c (the one I need)
from Kumar's 'next' tree. It most definitely still uses the old
model.
Can you suggest another place to look?
--
------------------------------------------------------------
Gary Thomas | Consulting for the
MLB Associates | Embedded world
------------------------------------------------------------
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Using archaic I2C with OF
2009-05-01 14:50 ` Gary Thomas
@ 2009-05-01 14:55 ` Jon Smirl
2009-05-01 16:04 ` Wolfram Sang
0 siblings, 1 reply; 8+ messages in thread
From: Jon Smirl @ 2009-05-01 14:55 UTC (permalink / raw)
To: Gary Thomas; +Cc: Linux PPC Development
On Fri, May 1, 2009 at 10:50 AM, Gary Thomas <gary@mlbassoc.com> wrote:
> Jon Smirl wrote:
>> On Fri, May 1, 2009 at 10:39 AM, Jon Smirl <jonsmirl@gmail.com> wrote:
>>> On Fri, May 1, 2009 at 9:04 AM, Gary Thomas <gary@mlbassoc.com> wrote:
>>>> I'd like to use an existing I2C driver (a touchscreen device)
>>>> with my 834x based platform. =A0How do I arrange to provide
>>>> platform data (i2c_client->dev.platform_data) from my OF world?
>>> It is easier to convert the i2c driver to work in the current model.
>>
>> All in-tree drivers have already been converted.
>
> I'm looking at drivers/input/touchscreen/tsc2007.c (the one I need)
> from Kumar's 'next' tree. =A0It most definitely still uses the old
> model.
>
> Can you suggest another place to look?
Post this on the i2c list. Jean has made an effort to convert all
drivers. He must have missed that one.
>
> --
> ------------------------------------------------------------
> Gary Thomas =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0Consulting for the
> MLB Associates =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A0Embedded world
> ------------------------------------------------------------
>
--=20
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Using archaic I2C with OF
2009-05-01 14:55 ` Jon Smirl
@ 2009-05-01 16:04 ` Wolfram Sang
2009-05-01 16:08 ` Gary Thomas
2009-05-04 12:19 ` Gary Thomas
0 siblings, 2 replies; 8+ messages in thread
From: Wolfram Sang @ 2009-05-01 16:04 UTC (permalink / raw)
To: Jon Smirl; +Cc: Linux PPC Development, Gary Thomas
[-- Attachment #1: Type: text/plain, Size: 998 bytes --]
> Post this on the i2c list. Jean has made an effort to convert all
> drivers. He must have missed that one.
What Jean did was converting all drivers who used the legacy i2c-binding to use
the new binding which is a lot better suited to the driver model. The above
mentioned driver already uses the new binding.
The problem coming up here is another issue and also long standing and not yet
solved. There are drivers which require platform_data with function pointers.
You cannot encode function pointers to the device tree.
One solution is to create a custom driver for your board with the needed
specific function and create a platform device from there. Sometimes it
works to add a bit more info to the device tree (e.g. some gpios) and
parse it via an of_wrapper around the platform driver.
Regards,
Wolfram
--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Using archaic I2C with OF
2009-05-01 16:04 ` Wolfram Sang
@ 2009-05-01 16:08 ` Gary Thomas
2009-05-04 12:19 ` Gary Thomas
1 sibling, 0 replies; 8+ messages in thread
From: Gary Thomas @ 2009-05-01 16:08 UTC (permalink / raw)
To: Wolfram Sang; +Cc: Linux PPC Development
Wolfram Sang wrote:
>> Post this on the i2c list. Jean has made an effort to convert all
>> drivers. He must have missed that one.
>
> What Jean did was converting all drivers who used the legacy i2c-binding to use
> the new binding which is a lot better suited to the driver model. The above
> mentioned driver already uses the new binding.
>
> The problem coming up here is another issue and also long standing and not yet
> solved. There are drivers which require platform_data with function pointers.
> You cannot encode function pointers to the device tree.
>
> One solution is to create a custom driver for your board with the needed
> specific function and create a platform device from there. Sometimes it
> works to add a bit more info to the device tree (e.g. some gpios) and
> parse it via an of_wrapper around the platform driver.
Pretty much as I expected.
Are there examples of how to do this? In particular how to
correlate a GPIO (with interrupt) to another (I2C) device?
--
------------------------------------------------------------
Gary Thomas | Consulting for the
MLB Associates | Embedded world
------------------------------------------------------------
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Using archaic I2C with OF
2009-05-01 16:04 ` Wolfram Sang
2009-05-01 16:08 ` Gary Thomas
@ 2009-05-04 12:19 ` Gary Thomas
1 sibling, 0 replies; 8+ messages in thread
From: Gary Thomas @ 2009-05-04 12:19 UTC (permalink / raw)
To: Wolfram Sang; +Cc: Linux PPC Development
Wolfram Sang wrote:
>> Post this on the i2c list. Jean has made an effort to convert all
>> drivers. He must have missed that one.
>>
>
> What Jean did was converting all drivers who used the legacy i2c-binding to use
> the new binding which is a lot better suited to the driver model. The above
> mentioned driver already uses the new binding.
>
> The problem coming up here is another issue and also long standing and not yet
> solved. There are drivers which require platform_data with function pointers.
> You cannot encode function pointers to the device tree.
>
> One solution is to create a custom driver for your board with the needed
> specific function and create a platform device from there. Sometimes it
> works to add a bit more info to the device tree (e.g. some gpios) and
> parse it via an of_wrapper around the platform driver.
>
So somehow, I need to create a platform driver, possibly inside an
of_wrapper, which
eventually instantiates an I2C device on a particular bus, with my
specific platform
data.
Sorry, but I'm lost here. How do I untangle this maze of twisty little
passages?
--
------------------------------------------------------------
Gary Thomas | Consulting for the
MLB Associates | Embedded world
------------------------------------------------------------
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2009-05-04 12:19 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-01 13:04 Using archaic I2C with OF Gary Thomas
2009-05-01 14:39 ` Jon Smirl
2009-05-01 14:39 ` Jon Smirl
2009-05-01 14:50 ` Gary Thomas
2009-05-01 14:55 ` Jon Smirl
2009-05-01 16:04 ` Wolfram Sang
2009-05-01 16:08 ` Gary Thomas
2009-05-04 12:19 ` Gary Thomas
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).