All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] device/driver work
@ 2012-09-11 13:31 Sascha Hauer
  2012-09-11 13:31 ` [PATCH 1/5] mfd mc13xxx: Separate I2C and SPI probe Sascha Hauer
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Sascha Hauer @ 2012-09-11 13:31 UTC (permalink / raw)
  To: barebox

The following patches are contain some misc driver core changes.

Sascha

----------------------------------------------------------------
Sascha Hauer (5):
      mfd mc13xxx: Separate I2C and SPI probe
      SPI: Put SPI devices on their own bus
      I2C: Put I2C devices on their own bus
      driver: rewrite dev_printf as a function
      driver: Add platform_device_id mechanism

 drivers/base/driver.c   |   19 +++++++++++++++++++
 drivers/base/platform.c |   17 ++++++++++++++++-
 drivers/eeprom/at25.c   |    2 +-
 drivers/i2c/i2c.c       |   23 +++++++++++++++++++++++
 drivers/mfd/lp3972.c    |    2 +-
 drivers/mfd/mc13xxx.c   |   28 ++++++++++++++++++----------
 drivers/mfd/mc34704.c   |    4 ++--
 drivers/mfd/mc34708.c   |    4 ++--
 drivers/mfd/mc9sdz60.c  |    2 +-
 drivers/mfd/stmpe-i2c.c |    2 +-
 drivers/mfd/twl4030.c   |    2 +-
 drivers/mfd/twl6030.c   |    2 +-
 drivers/nor/m25p80.c    |    2 +-
 drivers/spi/spi.c       |   24 ++++++++++++++++++++++++
 include/driver.h        |   15 ++++++++++++---
 include/i2c/i2c.h       |    8 ++++++++
 include/spi/spi.h       |    7 +++++++
 17 files changed, 138 insertions(+), 25 deletions(-)


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 1/5] mfd mc13xxx: Separate I2C and SPI probe
  2012-09-11 13:31 [PATCH] device/driver work Sascha Hauer
@ 2012-09-11 13:31 ` Sascha Hauer
  2012-09-11 13:31 ` [PATCH 2/5] SPI: Put SPI devices on their own bus bus Sascha Hauer
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 14+ messages in thread
From: Sascha Hauer @ 2012-09-11 13:31 UTC (permalink / raw)
  To: barebox

Upcoming patches will put I2C/SPI on their own busses with
spi_register_driver / i2c_register_driver which will only
be available if the subsystem is enabled. We could provide
static inlines, but it wouldn't make much sense to compile
a spi/i2c driver if the corresponding subsystem is disabled.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/mfd/mc13xxx.c |   28 ++++++++++++++++++----------
 1 file changed, 18 insertions(+), 10 deletions(-)

diff --git a/drivers/mfd/mc13xxx.c b/drivers/mfd/mc13xxx.c
index 704446d..58394a7 100644
--- a/drivers/mfd/mc13xxx.c
+++ b/drivers/mfd/mc13xxx.c
@@ -336,31 +336,39 @@ static int mc_probe(struct device_d *dev, enum mc13xxx_mode mode)
 	return 0;
 }
 
+#ifdef CONFIG_I2C
 static int mc_i2c_probe(struct device_d *dev)
 {
 	return mc_probe(dev, MC13XXX_MODE_I2C);
 }
 
-static int mc_spi_probe(struct device_d *dev)
-{
-	return mc_probe(dev, MC13XXX_MODE_SPI);
-}
-
 static struct driver_d mc_i2c_driver = {
 	.name  = "mc13xxx-i2c",
 	.probe = mc_i2c_probe,
 };
 
+static int mc_i2c_init(void)
+{
+	return register_driver(&mc_i2c_driver);
+}
+device_initcall(mc_i2c_init);
+#endif
+
+#ifdef CONFIG_SPI
+static int mc_spi_probe(struct device_d *dev)
+{
+	return mc_probe(dev, MC13XXX_MODE_SPI);
+}
+
 static struct driver_d mc_spi_driver = {
 	.name  = "mc13xxx-spi",
 	.probe = mc_spi_probe,
 };
 
-static int mc_init(void)
+static int mc_spi_init(void)
 {
-        register_driver(&mc_i2c_driver);
-        register_driver(&mc_spi_driver);
-        return 0;
+	return register_driver(&mc_spi_driver);
 }
 
-device_initcall(mc_init);
+device_initcall(mc_spi_init);
+#endif
-- 
1.7.10.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 2/5] SPI: Put SPI devices on their own bus bus
  2012-09-11 13:31 [PATCH] device/driver work Sascha Hauer
  2012-09-11 13:31 ` [PATCH 1/5] mfd mc13xxx: Separate I2C and SPI probe Sascha Hauer
@ 2012-09-11 13:31 ` Sascha Hauer
  2012-09-11 14:03   ` Jean-Christophe PLAGNIOL-VILLARD
  2012-09-11 13:31 ` [PATCH 3/5] I2C: Put I2C devices on their own bus Sascha Hauer
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 14+ messages in thread
From: Sascha Hauer @ 2012-09-11 13:31 UTC (permalink / raw)
  To: barebox

This patch adds a SPI bus on which the SPI devices and drivers register.
This makes it cleaner as SPI devices won't accidently end up probed by
a platform_device driver.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/eeprom/at25.c |    2 +-
 drivers/mfd/mc13xxx.c |    2 +-
 drivers/mfd/mc34708.c |    2 +-
 drivers/nor/m25p80.c  |    2 +-
 drivers/spi/spi.c     |   24 ++++++++++++++++++++++++
 include/spi/spi.h     |    7 +++++++
 6 files changed, 35 insertions(+), 4 deletions(-)

diff --git a/drivers/eeprom/at25.c b/drivers/eeprom/at25.c
index 03d191e..5578c78 100644
--- a/drivers/eeprom/at25.c
+++ b/drivers/eeprom/at25.c
@@ -312,7 +312,7 @@ static struct driver_d at25_driver = {
 
 static int at25_init(void)
 {
-	register_driver(&at25_driver);
+	spi_register_driver(&at25_driver);
 	return 0;
 }
 
diff --git a/drivers/mfd/mc13xxx.c b/drivers/mfd/mc13xxx.c
index 58394a7..42ed960 100644
--- a/drivers/mfd/mc13xxx.c
+++ b/drivers/mfd/mc13xxx.c
@@ -367,7 +367,7 @@ static struct driver_d mc_spi_driver = {
 
 static int mc_spi_init(void)
 {
-	return register_driver(&mc_spi_driver);
+	return spi_register_driver(&mc_spi_driver);
 }
 
 device_initcall(mc_spi_init);
diff --git a/drivers/mfd/mc34708.c b/drivers/mfd/mc34708.c
index 02c58a9..75fff7b 100644
--- a/drivers/mfd/mc34708.c
+++ b/drivers/mfd/mc34708.c
@@ -289,7 +289,7 @@ static struct driver_d mc_spi_driver = {
 static int mc_init(void)
 {
         register_driver(&mc_i2c_driver);
-        register_driver(&mc_spi_driver);
+        spi_register_driver(&mc_spi_driver);
         return 0;
 }
 
diff --git a/drivers/nor/m25p80.c b/drivers/nor/m25p80.c
index 5713ad5..f718483 100644
--- a/drivers/nor/m25p80.c
+++ b/drivers/nor/m25p80.c
@@ -838,7 +838,7 @@ static struct driver_d epcs_flash_driver = {
 
 static int epcs_init(void)
 {
-	register_driver(&epcs_flash_driver);
+	spi_register_driver(&epcs_flash_driver);
 	return 0;
 }
 
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index a7fe10c..4416783 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -27,6 +27,7 @@
 #include <xfuncs.h>
 #include <malloc.h>
 #include <errno.h>
+#include <init.h>
 
 /* SPI devices should normally not be created by SPI device drivers; that
  * would make them board-specific.  Similarly with SPI master drivers.
@@ -77,6 +78,7 @@ struct spi_device *spi_new_device(struct spi_master *master,
 	proxy->mode = chip->mode;
 	proxy->bits_per_word = chip->bits_per_word ? chip->bits_per_word : 8;
 	proxy->dev.platform_data = chip->platform_data;
+	proxy->dev.bus = &spi_bus;
 	strcpy(proxy->dev.name, chip->name);
 	/* allocate a free id for this chip */
 	proxy->dev.id = DEVICE_ID_DYNAMIC;
@@ -240,3 +242,25 @@ int spi_write_then_read(struct spi_device *spi,
 	return status;
 }
 EXPORT_SYMBOL(spi_write_then_read);
+
+static int spi_match(struct device_d *dev, struct driver_d *drv)
+{
+	return strcmp(dev->name, drv->name) ? -1 : 0;
+}
+
+static int spi_probe(struct device_d *dev)
+{
+	return dev->driver->probe(dev);
+}
+
+static void spi_remove(struct device_d *dev)
+{
+	dev->driver->remove(dev);
+}
+
+struct bus_type spi_bus = {
+	.name = "spi",
+	.match = spi_match,
+	.probe = spi_probe,
+	.remove = spi_remove,
+};
diff --git a/include/spi/spi.h b/include/spi/spi.h
index 9d01d06..569cdcd 100644
--- a/include/spi/spi.h
+++ b/include/spi/spi.h
@@ -427,4 +427,11 @@ static inline ssize_t spi_w8r8(struct spi_device *spi, u8 cmd)
 
 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
+extern struct bus_type spi_bus;
+
+static inline int spi_register_driver(struct driver_d *drv)
+{
+	drv->bus = &spi_bus;
+	return register_driver(drv);
+}
 #endif /* __INCLUDE_SPI_H */
-- 
1.7.10.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 3/5] I2C: Put I2C devices on their own bus
  2012-09-11 13:31 [PATCH] device/driver work Sascha Hauer
  2012-09-11 13:31 ` [PATCH 1/5] mfd mc13xxx: Separate I2C and SPI probe Sascha Hauer
  2012-09-11 13:31 ` [PATCH 2/5] SPI: Put SPI devices on their own bus bus Sascha Hauer
@ 2012-09-11 13:31 ` Sascha Hauer
  2012-09-11 14:04   ` Jean-Christophe PLAGNIOL-VILLARD
  2012-09-11 13:31 ` [PATCH 4/5] driver: rewrite dev_printf as a function Sascha Hauer
  2012-09-11 13:31 ` [PATCH 5/5] driver: Add platform_device_id mechanism Sascha Hauer
  4 siblings, 1 reply; 14+ messages in thread
From: Sascha Hauer @ 2012-09-11 13:31 UTC (permalink / raw)
  To: barebox

This patch adds a I2C bus on which the I2C devices and drivers register.
This makes it cleaner as I2C devices won't accidently end up probed by
a platform_device driver.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/i2c/i2c.c       |   23 +++++++++++++++++++++++
 drivers/mfd/lp3972.c    |    2 +-
 drivers/mfd/mc13xxx.c   |    2 +-
 drivers/mfd/mc34704.c   |    4 ++--
 drivers/mfd/mc34708.c   |    2 +-
 drivers/mfd/mc9sdz60.c  |    2 +-
 drivers/mfd/stmpe-i2c.c |    2 +-
 drivers/mfd/twl4030.c   |    2 +-
 drivers/mfd/twl6030.c   |    2 +-
 include/i2c/i2c.h       |    8 ++++++++
 10 files changed, 40 insertions(+), 9 deletions(-)

diff --git a/drivers/i2c/i2c.c b/drivers/i2c/i2c.c
index 3af2b3e..555722b 100644
--- a/drivers/i2c/i2c.c
+++ b/drivers/i2c/i2c.c
@@ -251,6 +251,7 @@ struct i2c_client *i2c_new_device(struct i2c_adapter *adapter,
 	strcpy(client->dev.name, chip->type);
 	client->dev.type_data = client;
 	client->dev.platform_data = chip->platform_data;
+	client->dev.bus = &i2c_bus;
 	client->adapter = adapter;
 	client->addr = chip->addr;
 
@@ -372,3 +373,25 @@ int i2c_add_numbered_adapter(struct i2c_adapter *adapter)
 	return 0;
 }
 EXPORT_SYMBOL(i2c_add_numbered_adapter);
+
+static int i2c_match(struct device_d *dev, struct driver_d *drv)
+{
+	return strcmp(dev->name, drv->name) ? -1 : 0;
+}
+
+static int i2c_probe(struct device_d *dev)
+{
+	return dev->driver->probe(dev);
+}
+
+static void i2c_remove(struct device_d *dev)
+{
+	dev->driver->remove(dev);
+}
+
+struct bus_type i2c_bus = {
+	.name = "i2c",
+	.match = i2c_match,
+	.probe = i2c_probe,
+	.remove = i2c_remove,
+};
diff --git a/drivers/mfd/lp3972.c b/drivers/mfd/lp3972.c
index 0f3093b..c5e6baa 100644
--- a/drivers/mfd/lp3972.c
+++ b/drivers/mfd/lp3972.c
@@ -103,7 +103,7 @@ static struct driver_d lp_driver = {
 
 static int lp_init(void)
 {
-	register_driver(&lp_driver);
+	i2c_register_driver(&lp_driver);
 	return 0;
 }
 
diff --git a/drivers/mfd/mc13xxx.c b/drivers/mfd/mc13xxx.c
index 42ed960..a62eca8 100644
--- a/drivers/mfd/mc13xxx.c
+++ b/drivers/mfd/mc13xxx.c
@@ -349,7 +349,7 @@ static struct driver_d mc_i2c_driver = {
 
 static int mc_i2c_init(void)
 {
-	return register_driver(&mc_i2c_driver);
+	return i2c_register_driver(&mc_i2c_driver);
 }
 device_initcall(mc_i2c_init);
 #endif
diff --git a/drivers/mfd/mc34704.c b/drivers/mfd/mc34704.c
index 0432a98..e22fb38 100644
--- a/drivers/mfd/mc34704.c
+++ b/drivers/mfd/mc34704.c
@@ -134,7 +134,7 @@ static struct driver_d mc34704_driver = {
 
 static int mc34704_init(void)
 {
-	register_driver(&mc34704_driver);
-        return 0;
+	i2c_register_driver(&mc34704_driver);
+	return 0;
 }
 device_initcall(mc34704_init);
diff --git a/drivers/mfd/mc34708.c b/drivers/mfd/mc34708.c
index 75fff7b..f5e08e1 100644
--- a/drivers/mfd/mc34708.c
+++ b/drivers/mfd/mc34708.c
@@ -288,7 +288,7 @@ static struct driver_d mc_spi_driver = {
 
 static int mc_init(void)
 {
-        register_driver(&mc_i2c_driver);
+        i2c_register_driver(&mc_i2c_driver);
         spi_register_driver(&mc_spi_driver);
         return 0;
 }
diff --git a/drivers/mfd/mc9sdz60.c b/drivers/mfd/mc9sdz60.c
index 75d0789..612817d 100644
--- a/drivers/mfd/mc9sdz60.c
+++ b/drivers/mfd/mc9sdz60.c
@@ -146,7 +146,7 @@ static struct driver_d mc_driver = {
 
 static int mc_init(void)
 {
-        register_driver(&mc_driver);
+        i2c_register_driver(&mc_driver);
         return 0;
 }
 
diff --git a/drivers/mfd/stmpe-i2c.c b/drivers/mfd/stmpe-i2c.c
index 4af8b7b..12e95c1 100644
--- a/drivers/mfd/stmpe-i2c.c
+++ b/drivers/mfd/stmpe-i2c.c
@@ -146,7 +146,7 @@ static struct driver_d stmpe_driver = {
 
 static int stmpe_init(void)
 {
-        register_driver(&stmpe_driver);
+        i2c_register_driver(&stmpe_driver);
         return 0;
 }
 
diff --git a/drivers/mfd/twl4030.c b/drivers/mfd/twl4030.c
index 191c91f..9309765 100644
--- a/drivers/mfd/twl4030.c
+++ b/drivers/mfd/twl4030.c
@@ -53,7 +53,7 @@ static struct driver_d twl_driver = {
 
 static int twl_init(void)
 {
-	register_driver(&twl_driver);
+	i2c_register_driver(&twl_driver);
 	return 0;
 }
 
diff --git a/drivers/mfd/twl6030.c b/drivers/mfd/twl6030.c
index 7ecfed8..01728fd 100644
--- a/drivers/mfd/twl6030.c
+++ b/drivers/mfd/twl6030.c
@@ -49,7 +49,7 @@ static struct driver_d twl_driver = {
 
 static int twl_init(void)
 {
-	register_driver(&twl_driver);
+	i2c_register_driver(&twl_driver);
 	return 0;
 }
 
diff --git a/include/i2c/i2c.h b/include/i2c/i2c.h
index c3e1763..de2a7ea 100644
--- a/include/i2c/i2c.h
+++ b/include/i2c/i2c.h
@@ -139,4 +139,12 @@ extern int i2c_write_reg(struct i2c_client *client, u32 addr, const u8 *buf, u16
 
 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
+extern struct bus_type i2c_bus;
+
+static inline int i2c_register_driver(struct driver_d *drv)
+{
+	drv->bus = &i2c_bus;
+	return register_driver(drv);
+}
+
 #endif /* I2C_I2C_H */
-- 
1.7.10.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 4/5] driver: rewrite dev_printf as a function
  2012-09-11 13:31 [PATCH] device/driver work Sascha Hauer
                   ` (2 preceding siblings ...)
  2012-09-11 13:31 ` [PATCH 3/5] I2C: Put I2C devices on their own bus Sascha Hauer
@ 2012-09-11 13:31 ` Sascha Hauer
  2012-09-11 13:31 ` [PATCH 5/5] driver: Add platform_device_id mechanism Sascha Hauer
  4 siblings, 0 replies; 14+ messages in thread
From: Sascha Hauer @ 2012-09-11 13:31 UTC (permalink / raw)
  To: barebox

Printing device context normally should be "driver instance:",
but instead we printed the device name twice. This patch fixes
this and as a bonus makes the binary a bit smaller. Instead of
a '@' between driver and instance this function now prints a
whitespace which is a bit more like Linux.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/base/driver.c |   19 +++++++++++++++++++
 include/driver.h      |    6 +++---
 2 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/drivers/base/driver.c b/drivers/base/driver.c
index 6cd4286..47d3803 100644
--- a/drivers/base/driver.c
+++ b/drivers/base/driver.c
@@ -313,6 +313,25 @@ const char *dev_id(const struct device_d *dev)
 	return buf;
 }
 
+int dev_printf(const struct device_d *dev, const char *format, ...)
+{
+	va_list args;
+	int ret = 0;
+
+	if (dev->driver && dev->driver->name)
+		ret += printf("%s ", dev->driver->name);
+
+	ret += printf("%s: ", dev_name(dev));
+
+	va_start(args, format);
+
+	ret += vprintf(format, args);
+
+	va_end(args);
+
+	return ret;
+}
+
 void devices_shutdown(void)
 {
 	struct device_d *dev;
diff --git a/include/driver.h b/include/driver.h
index 0fecc7a..c74f245 100644
--- a/include/driver.h
+++ b/include/driver.h
@@ -333,9 +333,9 @@ static inline int dev_close_default(struct device_d *dev, struct filep *f)
 
 /* debugging and troubleshooting/diagnostic helpers. */
 
-#define dev_printf(dev, format, arg...)	\
-	printf("%s@%s: " format , (dev)->name , \
-	       dev_name(dev) , ## arg)
+int dev_printf(const struct device_d *dev, const char *format, ...)
+	__attribute__ ((format(__printf__, 2, 3)));
+
 
 #define dev_emerg(dev, format, arg...)		\
 	dev_printf((dev) , format , ## arg)
-- 
1.7.10.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 5/5] driver: Add platform_device_id mechanism
  2012-09-11 13:31 [PATCH] device/driver work Sascha Hauer
                   ` (3 preceding siblings ...)
  2012-09-11 13:31 ` [PATCH 4/5] driver: rewrite dev_printf as a function Sascha Hauer
@ 2012-09-11 13:31 ` Sascha Hauer
  4 siblings, 0 replies; 14+ messages in thread
From: Sascha Hauer @ 2012-09-11 13:31 UTC (permalink / raw)
  To: barebox

It is common for drivers to handle multiple similar devices. On
Linux the driver can distinguish between the devices using the
platform_device_id mechanism. Introduce the same for barebox.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/base/platform.c |   17 ++++++++++++++++-
 include/driver.h        |    9 +++++++++
 2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index e0dd9ea..82d2521 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -24,7 +24,22 @@
 
 static int platform_match(struct device_d *dev, struct driver_d *drv)
 {
-	return strcmp(dev->name, drv->name) ? -1 : 0;
+	if (!strcmp(dev->name, drv->name))
+		return 0;
+
+	if (drv->id_table) {
+		struct platform_device_id *id = drv->id_table;
+
+		while (id->name) {
+			if (!strcmp(id->name, dev->name)) {
+				dev->id_entry = id;
+				return 0;
+			}
+			id++;
+		}
+	}
+
+	return -1;
 }
 
 static int platform_probe(struct device_d *dev)
diff --git a/include/driver.h b/include/driver.h
index c74f245..40b76c1 100644
--- a/include/driver.h
+++ b/include/driver.h
@@ -60,6 +60,11 @@
 struct filep;
 struct bus_type;
 
+struct platform_device_id {
+	const char *name;
+	unsigned long driver_data;
+};
+
 /** @brief Describes a particular device present in the system */
 struct device_d {
 	/*! This member (and 'type' described below) is used to match with a
@@ -99,6 +104,8 @@ struct device_d {
 	struct list_head parameters;
 
 	struct list_head cdevs;
+
+	struct platform_device_id *id_entry;
 };
 
 /** @brief Describes a driver present in the system */
@@ -119,6 +126,8 @@ struct driver_d {
 	void    (*shortinfo) (struct device_d *);
 
 	struct bus_type *bus;
+
+	struct platform_device_id *id_table;
 };
 
 /*@}*/	/* do not delete, doxygen relevant */
-- 
1.7.10.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH 2/5] SPI: Put SPI devices on their own bus bus
  2012-09-11 13:31 ` [PATCH 2/5] SPI: Put SPI devices on their own bus bus Sascha Hauer
@ 2012-09-11 14:03   ` Jean-Christophe PLAGNIOL-VILLARD
  2012-09-11 14:26     ` Sascha Hauer
  0 siblings, 1 reply; 14+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-09-11 14:03 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

On 15:31 Tue 11 Sep     , Sascha Hauer wrote:
> This patch adds a SPI bus on which the SPI devices and drivers register.
> This makes it cleaner as SPI devices won't accidently end up probed by
> a platform_device driver.
> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
>  drivers/eeprom/at25.c |    2 +-
>  drivers/mfd/mc13xxx.c |    2 +-
>  drivers/mfd/mc34708.c |    2 +-
>  drivers/nor/m25p80.c  |    2 +-
>  drivers/spi/spi.c     |   24 ++++++++++++++++++++++++
>  include/spi/spi.h     |    7 +++++++
>  6 files changed, 35 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/eeprom/at25.c b/drivers/eeprom/at25.c
> index 03d191e..5578c78 100644
> --- a/drivers/eeprom/at25.c
> +++ b/drivers/eeprom/at25.c
> @@ -312,7 +312,7 @@ static struct driver_d at25_driver = {
>  
>  static int at25_init(void)
>  {
> -	register_driver(&at25_driver);
> +	spi_register_driver(&at25_driver);
>  	return 0;
>  }
>  
> diff --git a/drivers/mfd/mc13xxx.c b/drivers/mfd/mc13xxx.c
> index 58394a7..42ed960 100644
> --- a/drivers/mfd/mc13xxx.c
> +++ b/drivers/mfd/mc13xxx.c
> @@ -367,7 +367,7 @@ static struct driver_d mc_spi_driver = {
>  
>  static int mc_spi_init(void)
>  {
> -	return register_driver(&mc_spi_driver);
> +	return spi_register_driver(&mc_spi_driver);
>  }
>  
>  device_initcall(mc_spi_init);
> diff --git a/drivers/mfd/mc34708.c b/drivers/mfd/mc34708.c
> index 02c58a9..75fff7b 100644
> --- a/drivers/mfd/mc34708.c
> +++ b/drivers/mfd/mc34708.c
> @@ -289,7 +289,7 @@ static struct driver_d mc_spi_driver = {
>  static int mc_init(void)
>  {
>          register_driver(&mc_i2c_driver);
> -        register_driver(&mc_spi_driver);
> +        spi_register_driver(&mc_spi_driver);
>          return 0;
>  }
>  
> diff --git a/drivers/nor/m25p80.c b/drivers/nor/m25p80.c
> index 5713ad5..f718483 100644
> --- a/drivers/nor/m25p80.c
> +++ b/drivers/nor/m25p80.c
> @@ -838,7 +838,7 @@ static struct driver_d epcs_flash_driver = {
>  
>  static int epcs_init(void)
>  {
> -	register_driver(&epcs_flash_driver);
> +	spi_register_driver(&epcs_flash_driver);
>  	return 0;
>  }
>  
> diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
> index a7fe10c..4416783 100644
> --- a/drivers/spi/spi.c
> +++ b/drivers/spi/spi.c
> @@ -27,6 +27,7 @@
>  #include <xfuncs.h>
>  #include <malloc.h>
>  #include <errno.h>
> +#include <init.h>
>  
>  /* SPI devices should normally not be created by SPI device drivers; that
>   * would make them board-specific.  Similarly with SPI master drivers.
> @@ -77,6 +78,7 @@ struct spi_device *spi_new_device(struct spi_master *master,
>  	proxy->mode = chip->mode;
>  	proxy->bits_per_word = chip->bits_per_word ? chip->bits_per_word : 8;
>  	proxy->dev.platform_data = chip->platform_data;
> +	proxy->dev.bus = &spi_bus;
>  	strcpy(proxy->dev.name, chip->name);
>  	/* allocate a free id for this chip */
>  	proxy->dev.id = DEVICE_ID_DYNAMIC;
> @@ -240,3 +242,25 @@ int spi_write_then_read(struct spi_device *spi,
>  	return status;
>  }
>  EXPORT_SYMBOL(spi_write_then_read);
> +
> +static int spi_match(struct device_d *dev, struct driver_d *drv)
> +{
> +	return strcmp(dev->name, drv->name) ? -1 : 0;
> +}
> +
> +static int spi_probe(struct device_d *dev)
> +{
> +	return dev->driver->probe(dev);
> +}
> +
> +static void spi_remove(struct device_d *dev)
> +{
> +	dev->driver->remove(dev);
> +}
this is code is commonon with the generix drvier can we share it?

Best Regards,
J.

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH 3/5] I2C: Put I2C devices on their own bus
  2012-09-11 13:31 ` [PATCH 3/5] I2C: Put I2C devices on their own bus Sascha Hauer
@ 2012-09-11 14:04   ` Jean-Christophe PLAGNIOL-VILLARD
  2012-09-11 14:27     ` Sascha Hauer
  0 siblings, 1 reply; 14+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-09-11 14:04 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

On 15:31 Tue 11 Sep     , Sascha Hauer wrote:
> This patch adds a I2C bus on which the I2C devices and drivers register.
> This makes it cleaner as I2C devices won't accidently end up probed by
> a platform_device driver.
> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
>  drivers/i2c/i2c.c       |   23 +++++++++++++++++++++++
>  drivers/mfd/lp3972.c    |    2 +-
>  drivers/mfd/mc13xxx.c   |    2 +-
>  drivers/mfd/mc34704.c   |    4 ++--
>  drivers/mfd/mc34708.c   |    2 +-
>  drivers/mfd/mc9sdz60.c  |    2 +-
>  drivers/mfd/stmpe-i2c.c |    2 +-
>  drivers/mfd/twl4030.c   |    2 +-
>  drivers/mfd/twl6030.c   |    2 +-
>  include/i2c/i2c.h       |    8 ++++++++
>  10 files changed, 40 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/i2c/i2c.c b/drivers/i2c/i2c.c
> index 3af2b3e..555722b 100644
> --- a/drivers/i2c/i2c.c
> +++ b/drivers/i2c/i2c.c
> @@ -251,6 +251,7 @@ struct i2c_client *i2c_new_device(struct i2c_adapter *adapter,
>  	strcpy(client->dev.name, chip->type);
>  	client->dev.type_data = client;
>  	client->dev.platform_data = chip->platform_data;
> +	client->dev.bus = &i2c_bus;
>  	client->adapter = adapter;
>  	client->addr = chip->addr;
>  
> @@ -372,3 +373,25 @@ int i2c_add_numbered_adapter(struct i2c_adapter *adapter)
>  	return 0;
>  }
>  EXPORT_SYMBOL(i2c_add_numbered_adapter);
> +
> +static int i2c_match(struct device_d *dev, struct driver_d *drv)
> +{
> +	return strcmp(dev->name, drv->name) ? -1 : 0;
can we check the address too here

Best Regards,
J.

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH 2/5] SPI: Put SPI devices on their own bus bus
  2012-09-11 14:03   ` Jean-Christophe PLAGNIOL-VILLARD
@ 2012-09-11 14:26     ` Sascha Hauer
  0 siblings, 0 replies; 14+ messages in thread
From: Sascha Hauer @ 2012-09-11 14:26 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox

On Tue, Sep 11, 2012 at 04:03:49PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 15:31 Tue 11 Sep     , Sascha Hauer wrote:
> > This patch adds a SPI bus on which the SPI devices and drivers register.
> > This makes it cleaner as SPI devices won't accidently end up probed by
> > a platform_device driver.
> > 
> >  EXPORT_SYMBOL(spi_write_then_read);
> > +
> > +static int spi_match(struct device_d *dev, struct driver_d *drv)
> > +{
> > +	return strcmp(dev->name, drv->name) ? -1 : 0;
> > +}
> > +
> > +static int spi_probe(struct device_d *dev)
> > +{
> > +	return dev->driver->probe(dev);
> > +}
> > +
> > +static void spi_remove(struct device_d *dev)
> > +{
> > +	dev->driver->remove(dev);
> > +}
> this is code is commonon with the generix drvier can we share it?

One of the next step in this area probably is to call a device->probe
function with a struct i2c_device / struct spi_device, so I don't think
it's worth the effort now.

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH 3/5] I2C: Put I2C devices on their own bus
  2012-09-11 14:04   ` Jean-Christophe PLAGNIOL-VILLARD
@ 2012-09-11 14:27     ` Sascha Hauer
  2012-09-11 15:56       ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 1 reply; 14+ messages in thread
From: Sascha Hauer @ 2012-09-11 14:27 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox

On Tue, Sep 11, 2012 at 04:04:55PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 15:31 Tue 11 Sep     , Sascha Hauer wrote:
> > This patch adds a I2C bus on which the I2C devices and drivers register.
> > This makes it cleaner as I2C devices won't accidently end up probed by
> > a platform_device driver.
> > 
> > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> > ---
> >  drivers/i2c/i2c.c       |   23 +++++++++++++++++++++++
> >  drivers/mfd/lp3972.c    |    2 +-
> >  drivers/mfd/mc13xxx.c   |    2 +-
> >  drivers/mfd/mc34704.c   |    4 ++--
> >  drivers/mfd/mc34708.c   |    2 +-
> >  drivers/mfd/mc9sdz60.c  |    2 +-
> >  drivers/mfd/stmpe-i2c.c |    2 +-
> >  drivers/mfd/twl4030.c   |    2 +-
> >  drivers/mfd/twl6030.c   |    2 +-
> >  include/i2c/i2c.h       |    8 ++++++++
> >  10 files changed, 40 insertions(+), 9 deletions(-)
> > 
> > diff --git a/drivers/i2c/i2c.c b/drivers/i2c/i2c.c
> > index 3af2b3e..555722b 100644
> > --- a/drivers/i2c/i2c.c
> > +++ b/drivers/i2c/i2c.c
> > @@ -251,6 +251,7 @@ struct i2c_client *i2c_new_device(struct i2c_adapter *adapter,
> >  	strcpy(client->dev.name, chip->type);
> >  	client->dev.type_data = client;
> >  	client->dev.platform_data = chip->platform_data;
> > +	client->dev.bus = &i2c_bus;
> >  	client->adapter = adapter;
> >  	client->addr = chip->addr;
> >  
> > @@ -372,3 +373,25 @@ int i2c_add_numbered_adapter(struct i2c_adapter *adapter)
> >  	return 0;
> >  }
> >  EXPORT_SYMBOL(i2c_add_numbered_adapter);
> > +
> > +static int i2c_match(struct device_d *dev, struct driver_d *drv)
> > +{
> > +	return strcmp(dev->name, drv->name) ? -1 : 0;
> can we check the address too here

What do you mean?

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH 3/5] I2C: Put I2C devices on their own bus
  2012-09-11 14:27     ` Sascha Hauer
@ 2012-09-11 15:56       ` Jean-Christophe PLAGNIOL-VILLARD
  2012-09-11 16:10         ` Sascha Hauer
  0 siblings, 1 reply; 14+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-09-11 15:56 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

On 16:27 Tue 11 Sep     , Sascha Hauer wrote:
> On Tue, Sep 11, 2012 at 04:04:55PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > On 15:31 Tue 11 Sep     , Sascha Hauer wrote:
> > > This patch adds a I2C bus on which the I2C devices and drivers register.
> > > This makes it cleaner as I2C devices won't accidently end up probed by
> > > a platform_device driver.
> > > 
> > > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> > > ---
> > >  drivers/i2c/i2c.c       |   23 +++++++++++++++++++++++
> > >  drivers/mfd/lp3972.c    |    2 +-
> > >  drivers/mfd/mc13xxx.c   |    2 +-
> > >  drivers/mfd/mc34704.c   |    4 ++--
> > >  drivers/mfd/mc34708.c   |    2 +-
> > >  drivers/mfd/mc9sdz60.c  |    2 +-
> > >  drivers/mfd/stmpe-i2c.c |    2 +-
> > >  drivers/mfd/twl4030.c   |    2 +-
> > >  drivers/mfd/twl6030.c   |    2 +-
> > >  include/i2c/i2c.h       |    8 ++++++++
> > >  10 files changed, 40 insertions(+), 9 deletions(-)
> > > 
> > > diff --git a/drivers/i2c/i2c.c b/drivers/i2c/i2c.c
> > > index 3af2b3e..555722b 100644
> > > --- a/drivers/i2c/i2c.c
> > > +++ b/drivers/i2c/i2c.c
> > > @@ -251,6 +251,7 @@ struct i2c_client *i2c_new_device(struct i2c_adapter *adapter,
> > >  	strcpy(client->dev.name, chip->type);
> > >  	client->dev.type_data = client;
> > >  	client->dev.platform_data = chip->platform_data;
> > > +	client->dev.bus = &i2c_bus;
> > >  	client->adapter = adapter;
> > >  	client->addr = chip->addr;
> > >  
> > > @@ -372,3 +373,25 @@ int i2c_add_numbered_adapter(struct i2c_adapter *adapter)
> > >  	return 0;
> > >  }
> > >  EXPORT_SYMBOL(i2c_add_numbered_adapter);
> > > +
> > > +static int i2c_match(struct device_d *dev, struct driver_d *drv)
> > > +{
> > > +	return strcmp(dev->name, drv->name) ? -1 : 0;
> > can we check the address too here
> 
> What do you mean?
i2c client address is valid

Best Regards,
J.

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH 3/5] I2C: Put I2C devices on their own bus
  2012-09-11 15:56       ` Jean-Christophe PLAGNIOL-VILLARD
@ 2012-09-11 16:10         ` Sascha Hauer
  2012-09-11 17:24           ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 1 reply; 14+ messages in thread
From: Sascha Hauer @ 2012-09-11 16:10 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox

On Tue, Sep 11, 2012 at 05:56:19PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 16:27 Tue 11 Sep     , Sascha Hauer wrote:
> > On Tue, Sep 11, 2012 at 04:04:55PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > > On 15:31 Tue 11 Sep     , Sascha Hauer wrote:
> > > > This patch adds a I2C bus on which the I2C devices and drivers register.
> > > > This makes it cleaner as I2C devices won't accidently end up probed by
> > > > a platform_device driver.
> > > > 
> > > > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> > > > ---
> > > >  drivers/i2c/i2c.c       |   23 +++++++++++++++++++++++
> > > >  drivers/mfd/lp3972.c    |    2 +-
> > > >  drivers/mfd/mc13xxx.c   |    2 +-
> > > >  drivers/mfd/mc34704.c   |    4 ++--
> > > >  drivers/mfd/mc34708.c   |    2 +-
> > > >  drivers/mfd/mc9sdz60.c  |    2 +-
> > > >  drivers/mfd/stmpe-i2c.c |    2 +-
> > > >  drivers/mfd/twl4030.c   |    2 +-
> > > >  drivers/mfd/twl6030.c   |    2 +-
> > > >  include/i2c/i2c.h       |    8 ++++++++
> > > >  10 files changed, 40 insertions(+), 9 deletions(-)
> > > > 
> > > > diff --git a/drivers/i2c/i2c.c b/drivers/i2c/i2c.c
> > > > index 3af2b3e..555722b 100644
> > > > --- a/drivers/i2c/i2c.c
> > > > +++ b/drivers/i2c/i2c.c
> > > > @@ -251,6 +251,7 @@ struct i2c_client *i2c_new_device(struct i2c_adapter *adapter,
> > > >  	strcpy(client->dev.name, chip->type);
> > > >  	client->dev.type_data = client;
> > > >  	client->dev.platform_data = chip->platform_data;
> > > > +	client->dev.bus = &i2c_bus;
> > > >  	client->adapter = adapter;
> > > >  	client->addr = chip->addr;
> > > >  
> > > > @@ -372,3 +373,25 @@ int i2c_add_numbered_adapter(struct i2c_adapter *adapter)
> > > >  	return 0;
> > > >  }
> > > >  EXPORT_SYMBOL(i2c_add_numbered_adapter);
> > > > +
> > > > +static int i2c_match(struct device_d *dev, struct driver_d *drv)
> > > > +{
> > > > +	return strcmp(dev->name, drv->name) ? -1 : 0;
> > > can we check the address too here
> > 
> > What do you mean?
> i2c client address is valid

This should be done at i2c_new_device() time.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH 3/5] I2C: Put I2C devices on their own bus
  2012-09-11 16:10         ` Sascha Hauer
@ 2012-09-11 17:24           ` Jean-Christophe PLAGNIOL-VILLARD
  2012-09-12  6:47             ` Sascha Hauer
  0 siblings, 1 reply; 14+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-09-11 17:24 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

On 18:10 Tue 11 Sep     , Sascha Hauer wrote:
> On Tue, Sep 11, 2012 at 05:56:19PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > On 16:27 Tue 11 Sep     , Sascha Hauer wrote:
> > > On Tue, Sep 11, 2012 at 04:04:55PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > > > On 15:31 Tue 11 Sep     , Sascha Hauer wrote:
> > > > > This patch adds a I2C bus on which the I2C devices and drivers register.
> > > > > This makes it cleaner as I2C devices won't accidently end up probed by
> > > > > a platform_device driver.
> > > > > 
> > > > > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> > > > > ---
> > > > >  drivers/i2c/i2c.c       |   23 +++++++++++++++++++++++
> > > > >  drivers/mfd/lp3972.c    |    2 +-
> > > > >  drivers/mfd/mc13xxx.c   |    2 +-
> > > > >  drivers/mfd/mc34704.c   |    4 ++--
> > > > >  drivers/mfd/mc34708.c   |    2 +-
> > > > >  drivers/mfd/mc9sdz60.c  |    2 +-
> > > > >  drivers/mfd/stmpe-i2c.c |    2 +-
> > > > >  drivers/mfd/twl4030.c   |    2 +-
> > > > >  drivers/mfd/twl6030.c   |    2 +-
> > > > >  include/i2c/i2c.h       |    8 ++++++++
> > > > >  10 files changed, 40 insertions(+), 9 deletions(-)
> > > > > 
> > > > > diff --git a/drivers/i2c/i2c.c b/drivers/i2c/i2c.c
> > > > > index 3af2b3e..555722b 100644
> > > > > --- a/drivers/i2c/i2c.c
> > > > > +++ b/drivers/i2c/i2c.c
> > > > > @@ -251,6 +251,7 @@ struct i2c_client *i2c_new_device(struct i2c_adapter *adapter,
> > > > >  	strcpy(client->dev.name, chip->type);
> > > > >  	client->dev.type_data = client;
> > > > >  	client->dev.platform_data = chip->platform_data;
> > > > > +	client->dev.bus = &i2c_bus;
> > > > >  	client->adapter = adapter;
> > > > >  	client->addr = chip->addr;
> > > > >  
> > > > > @@ -372,3 +373,25 @@ int i2c_add_numbered_adapter(struct i2c_adapter *adapter)
> > > > >  	return 0;
> > > > >  }
> > > > >  EXPORT_SYMBOL(i2c_add_numbered_adapter);
> > > > > +
> > > > > +static int i2c_match(struct device_d *dev, struct driver_d *drv)
> > > > > +{
> > > > > +	return strcmp(dev->name, drv->name) ? -1 : 0;
> > > > can we check the address too here
> > > 
> > > What do you mean?
> > i2c client address is valid
> 
> This should be done at i2c_new_device() time.
so what are you doing here except check the driver name?

which is the same as the current core code

Best Regards,
J.

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH 3/5] I2C: Put I2C devices on their own bus
  2012-09-11 17:24           ` Jean-Christophe PLAGNIOL-VILLARD
@ 2012-09-12  6:47             ` Sascha Hauer
  0 siblings, 0 replies; 14+ messages in thread
From: Sascha Hauer @ 2012-09-12  6:47 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox

On Tue, Sep 11, 2012 at 07:24:27PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > > > > > +
> > > > > > +static int i2c_match(struct device_d *dev, struct driver_d *drv)
> > > > > > +{
> > > > > > +	return strcmp(dev->name, drv->name) ? -1 : 0;
> > > > > can we check the address too here
> > > > 
> > > > What do you mean?
> > > i2c client address is valid
> > 
> > This should be done at i2c_new_device() time.
> so what are you doing here except check the driver name?
> 
> which is the same as the current core code

What do you mean with 'i2c client address is valid'? address <= 0x7f?

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2012-09-12  6:49 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-11 13:31 [PATCH] device/driver work Sascha Hauer
2012-09-11 13:31 ` [PATCH 1/5] mfd mc13xxx: Separate I2C and SPI probe Sascha Hauer
2012-09-11 13:31 ` [PATCH 2/5] SPI: Put SPI devices on their own bus bus Sascha Hauer
2012-09-11 14:03   ` Jean-Christophe PLAGNIOL-VILLARD
2012-09-11 14:26     ` Sascha Hauer
2012-09-11 13:31 ` [PATCH 3/5] I2C: Put I2C devices on their own bus Sascha Hauer
2012-09-11 14:04   ` Jean-Christophe PLAGNIOL-VILLARD
2012-09-11 14:27     ` Sascha Hauer
2012-09-11 15:56       ` Jean-Christophe PLAGNIOL-VILLARD
2012-09-11 16:10         ` Sascha Hauer
2012-09-11 17:24           ` Jean-Christophe PLAGNIOL-VILLARD
2012-09-12  6:47             ` Sascha Hauer
2012-09-11 13:31 ` [PATCH 4/5] driver: rewrite dev_printf as a function Sascha Hauer
2012-09-11 13:31 ` [PATCH 5/5] driver: Add platform_device_id mechanism Sascha Hauer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.