public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] I2C: BCM2835: Linking platform nodes to adapter nodes
@ 2013-11-08  9:49 Florian Meier
  2013-11-08 16:59 ` Stephen Warren
  0 siblings, 1 reply; 10+ messages in thread
From: Florian Meier @ 2013-11-08  9:49 UTC (permalink / raw)
  To: Stephen Warren; +Cc: linux-kernel, linux-rpi-kernel, linux-arm-kernel

In order to find I2C devices in the device tree, the platform nodes
have to be known by the I2C core. Analogous to the i2c-omap driver
this requires setting the dev.of_node parameter of the adapter.

Signed-off-by: Florian Meier <florian.meier@koalo.de>
---

I don't know if this is really necessary, but for me it does not work
without this line.

 drivers/i2c/busses/i2c-bcm2835.c |    1 +
 1 file changed, 1 insertion(+)

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

^ permalink raw reply related	[flat|nested] 10+ messages in thread
* [PATCH] I2C: BCM2835: Linking platform nodes to adapter nodes
@ 2013-11-25  8:01 Florian Meier
  2013-11-25 17:03 ` Stephen Warren
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Florian Meier @ 2013-11-25  8:01 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Stephen Warren, linux-kernel@vger.kernel.org, linux-rpi-kernel,
	linux-i2c

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

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

-- 1.7.9.5

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

end of thread, other threads:[~2013-11-28 17:14 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-08  9:49 [PATCH] I2C: BCM2835: Linking platform nodes to adapter nodes Florian Meier
2013-11-08 16:59 ` Stephen Warren
2013-11-26  3:31   ` Stephen Warren
2013-11-26 13:05   ` Charles Keepax
2013-11-28 17:13     ` Mark Brown
  -- strict thread matches above, loose matches on Subject: below --
2013-11-25  8:01 Florian Meier
2013-11-25 17:03 ` Stephen Warren
2013-11-26 12:57 ` Wolfram Sang
2013-11-28  8:50 ` Wolfram Sang
2013-11-28  8:56   ` Florian Meier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox