i2c-i801: Add device tree support
PATCH 1/1 i2c-i801: Add device tree support
This commit adds support for probing slave devices parsed from the device tree.
--- drivers/i2c/busses/i2c-i801.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/i2c/busses/i2c-i801.c +2 -0
@@ -80,6 +80,7 @@#include <linux/slab.h> #include <linux/wait.h> #include <linux/err.h> +#include <linux/of_i2c.h> #if definedCONFIG_I2C_MUX || definedCONFIG_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);
Signature · 1 line
1.7.11.4
Quoted 4 lines · Thierry Reding
This commit adds support for probing slave devices parsed from the device tree.
Signed-off-by Thierry Reding <[email protected]>
How are the devicetree nodes of the slaves connected to this PCI device which should not have a node itself?
Quoted 31 lines
--- drivers/i2c/busses/i2c-i801.c | 2 ++ 1 file changed, 2 insertions(+)drivers/i2c/busses/i2c-i801.c +2
-0@@ -80,6 +80,7 @@#include <linux/slab.h> #include <linux/wait.h> #include <linux/err.h> +#include <linux/of_i2c.h> #if definedCONFIG_I2C_MUX || definedCONFIG_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);Signature · 6 lines
1.7.11.4 -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ |
Quoted 8 lines · Wolfram Sang
Quoted 4 lines · Thierry Reding
This commit adds support for probing slave devices parsed from the device tree.
Signed-off-by Thierry Reding <[email protected]>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
Quoted 5 lines · Thierry Reding
Quoted 4 lines · Wolfram Sang
Quoted 3 lines · Thierry Reding
This commit adds support for probing slave devices parsed from the device tree.
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
Signed-off-by Thierry Reding <[email protected]>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()andpci_set_bus_of_node(). The latter will eventually callpcibios_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?
Signature · 2 lines
Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ |
Quoted 11 lines · Wolfram Sang
Quoted 10 lines · Thierry Reding
Quoted 8 lines · Wolfram Sang
Quoted 4 lines · Thierry Reding
This commit adds support for probing slave devices parsed from the device tree.
Signed-off-by Thierry Reding <[email protected]>How are the devicetree nodes of the slaves connected to this PCI device which should not have a node itself?
Quoted 7 lines
Quoted 3 lines
The matching is done by
pci_set_of_node()andpci_set_bus_of_node(). The latter will eventually callpcibios_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
Quoted 8 lines
Quoted 4 lines
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.
Quoted 2 lines
arch/x86/platform/ce4100/falconfalls.dtsis 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
Signature · 2 lines
Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ |
Quoted 9 lines · Wolfram Sang
Quoted 8 lines
Quoted 4 lines
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.
Quoted 7 lines
I understand the problem. I was wondering how it has been solved. Thanks for the pointer, I got the idea now.
Quoted 2 lines
arch/x86/platform/ce4100/falconfalls.dtsis 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
Quoted 4 lines · Thierry Reding
This commit adds support for probing slave devices parsed from the device tree.
Signed-off-by Thierry Reding <[email protected]>
Jean, this one is for you, I guess?
Quoted 31 lines
--- drivers/i2c/busses/i2c-i801.c | 2 ++ 1 file changed, 2 insertions(+)drivers/i2c/busses/i2c-i801.c +2
-0@@ -80,6 +80,7 @@#include <linux/slab.h> #include <linux/wait.h> #include <linux/err.h> +#include <linux/of_i2c.h> #if definedCONFIG_I2C_MUX || definedCONFIG_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);Signature · 6 lines
1.7.11.4 -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ |
Quoted 9 lines · Wolfram Sang
Quoted 4 lines · Thierry Reding
This commit adds support for probing slave devices parsed from the device tree.
Signed-off-by Thierry Reding <[email protected]>Acked-by Wolfram Sang <[email protected]>Jean, this one is for you, I guess?
Yes, sorry for the delay, applied.
Signature · 1 line
Jean Delvare