linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/17] i2c: deprecate class based instantiation for embedded I2C drivers
@ 2014-02-10 10:03 Wolfram Sang
  2014-02-10 10:03 ` [PATCH 01/17] Documentation: i2c: describe devicetree method for instantiating devices Wolfram Sang
                   ` (17 more replies)
  0 siblings, 18 replies; 28+ messages in thread
From: Wolfram Sang @ 2014-02-10 10:03 UTC (permalink / raw)
  To: linux-i2c
  Cc: Wolfram Sang, adi-buildroot-devel, davinci-linux-open-source,
	linux-arm-kernel, linux-doc, linux-kernel, linux-omap,
	linux-samsung-soc, linux-tegra

With I2C, class based instantiation means if a master driver has e.g.
I2C_CLASS_HWMON set, all slave drivers with this class will try to probe a
device using an array of possible addresses and some heuristics. That creates
traffic and needs time, even when nothing is connected. This mechanism is
needed when you do not have another method to describe the slaves. Embedded I2C
drivers do not need class based instantiation, since there is i2c_board_info or
devicetree description. Some drivers have the class flags set, though, and it
has spread further over the years. We can't remove the flags directly, because
there might be users out there relying on this feature. So, we add a
deprecation warning if a device is instantiated via class attributes. After
giving some time to switch over, we can then finally remove the class flags and
gain boot time.

Patch 1 adds some missing documentation. Patch 2 adds the deprecation feature.
Patches 3+4 are tested on hardware I need. Patches 5-17 are suggestions for
drivers I think could benefit from that. For those, acks are needed before I
will apply them to my tree. If you use a different driver which can also
benefit from this, just send a patch adding the new DEPRECATED flag.

The series can also be found here:

git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git i2c/deprecated_class

Thanks,

   Wolfram


Wolfram Sang (17):
  Documentation: i2c: describe devicetree method for instantiating
    devices
  i2c: add deprecation warning for class based instantiation
  i2c: i2c-omap: deprecate class based instantiation
  i2c: i2c-at91: deprecate class based instantiation
  i2c: i2c-bcm2835: deprecate class based instantiation
  i2c: i2c-bfin-twi: deprecate class based instantiation
  i2c: i2c-davinci: deprecate class based instantiation
  i2c: i2c-designware-platdrv: deprecate class based instantiation
  i2c: i2c-mv64xxx: deprecate class based instantiation
  i2c: i2c-nomadik: deprecate class based instantiation
  i2c: i2c-ocores: deprecate class based instantiation
  i2c: i2c-rcar: deprecate class based instantiation
  i2c: i2c-s3c2410: deprecate class based instantiation
  i2c: i2c-sirf: deprecate class based instantiation
  i2c: i2c-stu300: deprecate class based instantiation
  i2c: i2c-tegra: deprecate class based instantiation
  i2c: i2c-xiic: deprecate class based instantiation

 Documentation/i2c/instantiating-devices     | 34 +++++++++++++++++++++++++++--
 drivers/i2c/busses/i2c-at91.c               |  2 +-
 drivers/i2c/busses/i2c-bcm2835.c            |  2 +-
 drivers/i2c/busses/i2c-bfin-twi.c           |  2 +-
 drivers/i2c/busses/i2c-davinci.c            |  2 +-
 drivers/i2c/busses/i2c-designware-platdrv.c |  2 +-
 drivers/i2c/busses/i2c-mv64xxx.c            |  2 +-
 drivers/i2c/busses/i2c-nomadik.c            |  2 +-
 drivers/i2c/busses/i2c-ocores.c             |  2 +-
 drivers/i2c/busses/i2c-omap.c               |  2 +-
 drivers/i2c/busses/i2c-rcar.c               |  2 +-
 drivers/i2c/busses/i2c-s3c2410.c            |  2 +-
 drivers/i2c/busses/i2c-sirf.c               |  2 +-
 drivers/i2c/busses/i2c-stu300.c             |  2 +-
 drivers/i2c/busses/i2c-tegra.c              |  2 +-
 drivers/i2c/busses/i2c-xiic.c               |  2 +-
 drivers/i2c/i2c-core.c                      |  7 ++++++
 include/linux/i2c.h                         |  1 +
 18 files changed, 55 insertions(+), 17 deletions(-)

-- 
1.8.5.1


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

* [PATCH 01/17] Documentation: i2c: describe devicetree method for instantiating devices
  2014-02-10 10:03 [PATCH 00/17] i2c: deprecate class based instantiation for embedded I2C drivers Wolfram Sang
@ 2014-02-10 10:03 ` Wolfram Sang
  2014-02-10 18:21   ` linux
  2014-02-15 14:48   ` Wolfram Sang
  2014-02-10 10:03 ` [PATCH 02/17] i2c: add deprecation warning for class based instantiation Wolfram Sang
                   ` (16 subsequent siblings)
  17 siblings, 2 replies; 28+ messages in thread
From: Wolfram Sang @ 2014-02-10 10:03 UTC (permalink / raw)
  To: linux-i2c
  Cc: Wolfram Sang, devicetree, linux-arm-kernel, Rob Landley,
	linux-doc, linux-kernel

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Cc: devicetree@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
---

 Documentation/i2c/instantiating-devices | 34 +++++++++++++++++++++++++++++++--
 1 file changed, 32 insertions(+), 2 deletions(-)

diff --git a/Documentation/i2c/instantiating-devices b/Documentation/i2c/instantiating-devices
index c70e7a7..6df095a 100644
--- a/Documentation/i2c/instantiating-devices
+++ b/Documentation/i2c/instantiating-devices
@@ -8,8 +8,8 @@ reason, the kernel code must instantiate I2C devices explicitly. There are
 several ways to achieve this, depending on the context and requirements.
 
 
-Method 1: Declare the I2C devices by bus number
------------------------------------------------
+Method 1a: Declare the I2C devices by bus number
+------------------------------------------------
 
 This method is appropriate when the I2C bus is a system bus as is the case
 for many embedded systems. On such systems, each I2C bus has a number
@@ -51,6 +51,36 @@ The devices will be automatically unbound and destroyed when the I2C bus
 they sit on goes away (if ever.)
 
 
+Method 1b: Declare the I2C devices via devicetree
+-------------------------------------------------
+
+This method has the same implications as method 1a. The declaration of I2C
+devices is here done via devicetree as subnodes of the master controller.
+
+Example:
+
+	i2c1: i2c@400a0000 {
+		/* ... master properties skipped ... */
+		clock-frequency = <100000>;
+
+		flash@50 {
+			compatible = "atmel,24c256";
+			reg = <0x50>;
+		};
+
+		pca9532: gpio@60 {
+			compatible = "nxp,pca9532";
+			gpio-controller;
+			#gpio-cells = <2>;
+			reg = <0x60>;
+		};
+	};
+
+Here, two devices are attached to the bus using a speed of 100kHz. For
+additional properties which might be needed to set up the device, please refer
+to its devicetree documentation in Documentation/devicetree/bindings/.
+
+
 Method 2: Instantiate the devices explicitly
 --------------------------------------------
 
-- 
1.8.5.1


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

* [PATCH 02/17] i2c: add deprecation warning for class based instantiation
  2014-02-10 10:03 [PATCH 00/17] i2c: deprecate class based instantiation for embedded I2C drivers Wolfram Sang
  2014-02-10 10:03 ` [PATCH 01/17] Documentation: i2c: describe devicetree method for instantiating devices Wolfram Sang
@ 2014-02-10 10:03 ` Wolfram Sang
  2014-02-10 10:03 ` [PATCH 03/17] i2c: i2c-omap: deprecate " Wolfram Sang
                   ` (15 subsequent siblings)
  17 siblings, 0 replies; 28+ messages in thread
From: Wolfram Sang @ 2014-02-10 10:03 UTC (permalink / raw)
  To: linux-i2c; +Cc: Wolfram Sang, Jean Delvare, linux-arm-kernel, linux-kernel

Class based instantiation can cause noticeable delays when booting. This
mechanism is used when it is not possible to describe slaves on I2C
busses. As we do have other mechanisms, most embedded I2C will not need
classes and for embedded it is explicitly not recommended to use them. Add
a deprecation warning for drivers which want to disable class based
instantiation in the near future to gain boot-up time, so users relying
on this technique can switch to something better. They really should.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Cc: Jean Delvare <khali@linux-fr.org>
Cc: linux-arm-kernel@lists.infradead.org
---

 drivers/i2c/i2c-core.c | 7 +++++++
 include/linux/i2c.h    | 1 +
 2 files changed, 8 insertions(+)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index d74c0b3..42fcc59 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -1935,6 +1935,13 @@ static int i2c_detect_address(struct i2c_client *temp_client,
 		struct i2c_client *client;
 
 		/* Detection succeeded, instantiate the device */
+		if (adapter->class & I2C_CLASS_DEPRECATED)
+			dev_warn(&adapter->dev,
+				"This adapter will soon drop class based instantiation of devices. "
+				"Please make sure client 0x%02x gets instantiated by other means. "
+				"Check 'Documentation/i2c/instantiating-devices' for details.\n",
+				info.addr);
+
 		dev_dbg(&adapter->dev, "Creating %s at 0x%02x\n",
 			info.type, info.addr);
 		client = i2c_new_device(adapter, &info);
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index d9c8dbd3..b9e1707 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -473,6 +473,7 @@ void i2c_unlock_adapter(struct i2c_adapter *);
 #define I2C_CLASS_HWMON		(1<<0)	/* lm_sensors, ... */
 #define I2C_CLASS_DDC		(1<<3)	/* DDC bus on graphics adapters */
 #define I2C_CLASS_SPD		(1<<7)	/* Memory modules */
+#define I2C_CLASS_DEPRECATED	(1<<8)	/* Warn users that adapter will stop using classes */
 
 /* Internal numbers to terminate lists */
 #define I2C_CLIENT_END		0xfffeU
-- 
1.8.5.1


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

* [PATCH 03/17] i2c: i2c-omap: deprecate class based instantiation
  2014-02-10 10:03 [PATCH 00/17] i2c: deprecate class based instantiation for embedded I2C drivers Wolfram Sang
  2014-02-10 10:03 ` [PATCH 01/17] Documentation: i2c: describe devicetree method for instantiating devices Wolfram Sang
  2014-02-10 10:03 ` [PATCH 02/17] i2c: add deprecation warning for class based instantiation Wolfram Sang
@ 2014-02-10 10:03 ` Wolfram Sang
  2014-02-10 10:03 ` [PATCH 04/17] i2c: i2c-at91: " Wolfram Sang
                   ` (14 subsequent siblings)
  17 siblings, 0 replies; 28+ messages in thread
From: Wolfram Sang @ 2014-02-10 10:03 UTC (permalink / raw)
  To: linux-i2c
  Cc: Wolfram Sang, Jean Delvare, Tony Lindgren, linux-omap, linux-kernel

Warn users that class based instantiation is going away soon in favour
of more robust probing and faster bootup times.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Cc: Jean Delvare <khali@linux-fr.org>
---

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

diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index 90dcc2e..8e29004 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -1238,7 +1238,7 @@ omap_i2c_probe(struct platform_device *pdev)
 	adap = &dev->adapter;
 	i2c_set_adapdata(adap, dev);
 	adap->owner = THIS_MODULE;
-	adap->class = I2C_CLASS_HWMON;
+	adap->class = I2C_CLASS_HWMON | I2C_CLASS_DEPRECATED;
 	strlcpy(adap->name, "OMAP I2C adapter", sizeof(adap->name));
 	adap->algo = &omap_i2c_algo;
 	adap->dev.parent = &pdev->dev;
-- 
1.8.5.1


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

* [PATCH 04/17] i2c: i2c-at91: deprecate class based instantiation
  2014-02-10 10:03 [PATCH 00/17] i2c: deprecate class based instantiation for embedded I2C drivers Wolfram Sang
                   ` (2 preceding siblings ...)
  2014-02-10 10:03 ` [PATCH 03/17] i2c: i2c-omap: deprecate " Wolfram Sang
@ 2014-02-10 10:03 ` Wolfram Sang
  2014-02-11 13:33   ` Ludovic Desroches
  2014-02-10 10:03 ` [PATCH 05/17] i2c: i2c-bcm2835: " Wolfram Sang
                   ` (13 subsequent siblings)
  17 siblings, 1 reply; 28+ messages in thread
From: Wolfram Sang @ 2014-02-10 10:03 UTC (permalink / raw)
  To: linux-i2c; +Cc: Wolfram Sang, Ludovic Desroches, linux-kernel

Warn users that class based instantiation is going away soon in favour
of more robust probing and faster bootup times.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Cc: Ludovic Desroches <ludovic.desroches@atmel.com>
---

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

diff --git a/drivers/i2c/busses/i2c-at91.c b/drivers/i2c/busses/i2c-at91.c
index 8edba9d..4babcdb 100644
--- a/drivers/i2c/busses/i2c-at91.c
+++ b/drivers/i2c/busses/i2c-at91.c
@@ -759,7 +759,7 @@ static int at91_twi_probe(struct platform_device *pdev)
 	snprintf(dev->adapter.name, sizeof(dev->adapter.name), "AT91");
 	i2c_set_adapdata(&dev->adapter, dev);
 	dev->adapter.owner = THIS_MODULE;
-	dev->adapter.class = I2C_CLASS_HWMON;
+	dev->adapter.class = I2C_CLASS_HWMON | I2C_CLASS_DEPRECATED;
 	dev->adapter.algo = &at91_twi_algorithm;
 	dev->adapter.dev.parent = dev->dev;
 	dev->adapter.nr = pdev->id;
-- 
1.8.5.1


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

* [PATCH 05/17] i2c: i2c-bcm2835: deprecate class based instantiation
  2014-02-10 10:03 [PATCH 00/17] i2c: deprecate class based instantiation for embedded I2C drivers Wolfram Sang
                   ` (3 preceding siblings ...)
  2014-02-10 10:03 ` [PATCH 04/17] i2c: i2c-at91: " Wolfram Sang
@ 2014-02-10 10:03 ` Wolfram Sang
  2014-02-10 10:04 ` [PATCH 06/17] i2c: i2c-bfin-twi: " Wolfram Sang
                   ` (12 subsequent siblings)
  17 siblings, 0 replies; 28+ messages in thread
From: Wolfram Sang @ 2014-02-10 10:03 UTC (permalink / raw)
  To: linux-i2c; +Cc: Wolfram Sang, linux-kernel

Warn users that class based instantiation is going away soon in favour
of more robust probing and faster bootup times.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
---

This patch is a suggestion. Looking for an ack by someone who actually uses
the driver.

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

diff --git a/drivers/i2c/busses/i2c-bcm2835.c b/drivers/i2c/busses/i2c-bcm2835.c
index 77df97b..6722808 100644
--- a/drivers/i2c/busses/i2c-bcm2835.c
+++ b/drivers/i2c/busses/i2c-bcm2835.c
@@ -295,7 +295,7 @@ static int bcm2835_i2c_probe(struct platform_device *pdev)
 	adap = &i2c_dev->adapter;
 	i2c_set_adapdata(adap, i2c_dev);
 	adap->owner = THIS_MODULE;
-	adap->class = I2C_CLASS_HWMON;
+	adap->class = I2C_CLASS_HWMON | I2C_CLASS_DEPRECATED;
 	strlcpy(adap->name, "bcm2835 I2C adapter", sizeof(adap->name));
 	adap->algo = &bcm2835_i2c_algo;
 	adap->dev.parent = &pdev->dev;
-- 
1.8.5.1


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

* [PATCH 06/17] i2c: i2c-bfin-twi: deprecate class based instantiation
  2014-02-10 10:03 [PATCH 00/17] i2c: deprecate class based instantiation for embedded I2C drivers Wolfram Sang
                   ` (4 preceding siblings ...)
  2014-02-10 10:03 ` [PATCH 05/17] i2c: i2c-bcm2835: " Wolfram Sang
@ 2014-02-10 10:04 ` Wolfram Sang
  2014-02-11  9:02   ` Sonic Zhang
  2014-02-10 10:04 ` [PATCH 07/17] i2c: i2c-davinci: " Wolfram Sang
                   ` (11 subsequent siblings)
  17 siblings, 1 reply; 28+ messages in thread
From: Wolfram Sang @ 2014-02-10 10:04 UTC (permalink / raw)
  To: linux-i2c; +Cc: Wolfram Sang, Sonic Zhang, adi-buildroot-devel, linux-kernel

Warn users that class based instantiation is going away soon in favour
of more robust probing and faster bootup times.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Cc: Sonic Zhang <sonic.zhang@analog.com>
---

This patch is a suggestion. Looking for an ack by someone who actually uses
the driver.

 drivers/i2c/busses/i2c-bfin-twi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-bfin-twi.c b/drivers/i2c/busses/i2c-bfin-twi.c
index 3b9bd9a..c75f0e9 100644
--- a/drivers/i2c/busses/i2c-bfin-twi.c
+++ b/drivers/i2c/busses/i2c-bfin-twi.c
@@ -669,7 +669,7 @@ static int i2c_bfin_twi_probe(struct platform_device *pdev)
 	strlcpy(p_adap->name, pdev->name, sizeof(p_adap->name));
 	p_adap->algo = &bfin_twi_algorithm;
 	p_adap->algo_data = iface;
-	p_adap->class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
+	p_adap->class = I2C_CLASS_HWMON | I2C_CLASS_SPD | I2C_CLASS_DEPRECATED;
 	p_adap->dev.parent = &pdev->dev;
 	p_adap->timeout = 5 * HZ;
 	p_adap->retries = 3;
-- 
1.8.5.1


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

* [PATCH 07/17] i2c: i2c-davinci: deprecate class based instantiation
  2014-02-10 10:03 [PATCH 00/17] i2c: deprecate class based instantiation for embedded I2C drivers Wolfram Sang
                   ` (5 preceding siblings ...)
  2014-02-10 10:04 ` [PATCH 06/17] i2c: i2c-bfin-twi: " Wolfram Sang
@ 2014-02-10 10:04 ` Wolfram Sang
  2014-02-10 10:04 ` [PATCH 08/17] i2c: i2c-designware-platdrv: " Wolfram Sang
                   ` (10 subsequent siblings)
  17 siblings, 0 replies; 28+ messages in thread
From: Wolfram Sang @ 2014-02-10 10:04 UTC (permalink / raw)
  To: linux-i2c
  Cc: Wolfram Sang, Sekhar Nori, Kevin Hilman,
	davinci-linux-open-source, linux-kernel

Warn users that class based instantiation is going away soon in favour
of more robust probing and faster bootup times.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Cc: Sekhar Nori <nsekhar@ti.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
---

This patch is a suggestion. Looking for an ack by someone who actually uses
the driver.

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

diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c
index af0b583..389bc68 100644
--- a/drivers/i2c/busses/i2c-davinci.c
+++ b/drivers/i2c/busses/i2c-davinci.c
@@ -712,7 +712,7 @@ static int davinci_i2c_probe(struct platform_device *pdev)
 	adap = &dev->adapter;
 	i2c_set_adapdata(adap, dev);
 	adap->owner = THIS_MODULE;
-	adap->class = I2C_CLASS_HWMON;
+	adap->class = I2C_CLASS_HWMON | I2C_CLASS_DEPRECATED;
 	strlcpy(adap->name, "DaVinci I2C adapter", sizeof(adap->name));
 	adap->algo = &i2c_davinci_algo;
 	adap->dev.parent = &pdev->dev;
-- 
1.8.5.1


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

* [PATCH 08/17] i2c: i2c-designware-platdrv: deprecate class based instantiation
  2014-02-10 10:03 [PATCH 00/17] i2c: deprecate class based instantiation for embedded I2C drivers Wolfram Sang
                   ` (6 preceding siblings ...)
  2014-02-10 10:04 ` [PATCH 07/17] i2c: i2c-davinci: " Wolfram Sang
@ 2014-02-10 10:04 ` Wolfram Sang
  2014-02-10 10:04 ` [PATCH 09/17] i2c: i2c-mv64xxx: " Wolfram Sang
                   ` (9 subsequent siblings)
  17 siblings, 0 replies; 28+ messages in thread
From: Wolfram Sang @ 2014-02-10 10:04 UTC (permalink / raw)
  To: linux-i2c; +Cc: Wolfram Sang, linux-kernel

Warn users that class based instantiation is going away soon in favour
of more robust probing and faster bootup times.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
---

This patch is a suggestion. Looking for an ack by someone who actually uses
the driver.

 drivers/i2c/busses/i2c-designware-platdrv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index d0bdac0..d348940 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -195,7 +195,7 @@ static int dw_i2c_probe(struct platform_device *pdev)
 	adap = &dev->adapter;
 	i2c_set_adapdata(adap, dev);
 	adap->owner = THIS_MODULE;
-	adap->class = I2C_CLASS_HWMON;
+	adap->class = I2C_CLASS_HWMON | I2C_CLASS_DEPRECATED;
 	strlcpy(adap->name, "Synopsys DesignWare I2C adapter",
 			sizeof(adap->name));
 	adap->algo = &i2c_dw_algo;
-- 
1.8.5.1


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

* [PATCH 09/17] i2c: i2c-mv64xxx: deprecate class based instantiation
  2014-02-10 10:03 [PATCH 00/17] i2c: deprecate class based instantiation for embedded I2C drivers Wolfram Sang
                   ` (7 preceding siblings ...)
  2014-02-10 10:04 ` [PATCH 08/17] i2c: i2c-designware-platdrv: " Wolfram Sang
@ 2014-02-10 10:04 ` Wolfram Sang
  2014-02-10 10:04 ` [PATCH 10/17] i2c: i2c-nomadik: " Wolfram Sang
                   ` (8 subsequent siblings)
  17 siblings, 0 replies; 28+ messages in thread
From: Wolfram Sang @ 2014-02-10 10:04 UTC (permalink / raw)
  To: linux-i2c; +Cc: Wolfram Sang, linux-kernel

Warn users that class based instantiation is going away soon in favour
of more robust probing and faster bootup times.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
---

This patch is a suggestion. Looking for an ack by someone who actually uses
the driver.

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

diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c
index 8be7e42..05801c6 100644
--- a/drivers/i2c/busses/i2c-mv64xxx.c
+++ b/drivers/i2c/busses/i2c-mv64xxx.c
@@ -851,7 +851,7 @@ mv64xxx_i2c_probe(struct platform_device *pd)
 	drv_data->adapter.dev.parent = &pd->dev;
 	drv_data->adapter.algo = &mv64xxx_i2c_algo;
 	drv_data->adapter.owner = THIS_MODULE;
-	drv_data->adapter.class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
+	drv_data->adapter.class = I2C_CLASS_HWMON | I2C_CLASS_SPD | I2C_CLASS_DEPRECATED;
 	drv_data->adapter.nr = pd->id;
 	drv_data->adapter.dev.of_node = pd->dev.of_node;
 	platform_set_drvdata(pd, drv_data);
-- 
1.8.5.1


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

* [PATCH 10/17] i2c: i2c-nomadik: deprecate class based instantiation
  2014-02-10 10:03 [PATCH 00/17] i2c: deprecate class based instantiation for embedded I2C drivers Wolfram Sang
                   ` (8 preceding siblings ...)
  2014-02-10 10:04 ` [PATCH 09/17] i2c: i2c-mv64xxx: " Wolfram Sang
@ 2014-02-10 10:04 ` Wolfram Sang
  2014-02-12 16:24   ` Linus Walleij
  2014-02-10 10:04 ` [PATCH 11/17] i2c: i2c-ocores: " Wolfram Sang
                   ` (7 subsequent siblings)
  17 siblings, 1 reply; 28+ messages in thread
From: Wolfram Sang @ 2014-02-10 10:04 UTC (permalink / raw)
  To: linux-i2c
  Cc: Wolfram Sang, Alessandro Rubini, Linus Walleij, linux-arm-kernel,
	linux-kernel

Warn users that class based instantiation is going away soon in favour
of more robust probing and faster bootup times.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Cc: Alessandro Rubini <rubini@unipv.it>
Cc: Linus Walleij <linus.walleij@linaro.org>
---

This patch is a suggestion. Looking for an ack by someone who actually uses
the driver.

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

diff --git a/drivers/i2c/busses/i2c-nomadik.c b/drivers/i2c/busses/i2c-nomadik.c
index 8bf9ac0..e3777ac 100644
--- a/drivers/i2c/busses/i2c-nomadik.c
+++ b/drivers/i2c/busses/i2c-nomadik.c
@@ -1019,7 +1019,7 @@ static int nmk_i2c_probe(struct amba_device *adev, const struct amba_id *id)
 	adap->dev.of_node = np;
 	adap->dev.parent = &adev->dev;
 	adap->owner	= THIS_MODULE;
-	adap->class	= I2C_CLASS_HWMON | I2C_CLASS_SPD;
+	adap->class	= I2C_CLASS_HWMON | I2C_CLASS_SPD | I2C_CLASS_DEPRECATED;
 	adap->algo	= &nmk_i2c_algo;
 	adap->timeout	= msecs_to_jiffies(pdata->timeout);
 	snprintf(adap->name, sizeof(adap->name),
-- 
1.8.5.1


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

* [PATCH 11/17] i2c: i2c-ocores: deprecate class based instantiation
  2014-02-10 10:03 [PATCH 00/17] i2c: deprecate class based instantiation for embedded I2C drivers Wolfram Sang
                   ` (9 preceding siblings ...)
  2014-02-10 10:04 ` [PATCH 10/17] i2c: i2c-nomadik: " Wolfram Sang
@ 2014-02-10 10:04 ` Wolfram Sang
  2014-02-10 10:14   ` Peter Korsgaard
  2014-02-10 10:04 ` [PATCH 12/17] i2c: i2c-rcar: " Wolfram Sang
                   ` (6 subsequent siblings)
  17 siblings, 1 reply; 28+ messages in thread
From: Wolfram Sang @ 2014-02-10 10:04 UTC (permalink / raw)
  To: linux-i2c; +Cc: Wolfram Sang, Peter Korsgaard, linux-kernel

Warn users that class based instantiation is going away soon in favour
of more robust probing and faster bootup times.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Cc: Peter Korsgaard <jacmet@sunsite.dk>
---

This patch is a suggestion. Looking for an ack by someone who actually uses
the driver.

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

diff --git a/drivers/i2c/busses/i2c-ocores.c b/drivers/i2c/busses/i2c-ocores.c
index c61f37a..f49fe26 100644
--- a/drivers/i2c/busses/i2c-ocores.c
+++ b/drivers/i2c/busses/i2c-ocores.c
@@ -247,7 +247,7 @@ static const struct i2c_algorithm ocores_algorithm = {
 static struct i2c_adapter ocores_adapter = {
 	.owner		= THIS_MODULE,
 	.name		= "i2c-ocores",
-	.class		= I2C_CLASS_HWMON | I2C_CLASS_SPD,
+	.class		= I2C_CLASS_HWMON | I2C_CLASS_SPD | I2C_CLASS_DEPRECATED,
 	.algo		= &ocores_algorithm,
 };
 
-- 
1.8.5.1


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

* [PATCH 12/17] i2c: i2c-rcar: deprecate class based instantiation
  2014-02-10 10:03 [PATCH 00/17] i2c: deprecate class based instantiation for embedded I2C drivers Wolfram Sang
                   ` (10 preceding siblings ...)
  2014-02-10 10:04 ` [PATCH 11/17] i2c: i2c-ocores: " Wolfram Sang
@ 2014-02-10 10:04 ` Wolfram Sang
  2014-02-10 10:04 ` [PATCH 13/17] i2c: i2c-s3c2410: " Wolfram Sang
                   ` (5 subsequent siblings)
  17 siblings, 0 replies; 28+ messages in thread
From: Wolfram Sang @ 2014-02-10 10:04 UTC (permalink / raw)
  To: linux-i2c; +Cc: Wolfram Sang, linux-kernel

Warn users that class based instantiation is going away soon in favour
of more robust probing and faster bootup times.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
---

This patch is a suggestion. Looking for an ack by someone who actually uses
the driver.

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

diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c
index 2c2fd7c..a4951de 100644
--- a/drivers/i2c/busses/i2c-rcar.c
+++ b/drivers/i2c/busses/i2c-rcar.c
@@ -691,7 +691,7 @@ static int rcar_i2c_probe(struct platform_device *pdev)
 	adap			= &priv->adap;
 	adap->nr		= pdev->id;
 	adap->algo		= &rcar_i2c_algo;
-	adap->class		= I2C_CLASS_HWMON | I2C_CLASS_SPD;
+	adap->class		= I2C_CLASS_HWMON | I2C_CLASS_SPD | I2C_CLASS_DEPRECATED;
 	adap->retries		= 3;
 	adap->dev.parent	= dev;
 	adap->dev.of_node	= dev->of_node;
-- 
1.8.5.1


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

* [PATCH 13/17] i2c: i2c-s3c2410: deprecate class based instantiation
  2014-02-10 10:03 [PATCH 00/17] i2c: deprecate class based instantiation for embedded I2C drivers Wolfram Sang
                   ` (11 preceding siblings ...)
  2014-02-10 10:04 ` [PATCH 12/17] i2c: i2c-rcar: " Wolfram Sang
@ 2014-02-10 10:04 ` Wolfram Sang
  2014-02-10 10:04 ` [PATCH 14/17] i2c: i2c-sirf: " Wolfram Sang
                   ` (4 subsequent siblings)
  17 siblings, 0 replies; 28+ messages in thread
From: Wolfram Sang @ 2014-02-10 10:04 UTC (permalink / raw)
  To: linux-i2c
  Cc: Wolfram Sang, Ben Dooks, Kukjin Kim, linux-arm-kernel,
	linux-samsung-soc, linux-kernel

Warn users that class based instantiation is going away soon in favour
of more robust probing and faster bootup times.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Kukjin Kim <kgene.kim@samsung.com>
---

This patch is a suggestion. Looking for an ack by someone who actually uses
the driver.

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

diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index bf8fb94..4a623e0 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -1062,7 +1062,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
 	i2c->adap.owner   = THIS_MODULE;
 	i2c->adap.algo    = &s3c24xx_i2c_algorithm;
 	i2c->adap.retries = 2;
-	i2c->adap.class   = I2C_CLASS_HWMON | I2C_CLASS_SPD;
+	i2c->adap.class   = I2C_CLASS_HWMON | I2C_CLASS_SPD | I2C_CLASS_DEPRECATED;
 	i2c->tx_setup     = 50;
 
 	init_waitqueue_head(&i2c->wait);
-- 
1.8.5.1


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

* [PATCH 14/17] i2c: i2c-sirf: deprecate class based instantiation
  2014-02-10 10:03 [PATCH 00/17] i2c: deprecate class based instantiation for embedded I2C drivers Wolfram Sang
                   ` (12 preceding siblings ...)
  2014-02-10 10:04 ` [PATCH 13/17] i2c: i2c-s3c2410: " Wolfram Sang
@ 2014-02-10 10:04 ` Wolfram Sang
  2014-02-10 10:04 ` [PATCH 15/17] i2c: i2c-stu300: " Wolfram Sang
                   ` (3 subsequent siblings)
  17 siblings, 0 replies; 28+ messages in thread
From: Wolfram Sang @ 2014-02-10 10:04 UTC (permalink / raw)
  To: linux-i2c; +Cc: Wolfram Sang, Barry Song, linux-arm-kernel, linux-kernel

Warn users that class based instantiation is going away soon in favour
of more robust probing and faster bootup times.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Cc: Barry Song <baohua@kernel.org>
---

This patch is a suggestion. Looking for an ack by someone who actually uses
the driver.

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

diff --git a/drivers/i2c/busses/i2c-sirf.c b/drivers/i2c/busses/i2c-sirf.c
index 6784f7f..8e3be7e 100644
--- a/drivers/i2c/busses/i2c-sirf.c
+++ b/drivers/i2c/busses/i2c-sirf.c
@@ -312,7 +312,7 @@ static int i2c_sirfsoc_probe(struct platform_device *pdev)
 		goto out;
 	}
 	adap = &siic->adapter;
-	adap->class = I2C_CLASS_HWMON;
+	adap->class = I2C_CLASS_HWMON | I2C_CLASS_DEPRECATED;
 
 	mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	siic->base = devm_ioremap_resource(&pdev->dev, mem_res);
-- 
1.8.5.1


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

* [PATCH 15/17] i2c: i2c-stu300: deprecate class based instantiation
  2014-02-10 10:03 [PATCH 00/17] i2c: deprecate class based instantiation for embedded I2C drivers Wolfram Sang
                   ` (13 preceding siblings ...)
  2014-02-10 10:04 ` [PATCH 14/17] i2c: i2c-sirf: " Wolfram Sang
@ 2014-02-10 10:04 ` Wolfram Sang
  2014-02-12 16:22   ` Linus Walleij
  2014-02-10 10:04 ` [PATCH 16/17] i2c: i2c-tegra: " Wolfram Sang
                   ` (2 subsequent siblings)
  17 siblings, 1 reply; 28+ messages in thread
From: Wolfram Sang @ 2014-02-10 10:04 UTC (permalink / raw)
  To: linux-i2c; +Cc: Wolfram Sang, Linus Walleij, linux-arm-kernel, linux-kernel

Warn users that class based instantiation is going away soon in favour
of more robust probing and faster bootup times.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Cc: Linus Walleij <linus.walleij@linaro.org>
---

This patch is a suggestion. Looking for an ack by someone who actually uses
the driver.

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

diff --git a/drivers/i2c/busses/i2c-stu300.c b/drivers/i2c/busses/i2c-stu300.c
index 04a17b9..d381af9 100644
--- a/drivers/i2c/busses/i2c-stu300.c
+++ b/drivers/i2c/busses/i2c-stu300.c
@@ -911,7 +911,7 @@ static int stu300_probe(struct platform_device *pdev)
 	adap = &dev->adapter;
 	adap->owner = THIS_MODULE;
 	/* DDC class but actually often used for more generic I2C */
-	adap->class = I2C_CLASS_DDC;
+	adap->class = I2C_CLASS_DDC | I2C_CLASS_DEPRECATED;
 	strlcpy(adap->name, "ST Microelectronics DDC I2C adapter",
 		sizeof(adap->name));
 	adap->nr = bus_nr;
-- 
1.8.5.1


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

* [PATCH 16/17] i2c: i2c-tegra: deprecate class based instantiation
  2014-02-10 10:03 [PATCH 00/17] i2c: deprecate class based instantiation for embedded I2C drivers Wolfram Sang
                   ` (14 preceding siblings ...)
  2014-02-10 10:04 ` [PATCH 15/17] i2c: i2c-stu300: " Wolfram Sang
@ 2014-02-10 10:04 ` Wolfram Sang
  2014-02-10 16:46   ` Stephen Warren
  2014-02-10 10:04 ` [PATCH 17/17] i2c: i2c-xiic: " Wolfram Sang
  2014-03-28  7:55 ` [PATCH 00/17] i2c: deprecate class based instantiation for embedded I2C drivers Wolfram Sang
  17 siblings, 1 reply; 28+ messages in thread
From: Wolfram Sang @ 2014-02-10 10:04 UTC (permalink / raw)
  To: linux-i2c
  Cc: Wolfram Sang, Laxman Dewangan, Stephen Warren, Thierry Reding,
	linux-tegra, linux-kernel

Warn users that class based instantiation is going away soon in favour
of more robust probing and faster bootup times.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Cc: Laxman Dewangan <ldewangan@nvidia.com>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
---

This patch is a suggestion. Looking for an ack by someone who actually uses
the driver.

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

diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
index e661ede..a9adbbe 100644
--- a/drivers/i2c/busses/i2c-tegra.c
+++ b/drivers/i2c/busses/i2c-tegra.c
@@ -787,7 +787,7 @@ static int tegra_i2c_probe(struct platform_device *pdev)
 
 	i2c_set_adapdata(&i2c_dev->adapter, i2c_dev);
 	i2c_dev->adapter.owner = THIS_MODULE;
-	i2c_dev->adapter.class = I2C_CLASS_HWMON;
+	i2c_dev->adapter.class = I2C_CLASS_HWMON | I2C_CLASS_DEPRECATED;
 	strlcpy(i2c_dev->adapter.name, "Tegra I2C adapter",
 		sizeof(i2c_dev->adapter.name));
 	i2c_dev->adapter.algo = &tegra_i2c_algo;
-- 
1.8.5.1


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

* [PATCH 17/17] i2c: i2c-xiic: deprecate class based instantiation
  2014-02-10 10:03 [PATCH 00/17] i2c: deprecate class based instantiation for embedded I2C drivers Wolfram Sang
                   ` (15 preceding siblings ...)
  2014-02-10 10:04 ` [PATCH 16/17] i2c: i2c-tegra: " Wolfram Sang
@ 2014-02-10 10:04 ` Wolfram Sang
  2014-03-28  7:55 ` [PATCH 00/17] i2c: deprecate class based instantiation for embedded I2C drivers Wolfram Sang
  17 siblings, 0 replies; 28+ messages in thread
From: Wolfram Sang @ 2014-02-10 10:04 UTC (permalink / raw)
  To: linux-i2c; +Cc: Wolfram Sang, linux-kernel

Warn users that class based instantiation is going away soon in favour
of more robust probing and faster bootup times.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
---

This patch is a suggestion. Looking for an ack by someone who actually uses
the driver.

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

diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
index fc2716a..6bda167 100644
--- a/drivers/i2c/busses/i2c-xiic.c
+++ b/drivers/i2c/busses/i2c-xiic.c
@@ -682,7 +682,7 @@ static const struct i2c_algorithm xiic_algorithm = {
 static struct i2c_adapter xiic_adapter = {
 	.owner		= THIS_MODULE,
 	.name		= DRIVER_NAME,
-	.class		= I2C_CLASS_HWMON | I2C_CLASS_SPD,
+	.class		= I2C_CLASS_HWMON | I2C_CLASS_SPD | I2C_CLASS_DEPRECATED,
 	.algo		= &xiic_algorithm,
 };
 
-- 
1.8.5.1


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

* Re: [PATCH 11/17] i2c: i2c-ocores: deprecate class based instantiation
  2014-02-10 10:04 ` [PATCH 11/17] i2c: i2c-ocores: " Wolfram Sang
@ 2014-02-10 10:14   ` Peter Korsgaard
  0 siblings, 0 replies; 28+ messages in thread
From: Peter Korsgaard @ 2014-02-10 10:14 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: linux-i2c, Peter Korsgaard, linux-kernel

>>>>> "Wolfram" == Wolfram Sang <wsa@the-dreams.de> writes:

 > Warn users that class based instantiation is going away soon in favour
 > of more robust probing and faster bootup times.

 > Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
 > Cc: Peter Korsgaard <jacmet@sunsite.dk>
 > ---

 > This patch is a suggestion. Looking for an ack by someone who actually uses
 > the driver.

It's been some time since I last used it, but I never needed the class
based probing, so:

Acked-by: Peter Korsgaard <jacmet@sunsite.dk>

-- 
Bye, Peter Korsgaard

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

* Re: [PATCH 16/17] i2c: i2c-tegra: deprecate class based instantiation
  2014-02-10 10:04 ` [PATCH 16/17] i2c: i2c-tegra: " Wolfram Sang
@ 2014-02-10 16:46   ` Stephen Warren
  0 siblings, 0 replies; 28+ messages in thread
From: Stephen Warren @ 2014-02-10 16:46 UTC (permalink / raw)
  To: Wolfram Sang, linux-i2c
  Cc: Laxman Dewangan, Thierry Reding, linux-tegra, linux-kernel

On 02/10/2014 03:04 AM, Wolfram Sang wrote:
> Warn users that class based instantiation is going away soon in favour
> of more robust probing and faster bootup times.

Acked-by: Stephen Warren <swarren@nvidia.com>


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

* Re: [PATCH 01/17] Documentation: i2c: describe devicetree method for instantiating devices
  2014-02-10 10:03 ` [PATCH 01/17] Documentation: i2c: describe devicetree method for instantiating devices Wolfram Sang
@ 2014-02-10 18:21   ` linux
  2014-02-12 15:15     ` Wolfram Sang
  2014-02-15 14:48   ` Wolfram Sang
  1 sibling, 1 reply; 28+ messages in thread
From: linux @ 2014-02-10 18:21 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-i2c, devicetree, linux-arm-kernel, Rob Landley, linux-doc,
	linux-kernel

Quoting Wolfram Sang <wsa@the-dreams.de>:

> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
> Cc: devicetree@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org
> ---
>
>  Documentation/i2c/instantiating-devices | 34  
> +++++++++++++++++++++++++++++++--
>  1 file changed, 32 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/i2c/instantiating-devices  
> b/Documentation/i2c/instantiating-devices
> index c70e7a7..6df095a 100644
> --- a/Documentation/i2c/instantiating-devices
> +++ b/Documentation/i2c/instantiating-devices
> @@ -8,8 +8,8 @@ reason, the kernel code must instantiate I2C devices  
> explicitly. There are
>  several ways to achieve this, depending on the context and requirements.
>
>
> -Method 1: Declare the I2C devices by bus number
> ------------------------------------------------
> +Method 1a: Declare the I2C devices by bus number
> +------------------------------------------------
>
>  This method is appropriate when the I2C bus is a system bus as is the case
>  for many embedded systems. On such systems, each I2C bus has a number
> @@ -51,6 +51,36 @@ The devices will be automatically unbound and  
> destroyed when the I2C bus
>  they sit on goes away (if ever.)
>
>
> +Method 1b: Declare the I2C devices via devicetree
> +-------------------------------------------------
> +

Hi Wolfram,

There is now also a means to instantiate I2C devices through
ACPI. This is documented in Documentation/acpi/enumeration.txt.

Might be worthwhile to reference it from instantiating-devices.
I guess that would be a separate patch though.

Thanks,
Guenter


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

* Re: [PATCH 06/17] i2c: i2c-bfin-twi: deprecate class based instantiation
  2014-02-10 10:04 ` [PATCH 06/17] i2c: i2c-bfin-twi: " Wolfram Sang
@ 2014-02-11  9:02   ` Sonic Zhang
  0 siblings, 0 replies; 28+ messages in thread
From: Sonic Zhang @ 2014-02-11  9:02 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: linux-i2c, Sonic Zhang, adi-buildroot-devel, Linux Kernel

Acked-by: Sonic Zhang <sonic.zhang@analog.com>

On Mon, Feb 10, 2014 at 6:04 PM, Wolfram Sang <wsa@the-dreams.de> wrote:
> Warn users that class based instantiation is going away soon in favour
> of more robust probing and faster bootup times.
>
> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
> Cc: Sonic Zhang <sonic.zhang@analog.com>
> ---
>
> This patch is a suggestion. Looking for an ack by someone who actually uses
> the driver.
>
>  drivers/i2c/busses/i2c-bfin-twi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/i2c/busses/i2c-bfin-twi.c b/drivers/i2c/busses/i2c-bfin-twi.c
> index 3b9bd9a..c75f0e9 100644
> --- a/drivers/i2c/busses/i2c-bfin-twi.c
> +++ b/drivers/i2c/busses/i2c-bfin-twi.c
> @@ -669,7 +669,7 @@ static int i2c_bfin_twi_probe(struct platform_device *pdev)
>         strlcpy(p_adap->name, pdev->name, sizeof(p_adap->name));
>         p_adap->algo = &bfin_twi_algorithm;
>         p_adap->algo_data = iface;
> -       p_adap->class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
> +       p_adap->class = I2C_CLASS_HWMON | I2C_CLASS_SPD | I2C_CLASS_DEPRECATED;
>         p_adap->dev.parent = &pdev->dev;
>         p_adap->timeout = 5 * HZ;
>         p_adap->retries = 3;
> --
> 1.8.5.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

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

* Re: [PATCH 04/17] i2c: i2c-at91: deprecate class based instantiation
  2014-02-10 10:03 ` [PATCH 04/17] i2c: i2c-at91: " Wolfram Sang
@ 2014-02-11 13:33   ` Ludovic Desroches
  0 siblings, 0 replies; 28+ messages in thread
From: Ludovic Desroches @ 2014-02-11 13:33 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: linux-i2c, linux-kernel, Ludovic Desroches

On Mon, Feb 10, 2014 at 11:03:58AM +0100, Wolfram Sang wrote:
> Warn users that class based instantiation is going away soon in favour
> of more robust probing and faster bootup times.
> 
> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
> Cc: Ludovic Desroches <ludovic.desroches@atmel.com>

Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com>

Thanks

> ---
> 
>  drivers/i2c/busses/i2c-at91.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/busses/i2c-at91.c b/drivers/i2c/busses/i2c-at91.c
> index 8edba9d..4babcdb 100644
> --- a/drivers/i2c/busses/i2c-at91.c
> +++ b/drivers/i2c/busses/i2c-at91.c
> @@ -759,7 +759,7 @@ static int at91_twi_probe(struct platform_device *pdev)
>  	snprintf(dev->adapter.name, sizeof(dev->adapter.name), "AT91");
>  	i2c_set_adapdata(&dev->adapter, dev);
>  	dev->adapter.owner = THIS_MODULE;
> -	dev->adapter.class = I2C_CLASS_HWMON;
> +	dev->adapter.class = I2C_CLASS_HWMON | I2C_CLASS_DEPRECATED;
>  	dev->adapter.algo = &at91_twi_algorithm;
>  	dev->adapter.dev.parent = dev->dev;
>  	dev->adapter.nr = pdev->id;
> -- 
> 1.8.5.1
> 

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

* Re: [PATCH 01/17] Documentation: i2c: describe devicetree method for instantiating devices
  2014-02-10 18:21   ` linux
@ 2014-02-12 15:15     ` Wolfram Sang
  0 siblings, 0 replies; 28+ messages in thread
From: Wolfram Sang @ 2014-02-12 15:15 UTC (permalink / raw)
  To: linux
  Cc: linux-i2c, devicetree, linux-arm-kernel, Rob Landley, linux-doc,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 298 bytes --]


> There is now also a means to instantiate I2C devices through
> ACPI. This is documented in Documentation/acpi/enumeration.txt.
> 
> Might be worthwhile to reference it from instantiating-devices.
> I guess that would be a separate patch though.

Yes, it would. Thanks for the pointer!


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH 15/17] i2c: i2c-stu300: deprecate class based instantiation
  2014-02-10 10:04 ` [PATCH 15/17] i2c: i2c-stu300: " Wolfram Sang
@ 2014-02-12 16:22   ` Linus Walleij
  0 siblings, 0 replies; 28+ messages in thread
From: Linus Walleij @ 2014-02-12 16:22 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: linux-i2c, linux-arm-kernel, linux-kernel

On Mon, Feb 10, 2014 at 11:04 AM, Wolfram Sang <wsa@the-dreams.de> wrote:

> Warn users that class based instantiation is going away soon in favour
> of more robust probing and faster bootup times.
>
> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> ---
>
> This patch is a suggestion. Looking for an ack by someone who actually uses
> the driver.

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

* Re: [PATCH 10/17] i2c: i2c-nomadik: deprecate class based instantiation
  2014-02-10 10:04 ` [PATCH 10/17] i2c: i2c-nomadik: " Wolfram Sang
@ 2014-02-12 16:24   ` Linus Walleij
  0 siblings, 0 replies; 28+ messages in thread
From: Linus Walleij @ 2014-02-12 16:24 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: linux-i2c, Alessandro Rubini, linux-arm-kernel, linux-kernel

On Mon, Feb 10, 2014 at 11:04 AM, Wolfram Sang <wsa@the-dreams.de> wrote:

> Warn users that class based instantiation is going away soon in favour
> of more robust probing and faster bootup times.
>
> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
> Cc: Alessandro Rubini <rubini@unipv.it>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> ---
>
> This patch is a suggestion. Looking for an ack by someone who actually uses
> the driver.

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

* Re: [PATCH 01/17] Documentation: i2c: describe devicetree method for instantiating devices
  2014-02-10 10:03 ` [PATCH 01/17] Documentation: i2c: describe devicetree method for instantiating devices Wolfram Sang
  2014-02-10 18:21   ` linux
@ 2014-02-15 14:48   ` Wolfram Sang
  1 sibling, 0 replies; 28+ messages in thread
From: Wolfram Sang @ 2014-02-15 14:48 UTC (permalink / raw)
  To: linux-i2c
  Cc: devicetree, linux-arm-kernel, Rob Landley, linux-doc, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 222 bytes --]

On Mon, Feb 10, 2014 at 11:03:55AM +0100, Wolfram Sang wrote:
> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
> Cc: devicetree@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org

Applied to for-current, thanks!


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH 00/17] i2c: deprecate class based instantiation for embedded I2C drivers
  2014-02-10 10:03 [PATCH 00/17] i2c: deprecate class based instantiation for embedded I2C drivers Wolfram Sang
                   ` (16 preceding siblings ...)
  2014-02-10 10:04 ` [PATCH 17/17] i2c: i2c-xiic: " Wolfram Sang
@ 2014-03-28  7:55 ` Wolfram Sang
  17 siblings, 0 replies; 28+ messages in thread
From: Wolfram Sang @ 2014-03-28  7:55 UTC (permalink / raw)
  To: linux-i2c
  Cc: adi-buildroot-devel, davinci-linux-open-source, linux-arm-kernel,
	linux-doc, linux-kernel, linux-omap, linux-samsung-soc,
	linux-tegra

[-- Attachment #1: Type: text/plain, Size: 2857 bytes --]

On Mon, Feb 10, 2014 at 11:03:54AM +0100, Wolfram Sang wrote:
> With I2C, class based instantiation means if a master driver has e.g.
> I2C_CLASS_HWMON set, all slave drivers with this class will try to probe a
> device using an array of possible addresses and some heuristics. That creates
> traffic and needs time, even when nothing is connected. This mechanism is
> needed when you do not have another method to describe the slaves. Embedded I2C
> drivers do not need class based instantiation, since there is i2c_board_info or
> devicetree description. Some drivers have the class flags set, though, and it
> has spread further over the years. We can't remove the flags directly, because
> there might be users out there relying on this feature. So, we add a
> deprecation warning if a device is instantiated via class attributes. After
> giving some time to switch over, we can then finally remove the class flags and
> gain boot time.
> 
> Patch 1 adds some missing documentation. Patch 2 adds the deprecation feature.
> Patches 3+4 are tested on hardware I need. Patches 5-17 are suggestions for
> drivers I think could benefit from that. For those, acks are needed before I
> will apply them to my tree. If you use a different driver which can also
> benefit from this, just send a patch adding the new DEPRECATED flag.
> 
> The series can also be found here:
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git i2c/deprecated_class
> 
> Thanks,
> 
>    Wolfram
> 
> 
> Wolfram Sang (17):
>   Documentation: i2c: describe devicetree method for instantiating
>     devices
>   i2c: add deprecation warning for class based instantiation
>   i2c: i2c-omap: deprecate class based instantiation
>   i2c: i2c-at91: deprecate class based instantiation
>   i2c: i2c-bcm2835: deprecate class based instantiation
>   i2c: i2c-bfin-twi: deprecate class based instantiation
>   i2c: i2c-davinci: deprecate class based instantiation
>   i2c: i2c-designware-platdrv: deprecate class based instantiation
>   i2c: i2c-mv64xxx: deprecate class based instantiation
>   i2c: i2c-nomadik: deprecate class based instantiation
>   i2c: i2c-ocores: deprecate class based instantiation
>   i2c: i2c-rcar: deprecate class based instantiation
>   i2c: i2c-s3c2410: deprecate class based instantiation
>   i2c: i2c-sirf: deprecate class based instantiation
>   i2c: i2c-stu300: deprecate class based instantiation
>   i2c: i2c-tegra: deprecate class based instantiation
>   i2c: i2c-xiic: deprecate class based instantiation

I reconsidered and have now applied all patches. That way, all these
drivers can be converted to no class based instantiation in one go after
some grace period. If it turns out, one driver actually needs it, there
is still the grace period left to remove the DEPRECATED flag again.


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

end of thread, other threads:[~2014-03-28  7:55 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-10 10:03 [PATCH 00/17] i2c: deprecate class based instantiation for embedded I2C drivers Wolfram Sang
2014-02-10 10:03 ` [PATCH 01/17] Documentation: i2c: describe devicetree method for instantiating devices Wolfram Sang
2014-02-10 18:21   ` linux
2014-02-12 15:15     ` Wolfram Sang
2014-02-15 14:48   ` Wolfram Sang
2014-02-10 10:03 ` [PATCH 02/17] i2c: add deprecation warning for class based instantiation Wolfram Sang
2014-02-10 10:03 ` [PATCH 03/17] i2c: i2c-omap: deprecate " Wolfram Sang
2014-02-10 10:03 ` [PATCH 04/17] i2c: i2c-at91: " Wolfram Sang
2014-02-11 13:33   ` Ludovic Desroches
2014-02-10 10:03 ` [PATCH 05/17] i2c: i2c-bcm2835: " Wolfram Sang
2014-02-10 10:04 ` [PATCH 06/17] i2c: i2c-bfin-twi: " Wolfram Sang
2014-02-11  9:02   ` Sonic Zhang
2014-02-10 10:04 ` [PATCH 07/17] i2c: i2c-davinci: " Wolfram Sang
2014-02-10 10:04 ` [PATCH 08/17] i2c: i2c-designware-platdrv: " Wolfram Sang
2014-02-10 10:04 ` [PATCH 09/17] i2c: i2c-mv64xxx: " Wolfram Sang
2014-02-10 10:04 ` [PATCH 10/17] i2c: i2c-nomadik: " Wolfram Sang
2014-02-12 16:24   ` Linus Walleij
2014-02-10 10:04 ` [PATCH 11/17] i2c: i2c-ocores: " Wolfram Sang
2014-02-10 10:14   ` Peter Korsgaard
2014-02-10 10:04 ` [PATCH 12/17] i2c: i2c-rcar: " Wolfram Sang
2014-02-10 10:04 ` [PATCH 13/17] i2c: i2c-s3c2410: " Wolfram Sang
2014-02-10 10:04 ` [PATCH 14/17] i2c: i2c-sirf: " Wolfram Sang
2014-02-10 10:04 ` [PATCH 15/17] i2c: i2c-stu300: " Wolfram Sang
2014-02-12 16:22   ` Linus Walleij
2014-02-10 10:04 ` [PATCH 16/17] i2c: i2c-tegra: " Wolfram Sang
2014-02-10 16:46   ` Stephen Warren
2014-02-10 10:04 ` [PATCH 17/17] i2c: i2c-xiic: " Wolfram Sang
2014-03-28  7:55 ` [PATCH 00/17] i2c: deprecate class based instantiation for embedded I2C drivers Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).