All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] i2c: sirf: register i2c_client from dt child-nodes in probe entry
@ 2012-12-26  2:30 ` Barry Song
  0 siblings, 0 replies; 10+ messages in thread
From: Barry Song @ 2012-12-26  2:30 UTC (permalink / raw)
  To: w.sang-bIcnvbaLZ9MEGnE8C9+IrQ, ben-linux-elnMNo+KYs3YtjvyW6yDsg
  Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	workgroup.linux-kQvG35nSl+M, Barry Song

From: Barry Song <Baohua.Song-kQvG35nSl+M@public.gmane.org>

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

Signed-off-by: Barry Song <Baohua.Song-kQvG35nSl+M@public.gmane.org>
---
 drivers/i2c/busses/i2c-sirf.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/busses/i2c-sirf.c b/drivers/i2c/busses/i2c-sirf.c
index 5574a47..181d7c2 100644
--- a/drivers/i2c/busses/i2c-sirf.c
+++ b/drivers/i2c/busses/i2c-sirf.c
@@ -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;
-- 
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

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 1/2] i2c: sirf: register i2c_client from dt child-nodes in probe entry
@ 2012-12-26  2:30 ` Barry Song
  0 siblings, 0 replies; 10+ messages in thread
From: Barry Song @ 2012-12-26  2:30 UTC (permalink / raw)
  To: linux-arm-kernel

From: Barry Song <Baohua.Song@csr.com>

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

Signed-off-by: Barry Song <Baohua.Song@csr.com>
---
 drivers/i2c/busses/i2c-sirf.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/busses/i2c-sirf.c b/drivers/i2c/busses/i2c-sirf.c
index 5574a47..181d7c2 100644
--- a/drivers/i2c/busses/i2c-sirf.c
+++ b/drivers/i2c/busses/i2c-sirf.c
@@ -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;
-- 
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

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/2] i2c: sirf: add support for new SiRFmarco SMP SoC
  2012-12-26  2:30 ` Barry Song
@ 2012-12-26  2:30     ` Barry Song
  -1 siblings, 0 replies; 10+ messages in thread
From: Barry Song @ 2012-12-26  2:30 UTC (permalink / raw)
  To: w.sang-bIcnvbaLZ9MEGnE8C9+IrQ, ben-linux-elnMNo+KYs3YtjvyW6yDsg
  Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	workgroup.linux-kQvG35nSl+M, Barry Song

From: Barry Song <Baohua.Song-kQvG35nSl+M@public.gmane.org>

the driver is also compatible with SiRFmarco except SiRFprimaII,
so simply add "sirf,marco-i2c" to OF match table.

Signed-off-by: Barry Song <Baohua.Song-kQvG35nSl+M@public.gmane.org>
---
 drivers/i2c/busses/i2c-sirf.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/busses/i2c-sirf.c b/drivers/i2c/busses/i2c-sirf.c
index 181d7c2..ed38b16 100644
--- a/drivers/i2c/busses/i2c-sirf.c
+++ b/drivers/i2c/busses/i2c-sirf.c
@@ -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);
-- 
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

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/2] i2c: sirf: add support for new SiRFmarco SMP SoC
@ 2012-12-26  2:30     ` Barry Song
  0 siblings, 0 replies; 10+ messages in thread
From: Barry Song @ 2012-12-26  2:30 UTC (permalink / raw)
  To: linux-arm-kernel

From: Barry Song <Baohua.Song@csr.com>

the driver is also compatible with SiRFmarco except SiRFprimaII,
so simply add "sirf,marco-i2c" to OF match table.

Signed-off-by: Barry Song <Baohua.Song@csr.com>
---
 drivers/i2c/busses/i2c-sirf.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/busses/i2c-sirf.c b/drivers/i2c/busses/i2c-sirf.c
index 181d7c2..ed38b16 100644
--- a/drivers/i2c/busses/i2c-sirf.c
+++ b/drivers/i2c/busses/i2c-sirf.c
@@ -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);
-- 
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

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/2] i2c: sirf: register i2c_client from dt child-nodes in probe entry
  2012-12-26  2:30 ` Barry Song
@ 2013-01-23  9:56     ` Wolfram Sang
  -1 siblings, 0 replies; 10+ messages in thread
From: Wolfram Sang @ 2013-01-23  9:56 UTC (permalink / raw)
  To: Barry Song
  Cc: ben-linux-elnMNo+KYs3YtjvyW6yDsg,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	workgroup.linux-kQvG35nSl+M, Barry Song

On Wed, Dec 26, 2012 at 10:30:16AM +0800, Barry Song wrote:
> From: Barry Song <Baohua.Song-kQvG35nSl+M@public.gmane.org>
> 
> 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
> 
> Signed-off-by: Barry Song <Baohua.Song-kQvG35nSl+M@public.gmane.org>

Thanks, applied to for-current.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/2] i2c: sirf: register i2c_client from dt child-nodes in probe entry
@ 2013-01-23  9:56     ` Wolfram Sang
  0 siblings, 0 replies; 10+ messages in thread
From: Wolfram Sang @ 2013-01-23  9:56 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Dec 26, 2012 at 10:30:16AM +0800, Barry Song wrote:
> From: Barry Song <Baohua.Song@csr.com>
> 
> 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
> 
> Signed-off-by: Barry Song <Baohua.Song@csr.com>

Thanks, applied to for-current.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2] i2c: sirf: add support for new SiRFmarco SMP SoC
  2012-12-26  2:30     ` Barry Song
@ 2013-01-24  7:27         ` Wolfram Sang
  -1 siblings, 0 replies; 10+ messages in thread
From: Wolfram Sang @ 2013-01-24  7:27 UTC (permalink / raw)
  To: Barry Song
  Cc: ben-linux-elnMNo+KYs3YtjvyW6yDsg,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	workgroup.linux-kQvG35nSl+M, Barry Song

On Wed, Dec 26, 2012 at 10:30:17AM +0800, Barry Song wrote:
> From: Barry Song <Baohua.Song-kQvG35nSl+M@public.gmane.org>
> 
> the driver is also compatible with SiRFmarco except SiRFprimaII,
> so simply add "sirf,marco-i2c" to OF match table.
> 
> Signed-off-by: Barry Song <Baohua.Song-kQvG35nSl+M@public.gmane.org>

Why can't you use the existing compatible entry as a fallback like in:

	compatible = "sirf,marco-i2c", "sirf,prima2-i2c";
?

> ---
>  drivers/i2c/busses/i2c-sirf.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-sirf.c b/drivers/i2c/busses/i2c-sirf.c
> index 181d7c2..ed38b16 100644
> --- a/drivers/i2c/busses/i2c-sirf.c
> +++ b/drivers/i2c/busses/i2c-sirf.c
> @@ -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);
> -- 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 2/2] i2c: sirf: add support for new SiRFmarco SMP SoC
@ 2013-01-24  7:27         ` Wolfram Sang
  0 siblings, 0 replies; 10+ messages in thread
From: Wolfram Sang @ 2013-01-24  7:27 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Dec 26, 2012 at 10:30:17AM +0800, Barry Song wrote:
> From: Barry Song <Baohua.Song@csr.com>
> 
> the driver is also compatible with SiRFmarco except SiRFprimaII,
> so simply add "sirf,marco-i2c" to OF match table.
> 
> Signed-off-by: Barry Song <Baohua.Song@csr.com>

Why can't you use the existing compatible entry as a fallback like in:

	compatible = "sirf,marco-i2c", "sirf,prima2-i2c";
?

> ---
>  drivers/i2c/busses/i2c-sirf.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-sirf.c b/drivers/i2c/busses/i2c-sirf.c
> index 181d7c2..ed38b16 100644
> --- a/drivers/i2c/busses/i2c-sirf.c
> +++ b/drivers/i2c/busses/i2c-sirf.c
> @@ -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);
> -- 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2] i2c: sirf: add support for new SiRFmarco SMP SoC
  2013-01-24  7:27         ` Wolfram Sang
@ 2013-01-24  7:38             ` Barry Song
  -1 siblings, 0 replies; 10+ messages in thread
From: Barry Song @ 2013-01-24  7:38 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Barry Song, ben-linux-elnMNo+KYs3YtjvyW6yDsg,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	workgroup.linux-kQvG35nSl+M, Barry Song

2013/1/24 Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>:
> On Wed, Dec 26, 2012 at 10:30:17AM +0800, Barry Song wrote:
>> From: Barry Song <Baohua.Song-kQvG35nSl+M@public.gmane.org>
>>
>> the driver is also compatible with SiRFmarco except SiRFprimaII,
>> so simply add "sirf,marco-i2c" to OF match table.
>>
>> Signed-off-by: Barry Song <Baohua.Song-kQvG35nSl+M@public.gmane.org>
>
> 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.

>
>> ---
>>  drivers/i2c/busses/i2c-sirf.c |    1 +
>>  1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/i2c/busses/i2c-sirf.c b/drivers/i2c/busses/i2c-sirf.c
>> index 181d7c2..ed38b16 100644
>> --- a/drivers/i2c/busses/i2c-sirf.c
>> +++ b/drivers/i2c/busses/i2c-sirf.c
>> @@ -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);
>> --

-barry

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 2/2] i2c: sirf: add support for new SiRFmarco SMP SoC
@ 2013-01-24  7:38             ` Barry Song
  0 siblings, 0 replies; 10+ messages in thread
From: Barry Song @ 2013-01-24  7:38 UTC (permalink / raw)
  To: linux-arm-kernel

2013/1/24 Wolfram Sang <w.sang@pengutronix.de>:
> On Wed, Dec 26, 2012 at 10:30:17AM +0800, Barry Song wrote:
>> From: Barry Song <Baohua.Song@csr.com>
>>
>> the driver is also compatible with SiRFmarco except SiRFprimaII,
>> so simply add "sirf,marco-i2c" to OF match table.
>>
>> Signed-off-by: Barry Song <Baohua.Song@csr.com>
>
> 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.

>
>> ---
>>  drivers/i2c/busses/i2c-sirf.c |    1 +
>>  1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/i2c/busses/i2c-sirf.c b/drivers/i2c/busses/i2c-sirf.c
>> index 181d7c2..ed38b16 100644
>> --- a/drivers/i2c/busses/i2c-sirf.c
>> +++ b/drivers/i2c/busses/i2c-sirf.c
>> @@ -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);
>> --

-barry

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-01-24  7:38 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-26  2:30 [PATCH 1/2] i2c: sirf: register i2c_client from dt child-nodes in probe entry Barry Song
2012-12-26  2:30 ` Barry Song
     [not found] ` <1356489017-17737-1-git-send-email-Barry.Song-kQvG35nSl+M@public.gmane.org>
2012-12-26  2:30   ` [PATCH 2/2] i2c: sirf: add support for new SiRFmarco SMP SoC Barry Song
2012-12-26  2:30     ` Barry Song
     [not found]     ` <1356489017-17737-2-git-send-email-Barry.Song-kQvG35nSl+M@public.gmane.org>
2013-01-24  7:27       ` Wolfram Sang
2013-01-24  7:27         ` Wolfram Sang
     [not found]         ` <20130124072736.GJ8364-8EAEigeeuNG034pCzgS/Qg7AFbiQbgqx@public.gmane.org>
2013-01-24  7:38           ` Barry Song
2013-01-24  7:38             ` Barry Song
2013-01-23  9:56   ` [PATCH 1/2] i2c: sirf: register i2c_client from dt child-nodes in probe entry Wolfram Sang
2013-01-23  9:56     ` Wolfram Sang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.