linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i2c-i801: Add device tree support
@ 2012-08-08  7:06 Thierry Reding
  2012-08-18  9:48 ` Wolfram Sang
  2012-08-21  8:29 ` Wolfram Sang
  0 siblings, 2 replies; 9+ messages in thread
From: Thierry Reding @ 2012-08-08  7:06 UTC (permalink / raw)
  To: Jean Delvare, Ben Dooks, Wolfram Sang
  Cc: Daniel Kurtz, linux-i2c, linux-kernel

This commit adds support for probing slave devices parsed from the
device tree.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
---
 drivers/i2c/busses/i2c-i801.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index 6f00785..b5311cf 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -80,6 +80,7 @@
 #include <linux/slab.h>
 #include <linux/wait.h>
 #include <linux/err.h>
+#include <linux/of_i2c.h>
 
 #if defined CONFIG_I2C_MUX || defined CONFIG_I2C_MUX_MODULE
 #include <linux/gpio.h>
@@ -1238,6 +1239,7 @@ static int __devinit i801_probe(struct pci_dev *dev,
 		goto exit_free_irq;
 	}
 
+	of_i2c_register_devices(&priv->adapter);
 	i801_probe_optional_slaves(priv);
 	/* We ignore errors - multiplexing is optional */
 	i801_add_mux(priv);
-- 
1.7.11.4


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

* Re: [PATCH] i2c-i801: Add device tree support
  2012-08-08  7:06 [PATCH] i2c-i801: Add device tree support Thierry Reding
@ 2012-08-18  9:48 ` Wolfram Sang
  2012-08-18 11:17   ` Thierry Reding
  2012-08-21  8:29 ` Wolfram Sang
  1 sibling, 1 reply; 9+ messages in thread
From: Wolfram Sang @ 2012-08-18  9:48 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Jean Delvare, Ben Dooks, Daniel Kurtz, linux-i2c, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1514 bytes --]

On Wed, Aug 08, 2012 at 09:06:47AM +0200, Thierry Reding wrote:
> This commit adds support for probing slave devices parsed from the
> device tree.
> 
> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>

How are the devicetree nodes of the slaves connected to this PCI device
which should not have a node itself?

> ---
>  drivers/i2c/busses/i2c-i801.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
> index 6f00785..b5311cf 100644
> --- a/drivers/i2c/busses/i2c-i801.c
> +++ b/drivers/i2c/busses/i2c-i801.c
> @@ -80,6 +80,7 @@
>  #include <linux/slab.h>
>  #include <linux/wait.h>
>  #include <linux/err.h>
> +#include <linux/of_i2c.h>
>  
>  #if defined CONFIG_I2C_MUX || defined CONFIG_I2C_MUX_MODULE
>  #include <linux/gpio.h>
> @@ -1238,6 +1239,7 @@ static int __devinit i801_probe(struct pci_dev *dev,
>  		goto exit_free_irq;
>  	}
>  
> +	of_i2c_register_devices(&priv->adapter);
>  	i801_probe_optional_slaves(priv);
>  	/* We ignore errors - multiplexing is optional */
>  	i801_add_mux(priv);
> -- 
> 1.7.11.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: [PATCH] i2c-i801: Add device tree support
  2012-08-18  9:48 ` Wolfram Sang
@ 2012-08-18 11:17   ` Thierry Reding
  2012-08-18 12:16     ` Wolfram Sang
  0 siblings, 1 reply; 9+ messages in thread
From: Thierry Reding @ 2012-08-18 11:17 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Jean Delvare, Ben Dooks, Daniel Kurtz, linux-i2c, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 628 bytes --]

On Sat, Aug 18, 2012 at 11:48:46AM +0200, Wolfram Sang wrote:
> On Wed, Aug 08, 2012 at 09:06:47AM +0200, Thierry Reding wrote:
> > This commit adds support for probing slave devices parsed from the
> > device tree.
> > 
> > Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
> 
> How are the devicetree nodes of the slaves connected to this PCI device
> which should not have a node itself?

The matching is done by pci_set_of_node() and pci_set_bus_of_node().
The latter will eventually call pcibios_get_phb_of_node(). What makes
you say that PCI devices shouldn't have nodes themselves?

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH] i2c-i801: Add device tree support
  2012-08-18 11:17   ` Thierry Reding
@ 2012-08-18 12:16     ` Wolfram Sang
  2012-08-18 12:35       ` Thierry Reding
  0 siblings, 1 reply; 9+ messages in thread
From: Wolfram Sang @ 2012-08-18 12:16 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Jean Delvare, Ben Dooks, Daniel Kurtz, linux-i2c, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1049 bytes --]

On Sat, Aug 18, 2012 at 01:17:45PM +0200, Thierry Reding wrote:
> On Sat, Aug 18, 2012 at 11:48:46AM +0200, Wolfram Sang wrote:
> > On Wed, Aug 08, 2012 at 09:06:47AM +0200, Thierry Reding wrote:
> > > This commit adds support for probing slave devices parsed from the
> > > device tree.
> > > 
> > > Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
> > 
> > How are the devicetree nodes of the slaves connected to this PCI device
> > which should not have a node itself?
> 
> The matching is done by pci_set_of_node() and pci_set_bus_of_node().
> The latter will eventually call pcibios_get_phb_of_node(). What makes
> you say that PCI devices shouldn't have nodes themselves?

I thought to recall that busses which can be probed at runtime should
not have nodes but should be probed. Maybe that was wrong. Can you point
me to a dts-file with an example?

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: [PATCH] i2c-i801: Add device tree support
  2012-08-18 12:16     ` Wolfram Sang
@ 2012-08-18 12:35       ` Thierry Reding
  2012-08-18 19:01         ` Wolfram Sang
  0 siblings, 1 reply; 9+ messages in thread
From: Thierry Reding @ 2012-08-18 12:35 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Jean Delvare, Ben Dooks, Daniel Kurtz, linux-i2c, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1320 bytes --]

On Sat, Aug 18, 2012 at 02:16:28PM +0200, Wolfram Sang wrote:
> On Sat, Aug 18, 2012 at 01:17:45PM +0200, Thierry Reding wrote:
> > On Sat, Aug 18, 2012 at 11:48:46AM +0200, Wolfram Sang wrote:
> > > On Wed, Aug 08, 2012 at 09:06:47AM +0200, Thierry Reding wrote:
> > > > This commit adds support for probing slave devices parsed from the
> > > > device tree.
> > > > 
> > > > Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
> > > 
> > > How are the devicetree nodes of the slaves connected to this PCI device
> > > which should not have a node itself?
> > 
> > The matching is done by pci_set_of_node() and pci_set_bus_of_node().
> > The latter will eventually call pcibios_get_phb_of_node(). What makes
> > you say that PCI devices shouldn't have nodes themselves?
> 
> I thought to recall that busses which can be probed at runtime should
> not have nodes but should be probed. Maybe that was wrong. Can you point
> me to a dts-file with an example?

That approach doesn't work for I2C controllers, though because you
couldn't attach an slaves to them. The same goes for SPI controllers or
any other dumb busses that can't be probed.

arch/x86/platform/ce4100/falconfalls.dts is an example for an X86
platform where PCI devices have associated device tree nodes.

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH] i2c-i801: Add device tree support
  2012-08-18 12:35       ` Thierry Reding
@ 2012-08-18 19:01         ` Wolfram Sang
  2012-08-20  7:13           ` Thierry Reding
  0 siblings, 1 reply; 9+ messages in thread
From: Wolfram Sang @ 2012-08-18 19:01 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Jean Delvare, Ben Dooks, Daniel Kurtz, linux-i2c, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 902 bytes --]


> > I thought to recall that busses which can be probed at runtime should
> > not have nodes but should be probed. Maybe that was wrong. Can you point
> > me to a dts-file with an example?
> 
> That approach doesn't work for I2C controllers, though because you
> couldn't attach an slaves to them. The same goes for SPI controllers or
> any other dumb busses that can't be probed.

I understand the problem. I was wondering how it has been solved. Thanks
for the pointer, I got the idea now.

> arch/x86/platform/ce4100/falconfalls.dts is an example for an X86
> platform where PCI devices have associated device tree nodes.

Do you intend to send a dts file mainline which needs the patch you sent?

Regards,

   Wolfram

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: [PATCH] i2c-i801: Add device tree support
  2012-08-18 19:01         ` Wolfram Sang
@ 2012-08-20  7:13           ` Thierry Reding
  0 siblings, 0 replies; 9+ messages in thread
From: Thierry Reding @ 2012-08-20  7:13 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Jean Delvare, Ben Dooks, Daniel Kurtz, linux-i2c, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1174 bytes --]

On Sat, Aug 18, 2012 at 09:01:52PM +0200, Wolfram Sang wrote:
> 
> > > I thought to recall that busses which can be probed at runtime should
> > > not have nodes but should be probed. Maybe that was wrong. Can you point
> > > me to a dts-file with an example?
> > 
> > That approach doesn't work for I2C controllers, though because you
> > couldn't attach an slaves to them. The same goes for SPI controllers or
> > any other dumb busses that can't be probed.
> 
> I understand the problem. I was wondering how it has been solved. Thanks
> for the pointer, I got the idea now.
> 
> > arch/x86/platform/ce4100/falconfalls.dts is an example for an X86
> > platform where PCI devices have associated device tree nodes.
> 
> Do you intend to send a dts file mainline which needs the patch you sent?

Yes. I have an x86 platform which has an lm63 temperature sensor
connected to the i801. There are a couple of loose ends that I need to
take care of before I can send the DTS. I can send it for reference, but
it won't be of much use because other things are still missing from the
kernel and I don't know in what timeframe they can be applied.

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH] i2c-i801: Add device tree support
  2012-08-08  7:06 [PATCH] i2c-i801: Add device tree support Thierry Reding
  2012-08-18  9:48 ` Wolfram Sang
@ 2012-08-21  8:29 ` Wolfram Sang
  2012-10-15  7:36   ` Jean Delvare
  1 sibling, 1 reply; 9+ messages in thread
From: Wolfram Sang @ 2012-08-21  8:29 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Jean Delvare, Ben Dooks, Daniel Kurtz, linux-i2c, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1490 bytes --]

On Wed, Aug 08, 2012 at 09:06:47AM +0200, Thierry Reding wrote:
> This commit adds support for probing slave devices parsed from the
> device tree.
> 
> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>

Acked-by: Wolfram Sang <w.sang@pengutronix.de>

Jean, this one is for you, I guess?

> ---
>  drivers/i2c/busses/i2c-i801.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
> index 6f00785..b5311cf 100644
> --- a/drivers/i2c/busses/i2c-i801.c
> +++ b/drivers/i2c/busses/i2c-i801.c
> @@ -80,6 +80,7 @@
>  #include <linux/slab.h>
>  #include <linux/wait.h>
>  #include <linux/err.h>
> +#include <linux/of_i2c.h>
>  
>  #if defined CONFIG_I2C_MUX || defined CONFIG_I2C_MUX_MODULE
>  #include <linux/gpio.h>
> @@ -1238,6 +1239,7 @@ static int __devinit i801_probe(struct pci_dev *dev,
>  		goto exit_free_irq;
>  	}
>  
> +	of_i2c_register_devices(&priv->adapter);
>  	i801_probe_optional_slaves(priv);
>  	/* We ignore errors - multiplexing is optional */
>  	i801_add_mux(priv);
> -- 
> 1.7.11.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: [PATCH] i2c-i801: Add device tree support
  2012-08-21  8:29 ` Wolfram Sang
@ 2012-10-15  7:36   ` Jean Delvare
  0 siblings, 0 replies; 9+ messages in thread
From: Jean Delvare @ 2012-10-15  7:36 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Thierry Reding, Ben Dooks, Daniel Kurtz, linux-i2c, linux-kernel

On Tue, 21 Aug 2012 10:29:06 +0200, Wolfram Sang wrote:
> On Wed, Aug 08, 2012 at 09:06:47AM +0200, Thierry Reding wrote:
> > This commit adds support for probing slave devices parsed from the
> > device tree.
> > 
> > Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
> 
> Acked-by: Wolfram Sang <w.sang@pengutronix.de>
> 
> Jean, this one is for you, I guess?

Yes, sorry for the delay, applied.

-- 
Jean Delvare

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

end of thread, other threads:[~2012-10-15  7:37 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-08  7:06 [PATCH] i2c-i801: Add device tree support Thierry Reding
2012-08-18  9:48 ` Wolfram Sang
2012-08-18 11:17   ` Thierry Reding
2012-08-18 12:16     ` Wolfram Sang
2012-08-18 12:35       ` Thierry Reding
2012-08-18 19:01         ` Wolfram Sang
2012-08-20  7:13           ` Thierry Reding
2012-08-21  8:29 ` Wolfram Sang
2012-10-15  7:36   ` Jean Delvare

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).