diff mbox

I2C: BCM2835: Linking platform nodes to adapter nodes

Message ID 529303EE.4080606@koalo.de
State Changes Requested
Headers show

Commit Message

Florian Meier Nov. 25, 2013, 8:01 a.m. UTC
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@koalo.de>
---

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(+)


-- 1.7.9.5
--
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

Comments

Stephen Warren Nov. 25, 2013, 5:03 p.m. UTC | #1
On 11/25/2013 01:01 AM, Florian Meier wrote:
> 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.

Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Tested-by: Stephen Warren <swarren@wwwdotorg.org>

(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:-)
--
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
Wolfram Sang Nov. 26, 2013, 12:57 p.m. UTC | #2
On Mon, Nov 25, 2013 at 09:01:50AM +0100, Florian Meier wrote:
> 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@koalo.de>

Malformed patch, please resend.
Wolfram Sang Nov. 28, 2013, 8:50 a.m. UTC | #3
On Mon, Nov 25, 2013 at 09:01:50AM +0100, Florian Meier wrote:
> 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@koalo.de>

Fixed up for you and applied to for-current. But PLEASE fix your mailer!
Florian Meier Nov. 28, 2013, 8:56 a.m. UTC | #4
Thank you very much!
I am sorry and will try to make it better next time.

On 11/28/2013 09:50 AM, Wolfram Sang wrote:
> On Mon, Nov 25, 2013 at 09:01:50AM +0100, Florian Meier wrote:
>> 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@koalo.de>
> 
> Fixed up for you and applied to for-current. But PLEASE fix your mailer!
> 
--
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
diff mbox

Patch

diff --git a/drivers/i2c/busses/i2c-bcm2835.c
b/drivers/i2c/busses/i2c-bcm2835.c
index ea4b08f..8beecfa 100644
--- a/drivers/i2c/busses/i2c-bcm2835.c
+++ b/drivers/i2c/busses/i2c-bcm2835.c
@@ -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);