All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/{1,1}] i2c: Make I2C ID tables non-mandatory for DT/ACPI
@ 2014-05-30 12:26 ` Lee Jones
  0 siblings, 0 replies; 50+ messages in thread
From: Lee Jones @ 2014-05-30 12:26 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel, wsa
  Cc: grant.likely, linus.walleij, linux-i2c

Hi Wolfram,

Here we have two patches which achieve exactly the same aim.  I
wasn't sure with method you'd prefer, so I thought I'd submit
both and you can make a choice.

Kind regards,
Lee


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

* [PATCH 0/{1,1}] i2c: Make I2C ID tables non-mandatory for DT/ACPI
@ 2014-05-30 12:26 ` Lee Jones
  0 siblings, 0 replies; 50+ messages in thread
From: Lee Jones @ 2014-05-30 12:26 UTC (permalink / raw)
  To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, wsa-z923LK4zBo2bacvFa/9K2g
  Cc: grant.likely-QSEj5FYQhm4dnm+yROfE0A,
	linus.walleij-QSEj5FYQhm4dnm+yROfE0A,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA

Hi Wolfram,

Here we have two patches which achieve exactly the same aim.  I
wasn't sure with method you'd prefer, so I thought I'd submit
both and you can make a choice.

Kind regards,
Lee

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

* [PATCH 0/{1,1}] i2c: Make I2C ID tables non-mandatory for DT/ACPI
@ 2014-05-30 12:26 ` Lee Jones
  0 siblings, 0 replies; 50+ messages in thread
From: Lee Jones @ 2014-05-30 12:26 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Wolfram,

Here we have two patches which achieve exactly the same aim.  I
wasn't sure with method you'd prefer, so I thought I'd submit
both and you can make a choice.

Kind regards,
Lee

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

* [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices
  2014-05-30 12:26 ` Lee Jones
@ 2014-05-30 12:26   ` Lee Jones
  -1 siblings, 0 replies; 50+ messages in thread
From: Lee Jones @ 2014-05-30 12:26 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel, wsa
  Cc: grant.likely, linus.walleij, linux-i2c, Lee Jones

Currently the I2C framework insists on devices supplying an I2C ID
table.  Many of the devices which do so unnecessarily adding quite a
few wasted lines to kernel code.  This patch allows drivers a means
to 'not' supply the aforementioned table and match on either DT
and/or ACPI match tables instead.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/i2c/i2c-core.c | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 7c7f4b8..703da9e 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -260,13 +260,25 @@ static int i2c_device_probe(struct device *dev)
 {
 	struct i2c_client	*client = i2c_verify_client(dev);
 	struct i2c_driver	*driver;
+	const struct of_device_id *of_match	= dev->driver->of_match_table;
+	const struct acpi_device_id *acpi_match	= dev->driver->acpi_match_table;
 	int status;
 
 	if (!client)
 		return 0;
 
 	driver = to_i2c_driver(dev->driver);
-	if (!driver->probe || !driver->id_table)
+	if (!driver->probe)
+		return -EINVAL;
+
+	/*
+	 * An I2C ID table is not madatory, if and only if, a suitable Device
+	 * Tree and/or ACPI match table entry is supplied for the probing
+	 * device.
+	 */
+	if (!driver->id_table &&
+	    !of_match_device(of_match, dev) &&
+	    !acpi_match_device(acpi_match, dev))
 		return -ENODEV;
 
 	if (!device_can_wakeup(&client->dev))
@@ -275,7 +287,12 @@ static int i2c_device_probe(struct device *dev)
 	dev_dbg(dev, "probe\n");
 
 	acpi_dev_pm_attach(&client->dev, true);
-	status = driver->probe(client, i2c_match_id(driver->id_table, client));
+
+	if (!driver->id_table)
+		status = driver->probe(client, NULL);
+	else
+		status = driver->probe(client,
+				       i2c_match_id(driver->id_table, client));
 	if (status)
 		acpi_dev_pm_detach(&client->dev, true);
 
-- 
1.8.3.2


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

* [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices
@ 2014-05-30 12:26   ` Lee Jones
  0 siblings, 0 replies; 50+ messages in thread
From: Lee Jones @ 2014-05-30 12:26 UTC (permalink / raw)
  To: linux-arm-kernel

Currently the I2C framework insists on devices supplying an I2C ID
table.  Many of the devices which do so unnecessarily adding quite a
few wasted lines to kernel code.  This patch allows drivers a means
to 'not' supply the aforementioned table and match on either DT
and/or ACPI match tables instead.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/i2c/i2c-core.c | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 7c7f4b8..703da9e 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -260,13 +260,25 @@ static int i2c_device_probe(struct device *dev)
 {
 	struct i2c_client	*client = i2c_verify_client(dev);
 	struct i2c_driver	*driver;
+	const struct of_device_id *of_match	= dev->driver->of_match_table;
+	const struct acpi_device_id *acpi_match	= dev->driver->acpi_match_table;
 	int status;
 
 	if (!client)
 		return 0;
 
 	driver = to_i2c_driver(dev->driver);
-	if (!driver->probe || !driver->id_table)
+	if (!driver->probe)
+		return -EINVAL;
+
+	/*
+	 * An I2C ID table is not madatory, if and only if, a suitable Device
+	 * Tree and/or ACPI match table entry is supplied for the probing
+	 * device.
+	 */
+	if (!driver->id_table &&
+	    !of_match_device(of_match, dev) &&
+	    !acpi_match_device(acpi_match, dev))
 		return -ENODEV;
 
 	if (!device_can_wakeup(&client->dev))
@@ -275,7 +287,12 @@ static int i2c_device_probe(struct device *dev)
 	dev_dbg(dev, "probe\n");
 
 	acpi_dev_pm_attach(&client->dev, true);
-	status = driver->probe(client, i2c_match_id(driver->id_table, client));
+
+	if (!driver->id_table)
+		status = driver->probe(client, NULL);
+	else
+		status = driver->probe(client,
+				       i2c_match_id(driver->id_table, client));
 	if (status)
 		acpi_dev_pm_detach(&client->dev, true);
 
-- 
1.8.3.2

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

* [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices
  2014-05-30 12:26 ` Lee Jones
@ 2014-05-30 12:26   ` Lee Jones
  -1 siblings, 0 replies; 50+ messages in thread
From: Lee Jones @ 2014-05-30 12:26 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel, wsa
  Cc: grant.likely, linus.walleij, linux-i2c, Lee Jones

Currently the I2C framework insists on devices supplying an I2C ID
table.  Many of the devices which do so unnecessarily adding quite a
few wasted lines to kernel code.  This patch allows drivers a means
to 'not' supply the aforementioned table and match on either DT
and/or ACPI match tables instead.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/i2c/i2c-core.c | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 7c7f4b8..49c534d 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -260,13 +260,29 @@ static int i2c_device_probe(struct device *dev)
 {
 	struct i2c_client	*client = i2c_verify_client(dev);
 	struct i2c_driver	*driver;
+	const struct of_device_id *of_match	= dev->driver->of_match_table;
+	const struct acpi_device_id *acpi_match	= dev->driver->acpi_match_table;
+	const struct i2c_device_id *id;
 	int status;
 
 	if (!client)
 		return 0;
 
 	driver = to_i2c_driver(dev->driver);
-	if (!driver->probe || !driver->id_table)
+	if (!driver->probe)
+		return -EINVAL;
+
+	/*
+	 * An I2C ID table is not madatory, if and only if, a suitable Device
+	 * Tree and/or ACPI match table entry is supplied for the probing
+	 * device.
+	 */
+	if (driver->id_table)
+		id = i2c_match_id(driver->id_table, client);
+	else if (of_match_device(of_match, dev) ||
+		 acpi_match_device(acpi_match, dev))
+		id = NULL;
+	else
 		return -ENODEV;
 
 	if (!device_can_wakeup(&client->dev))
@@ -275,7 +291,7 @@ static int i2c_device_probe(struct device *dev)
 	dev_dbg(dev, "probe\n");
 
 	acpi_dev_pm_attach(&client->dev, true);
-	status = driver->probe(client, i2c_match_id(driver->id_table, client));
+	status = driver->probe(client, id);
 	if (status)
 		acpi_dev_pm_detach(&client->dev, true);
 
-- 
1.8.3.2


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

* [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices
@ 2014-05-30 12:26   ` Lee Jones
  0 siblings, 0 replies; 50+ messages in thread
From: Lee Jones @ 2014-05-30 12:26 UTC (permalink / raw)
  To: linux-arm-kernel

Currently the I2C framework insists on devices supplying an I2C ID
table.  Many of the devices which do so unnecessarily adding quite a
few wasted lines to kernel code.  This patch allows drivers a means
to 'not' supply the aforementioned table and match on either DT
and/or ACPI match tables instead.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/i2c/i2c-core.c | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 7c7f4b8..49c534d 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -260,13 +260,29 @@ static int i2c_device_probe(struct device *dev)
 {
 	struct i2c_client	*client = i2c_verify_client(dev);
 	struct i2c_driver	*driver;
+	const struct of_device_id *of_match	= dev->driver->of_match_table;
+	const struct acpi_device_id *acpi_match	= dev->driver->acpi_match_table;
+	const struct i2c_device_id *id;
 	int status;
 
 	if (!client)
 		return 0;
 
 	driver = to_i2c_driver(dev->driver);
-	if (!driver->probe || !driver->id_table)
+	if (!driver->probe)
+		return -EINVAL;
+
+	/*
+	 * An I2C ID table is not madatory, if and only if, a suitable Device
+	 * Tree and/or ACPI match table entry is supplied for the probing
+	 * device.
+	 */
+	if (driver->id_table)
+		id = i2c_match_id(driver->id_table, client);
+	else if (of_match_device(of_match, dev) ||
+		 acpi_match_device(acpi_match, dev))
+		id = NULL;
+	else
 		return -ENODEV;
 
 	if (!device_can_wakeup(&client->dev))
@@ -275,7 +291,7 @@ static int i2c_device_probe(struct device *dev)
 	dev_dbg(dev, "probe\n");
 
 	acpi_dev_pm_attach(&client->dev, true);
-	status = driver->probe(client, i2c_match_id(driver->id_table, client));
+	status = driver->probe(client, id);
 	if (status)
 		acpi_dev_pm_detach(&client->dev, true);
 
-- 
1.8.3.2

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

* Re: [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices
  2014-05-30 12:26   ` Lee Jones
@ 2014-05-30 12:36     ` Wolfram Sang
  -1 siblings, 0 replies; 50+ messages in thread
From: Wolfram Sang @ 2014-05-30 12:36 UTC (permalink / raw)
  To: Lee Jones
  Cc: linux-arm-kernel, linux-kernel, grant.likely, linus.walleij, linux-i2c

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

On Fri, May 30, 2014 at 01:26:36PM +0100, Lee Jones wrote:
> Currently the I2C framework insists on devices supplying an I2C ID
> table.  Many of the devices which do so unnecessarily adding quite a
> few wasted lines to kernel code.  This patch allows drivers a means
> to 'not' supply the aforementioned table and match on either DT
> and/or ACPI match tables instead.
> 
> Signed-off-by: Lee Jones <lee.jones@linaro.org>

Sadly, it is not that easy...

> +	/*
> +	 * An I2C ID table is not madatory, if and only if, a suitable Device
> +	 * Tree and/or ACPI match table entry is supplied for the probing
> +	 * device.
> +	 */

That means we end up with drivers which cannot be used for run-time
instantiation via the 'new_device'-file in sysfs. I don't like that.


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

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

* [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices
@ 2014-05-30 12:36     ` Wolfram Sang
  0 siblings, 0 replies; 50+ messages in thread
From: Wolfram Sang @ 2014-05-30 12:36 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, May 30, 2014 at 01:26:36PM +0100, Lee Jones wrote:
> Currently the I2C framework insists on devices supplying an I2C ID
> table.  Many of the devices which do so unnecessarily adding quite a
> few wasted lines to kernel code.  This patch allows drivers a means
> to 'not' supply the aforementioned table and match on either DT
> and/or ACPI match tables instead.
> 
> Signed-off-by: Lee Jones <lee.jones@linaro.org>

Sadly, it is not that easy...

> +	/*
> +	 * An I2C ID table is not madatory, if and only if, a suitable Device
> +	 * Tree and/or ACPI match table entry is supplied for the probing
> +	 * device.
> +	 */

That means we end up with drivers which cannot be used for run-time
instantiation via the 'new_device'-file in sysfs. I don't like that.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140530/9bf142e5/attachment.sig>

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

* Re: [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices
  2014-05-30 12:36     ` Wolfram Sang
  (?)
@ 2014-05-30 12:55       ` Lee Jones
  -1 siblings, 0 replies; 50+ messages in thread
From: Lee Jones @ 2014-05-30 12:55 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-arm-kernel, linux-kernel, grant.likely, linus.walleij, linux-i2c

On Fri, 30 May 2014, Wolfram Sang wrote:

> On Fri, May 30, 2014 at 01:26:36PM +0100, Lee Jones wrote:
> > Currently the I2C framework insists on devices supplying an I2C ID
> > table.  Many of the devices which do so unnecessarily adding quite a
> > few wasted lines to kernel code.  This patch allows drivers a means
> > to 'not' supply the aforementioned table and match on either DT
> > and/or ACPI match tables instead.
> > 
> > Signed-off-by: Lee Jones <lee.jones@linaro.org>
> 
> Sadly, it is not that easy...
> 
> > +	/*
> > +	 * An I2C ID table is not madatory, if and only if, a suitable Device
> > +	 * Tree and/or ACPI match table entry is supplied for the probing
> > +	 * device.
> > +	 */
> 
> That means we end up with drivers which cannot be used for run-time
> instantiation via the 'new_device'-file in sysfs. I don't like that.

Would you mind explaining that a little please?  And perhaps point me
to the code?

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices
@ 2014-05-30 12:55       ` Lee Jones
  0 siblings, 0 replies; 50+ messages in thread
From: Lee Jones @ 2014-05-30 12:55 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	grant.likely-QSEj5FYQhm4dnm+yROfE0A,
	linus.walleij-QSEj5FYQhm4dnm+yROfE0A,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA

On Fri, 30 May 2014, Wolfram Sang wrote:

> On Fri, May 30, 2014 at 01:26:36PM +0100, Lee Jones wrote:
> > Currently the I2C framework insists on devices supplying an I2C ID
> > table.  Many of the devices which do so unnecessarily adding quite a
> > few wasted lines to kernel code.  This patch allows drivers a means
> > to 'not' supply the aforementioned table and match on either DT
> > and/or ACPI match tables instead.
> > 
> > Signed-off-by: Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> 
> Sadly, it is not that easy...
> 
> > +	/*
> > +	 * An I2C ID table is not madatory, if and only if, a suitable Device
> > +	 * Tree and/or ACPI match table entry is supplied for the probing
> > +	 * device.
> > +	 */
> 
> That means we end up with drivers which cannot be used for run-time
> instantiation via the 'new_device'-file in sysfs. I don't like that.

Would you mind explaining that a little please?  And perhaps point me
to the code?

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices
@ 2014-05-30 12:55       ` Lee Jones
  0 siblings, 0 replies; 50+ messages in thread
From: Lee Jones @ 2014-05-30 12:55 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, 30 May 2014, Wolfram Sang wrote:

> On Fri, May 30, 2014 at 01:26:36PM +0100, Lee Jones wrote:
> > Currently the I2C framework insists on devices supplying an I2C ID
> > table.  Many of the devices which do so unnecessarily adding quite a
> > few wasted lines to kernel code.  This patch allows drivers a means
> > to 'not' supply the aforementioned table and match on either DT
> > and/or ACPI match tables instead.
> > 
> > Signed-off-by: Lee Jones <lee.jones@linaro.org>
> 
> Sadly, it is not that easy...
> 
> > +	/*
> > +	 * An I2C ID table is not madatory, if and only if, a suitable Device
> > +	 * Tree and/or ACPI match table entry is supplied for the probing
> > +	 * device.
> > +	 */
> 
> That means we end up with drivers which cannot be used for run-time
> instantiation via the 'new_device'-file in sysfs. I don't like that.

Would you mind explaining that a little please?  And perhaps point me
to the code?

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices
  2014-05-30 12:36     ` Wolfram Sang
  (?)
@ 2014-05-30 13:34       ` Lee Jones
  -1 siblings, 0 replies; 50+ messages in thread
From: Lee Jones @ 2014-05-30 13:34 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-arm-kernel, linux-kernel, grant.likely, linus.walleij, linux-i2c

> > Currently the I2C framework insists on devices supplying an I2C ID
> > table.  Many of the devices which do so unnecessarily adding quite a
> > few wasted lines to kernel code.  This patch allows drivers a means
> > to 'not' supply the aforementioned table and match on either DT
> > and/or ACPI match tables instead.
> > 
> > Signed-off-by: Lee Jones <lee.jones@linaro.org>
> 
> Sadly, it is not that easy...
> 
> > +	/*
> > +	 * An I2C ID table is not madatory, if and only if, a suitable Device
> > +	 * Tree and/or ACPI match table entry is supplied for the probing
> > +	 * device.
> > +	 */
> 
> That means we end up with drivers which cannot be used for run-time
> instantiation via the 'new_device'-file in sysfs. I don't like that.

I've found the code and taken a quick look at it.  I'm still not sure
I understand your point.  The semantics for any device attempting to
register with an I2C ID table should be unchanged.  The only intended
difference would be for drivers which do not wish to supply one due
to the fact that they have other means of matching, namely DT and
ACPI.

Would you mind telling me what I have changed that affects drivers
registering via Sysfs?
-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices
@ 2014-05-30 13:34       ` Lee Jones
  0 siblings, 0 replies; 50+ messages in thread
From: Lee Jones @ 2014-05-30 13:34 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	grant.likely-QSEj5FYQhm4dnm+yROfE0A,
	linus.walleij-QSEj5FYQhm4dnm+yROfE0A,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA

> > Currently the I2C framework insists on devices supplying an I2C ID
> > table.  Many of the devices which do so unnecessarily adding quite a
> > few wasted lines to kernel code.  This patch allows drivers a means
> > to 'not' supply the aforementioned table and match on either DT
> > and/or ACPI match tables instead.
> > 
> > Signed-off-by: Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> 
> Sadly, it is not that easy...
> 
> > +	/*
> > +	 * An I2C ID table is not madatory, if and only if, a suitable Device
> > +	 * Tree and/or ACPI match table entry is supplied for the probing
> > +	 * device.
> > +	 */
> 
> That means we end up with drivers which cannot be used for run-time
> instantiation via the 'new_device'-file in sysfs. I don't like that.

I've found the code and taken a quick look at it.  I'm still not sure
I understand your point.  The semantics for any device attempting to
register with an I2C ID table should be unchanged.  The only intended
difference would be for drivers which do not wish to supply one due
to the fact that they have other means of matching, namely DT and
ACPI.

Would you mind telling me what I have changed that affects drivers
registering via Sysfs?
-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices
@ 2014-05-30 13:34       ` Lee Jones
  0 siblings, 0 replies; 50+ messages in thread
From: Lee Jones @ 2014-05-30 13:34 UTC (permalink / raw)
  To: linux-arm-kernel

> > Currently the I2C framework insists on devices supplying an I2C ID
> > table.  Many of the devices which do so unnecessarily adding quite a
> > few wasted lines to kernel code.  This patch allows drivers a means
> > to 'not' supply the aforementioned table and match on either DT
> > and/or ACPI match tables instead.
> > 
> > Signed-off-by: Lee Jones <lee.jones@linaro.org>
> 
> Sadly, it is not that easy...
> 
> > +	/*
> > +	 * An I2C ID table is not madatory, if and only if, a suitable Device
> > +	 * Tree and/or ACPI match table entry is supplied for the probing
> > +	 * device.
> > +	 */
> 
> That means we end up with drivers which cannot be used for run-time
> instantiation via the 'new_device'-file in sysfs. I don't like that.

I've found the code and taken a quick look at it.  I'm still not sure
I understand your point.  The semantics for any device attempting to
register with an I2C ID table should be unchanged.  The only intended
difference would be for drivers which do not wish to supply one due
to the fact that they have other means of matching, namely DT and
ACPI.

Would you mind telling me what I have changed that affects drivers
registering via Sysfs?
-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices
  2014-05-30 13:34       ` Lee Jones
  (?)
@ 2014-05-30 17:48         ` Wolfram Sang
  -1 siblings, 0 replies; 50+ messages in thread
From: Wolfram Sang @ 2014-05-30 17:48 UTC (permalink / raw)
  To: Lee Jones
  Cc: linux-arm-kernel, linux-kernel, grant.likely, linus.walleij, linux-i2c

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

Hi Lee,

sorry for the delay.

> Would you mind telling me what I have changed that affects drivers
> registering via Sysfs?

Check Documentation/i2c/instantiating-devices, method 4. If a driver
does not have i2c_device_id, then this method won't work because the
newly created device has no of_node or ACPI_node and nothing will match.
Looking at the bigger picture, I'd really like to keep this feature.
People use it.

Regards,

   Wolfram


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

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

* Re: [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices
@ 2014-05-30 17:48         ` Wolfram Sang
  0 siblings, 0 replies; 50+ messages in thread
From: Wolfram Sang @ 2014-05-30 17:48 UTC (permalink / raw)
  To: Lee Jones
  Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	grant.likely-QSEj5FYQhm4dnm+yROfE0A,
	linus.walleij-QSEj5FYQhm4dnm+yROfE0A,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA

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

Hi Lee,

sorry for the delay.

> Would you mind telling me what I have changed that affects drivers
> registering via Sysfs?

Check Documentation/i2c/instantiating-devices, method 4. If a driver
does not have i2c_device_id, then this method won't work because the
newly created device has no of_node or ACPI_node and nothing will match.
Looking at the bigger picture, I'd really like to keep this feature.
People use it.

Regards,

   Wolfram


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

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

* [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices
@ 2014-05-30 17:48         ` Wolfram Sang
  0 siblings, 0 replies; 50+ messages in thread
From: Wolfram Sang @ 2014-05-30 17:48 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Lee,

sorry for the delay.

> Would you mind telling me what I have changed that affects drivers
> registering via Sysfs?

Check Documentation/i2c/instantiating-devices, method 4. If a driver
does not have i2c_device_id, then this method won't work because the
newly created device has no of_node or ACPI_node and nothing will match.
Looking at the bigger picture, I'd really like to keep this feature.
People use it.

Regards,

   Wolfram

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140530/5fb539ef/attachment.sig>

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

* Re: [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices
  2014-05-30 17:48         ` Wolfram Sang
@ 2014-05-30 19:25           ` Lee Jones
  -1 siblings, 0 replies; 50+ messages in thread
From: Lee Jones @ 2014-05-30 19:25 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-arm-kernel, linux-kernel, grant.likely, linus.walleij, linux-i2c

> > Would you mind telling me what I have changed that affects drivers
> > registering via Sysfs?
> 
> Check Documentation/i2c/instantiating-devices, method 4. If a driver
> does not have i2c_device_id, then this method won't work because the
> newly created device has no of_node or ACPI_node and nothing will match.
> Looking at the bigger picture, I'd really like to keep this feature.
> People use it.

Right, I read the function which provides the functionality, but my
point is; I don't think my patch changes the semantics in a way which
would adversely affect this option.  If you think that it does, can you
specify how please?

Does the sysfs method create a i2c_device_id table?  If not, how does
it probe successfully pre-patch?

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices
@ 2014-05-30 19:25           ` Lee Jones
  0 siblings, 0 replies; 50+ messages in thread
From: Lee Jones @ 2014-05-30 19:25 UTC (permalink / raw)
  To: linux-arm-kernel

> > Would you mind telling me what I have changed that affects drivers
> > registering via Sysfs?
> 
> Check Documentation/i2c/instantiating-devices, method 4. If a driver
> does not have i2c_device_id, then this method won't work because the
> newly created device has no of_node or ACPI_node and nothing will match.
> Looking at the bigger picture, I'd really like to keep this feature.
> People use it.

Right, I read the function which provides the functionality, but my
point is; I don't think my patch changes the semantics in a way which
would adversely affect this option.  If you think that it does, can you
specify how please?

Does the sysfs method create a i2c_device_id table?  If not, how does
it probe successfully pre-patch?

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices
  2014-05-30 19:25           ` Lee Jones
  (?)
@ 2014-05-31 13:48             ` Wolfram Sang
  -1 siblings, 0 replies; 50+ messages in thread
From: Wolfram Sang @ 2014-05-31 13:48 UTC (permalink / raw)
  To: Lee Jones
  Cc: linux-arm-kernel, linux-kernel, grant.likely, linus.walleij, linux-i2c

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


> Right, I read the function which provides the functionality, but my
> point is; I don't think my patch changes the semantics in a way which
> would adversely affect this option.  If you think that it does, can you
> specify how please?

Currently, if a driver would be DT only and does not provide a seperate
i2c_device_id table, then the driver is unusable with method 4. I don't
like to have some drivers being capable of it and some not.

> Does the sysfs method create a i2c_device_id table?  If not, how does
> it probe successfully pre-patch?

The sysfs method creates a device. Its name is matched against
i2c_device_ids only since it does not have a node pointer for DT to be
matched against.


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

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

* Re: [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices
@ 2014-05-31 13:48             ` Wolfram Sang
  0 siblings, 0 replies; 50+ messages in thread
From: Wolfram Sang @ 2014-05-31 13:48 UTC (permalink / raw)
  To: Lee Jones
  Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	grant.likely-QSEj5FYQhm4dnm+yROfE0A,
	linus.walleij-QSEj5FYQhm4dnm+yROfE0A,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA

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


> Right, I read the function which provides the functionality, but my
> point is; I don't think my patch changes the semantics in a way which
> would adversely affect this option.  If you think that it does, can you
> specify how please?

Currently, if a driver would be DT only and does not provide a seperate
i2c_device_id table, then the driver is unusable with method 4. I don't
like to have some drivers being capable of it and some not.

> Does the sysfs method create a i2c_device_id table?  If not, how does
> it probe successfully pre-patch?

The sysfs method creates a device. Its name is matched against
i2c_device_ids only since it does not have a node pointer for DT to be
matched against.


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

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

* [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices
@ 2014-05-31 13:48             ` Wolfram Sang
  0 siblings, 0 replies; 50+ messages in thread
From: Wolfram Sang @ 2014-05-31 13:48 UTC (permalink / raw)
  To: linux-arm-kernel


> Right, I read the function which provides the functionality, but my
> point is; I don't think my patch changes the semantics in a way which
> would adversely affect this option.  If you think that it does, can you
> specify how please?

Currently, if a driver would be DT only and does not provide a seperate
i2c_device_id table, then the driver is unusable with method 4. I don't
like to have some drivers being capable of it and some not.

> Does the sysfs method create a i2c_device_id table?  If not, how does
> it probe successfully pre-patch?

The sysfs method creates a device. Its name is matched against
i2c_device_ids only since it does not have a node pointer for DT to be
matched against.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140531/ed161c08/attachment.sig>

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

* Re: [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices
  2014-05-31 13:48             ` Wolfram Sang
  (?)
@ 2014-06-02 12:16               ` Linus Walleij
  -1 siblings, 0 replies; 50+ messages in thread
From: Linus Walleij @ 2014-06-02 12:16 UTC (permalink / raw)
  To: Wolfram Sang, Grant Likely
  Cc: Lee Jones, linux-arm-kernel, linux-kernel, linux-i2c

On Sat, May 31, 2014 at 3:48 PM, Wolfram Sang <wsa@the-dreams.de> wrote:
>
>> Right, I read the function which provides the functionality, but my
>> point is; I don't think my patch changes the semantics in a way which
>> would adversely affect this option.  If you think that it does, can you
>> specify how please?
>
> Currently, if a driver would be DT only and does not provide a seperate
> i2c_device_id table, then the driver is unusable with method 4. I don't
> like to have some drivers being capable of it and some not.
>
>> Does the sysfs method create a i2c_device_id table?  If not, how does
>> it probe successfully pre-patch?
>
> The sysfs method creates a device. Its name is matched against
> i2c_device_ids only since it does not have a node pointer for DT to be
> matched against.

Is this really so useful on embedded systems?

I was under the impression that this method was something used
on say PC desktops with temperature monitors and EEPROMs
on some I2C link on the PCB, usage entirely optional and fun
for userspace hacks.

And when we say "people use it" do we mean "sensors-detect
uses it, on desktops", really?

Yours,
Linus Walleij

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

* Re: [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices
@ 2014-06-02 12:16               ` Linus Walleij
  0 siblings, 0 replies; 50+ messages in thread
From: Linus Walleij @ 2014-06-02 12:16 UTC (permalink / raw)
  To: Wolfram Sang, Grant Likely
  Cc: Lee Jones, linux-arm-kernel, linux-kernel, linux-i2c

On Sat, May 31, 2014 at 3:48 PM, Wolfram Sang <wsa@the-dreams.de> wrote:
>
>> Right, I read the function which provides the functionality, but my
>> point is; I don't think my patch changes the semantics in a way which
>> would adversely affect this option.  If you think that it does, can you
>> specify how please?
>
> Currently, if a driver would be DT only and does not provide a seperate
> i2c_device_id table, then the driver is unusable with method 4. I don't
> like to have some drivers being capable of it and some not.
>
>> Does the sysfs method create a i2c_device_id table?  If not, how does
>> it probe successfully pre-patch?
>
> The sysfs method creates a device. Its name is matched against
> i2c_device_ids only since it does not have a node pointer for DT to be
> matched against.

Is this really so useful on embedded systems?

I was under the impression that this method was something used
on say PC desktops with temperature monitors and EEPROMs
on some I2C link on the PCB, usage entirely optional and fun
for userspace hacks.

And when we say "people use it" do we mean "sensors-detect
uses it, on desktops", really?

Yours,
Linus Walleij

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

* [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices
@ 2014-06-02 12:16               ` Linus Walleij
  0 siblings, 0 replies; 50+ messages in thread
From: Linus Walleij @ 2014-06-02 12:16 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, May 31, 2014 at 3:48 PM, Wolfram Sang <wsa@the-dreams.de> wrote:
>
>> Right, I read the function which provides the functionality, but my
>> point is; I don't think my patch changes the semantics in a way which
>> would adversely affect this option.  If you think that it does, can you
>> specify how please?
>
> Currently, if a driver would be DT only and does not provide a seperate
> i2c_device_id table, then the driver is unusable with method 4. I don't
> like to have some drivers being capable of it and some not.
>
>> Does the sysfs method create a i2c_device_id table?  If not, how does
>> it probe successfully pre-patch?
>
> The sysfs method creates a device. Its name is matched against
> i2c_device_ids only since it does not have a node pointer for DT to be
> matched against.

Is this really so useful on embedded systems?

I was under the impression that this method was something used
on say PC desktops with temperature monitors and EEPROMs
on some I2C link on the PCB, usage entirely optional and fun
for userspace hacks.

And when we say "people use it" do we mean "sensors-detect
uses it, on desktops", really?

Yours,
Linus Walleij

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

* Re: [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices
@ 2014-06-02 12:38                 ` Wolfram Sang
  0 siblings, 0 replies; 50+ messages in thread
From: Wolfram Sang @ 2014-06-02 12:38 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Grant Likely, Lee Jones, linux-arm-kernel, linux-kernel, linux-i2c

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

On Mon, Jun 02, 2014 at 02:16:59PM +0200, Linus Walleij wrote:
> On Sat, May 31, 2014 at 3:48 PM, Wolfram Sang <wsa@the-dreams.de> wrote:
> >
> >> Right, I read the function which provides the functionality, but my
> >> point is; I don't think my patch changes the semantics in a way which
> >> would adversely affect this option.  If you think that it does, can you
> >> specify how please?
> >
> > Currently, if a driver would be DT only and does not provide a seperate
> > i2c_device_id table, then the driver is unusable with method 4. I don't
> > like to have some drivers being capable of it and some not.
> >
> >> Does the sysfs method create a i2c_device_id table?  If not, how does
> >> it probe successfully pre-patch?
> >
> > The sysfs method creates a device. Its name is matched against
> > i2c_device_ids only since it does not have a node pointer for DT to be
> > matched against.
> 
> Is this really so useful on embedded systems?

Well, this feature is at least nice with embedded:

---

* You are developing a driver on a test board, where you soldered the I2C
  device yourself.

---

Or during HW bringup, you this or that driver for a device (out-of-tree
vs. in-kernel), and hey, the RTC even has an EEPROM at another address,
let's try. Such things are the use cases I have mostly seen and those
customers liked it.

The problem is that we are talking about matching against I2C slave
drivers. I can't see a line between embedded and non-embedded when it
comes to slaves. They are just slaves and could be on any hardware.
Keeping the bigger picture in mind, IMO it is cumbersome if some drivers
support user-space instantiation and some not.

Though, I wouldn't mind if compatible entries could be passed to the
'new_device' file, in addition to i2c_device_ids. Yet, this needs some
extra handling I haven't found the time for, yet.


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

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

* Re: [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices
@ 2014-06-02 12:38                 ` Wolfram Sang
  0 siblings, 0 replies; 50+ messages in thread
From: Wolfram Sang @ 2014-06-02 12:38 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Grant Likely, Lee Jones,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA

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

On Mon, Jun 02, 2014 at 02:16:59PM +0200, Linus Walleij wrote:
> On Sat, May 31, 2014 at 3:48 PM, Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org> wrote:
> >
> >> Right, I read the function which provides the functionality, but my
> >> point is; I don't think my patch changes the semantics in a way which
> >> would adversely affect this option.  If you think that it does, can you
> >> specify how please?
> >
> > Currently, if a driver would be DT only and does not provide a seperate
> > i2c_device_id table, then the driver is unusable with method 4. I don't
> > like to have some drivers being capable of it and some not.
> >
> >> Does the sysfs method create a i2c_device_id table?  If not, how does
> >> it probe successfully pre-patch?
> >
> > The sysfs method creates a device. Its name is matched against
> > i2c_device_ids only since it does not have a node pointer for DT to be
> > matched against.
> 
> Is this really so useful on embedded systems?

Well, this feature is at least nice with embedded:

---

* You are developing a driver on a test board, where you soldered the I2C
  device yourself.

---

Or during HW bringup, you this or that driver for a device (out-of-tree
vs. in-kernel), and hey, the RTC even has an EEPROM at another address,
let's try. Such things are the use cases I have mostly seen and those
customers liked it.

The problem is that we are talking about matching against I2C slave
drivers. I can't see a line between embedded and non-embedded when it
comes to slaves. They are just slaves and could be on any hardware.
Keeping the bigger picture in mind, IMO it is cumbersome if some drivers
support user-space instantiation and some not.

Though, I wouldn't mind if compatible entries could be passed to the
'new_device' file, in addition to i2c_device_ids. Yet, this needs some
extra handling I haven't found the time for, yet.


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

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

* [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices
@ 2014-06-02 12:38                 ` Wolfram Sang
  0 siblings, 0 replies; 50+ messages in thread
From: Wolfram Sang @ 2014-06-02 12:38 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jun 02, 2014 at 02:16:59PM +0200, Linus Walleij wrote:
> On Sat, May 31, 2014 at 3:48 PM, Wolfram Sang <wsa@the-dreams.de> wrote:
> >
> >> Right, I read the function which provides the functionality, but my
> >> point is; I don't think my patch changes the semantics in a way which
> >> would adversely affect this option.  If you think that it does, can you
> >> specify how please?
> >
> > Currently, if a driver would be DT only and does not provide a seperate
> > i2c_device_id table, then the driver is unusable with method 4. I don't
> > like to have some drivers being capable of it and some not.
> >
> >> Does the sysfs method create a i2c_device_id table?  If not, how does
> >> it probe successfully pre-patch?
> >
> > The sysfs method creates a device. Its name is matched against
> > i2c_device_ids only since it does not have a node pointer for DT to be
> > matched against.
> 
> Is this really so useful on embedded systems?

Well, this feature is at least nice with embedded:

---

* You are developing a driver on a test board, where you soldered the I2C
  device yourself.

---

Or during HW bringup, you this or that driver for a device (out-of-tree
vs. in-kernel), and hey, the RTC even has an EEPROM at another address,
let's try. Such things are the use cases I have mostly seen and those
customers liked it.

The problem is that we are talking about matching against I2C slave
drivers. I can't see a line between embedded and non-embedded when it
comes to slaves. They are just slaves and could be on any hardware.
Keeping the bigger picture in mind, IMO it is cumbersome if some drivers
support user-space instantiation and some not.

Though, I wouldn't mind if compatible entries could be passed to the
'new_device' file, in addition to i2c_device_ids. Yet, this needs some
extra handling I haven't found the time for, yet.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140602/18a595ec/attachment-0001.sig>

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

* Re: [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices
  2014-06-02 12:38                 ` Wolfram Sang
  (?)
@ 2014-06-02 13:26                   ` Linus Walleij
  -1 siblings, 0 replies; 50+ messages in thread
From: Linus Walleij @ 2014-06-02 13:26 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Grant Likely, Lee Jones, linux-arm-kernel, linux-kernel, linux-i2c

On Mon, Jun 2, 2014 at 2:38 PM, Wolfram Sang <wsa@the-dreams.de> wrote:

> Though, I wouldn't mind if compatible entries could be passed to the
> 'new_device' file, in addition to i2c_device_ids. Yet, this needs some
> extra handling I haven't found the time for, yet.

Hm that's a way forward then I guess... but passing a compatible
string to that same file is a bit arbitrarily ambigous. So we'd rather
add a new instatiation file named new_device_of_compatible or so?

Yours,
Linus Walleij

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

* Re: [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices
@ 2014-06-02 13:26                   ` Linus Walleij
  0 siblings, 0 replies; 50+ messages in thread
From: Linus Walleij @ 2014-06-02 13:26 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Grant Likely, Lee Jones, linux-arm-kernel, linux-kernel, linux-i2c

On Mon, Jun 2, 2014 at 2:38 PM, Wolfram Sang <wsa@the-dreams.de> wrote:

> Though, I wouldn't mind if compatible entries could be passed to the
> 'new_device' file, in addition to i2c_device_ids. Yet, this needs some
> extra handling I haven't found the time for, yet.

Hm that's a way forward then I guess... but passing a compatible
string to that same file is a bit arbitrarily ambigous. So we'd rather
add a new instatiation file named new_device_of_compatible or so?

Yours,
Linus Walleij

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

* [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices
@ 2014-06-02 13:26                   ` Linus Walleij
  0 siblings, 0 replies; 50+ messages in thread
From: Linus Walleij @ 2014-06-02 13:26 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jun 2, 2014 at 2:38 PM, Wolfram Sang <wsa@the-dreams.de> wrote:

> Though, I wouldn't mind if compatible entries could be passed to the
> 'new_device' file, in addition to i2c_device_ids. Yet, this needs some
> extra handling I haven't found the time for, yet.

Hm that's a way forward then I guess... but passing a compatible
string to that same file is a bit arbitrarily ambigous. So we'd rather
add a new instatiation file named new_device_of_compatible or so?

Yours,
Linus Walleij

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

* Re: [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices
  2014-06-02 12:38                 ` Wolfram Sang
  (?)
@ 2014-06-02 13:26                   ` Lee Jones
  -1 siblings, 0 replies; 50+ messages in thread
From: Lee Jones @ 2014-06-02 13:26 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Linus Walleij, Grant Likely, linux-arm-kernel, linux-kernel, linux-i2c

On Mon, 02 Jun 2014, Wolfram Sang wrote:

> On Mon, Jun 02, 2014 at 02:16:59PM +0200, Linus Walleij wrote:
> > On Sat, May 31, 2014 at 3:48 PM, Wolfram Sang <wsa@the-dreams.de> wrote:
> > >
> > >> Right, I read the function which provides the functionality, but my
> > >> point is; I don't think my patch changes the semantics in a way which
> > >> would adversely affect this option.  If you think that it does, can you
> > >> specify how please?
> > >
> > > Currently, if a driver would be DT only and does not provide a seperate
> > > i2c_device_id table, then the driver is unusable with method 4. I don't
> > > like to have some drivers being capable of it and some not.
> > >
> > >> Does the sysfs method create a i2c_device_id table?  If not, how does
> > >> it probe successfully pre-patch?
> > >
> > > The sysfs method creates a device. Its name is matched against
> > > i2c_device_ids only since it does not have a node pointer for DT to be
> > > matched against.
> > 
> > Is this really so useful on embedded systems?
> 
> Well, this feature is at least nice with embedded:
> 
> ---
> 
> * You are developing a driver on a test board, where you soldered the I2C
>   device yourself.
> 
> ---
> 
> Or during HW bringup, you this or that driver for a device (out-of-tree
> vs. in-kernel), and hey, the RTC even has an EEPROM at another address,
> let's try. Such things are the use cases I have mostly seen and those
> customers liked it.
> 
> The problem is that we are talking about matching against I2C slave
> drivers. I can't see a line between embedded and non-embedded when it
> comes to slaves. They are just slaves and could be on any hardware.
> Keeping the bigger picture in mind, IMO it is cumbersome if some drivers
> support user-space instantiation and some not.
> 
> Though, I wouldn't mind if compatible entries could be passed to the
> 'new_device' file, in addition to i2c_device_ids. Yet, this needs some
> extra handling I haven't found the time for, yet.

Actually, I'm just about to submit a new set.

Hopefully we cover some bases.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices
@ 2014-06-02 13:26                   ` Lee Jones
  0 siblings, 0 replies; 50+ messages in thread
From: Lee Jones @ 2014-06-02 13:26 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Linus Walleij, Grant Likely, linux-arm-kernel, linux-kernel, linux-i2c

On Mon, 02 Jun 2014, Wolfram Sang wrote:

> On Mon, Jun 02, 2014 at 02:16:59PM +0200, Linus Walleij wrote:
> > On Sat, May 31, 2014 at 3:48 PM, Wolfram Sang <wsa@the-dreams.de> wrote:
> > >
> > >> Right, I read the function which provides the functionality, but my
> > >> point is; I don't think my patch changes the semantics in a way which
> > >> would adversely affect this option.  If you think that it does, can you
> > >> specify how please?
> > >
> > > Currently, if a driver would be DT only and does not provide a seperate
> > > i2c_device_id table, then the driver is unusable with method 4. I don't
> > > like to have some drivers being capable of it and some not.
> > >
> > >> Does the sysfs method create a i2c_device_id table?  If not, how does
> > >> it probe successfully pre-patch?
> > >
> > > The sysfs method creates a device. Its name is matched against
> > > i2c_device_ids only since it does not have a node pointer for DT to be
> > > matched against.
> > 
> > Is this really so useful on embedded systems?
> 
> Well, this feature is at least nice with embedded:
> 
> ---
> 
> * You are developing a driver on a test board, where you soldered the I2C
>   device yourself.
> 
> ---
> 
> Or during HW bringup, you this or that driver for a device (out-of-tree
> vs. in-kernel), and hey, the RTC even has an EEPROM at another address,
> let's try. Such things are the use cases I have mostly seen and those
> customers liked it.
> 
> The problem is that we are talking about matching against I2C slave
> drivers. I can't see a line between embedded and non-embedded when it
> comes to slaves. They are just slaves and could be on any hardware.
> Keeping the bigger picture in mind, IMO it is cumbersome if some drivers
> support user-space instantiation and some not.
> 
> Though, I wouldn't mind if compatible entries could be passed to the
> 'new_device' file, in addition to i2c_device_ids. Yet, this needs some
> extra handling I haven't found the time for, yet.

Actually, I'm just about to submit a new set.

Hopefully we cover some bases.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices
@ 2014-06-02 13:26                   ` Lee Jones
  0 siblings, 0 replies; 50+ messages in thread
From: Lee Jones @ 2014-06-02 13:26 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, 02 Jun 2014, Wolfram Sang wrote:

> On Mon, Jun 02, 2014 at 02:16:59PM +0200, Linus Walleij wrote:
> > On Sat, May 31, 2014 at 3:48 PM, Wolfram Sang <wsa@the-dreams.de> wrote:
> > >
> > >> Right, I read the function which provides the functionality, but my
> > >> point is; I don't think my patch changes the semantics in a way which
> > >> would adversely affect this option.  If you think that it does, can you
> > >> specify how please?
> > >
> > > Currently, if a driver would be DT only and does not provide a seperate
> > > i2c_device_id table, then the driver is unusable with method 4. I don't
> > > like to have some drivers being capable of it and some not.
> > >
> > >> Does the sysfs method create a i2c_device_id table?  If not, how does
> > >> it probe successfully pre-patch?
> > >
> > > The sysfs method creates a device. Its name is matched against
> > > i2c_device_ids only since it does not have a node pointer for DT to be
> > > matched against.
> > 
> > Is this really so useful on embedded systems?
> 
> Well, this feature is at least nice with embedded:
> 
> ---
> 
> * You are developing a driver on a test board, where you soldered the I2C
>   device yourself.
> 
> ---
> 
> Or during HW bringup, you this or that driver for a device (out-of-tree
> vs. in-kernel), and hey, the RTC even has an EEPROM at another address,
> let's try. Such things are the use cases I have mostly seen and those
> customers liked it.
> 
> The problem is that we are talking about matching against I2C slave
> drivers. I can't see a line between embedded and non-embedded when it
> comes to slaves. They are just slaves and could be on any hardware.
> Keeping the bigger picture in mind, IMO it is cumbersome if some drivers
> support user-space instantiation and some not.
> 
> Though, I wouldn't mind if compatible entries could be passed to the
> 'new_device' file, in addition to i2c_device_ids. Yet, this needs some
> extra handling I haven't found the time for, yet.

Actually, I'm just about to submit a new set.

Hopefully we cover some bases.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices
@ 2014-06-02 14:29                 ` Michael Lawnick
  0 siblings, 0 replies; 50+ messages in thread
From: Michael Lawnick @ 2014-06-02 14:29 UTC (permalink / raw)
  To: Linus Walleij, Wolfram Sang, Grant Likely
  Cc: Lee Jones, linux-arm-kernel, linux-kernel, linux-i2c

Am 02.06.2014 14:16, schrieb Linus Walleij:
> On Sat, May 31, 2014 at 3:48 PM, Wolfram Sang <wsa@the-dreams.de> wrote:
>>
>>> Right, I read the function which provides the functionality, but my
>>> point is; I don't think my patch changes the semantics in a way which
>>> would adversely affect this option.  If you think that it does, can you
>>> specify how please?
>>
>> Currently, if a driver would be DT only and does not provide a seperate
>> i2c_device_id table, then the driver is unusable with method 4. I don't
>> like to have some drivers being capable of it and some not.
>>
>>> Does the sysfs method create a i2c_device_id table?  If not, how does
>>> it probe successfully pre-patch?
>>
>> The sysfs method creates a device. Its name is matched against
>> i2c_device_ids only since it does not have a node pointer for DT to be
>> matched against.
>
> Is this really so useful on embedded systems?
>
> I was under the impression that this method was something used
> on say PC desktops with temperature monitors and EEPROMs
> on some I2C link on the PCB, usage entirely optional and fun
> for userspace hacks.
>
We use it for dynamic instantiating whole subsystems with multiplexers, 
sensors, controllers in an embedded system. The device list is taken 
from an I2C eeprom which gets read on hotplug.

KR
Michael



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

* Re: [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices
@ 2014-06-02 14:29                 ` Michael Lawnick
  0 siblings, 0 replies; 50+ messages in thread
From: Michael Lawnick @ 2014-06-02 14:29 UTC (permalink / raw)
  To: Linus Walleij, Wolfram Sang, Grant Likely
  Cc: Lee Jones, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA

Am 02.06.2014 14:16, schrieb Linus Walleij:
> On Sat, May 31, 2014 at 3:48 PM, Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org> wrote:
>>
>>> Right, I read the function which provides the functionality, but my
>>> point is; I don't think my patch changes the semantics in a way which
>>> would adversely affect this option.  If you think that it does, can you
>>> specify how please?
>>
>> Currently, if a driver would be DT only and does not provide a seperate
>> i2c_device_id table, then the driver is unusable with method 4. I don't
>> like to have some drivers being capable of it and some not.
>>
>>> Does the sysfs method create a i2c_device_id table?  If not, how does
>>> it probe successfully pre-patch?
>>
>> The sysfs method creates a device. Its name is matched against
>> i2c_device_ids only since it does not have a node pointer for DT to be
>> matched against.
>
> Is this really so useful on embedded systems?
>
> I was under the impression that this method was something used
> on say PC desktops with temperature monitors and EEPROMs
> on some I2C link on the PCB, usage entirely optional and fun
> for userspace hacks.
>
We use it for dynamic instantiating whole subsystems with multiplexers, 
sensors, controllers in an embedded system. The device list is taken 
from an I2C eeprom which gets read on hotplug.

KR
Michael

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

* [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices
@ 2014-06-02 14:29                 ` Michael Lawnick
  0 siblings, 0 replies; 50+ messages in thread
From: Michael Lawnick @ 2014-06-02 14:29 UTC (permalink / raw)
  To: linux-arm-kernel

Am 02.06.2014 14:16, schrieb Linus Walleij:
> On Sat, May 31, 2014 at 3:48 PM, Wolfram Sang <wsa@the-dreams.de> wrote:
>>
>>> Right, I read the function which provides the functionality, but my
>>> point is; I don't think my patch changes the semantics in a way which
>>> would adversely affect this option.  If you think that it does, can you
>>> specify how please?
>>
>> Currently, if a driver would be DT only and does not provide a seperate
>> i2c_device_id table, then the driver is unusable with method 4. I don't
>> like to have some drivers being capable of it and some not.
>>
>>> Does the sysfs method create a i2c_device_id table?  If not, how does
>>> it probe successfully pre-patch?
>>
>> The sysfs method creates a device. Its name is matched against
>> i2c_device_ids only since it does not have a node pointer for DT to be
>> matched against.
>
> Is this really so useful on embedded systems?
>
> I was under the impression that this method was something used
> on say PC desktops with temperature monitors and EEPROMs
> on some I2C link on the PCB, usage entirely optional and fun
> for userspace hacks.
>
We use it for dynamic instantiating whole subsystems with multiplexers, 
sensors, controllers in an embedded system. The device list is taken 
from an I2C eeprom which gets read on hotplug.

KR
Michael

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

* Re: [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices
  2014-06-02 14:29                 ` Michael Lawnick
  (?)
@ 2014-06-03 11:18                   ` Linus Walleij
  -1 siblings, 0 replies; 50+ messages in thread
From: Linus Walleij @ 2014-06-03 11:18 UTC (permalink / raw)
  To: Michael Lawnick
  Cc: Wolfram Sang, Grant Likely, Lee Jones, linux-arm-kernel,
	linux-kernel, linux-i2c

On Mon, Jun 2, 2014 at 4:29 PM, Michael Lawnick <ml.lawnick@gmx.de> wrote:
> Am 02.06.2014 14:16, schrieb Linus Walleij:

>> Is this really so useful on embedded systems?
>>
>> I was under the impression that this method was something used
>> on say PC desktops with temperature monitors and EEPROMs
>> on some I2C link on the PCB, usage entirely optional and fun
>> for userspace hacks.
>>
> We use it for dynamic instantiating whole subsystems with multiplexers,
> sensors, controllers in an embedded system. The device list is taken from an
> I2C eeprom which gets read on hotplug.

Does this mean that you have stored the names (strings) that are used
by the Linux kernel for identifying the devices into your EEPROM?

That means that you have made the kernel-internal device driver names
an ABI which is unfortunate :-/

This is one of the reasons to why we insist on device tree: OS neutral
hardware description.

Yours,
Linus Walleij

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

* Re: [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices
@ 2014-06-03 11:18                   ` Linus Walleij
  0 siblings, 0 replies; 50+ messages in thread
From: Linus Walleij @ 2014-06-03 11:18 UTC (permalink / raw)
  To: Michael Lawnick
  Cc: Wolfram Sang, Grant Likely, Lee Jones, linux-arm-kernel,
	linux-kernel, linux-i2c

On Mon, Jun 2, 2014 at 4:29 PM, Michael Lawnick <ml.lawnick@gmx.de> wrote:
> Am 02.06.2014 14:16, schrieb Linus Walleij:

>> Is this really so useful on embedded systems?
>>
>> I was under the impression that this method was something used
>> on say PC desktops with temperature monitors and EEPROMs
>> on some I2C link on the PCB, usage entirely optional and fun
>> for userspace hacks.
>>
> We use it for dynamic instantiating whole subsystems with multiplexers,
> sensors, controllers in an embedded system. The device list is taken from an
> I2C eeprom which gets read on hotplug.

Does this mean that you have stored the names (strings) that are used
by the Linux kernel for identifying the devices into your EEPROM?

That means that you have made the kernel-internal device driver names
an ABI which is unfortunate :-/

This is one of the reasons to why we insist on device tree: OS neutral
hardware description.

Yours,
Linus Walleij

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

* [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices
@ 2014-06-03 11:18                   ` Linus Walleij
  0 siblings, 0 replies; 50+ messages in thread
From: Linus Walleij @ 2014-06-03 11:18 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jun 2, 2014 at 4:29 PM, Michael Lawnick <ml.lawnick@gmx.de> wrote:
> Am 02.06.2014 14:16, schrieb Linus Walleij:

>> Is this really so useful on embedded systems?
>>
>> I was under the impression that this method was something used
>> on say PC desktops with temperature monitors and EEPROMs
>> on some I2C link on the PCB, usage entirely optional and fun
>> for userspace hacks.
>>
> We use it for dynamic instantiating whole subsystems with multiplexers,
> sensors, controllers in an embedded system. The device list is taken from an
> I2C eeprom which gets read on hotplug.

Does this mean that you have stored the names (strings) that are used
by the Linux kernel for identifying the devices into your EEPROM?

That means that you have made the kernel-internal device driver names
an ABI which is unfortunate :-/

This is one of the reasons to why we insist on device tree: OS neutral
hardware description.

Yours,
Linus Walleij

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

* Re: [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices
  2014-06-03 11:18                   ` Linus Walleij
  (?)
@ 2014-06-04  6:09                     ` Michael Lawnick
  -1 siblings, 0 replies; 50+ messages in thread
From: Michael Lawnick @ 2014-06-04  6:09 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Wolfram Sang, Grant Likely, Lee Jones, linux-arm-kernel,
	linux-kernel, linux-i2c

Am 03.06.2014 13:18, schrieb Linus Walleij:
> On Mon, Jun 2, 2014 at 4:29 PM, Michael Lawnick <ml.lawnick@gmx.de> wrote:
>> Am 02.06.2014 14:16, schrieb Linus Walleij:
>
>>> Is this really so useful on embedded systems?
>>>
>>> I was under the impression that this method was something used
>>> on say PC desktops with temperature monitors and EEPROMs
>>> on some I2C link on the PCB, usage entirely optional and fun
>>> for userspace hacks.
>>>
>> We use it for dynamic instantiating whole subsystems with multiplexers,
>> sensors, controllers in an embedded system. The device list is taken from an
>> I2C eeprom which gets read on hotplug.
>
> Does this mean that you have stored the names (strings) that are used
> by the Linux kernel for identifying the devices into your EEPROM?
>
> That means that you have made the kernel-internal device driver names
> an ABI which is unfortunate :-/
>
> This is one of the reasons to why we insist on device tree: OS neutral
> hardware description.

The eeprom contains a device tree that is dynamically merged.

KR
Michael



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

* Re: [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices
@ 2014-06-04  6:09                     ` Michael Lawnick
  0 siblings, 0 replies; 50+ messages in thread
From: Michael Lawnick @ 2014-06-04  6:09 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Wolfram Sang, Grant Likely, Lee Jones, linux-arm-kernel,
	linux-kernel, linux-i2c

Am 03.06.2014 13:18, schrieb Linus Walleij:
> On Mon, Jun 2, 2014 at 4:29 PM, Michael Lawnick <ml.lawnick@gmx.de> wrote:
>> Am 02.06.2014 14:16, schrieb Linus Walleij:
>
>>> Is this really so useful on embedded systems?
>>>
>>> I was under the impression that this method was something used
>>> on say PC desktops with temperature monitors and EEPROMs
>>> on some I2C link on the PCB, usage entirely optional and fun
>>> for userspace hacks.
>>>
>> We use it for dynamic instantiating whole subsystems with multiplexers,
>> sensors, controllers in an embedded system. The device list is taken from an
>> I2C eeprom which gets read on hotplug.
>
> Does this mean that you have stored the names (strings) that are used
> by the Linux kernel for identifying the devices into your EEPROM?
>
> That means that you have made the kernel-internal device driver names
> an ABI which is unfortunate :-/
>
> This is one of the reasons to why we insist on device tree: OS neutral
> hardware description.

The eeprom contains a device tree that is dynamically merged.

KR
Michael

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

* [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices
@ 2014-06-04  6:09                     ` Michael Lawnick
  0 siblings, 0 replies; 50+ messages in thread
From: Michael Lawnick @ 2014-06-04  6:09 UTC (permalink / raw)
  To: linux-arm-kernel

Am 03.06.2014 13:18, schrieb Linus Walleij:
> On Mon, Jun 2, 2014 at 4:29 PM, Michael Lawnick <ml.lawnick@gmx.de> wrote:
>> Am 02.06.2014 14:16, schrieb Linus Walleij:
>
>>> Is this really so useful on embedded systems?
>>>
>>> I was under the impression that this method was something used
>>> on say PC desktops with temperature monitors and EEPROMs
>>> on some I2C link on the PCB, usage entirely optional and fun
>>> for userspace hacks.
>>>
>> We use it for dynamic instantiating whole subsystems with multiplexers,
>> sensors, controllers in an embedded system. The device list is taken from an
>> I2C eeprom which gets read on hotplug.
>
> Does this mean that you have stored the names (strings) that are used
> by the Linux kernel for identifying the devices into your EEPROM?
>
> That means that you have made the kernel-internal device driver names
> an ABI which is unfortunate :-/
>
> This is one of the reasons to why we insist on device tree: OS neutral
> hardware description.

The eeprom contains a device tree that is dynamically merged.

KR
Michael

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

* Re: [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices
@ 2014-06-12  7:55                       ` Linus Walleij
  0 siblings, 0 replies; 50+ messages in thread
From: Linus Walleij @ 2014-06-12  7:55 UTC (permalink / raw)
  To: Michael Lawnick
  Cc: Wolfram Sang, Grant Likely, Lee Jones, linux-arm-kernel,
	linux-kernel, linux-i2c

On Wed, Jun 4, 2014 at 8:09 AM, Michael Lawnick <ml.lawnick@gmx.de> wrote:
> Am 03.06.2014 13:18, schrieb Linus Walleij:
>> On Mon, Jun 2, 2014 at 4:29 PM, Michael Lawnick <ml.lawnick@gmx.de> wrote:
>>>
>>> Am 02.06.2014 14:16, schrieb Linus Walleij:
>>
>>
>>>> Is this really so useful on embedded systems?
>>>>
>>>> I was under the impression that this method was something used
>>>> on say PC desktops with temperature monitors and EEPROMs
>>>> on some I2C link on the PCB, usage entirely optional and fun
>>>> for userspace hacks.
>>>>
>>> We use it for dynamic instantiating whole subsystems with multiplexers,
>>> sensors, controllers in an embedded system. The device list is taken from
>>> an
>>> I2C eeprom which gets read on hotplug.
>>
>>
>> Does this mean that you have stored the names (strings) that are used
>> by the Linux kernel for identifying the devices into your EEPROM?
>>
>> That means that you have made the kernel-internal device driver names
>> an ABI which is unfortunate :-/
>>
>> This is one of the reasons to why we insist on device tree: OS neutral
>> hardware description.
>
> The eeprom contains a device tree that is dynamically merged.

That is a kind of way of saying "yes we made the kernel-internal
driver named an ABI" I guess?

Yours,
Linus Walleij

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

* Re: [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices
@ 2014-06-12  7:55                       ` Linus Walleij
  0 siblings, 0 replies; 50+ messages in thread
From: Linus Walleij @ 2014-06-12  7:55 UTC (permalink / raw)
  To: Michael Lawnick
  Cc: Wolfram Sang, Grant Likely, Lee Jones,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA

On Wed, Jun 4, 2014 at 8:09 AM, Michael Lawnick <ml.lawnick-Mmb7MZpHnFY@public.gmane.org> wrote:
> Am 03.06.2014 13:18, schrieb Linus Walleij:
>> On Mon, Jun 2, 2014 at 4:29 PM, Michael Lawnick <ml.lawnick-Mmb7MZpHnFY@public.gmane.org> wrote:
>>>
>>> Am 02.06.2014 14:16, schrieb Linus Walleij:
>>
>>
>>>> Is this really so useful on embedded systems?
>>>>
>>>> I was under the impression that this method was something used
>>>> on say PC desktops with temperature monitors and EEPROMs
>>>> on some I2C link on the PCB, usage entirely optional and fun
>>>> for userspace hacks.
>>>>
>>> We use it for dynamic instantiating whole subsystems with multiplexers,
>>> sensors, controllers in an embedded system. The device list is taken from
>>> an
>>> I2C eeprom which gets read on hotplug.
>>
>>
>> Does this mean that you have stored the names (strings) that are used
>> by the Linux kernel for identifying the devices into your EEPROM?
>>
>> That means that you have made the kernel-internal device driver names
>> an ABI which is unfortunate :-/
>>
>> This is one of the reasons to why we insist on device tree: OS neutral
>> hardware description.
>
> The eeprom contains a device tree that is dynamically merged.

That is a kind of way of saying "yes we made the kernel-internal
driver named an ABI" I guess?

Yours,
Linus Walleij

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

* [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices
@ 2014-06-12  7:55                       ` Linus Walleij
  0 siblings, 0 replies; 50+ messages in thread
From: Linus Walleij @ 2014-06-12  7:55 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jun 4, 2014 at 8:09 AM, Michael Lawnick <ml.lawnick@gmx.de> wrote:
> Am 03.06.2014 13:18, schrieb Linus Walleij:
>> On Mon, Jun 2, 2014 at 4:29 PM, Michael Lawnick <ml.lawnick@gmx.de> wrote:
>>>
>>> Am 02.06.2014 14:16, schrieb Linus Walleij:
>>
>>
>>>> Is this really so useful on embedded systems?
>>>>
>>>> I was under the impression that this method was something used
>>>> on say PC desktops with temperature monitors and EEPROMs
>>>> on some I2C link on the PCB, usage entirely optional and fun
>>>> for userspace hacks.
>>>>
>>> We use it for dynamic instantiating whole subsystems with multiplexers,
>>> sensors, controllers in an embedded system. The device list is taken from
>>> an
>>> I2C eeprom which gets read on hotplug.
>>
>>
>> Does this mean that you have stored the names (strings) that are used
>> by the Linux kernel for identifying the devices into your EEPROM?
>>
>> That means that you have made the kernel-internal device driver names
>> an ABI which is unfortunate :-/
>>
>> This is one of the reasons to why we insist on device tree: OS neutral
>> hardware description.
>
> The eeprom contains a device tree that is dynamically merged.

That is a kind of way of saying "yes we made the kernel-internal
driver named an ABI" I guess?

Yours,
Linus Walleij

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

* Re: [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices
@ 2014-06-12  9:28                         ` Michael Lawnick
  0 siblings, 0 replies; 50+ messages in thread
From: Michael Lawnick @ 2014-06-12  9:28 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Wolfram Sang, Grant Likely, Lee Jones, linux-arm-kernel,
	linux-kernel, linux-i2c

Am 12.06.2014 09:55, schrieb Linus Walleij:
> On Wed, Jun 4, 2014 at 8:09 AM, Michael Lawnick <ml.lawnick@gmx.de> wrote:
>> Am 03.06.2014 13:18, schrieb Linus Walleij:
>>> On Mon, Jun 2, 2014 at 4:29 PM, Michael Lawnick <ml.lawnick@gmx.de> wrote:
>>>>
>>>> Am 02.06.2014 14:16, schrieb Linus Walleij:
>>>
>>>
>>>>> Is this really so useful on embedded systems?
>>>>>
>>>>> I was under the impression that this method was something used
>>>>> on say PC desktops with temperature monitors and EEPROMs
>>>>> on some I2C link on the PCB, usage entirely optional and fun
>>>>> for userspace hacks.
>>>>>
>>>> We use it for dynamic instantiating whole subsystems with multiplexers,
>>>> sensors, controllers in an embedded system. The device list is taken from
>>>> an
>>>> I2C eeprom which gets read on hotplug.
>>>
>>>
>>> Does this mean that you have stored the names (strings) that are used
>>> by the Linux kernel for identifying the devices into your EEPROM?
>>>
>>> That means that you have made the kernel-internal device driver names
>>> an ABI which is unfortunate :-/
>>>
>>> This is one of the reasons to why we insist on device tree: OS neutral
>>> hardware description.
>>
>> The eeprom contains a device tree that is dynamically merged.
>
> That is a kind of way of saying "yes we made the kernel-internal
> driver named an ABI" I guess?

Sorry, I fear I don't get you. Could you please rephrase?
Of course it might be that I'm missing some fundamental idea of device 
tree. The mechanism we use started with K2.6 where device tree usage on 
MIPS wasn't that intensive. Anyway the original idea of removing 
i2c_table now moved towards non-mandatory usage.

-- 
KR
Michael


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

* Re: [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices
@ 2014-06-12  9:28                         ` Michael Lawnick
  0 siblings, 0 replies; 50+ messages in thread
From: Michael Lawnick @ 2014-06-12  9:28 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Wolfram Sang, Grant Likely, Lee Jones,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA

Am 12.06.2014 09:55, schrieb Linus Walleij:
> On Wed, Jun 4, 2014 at 8:09 AM, Michael Lawnick <ml.lawnick-Mmb7MZpHnFY@public.gmane.org> wrote:
>> Am 03.06.2014 13:18, schrieb Linus Walleij:
>>> On Mon, Jun 2, 2014 at 4:29 PM, Michael Lawnick <ml.lawnick-Mmb7MZpHnFY@public.gmane.org> wrote:
>>>>
>>>> Am 02.06.2014 14:16, schrieb Linus Walleij:
>>>
>>>
>>>>> Is this really so useful on embedded systems?
>>>>>
>>>>> I was under the impression that this method was something used
>>>>> on say PC desktops with temperature monitors and EEPROMs
>>>>> on some I2C link on the PCB, usage entirely optional and fun
>>>>> for userspace hacks.
>>>>>
>>>> We use it for dynamic instantiating whole subsystems with multiplexers,
>>>> sensors, controllers in an embedded system. The device list is taken from
>>>> an
>>>> I2C eeprom which gets read on hotplug.
>>>
>>>
>>> Does this mean that you have stored the names (strings) that are used
>>> by the Linux kernel for identifying the devices into your EEPROM?
>>>
>>> That means that you have made the kernel-internal device driver names
>>> an ABI which is unfortunate :-/
>>>
>>> This is one of the reasons to why we insist on device tree: OS neutral
>>> hardware description.
>>
>> The eeprom contains a device tree that is dynamically merged.
>
> That is a kind of way of saying "yes we made the kernel-internal
> driver named an ABI" I guess?

Sorry, I fear I don't get you. Could you please rephrase?
Of course it might be that I'm missing some fundamental idea of device 
tree. The mechanism we use started with K2.6 where device tree usage on 
MIPS wasn't that intensive. Anyway the original idea of removing 
i2c_table now moved towards non-mandatory usage.

-- 
KR
Michael

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

* [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices
@ 2014-06-12  9:28                         ` Michael Lawnick
  0 siblings, 0 replies; 50+ messages in thread
From: Michael Lawnick @ 2014-06-12  9:28 UTC (permalink / raw)
  To: linux-arm-kernel

Am 12.06.2014 09:55, schrieb Linus Walleij:
> On Wed, Jun 4, 2014 at 8:09 AM, Michael Lawnick <ml.lawnick@gmx.de> wrote:
>> Am 03.06.2014 13:18, schrieb Linus Walleij:
>>> On Mon, Jun 2, 2014 at 4:29 PM, Michael Lawnick <ml.lawnick@gmx.de> wrote:
>>>>
>>>> Am 02.06.2014 14:16, schrieb Linus Walleij:
>>>
>>>
>>>>> Is this really so useful on embedded systems?
>>>>>
>>>>> I was under the impression that this method was something used
>>>>> on say PC desktops with temperature monitors and EEPROMs
>>>>> on some I2C link on the PCB, usage entirely optional and fun
>>>>> for userspace hacks.
>>>>>
>>>> We use it for dynamic instantiating whole subsystems with multiplexers,
>>>> sensors, controllers in an embedded system. The device list is taken from
>>>> an
>>>> I2C eeprom which gets read on hotplug.
>>>
>>>
>>> Does this mean that you have stored the names (strings) that are used
>>> by the Linux kernel for identifying the devices into your EEPROM?
>>>
>>> That means that you have made the kernel-internal device driver names
>>> an ABI which is unfortunate :-/
>>>
>>> This is one of the reasons to why we insist on device tree: OS neutral
>>> hardware description.
>>
>> The eeprom contains a device tree that is dynamically merged.
>
> That is a kind of way of saying "yes we made the kernel-internal
> driver named an ABI" I guess?

Sorry, I fear I don't get you. Could you please rephrase?
Of course it might be that I'm missing some fundamental idea of device 
tree. The mechanism we use started with K2.6 where device tree usage on 
MIPS wasn't that intensive. Anyway the original idea of removing 
i2c_table now moved towards non-mandatory usage.

-- 
KR
Michael

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

end of thread, other threads:[~2014-06-12  9:28 UTC | newest]

Thread overview: 50+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-30 12:26 [PATCH 0/{1,1}] i2c: Make I2C ID tables non-mandatory for DT/ACPI Lee Jones
2014-05-30 12:26 ` Lee Jones
2014-05-30 12:26 ` Lee Jones
2014-05-30 12:26 ` [PATCH] i2c: Make I2C ID tables non-mandatory for DT'ed and/or ACPI'ed devices Lee Jones
2014-05-30 12:26   ` Lee Jones
2014-05-30 12:36   ` Wolfram Sang
2014-05-30 12:36     ` Wolfram Sang
2014-05-30 12:55     ` Lee Jones
2014-05-30 12:55       ` Lee Jones
2014-05-30 12:55       ` Lee Jones
2014-05-30 13:34     ` Lee Jones
2014-05-30 13:34       ` Lee Jones
2014-05-30 13:34       ` Lee Jones
2014-05-30 17:48       ` Wolfram Sang
2014-05-30 17:48         ` Wolfram Sang
2014-05-30 17:48         ` Wolfram Sang
2014-05-30 19:25         ` Lee Jones
2014-05-30 19:25           ` Lee Jones
2014-05-31 13:48           ` Wolfram Sang
2014-05-31 13:48             ` Wolfram Sang
2014-05-31 13:48             ` Wolfram Sang
2014-06-02 12:16             ` Linus Walleij
2014-06-02 12:16               ` Linus Walleij
2014-06-02 12:16               ` Linus Walleij
2014-06-02 12:38               ` Wolfram Sang
2014-06-02 12:38                 ` Wolfram Sang
2014-06-02 12:38                 ` Wolfram Sang
2014-06-02 13:26                 ` Linus Walleij
2014-06-02 13:26                   ` Linus Walleij
2014-06-02 13:26                   ` Linus Walleij
2014-06-02 13:26                 ` Lee Jones
2014-06-02 13:26                   ` Lee Jones
2014-06-02 13:26                   ` Lee Jones
2014-06-02 14:29               ` Michael Lawnick
2014-06-02 14:29                 ` Michael Lawnick
2014-06-02 14:29                 ` Michael Lawnick
2014-06-03 11:18                 ` Linus Walleij
2014-06-03 11:18                   ` Linus Walleij
2014-06-03 11:18                   ` Linus Walleij
2014-06-04  6:09                   ` Michael Lawnick
2014-06-04  6:09                     ` Michael Lawnick
2014-06-04  6:09                     ` Michael Lawnick
2014-06-12  7:55                     ` Linus Walleij
2014-06-12  7:55                       ` Linus Walleij
2014-06-12  7:55                       ` Linus Walleij
2014-06-12  9:28                       ` Michael Lawnick
2014-06-12  9:28                         ` Michael Lawnick
2014-06-12  9:28                         ` Michael Lawnick
2014-05-30 12:26 ` Lee Jones
2014-05-30 12:26   ` Lee Jones

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.