Using archaic I2C with OF
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?
Signature · 4 lines
------------------------------------------------------------ Gary Thomas | Consulting for the MLB Associates | Embedded world ------------------------------------------------------------
Quoted 3 lines · Gary Thomas
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
[email protected]
Quoted 6 lines · Jon Smirl
Quoted 3 lines · Gary Thomas
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.
Quoted 5 lines
--
Jon Smirl
[email protected]
--=20
Jon Smirl
[email protected]
Quoted 8 lines · Jon Smirl
Quoted 5 lines · Jon Smirl
Quoted 3 lines · Gary Thomas
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?
Signature · 4 lines
------------------------------------------------------------ Gary Thomas | Consulting for the MLB Associates | Embedded world ------------------------------------------------------------
Quoted 8 lines · Gary Thomas
Quoted 7 lines · Jon Smirl
Quoted 5 lines · Jon Smirl
Quoted 3 lines · Gary Thomas
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.
Quoted 7 lines
Quoted 1 line
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.
Quoted 7 lines
--
------------------------------------------------------------
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
[email protected]
Quoted 2 lines
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
Signature · 2 lines
Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ |
Quoted 7 lines · Wolfram Sang
Quoted 2 lines
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.
Quoted 8 lines
The problem coming up here is another issue and also long standing and not yet solved. There are drivers which require
platform_datawith 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_wrapperaround 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?
Signature · 4 lines
------------------------------------------------------------ Gary Thomas | Consulting for the MLB Associates | Embedded world ------------------------------------------------------------
Quoted 8 lines · Wolfram Sang
Quoted 3 lines
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.
Quoted 9 lines
The problem coming up here is another issue and also long standing and not yet solved. There are drivers which require
platform_datawith 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_wrapperaround 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?
Signature · 4 lines
------------------------------------------------------------ Gary Thomas | Consulting for the MLB Associates | Embedded world ------------------------------------------------------------