I2C: BCM2835: Linking platform nodes to adapter nodes
Subsystems (3)
PATCH 1/1 I2C: BCM2835: Linking platform nodes to adapter nodes
In order to find I2C devices in the device tree, the platform nodes have to be known by the I2C core. This requires setting the dev.of_node parameter of the adapter.
---
Since the general approach is not easy enough (see [PATCH] i2c: Fallback to of_node of parent), this patch adds the required line to the bcm2835 bus.
drivers/i2c/busses/i2c-bcm2835.c | 1 + 1 file changed, 1 insertion(+)
(quoted diff) +0 -0
b/drivers/i2c/busses/i2c-bcm2835.c
index ea4b08f..8beecfa 100644
drivers/i2c/busses/i2c-bcm2835.c +0 -0
@@ -299,6 +299,7 @@ static int bcm2835_i2c_probe(struct platform_device
*pdev)
strlcpy(adap->name, "bcm2835 I2C adapter", sizeof(adap->name)); adap->algo = &bcm2835_i2c_algo;
adap->dev.parent = &pdev->dev;
+ adap->dev.of_node = pdev->dev.of_node;
bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_C, 0);
-- 1.7.9.5
Quoted 3 lines · Florian Meier
In order to find I2C devices in the device tree, the platform nodes have to be known by the I2C core. This requires setting the dev.of_node parameter of the adapter.
(Interestingly, I just attached an I2C light sensor to my Pi a couple days back, so ended up needing this commit, and the patches someone else had very recently sent to add DT support to the sensor driver. My timing was impeccable:-)
Quoted 5 lines · Florian Meier
In order to find I2C devices in the device tree, the platform nodes have to be known by the I2C core. This requires setting the dev.of_node parameter of the adapter.
Signed-off-by Florian Meier <florian.meier-oZ8rN/[email protected]>
Malformed patch, please resend.
Quoted 5 lines · Florian Meier
In order to find I2C devices in the device tree, the platform nodes have to be known by the I2C core. This requires setting the dev.of_node parameter of the adapter.
Signed-off-by Florian Meier <florian.meier-oZ8rN/[email protected]>
Fixed up for you and applied to for-current. But PLEASE fix your mailer!
Thank you very much!
I am sorry and will try to make it better next time.
Quoted 9 lines · Wolfram Sang
Quoted 5 lines · Florian Meier
In order to find I2C devices in the device tree, the platform nodes have to be known by the I2C core. This requires setting the dev.of_node parameter of the adapter.
Signed-off-by Florian Meier <[email protected]>Fixed up for you and applied to for-current. But PLEASE fix your mailer!