i2c: sirf: register i2c_client from dt child-nodes in probe entry
PATCH 1/2 i2c: sirf: register i2c_client from dt child-nodes in probe entry
From: Barry Song <[email protected]>
in probe() entry of i2c_driver, set the of node of adapter and call of_i2c_register_devices to register all i2c_client from dt child-nodes
--- drivers/i2c/busses/i2c-sirf.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/i2c/busses/i2c-sirf.c +4 -0
@@ -12,6 +12,7 @@#include <linux/slab.h> #include <linux/platform_device.h> #include <linux/i2c.h> +#include <linux/of_i2c.h> #include <linux/clk.h> #include <linux/err.h> #include <linux/io.h>
@@ -328,6 +329,7 @@ static int __devinit i2c_sirfsoc_probe(struct platform_device *pdev) adap->algo = &i2c_sirfsoc_algo; adap->algo_data = siic; + adap->dev.of_node = pdev->dev.of_node; adap->dev.parent = &pdev->dev; adap->nr = pdev->id;
@@ -371,6 +373,8 @@ static int __devinit i2c_sirfsoc_probe(struct platform_device *pdev)clk_disable (clk); +of_i2c_register_devices (adap); +dev_info (&pdev->dev," I2C adapter ready to operate\n" );return 0 ;
Signature · 6 lines
1.7.5.4 Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog
PATCH 2/2 i2c: sirf: add support for new SiRFmarco SMP SoC
From: Barry Song <[email protected]>
the driver is also compatible with SiRFmarco except SiRFprimaII, so simply add "sirf,marco-i2c" to OF match table.
--- drivers/i2c/busses/i2c-sirf.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/i2c/busses/i2c-sirf.c +1 -0
@@ -439,6 +439,7 @@ static const struct dev_pm_ops i2c_sirfsoc_pm_ops = {static const struct of_device_id sirfsoc_i2c_of_match[]__devinitconst = { { .compatible ="sirf,prima2-i2c" , }, + { .compatible ="sirf,marco-i2c" , }, {}, };MODULE_DEVICE_TABLE (of, sirfsoc_i2c_of_match);
Signature · 6 lines
1.7.5.4 Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog
Wolfram Sang
AppliedPATCH 1/2 i2c: sirf: register i2c_client from dt child-nodes in probe entry
In reply to Barry SongQuoted 7 lines · Barry Song
From: Barry Song <[email protected]>
in
probe()entry ofi2c_driver, set the of node of adapter and callof_i2c_register_devicesto register alli2c_clientfrom dt child-nodesSigned-off-by Barry Song <[email protected]>
Thanks, applied to for-current.
PATCH 2/2 i2c: sirf: add support for new SiRFmarco SMP SoC
In reply to Barry SongQuoted 6 lines · Barry Song
From: Barry Song <[email protected]>
the driver is also compatible with SiRFmarco except SiRFprimaII, so simply add "sirf,marco-i2c" to OF match table.
Signed-off-by Barry Song <[email protected]>
Why can't you use the existing compatible entry as a fallback like in:
compatible = "sirf,marco-i2c", "sirf,prima2-i2c";
?
Quoted 17 lines
--- drivers/i2c/busses/i2c-sirf.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)drivers/i2c/busses/i2c-sirf.c +1
-0@@ -439,6 +439,7 @@ static const struct dev_pm_ops i2c_sirfsoc_pm_ops = {static const struct of_device_id sirfsoc_i2c_of_match[]__devinitconst = { { .compatible ="sirf,prima2-i2c" , }, + { .compatible ="sirf,marco-i2c" , }, {}, };MODULE_DEVICE_TABLE (of, sirfsoc_i2c_of_match);
PATCH 2/2 i2c: sirf: add support for new SiRFmarco SMP SoC
2013/1/24 Wolfram Sang <[email protected]>:
Quoted 6 lines · Barry Song
Quoted 5 lines
From: Barry Song <[email protected]>
the driver is also compatible with SiRFmarco except SiRFprimaII, so simply add "sirf,marco-i2c" to OF match table.
Quoted 6 lines
Quoted 1 line
Signed-off-by Barry Song <[email protected]>Why can't you use the existing compatible entry as a fallback like in:
compatible = "sirf,marco-i2c", "sirf,prima2-i2c";?
ok. let's hold on this one.
i was hoping registers layout/work mode would have some changes in the final marco design as marco chip was still a fpga.
i have been sure spi will have a new high speed mode, for i2c, no message for the moment.
Quoted 11 lines
Quoted 11 lines
--- drivers/i2c/busses/i2c-sirf.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)drivers/i2c/busses/i2c-sirf.c +0
-0@@ -439,6 +439,7 @@ static const struct dev_pm_ops i2c_sirfsoc_pm_ops = {
Quoted 7 lines
drivers/i2c/busses/i2c-sirf.c static const struct dev_pm_ops i2c_sirfsoc_pm_ops = {
Quoted 7 lines
drivers/i2c/busses/i2c-sirf.c +1
-1static const struct of_device_id sirfsoc_i2c_of_match[]__devinitconst = { { .compatible ="sirf,prima2-i2c" , }, + { .compatible ="sirf,marco-i2c" , }, {}, };MODULE_DEVICE_TABLE (of, sirfsoc_i2c_of_match); --
-barry