All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i2c: Allow i2c_add_numbered_adapter() to assign a bus id.
@ 2011-06-27 18:55 ` Grant Likely
  0 siblings, 0 replies; 12+ messages in thread
From: Grant Likely @ 2011-06-27 18:55 UTC (permalink / raw)
  To: Jean Delvare (PC drivers, core),
	linux-i2c, Ben Dooks (embedded platforms),
	linux-kernel
  Cc: Dirk Brandewie, bones, Sebastian Andrzej Siewior

Currently, if an i2c bus driver supports both static and dynamic bus
ids, it needs to choose between calling i2c_add_numbered_adapter() and
i2c_add_adapter().  This patch makes i2c_add_numbered_adapter()
redirect to i2c_add_adapter() if the requested bus id is -1.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---
 drivers/i2c/busses/i2c-cpm.c   |    7 ++-----
 drivers/i2c/busses/i2c-pxa.c   |    7 ++-----
 drivers/i2c/busses/i2c-s6000.c |    5 +----
 drivers/i2c/i2c-core.c         |    5 +++++
 4 files changed, 10 insertions(+), 14 deletions(-)

diff --git a/drivers/i2c/busses/i2c-cpm.c b/drivers/i2c/busses/i2c-cpm.c
index 3a20961..b1d9cd2 100644
--- a/drivers/i2c/busses/i2c-cpm.c
+++ b/drivers/i2c/busses/i2c-cpm.c
@@ -662,11 +662,8 @@ static int __devinit cpm_i2c_probe(struct platform_device *ofdev)
 	/* register new adapter to i2c module... */
 
 	data = of_get_property(ofdev->dev.of_node, "linux,i2c-index", &len);
-	if (data && len == 4) {
-		cpm->adap.nr = *data;
-		result = i2c_add_numbered_adapter(&cpm->adap);
-	} else
-		result = i2c_add_adapter(&cpm->adap);
+	cpm->adap.nr = (data && len == 4) ? be32_to_cpup(data) : -1;
+	result = i2c_add_numbered_adapter(&cpm->adap);
 
 	if (result < 0) {
 		dev_err(&ofdev->dev, "Unable to register with I2C\n");
diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
index f59224a..d603646 100644
--- a/drivers/i2c/busses/i2c-pxa.c
+++ b/drivers/i2c/busses/i2c-pxa.c
@@ -1079,7 +1079,7 @@ static int i2c_pxa_probe(struct platform_device *dev)
 	 * The reason to do so is to avoid sysfs names that only make
 	 * sense when there are multiple adapters.
 	 */
-	i2c->adap.nr = dev->id != -1 ? dev->id : 0;
+	i2c->adap.nr = dev->id;
 	snprintf(i2c->adap.name, sizeof(i2c->adap.name), "pxa_i2c-i2c.%u",
 		 i2c->adap.nr);
 
@@ -1142,10 +1142,7 @@ static int i2c_pxa_probe(struct platform_device *dev)
 	i2c->adap.dev.of_node = dev->dev.of_node;
 #endif
 
-	if (i2c_type == REGS_CE4100)
-		ret = i2c_add_adapter(&i2c->adap);
-	else
-		ret = i2c_add_numbered_adapter(&i2c->adap);
+	ret = i2c_add_numbered_adapter(&i2c->adap);
 	if (ret < 0) {
 		printk(KERN_INFO "I2C: Failed to add bus\n");
 		goto eadapt;
diff --git a/drivers/i2c/busses/i2c-s6000.c b/drivers/i2c/busses/i2c-s6000.c
index cb5d01e..c64ba73 100644
--- a/drivers/i2c/busses/i2c-s6000.c
+++ b/drivers/i2c/busses/i2c-s6000.c
@@ -341,10 +341,7 @@ static int __devinit s6i2c_probe(struct platform_device *dev)
 	i2c_wr16(iface, S6_I2C_TXTL, 0);
 
 	platform_set_drvdata(dev, iface);
-	if (bus_num < 0)
-		rc = i2c_add_adapter(p_adap);
-	else
-		rc = i2c_add_numbered_adapter(p_adap);
+	rc = i2c_add_numbered_adapter(p_adap);
 	if (rc)
 		goto err_irq_free;
 	return 0;
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 9a58994..131079a 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -925,6 +925,9 @@ EXPORT_SYMBOL(i2c_add_adapter);
  * or otherwise built in to the system's mainboard, and where i2c_board_info
  * is used to properly configure I2C devices.
  *
+ * If the requested bus number is set to -1, then this function will behave
+ * identically to i2c_add_adapter, and will dynamically assign a bus number.
+ *
  * If no devices have pre-been declared for this bus, then be sure to
  * register the adapter before any dynamically allocated ones.  Otherwise
  * the required bus ID may not be available.
@@ -940,6 +943,8 @@ int i2c_add_numbered_adapter(struct i2c_adapter *adap)
 	int	id;
 	int	status;
 
+	if (adap->nr == -1) /* -1 means dynamically assign bus id */
+		return i2c_add_adapter(adap);
 	if (adap->nr & ~MAX_ID_MASK)
 		return -EINVAL;
 


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

* [PATCH] i2c: Allow i2c_add_numbered_adapter() to assign a bus id.
@ 2011-06-27 18:55 ` Grant Likely
  0 siblings, 0 replies; 12+ messages in thread
From: Grant Likely @ 2011-06-27 18:55 UTC (permalink / raw)
  To: Jean Delvare (PC drivers, core),
	linux-i2c-u79uwXL29TY76Z2rM5mHXA, Ben Dooks (embedded platforms),
	linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: Dirk Brandewie, bones-s3s/WqlpOiPyB63q8FvJNQ, Sebastian Andrzej Siewior

Currently, if an i2c bus driver supports both static and dynamic bus
ids, it needs to choose between calling i2c_add_numbered_adapter() and
i2c_add_adapter().  This patch makes i2c_add_numbered_adapter()
redirect to i2c_add_adapter() if the requested bus id is -1.

Signed-off-by: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
---
 drivers/i2c/busses/i2c-cpm.c   |    7 ++-----
 drivers/i2c/busses/i2c-pxa.c   |    7 ++-----
 drivers/i2c/busses/i2c-s6000.c |    5 +----
 drivers/i2c/i2c-core.c         |    5 +++++
 4 files changed, 10 insertions(+), 14 deletions(-)

diff --git a/drivers/i2c/busses/i2c-cpm.c b/drivers/i2c/busses/i2c-cpm.c
index 3a20961..b1d9cd2 100644
--- a/drivers/i2c/busses/i2c-cpm.c
+++ b/drivers/i2c/busses/i2c-cpm.c
@@ -662,11 +662,8 @@ static int __devinit cpm_i2c_probe(struct platform_device *ofdev)
 	/* register new adapter to i2c module... */
 
 	data = of_get_property(ofdev->dev.of_node, "linux,i2c-index", &len);
-	if (data && len == 4) {
-		cpm->adap.nr = *data;
-		result = i2c_add_numbered_adapter(&cpm->adap);
-	} else
-		result = i2c_add_adapter(&cpm->adap);
+	cpm->adap.nr = (data && len == 4) ? be32_to_cpup(data) : -1;
+	result = i2c_add_numbered_adapter(&cpm->adap);
 
 	if (result < 0) {
 		dev_err(&ofdev->dev, "Unable to register with I2C\n");
diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
index f59224a..d603646 100644
--- a/drivers/i2c/busses/i2c-pxa.c
+++ b/drivers/i2c/busses/i2c-pxa.c
@@ -1079,7 +1079,7 @@ static int i2c_pxa_probe(struct platform_device *dev)
 	 * The reason to do so is to avoid sysfs names that only make
 	 * sense when there are multiple adapters.
 	 */
-	i2c->adap.nr = dev->id != -1 ? dev->id : 0;
+	i2c->adap.nr = dev->id;
 	snprintf(i2c->adap.name, sizeof(i2c->adap.name), "pxa_i2c-i2c.%u",
 		 i2c->adap.nr);
 
@@ -1142,10 +1142,7 @@ static int i2c_pxa_probe(struct platform_device *dev)
 	i2c->adap.dev.of_node = dev->dev.of_node;
 #endif
 
-	if (i2c_type == REGS_CE4100)
-		ret = i2c_add_adapter(&i2c->adap);
-	else
-		ret = i2c_add_numbered_adapter(&i2c->adap);
+	ret = i2c_add_numbered_adapter(&i2c->adap);
 	if (ret < 0) {
 		printk(KERN_INFO "I2C: Failed to add bus\n");
 		goto eadapt;
diff --git a/drivers/i2c/busses/i2c-s6000.c b/drivers/i2c/busses/i2c-s6000.c
index cb5d01e..c64ba73 100644
--- a/drivers/i2c/busses/i2c-s6000.c
+++ b/drivers/i2c/busses/i2c-s6000.c
@@ -341,10 +341,7 @@ static int __devinit s6i2c_probe(struct platform_device *dev)
 	i2c_wr16(iface, S6_I2C_TXTL, 0);
 
 	platform_set_drvdata(dev, iface);
-	if (bus_num < 0)
-		rc = i2c_add_adapter(p_adap);
-	else
-		rc = i2c_add_numbered_adapter(p_adap);
+	rc = i2c_add_numbered_adapter(p_adap);
 	if (rc)
 		goto err_irq_free;
 	return 0;
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 9a58994..131079a 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -925,6 +925,9 @@ EXPORT_SYMBOL(i2c_add_adapter);
  * or otherwise built in to the system's mainboard, and where i2c_board_info
  * is used to properly configure I2C devices.
  *
+ * If the requested bus number is set to -1, then this function will behave
+ * identically to i2c_add_adapter, and will dynamically assign a bus number.
+ *
  * If no devices have pre-been declared for this bus, then be sure to
  * register the adapter before any dynamically allocated ones.  Otherwise
  * the required bus ID may not be available.
@@ -940,6 +943,8 @@ int i2c_add_numbered_adapter(struct i2c_adapter *adap)
 	int	id;
 	int	status;
 
+	if (adap->nr == -1) /* -1 means dynamically assign bus id */
+		return i2c_add_adapter(adap);
 	if (adap->nr & ~MAX_ID_MASK)
 		return -EINVAL;
 

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

* Re: [PATCH] i2c: Allow i2c_add_numbered_adapter() to assign a bus id.
  2011-06-27 18:55 ` Grant Likely
@ 2011-06-27 19:02   ` Grant Likely
  -1 siblings, 0 replies; 12+ messages in thread
From: Grant Likely @ 2011-06-27 19:02 UTC (permalink / raw)
  To: Jean Delvare (PC drivers, core),
	linux-i2c, Ben Dooks (embedded platforms),
	linux-kernel
  Cc: Dirk Brandewie, Sebastian Andrzej Siewior, John Bonesio, Stephen Warren

On Mon, Jun 27, 2011 at 12:55 PM, Grant Likely
<grant.likely@secretlab.ca> wrote:
> Currently, if an i2c bus driver supports both static and dynamic bus
> ids, it needs to choose between calling i2c_add_numbered_adapter() and
> i2c_add_adapter().  This patch makes i2c_add_numbered_adapter()
> redirect to i2c_add_adapter() if the requested bus id is -1.
>
> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>

Oops, forgot to edit the email before sending the patch.

This patch is as-yet untested other than build testing, but I want to
get feedback.  With the move to DT on ARM, there are going to be a lot
more i2c bus drivers that need to support both static and dynamically
allocated busses, and it is very likely that it will be needed in the
v3.1 merge window.

Ben/Jean, *IF* this patch tests out okay, and *IF* I get an ack from
you, it will probably need to have this commit in my devicetree/next
branch.  If so, then I'll either need to commit it myself, or have it
put into a separate topic branch that both of us can merge into our
trees.  What is your preference.

John: this is the patch that I asked you to write earlier today, but I
think one of the TI folks will run into the same issue, so I wanted to
get it drafted and onto the list ASAP.

g.

> ---
>  drivers/i2c/busses/i2c-cpm.c   |    7 ++-----
>  drivers/i2c/busses/i2c-pxa.c   |    7 ++-----
>  drivers/i2c/busses/i2c-s6000.c |    5 +----
>  drivers/i2c/i2c-core.c         |    5 +++++
>  4 files changed, 10 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-cpm.c b/drivers/i2c/busses/i2c-cpm.c
> index 3a20961..b1d9cd2 100644
> --- a/drivers/i2c/busses/i2c-cpm.c
> +++ b/drivers/i2c/busses/i2c-cpm.c
> @@ -662,11 +662,8 @@ static int __devinit cpm_i2c_probe(struct platform_device *ofdev)
>        /* register new adapter to i2c module... */
>
>        data = of_get_property(ofdev->dev.of_node, "linux,i2c-index", &len);
> -       if (data && len == 4) {
> -               cpm->adap.nr = *data;
> -               result = i2c_add_numbered_adapter(&cpm->adap);
> -       } else
> -               result = i2c_add_adapter(&cpm->adap);
> +       cpm->adap.nr = (data && len == 4) ? be32_to_cpup(data) : -1;
> +       result = i2c_add_numbered_adapter(&cpm->adap);
>
>        if (result < 0) {
>                dev_err(&ofdev->dev, "Unable to register with I2C\n");
> diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
> index f59224a..d603646 100644
> --- a/drivers/i2c/busses/i2c-pxa.c
> +++ b/drivers/i2c/busses/i2c-pxa.c
> @@ -1079,7 +1079,7 @@ static int i2c_pxa_probe(struct platform_device *dev)
>         * The reason to do so is to avoid sysfs names that only make
>         * sense when there are multiple adapters.
>         */
> -       i2c->adap.nr = dev->id != -1 ? dev->id : 0;
> +       i2c->adap.nr = dev->id;
>        snprintf(i2c->adap.name, sizeof(i2c->adap.name), "pxa_i2c-i2c.%u",
>                 i2c->adap.nr);
>
> @@ -1142,10 +1142,7 @@ static int i2c_pxa_probe(struct platform_device *dev)
>        i2c->adap.dev.of_node = dev->dev.of_node;
>  #endif
>
> -       if (i2c_type == REGS_CE4100)
> -               ret = i2c_add_adapter(&i2c->adap);
> -       else
> -               ret = i2c_add_numbered_adapter(&i2c->adap);
> +       ret = i2c_add_numbered_adapter(&i2c->adap);
>        if (ret < 0) {
>                printk(KERN_INFO "I2C: Failed to add bus\n");
>                goto eadapt;
> diff --git a/drivers/i2c/busses/i2c-s6000.c b/drivers/i2c/busses/i2c-s6000.c
> index cb5d01e..c64ba73 100644
> --- a/drivers/i2c/busses/i2c-s6000.c
> +++ b/drivers/i2c/busses/i2c-s6000.c
> @@ -341,10 +341,7 @@ static int __devinit s6i2c_probe(struct platform_device *dev)
>        i2c_wr16(iface, S6_I2C_TXTL, 0);
>
>        platform_set_drvdata(dev, iface);
> -       if (bus_num < 0)
> -               rc = i2c_add_adapter(p_adap);
> -       else
> -               rc = i2c_add_numbered_adapter(p_adap);
> +       rc = i2c_add_numbered_adapter(p_adap);
>        if (rc)
>                goto err_irq_free;
>        return 0;
> diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
> index 9a58994..131079a 100644
> --- a/drivers/i2c/i2c-core.c
> +++ b/drivers/i2c/i2c-core.c
> @@ -925,6 +925,9 @@ EXPORT_SYMBOL(i2c_add_adapter);
>  * or otherwise built in to the system's mainboard, and where i2c_board_info
>  * is used to properly configure I2C devices.
>  *
> + * If the requested bus number is set to -1, then this function will behave
> + * identically to i2c_add_adapter, and will dynamically assign a bus number.
> + *
>  * If no devices have pre-been declared for this bus, then be sure to
>  * register the adapter before any dynamically allocated ones.  Otherwise
>  * the required bus ID may not be available.
> @@ -940,6 +943,8 @@ int i2c_add_numbered_adapter(struct i2c_adapter *adap)
>        int     id;
>        int     status;
>
> +       if (adap->nr == -1) /* -1 means dynamically assign bus id */
> +               return i2c_add_adapter(adap);
>        if (adap->nr & ~MAX_ID_MASK)
>                return -EINVAL;
>
>
>



-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

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

* Re: [PATCH] i2c: Allow i2c_add_numbered_adapter() to assign a bus id.
@ 2011-06-27 19:02   ` Grant Likely
  0 siblings, 0 replies; 12+ messages in thread
From: Grant Likely @ 2011-06-27 19:02 UTC (permalink / raw)
  To: Jean Delvare (PC drivers, core),
	linux-i2c-u79uwXL29TY76Z2rM5mHXA, Ben Dooks (embedded platforms),
	linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: Dirk Brandewie, Sebastian Andrzej Siewior, John Bonesio, Stephen Warren

On Mon, Jun 27, 2011 at 12:55 PM, Grant Likely
<grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org> wrote:
> Currently, if an i2c bus driver supports both static and dynamic bus
> ids, it needs to choose between calling i2c_add_numbered_adapter() and
> i2c_add_adapter().  This patch makes i2c_add_numbered_adapter()
> redirect to i2c_add_adapter() if the requested bus id is -1.
>
> Signed-off-by: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>

Oops, forgot to edit the email before sending the patch.

This patch is as-yet untested other than build testing, but I want to
get feedback.  With the move to DT on ARM, there are going to be a lot
more i2c bus drivers that need to support both static and dynamically
allocated busses, and it is very likely that it will be needed in the
v3.1 merge window.

Ben/Jean, *IF* this patch tests out okay, and *IF* I get an ack from
you, it will probably need to have this commit in my devicetree/next
branch.  If so, then I'll either need to commit it myself, or have it
put into a separate topic branch that both of us can merge into our
trees.  What is your preference.

John: this is the patch that I asked you to write earlier today, but I
think one of the TI folks will run into the same issue, so I wanted to
get it drafted and onto the list ASAP.

g.

> ---
>  drivers/i2c/busses/i2c-cpm.c   |    7 ++-----
>  drivers/i2c/busses/i2c-pxa.c   |    7 ++-----
>  drivers/i2c/busses/i2c-s6000.c |    5 +----
>  drivers/i2c/i2c-core.c         |    5 +++++
>  4 files changed, 10 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-cpm.c b/drivers/i2c/busses/i2c-cpm.c
> index 3a20961..b1d9cd2 100644
> --- a/drivers/i2c/busses/i2c-cpm.c
> +++ b/drivers/i2c/busses/i2c-cpm.c
> @@ -662,11 +662,8 @@ static int __devinit cpm_i2c_probe(struct platform_device *ofdev)
>        /* register new adapter to i2c module... */
>
>        data = of_get_property(ofdev->dev.of_node, "linux,i2c-index", &len);
> -       if (data && len == 4) {
> -               cpm->adap.nr = *data;
> -               result = i2c_add_numbered_adapter(&cpm->adap);
> -       } else
> -               result = i2c_add_adapter(&cpm->adap);
> +       cpm->adap.nr = (data && len == 4) ? be32_to_cpup(data) : -1;
> +       result = i2c_add_numbered_adapter(&cpm->adap);
>
>        if (result < 0) {
>                dev_err(&ofdev->dev, "Unable to register with I2C\n");
> diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
> index f59224a..d603646 100644
> --- a/drivers/i2c/busses/i2c-pxa.c
> +++ b/drivers/i2c/busses/i2c-pxa.c
> @@ -1079,7 +1079,7 @@ static int i2c_pxa_probe(struct platform_device *dev)
>         * The reason to do so is to avoid sysfs names that only make
>         * sense when there are multiple adapters.
>         */
> -       i2c->adap.nr = dev->id != -1 ? dev->id : 0;
> +       i2c->adap.nr = dev->id;
>        snprintf(i2c->adap.name, sizeof(i2c->adap.name), "pxa_i2c-i2c.%u",
>                 i2c->adap.nr);
>
> @@ -1142,10 +1142,7 @@ static int i2c_pxa_probe(struct platform_device *dev)
>        i2c->adap.dev.of_node = dev->dev.of_node;
>  #endif
>
> -       if (i2c_type == REGS_CE4100)
> -               ret = i2c_add_adapter(&i2c->adap);
> -       else
> -               ret = i2c_add_numbered_adapter(&i2c->adap);
> +       ret = i2c_add_numbered_adapter(&i2c->adap);
>        if (ret < 0) {
>                printk(KERN_INFO "I2C: Failed to add bus\n");
>                goto eadapt;
> diff --git a/drivers/i2c/busses/i2c-s6000.c b/drivers/i2c/busses/i2c-s6000.c
> index cb5d01e..c64ba73 100644
> --- a/drivers/i2c/busses/i2c-s6000.c
> +++ b/drivers/i2c/busses/i2c-s6000.c
> @@ -341,10 +341,7 @@ static int __devinit s6i2c_probe(struct platform_device *dev)
>        i2c_wr16(iface, S6_I2C_TXTL, 0);
>
>        platform_set_drvdata(dev, iface);
> -       if (bus_num < 0)
> -               rc = i2c_add_adapter(p_adap);
> -       else
> -               rc = i2c_add_numbered_adapter(p_adap);
> +       rc = i2c_add_numbered_adapter(p_adap);
>        if (rc)
>                goto err_irq_free;
>        return 0;
> diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
> index 9a58994..131079a 100644
> --- a/drivers/i2c/i2c-core.c
> +++ b/drivers/i2c/i2c-core.c
> @@ -925,6 +925,9 @@ EXPORT_SYMBOL(i2c_add_adapter);
>  * or otherwise built in to the system's mainboard, and where i2c_board_info
>  * is used to properly configure I2C devices.
>  *
> + * If the requested bus number is set to -1, then this function will behave
> + * identically to i2c_add_adapter, and will dynamically assign a bus number.
> + *
>  * If no devices have pre-been declared for this bus, then be sure to
>  * register the adapter before any dynamically allocated ones.  Otherwise
>  * the required bus ID may not be available.
> @@ -940,6 +943,8 @@ int i2c_add_numbered_adapter(struct i2c_adapter *adap)
>        int     id;
>        int     status;
>
> +       if (adap->nr == -1) /* -1 means dynamically assign bus id */
> +               return i2c_add_adapter(adap);
>        if (adap->nr & ~MAX_ID_MASK)
>                return -EINVAL;
>
>
>



-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

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

* Re: [PATCH] i2c: Allow i2c_add_numbered_adapter() to assign a bus id.
@ 2011-07-05  8:53     ` Jean Delvare
  0 siblings, 0 replies; 12+ messages in thread
From: Jean Delvare @ 2011-07-05  8:53 UTC (permalink / raw)
  To: Grant Likely
  Cc: linux-i2c, Ben Dooks, linux-kernel, Dirk Brandewie,
	Sebastian Andrzej Siewior, John Bonesio, Stephen Warren

Hi Grant,

Sorry for the late answer.

On Mon, 27 Jun 2011 13:02:45 -0600, Grant Likely wrote:
> On Mon, Jun 27, 2011 at 12:55 PM, Grant Likely
> <grant.likely@secretlab.ca> wrote:
> > Currently, if an i2c bus driver supports both static and dynamic bus
> > ids, it needs to choose between calling i2c_add_numbered_adapter() and
> > i2c_add_adapter().  This patch makes i2c_add_numbered_adapter()
> > redirect to i2c_add_adapter() if the requested bus id is -1.
> >
> > Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
> 
> Oops, forgot to edit the email before sending the patch.
> 
> This patch is as-yet untested other than build testing, but I want to
> get feedback.  With the move to DT on ARM, there are going to be a lot
> more i2c bus drivers that need to support both static and dynamically
> allocated busses, and it is very likely that it will be needed in the
> v3.1 merge window.
> 
> Ben/Jean, *IF* this patch tests out okay, and *IF* I get an ack from
> you, it will probably need to have this commit in my devicetree/next
> branch.  If so, then I'll either need to commit it myself, or have it
> put into a separate topic branch that both of us can merge into our
> trees.  What is your preference.
> 
> John: this is the patch that I asked you to write earlier today, but I
> think one of the TI folks will run into the same issue, so I wanted to
> get it drafted and onto the list ASAP.

If this makes your life easier then I have no objection, you can go
ahead. I don't expect any conflict with my tree as there is no i2c-core
work going on on my end at the moment. So you can just take it in your
tree and merge it yourself as you see fit.

Acked-by: Jean Delvare <khali@linux-fr.org>

-- 
Jean Delvare

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

* Re: [PATCH] i2c: Allow i2c_add_numbered_adapter() to assign a bus id.
@ 2011-07-05  8:53     ` Jean Delvare
  0 siblings, 0 replies; 12+ messages in thread
From: Jean Delvare @ 2011-07-05  8:53 UTC (permalink / raw)
  To: Grant Likely
  Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA, Ben Dooks,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Dirk Brandewie,
	Sebastian Andrzej Siewior, John Bonesio, Stephen Warren

Hi Grant,

Sorry for the late answer.

On Mon, 27 Jun 2011 13:02:45 -0600, Grant Likely wrote:
> On Mon, Jun 27, 2011 at 12:55 PM, Grant Likely
> <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org> wrote:
> > Currently, if an i2c bus driver supports both static and dynamic bus
> > ids, it needs to choose between calling i2c_add_numbered_adapter() and
> > i2c_add_adapter().  This patch makes i2c_add_numbered_adapter()
> > redirect to i2c_add_adapter() if the requested bus id is -1.
> >
> > Signed-off-by: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
> 
> Oops, forgot to edit the email before sending the patch.
> 
> This patch is as-yet untested other than build testing, but I want to
> get feedback.  With the move to DT on ARM, there are going to be a lot
> more i2c bus drivers that need to support both static and dynamically
> allocated busses, and it is very likely that it will be needed in the
> v3.1 merge window.
> 
> Ben/Jean, *IF* this patch tests out okay, and *IF* I get an ack from
> you, it will probably need to have this commit in my devicetree/next
> branch.  If so, then I'll either need to commit it myself, or have it
> put into a separate topic branch that both of us can merge into our
> trees.  What is your preference.
> 
> John: this is the patch that I asked you to write earlier today, but I
> think one of the TI folks will run into the same issue, so I wanted to
> get it drafted and onto the list ASAP.

If this makes your life easier then I have no objection, you can go
ahead. I don't expect any conflict with my tree as there is no i2c-core
work going on on my end at the moment. So you can just take it in your
tree and merge it yourself as you see fit.

Acked-by: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>

-- 
Jean Delvare

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

* Re: [PATCH] i2c: Allow i2c_add_numbered_adapter() to assign a bus id.
@ 2011-07-05 13:31       ` Grant Likely
  0 siblings, 0 replies; 12+ messages in thread
From: Grant Likely @ 2011-07-05 13:31 UTC (permalink / raw)
  To: Jean Delvare
  Cc: linux-i2c, Ben Dooks, linux-kernel, Dirk Brandewie,
	Sebastian Andrzej Siewior, John Bonesio, Stephen Warren

On Tue, Jul 5, 2011 at 2:53 AM, Jean Delvare <khali@linux-fr.org> wrote:
> Hi Grant,
>
> Sorry for the late answer.
>
> On Mon, 27 Jun 2011 13:02:45 -0600, Grant Likely wrote:
>> On Mon, Jun 27, 2011 at 12:55 PM, Grant Likely
>> <grant.likely@secretlab.ca> wrote:
>> > Currently, if an i2c bus driver supports both static and dynamic bus
>> > ids, it needs to choose between calling i2c_add_numbered_adapter() and
>> > i2c_add_adapter().  This patch makes i2c_add_numbered_adapter()
>> > redirect to i2c_add_adapter() if the requested bus id is -1.
>> >
>> > Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
>>
>> Oops, forgot to edit the email before sending the patch.
>>
>> This patch is as-yet untested other than build testing, but I want to
>> get feedback.  With the move to DT on ARM, there are going to be a lot
>> more i2c bus drivers that need to support both static and dynamically
>> allocated busses, and it is very likely that it will be needed in the
>> v3.1 merge window.
>>
>> Ben/Jean, *IF* this patch tests out okay, and *IF* I get an ack from
>> you, it will probably need to have this commit in my devicetree/next
>> branch.  If so, then I'll either need to commit it myself, or have it
>> put into a separate topic branch that both of us can merge into our
>> trees.  What is your preference.
>>
>> John: this is the patch that I asked you to write earlier today, but I
>> think one of the TI folks will run into the same issue, so I wanted to
>> get it drafted and onto the list ASAP.
>
> If this makes your life easier then I have no objection, you can go
> ahead. I don't expect any conflict with my tree as there is no i2c-core
> work going on on my end at the moment. So you can just take it in your
> tree and merge it yourself as you see fit.
>
> Acked-by: Jean Delvare <khali@linux-fr.org>

Thanks Jean, will do.

g.

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

* Re: [PATCH] i2c: Allow i2c_add_numbered_adapter() to assign a bus id.
@ 2011-07-05 13:31       ` Grant Likely
  0 siblings, 0 replies; 12+ messages in thread
From: Grant Likely @ 2011-07-05 13:31 UTC (permalink / raw)
  To: Jean Delvare
  Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA, Ben Dooks,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Dirk Brandewie,
	Sebastian Andrzej Siewior, John Bonesio, Stephen Warren

On Tue, Jul 5, 2011 at 2:53 AM, Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org> wrote:
> Hi Grant,
>
> Sorry for the late answer.
>
> On Mon, 27 Jun 2011 13:02:45 -0600, Grant Likely wrote:
>> On Mon, Jun 27, 2011 at 12:55 PM, Grant Likely
>> <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org> wrote:
>> > Currently, if an i2c bus driver supports both static and dynamic bus
>> > ids, it needs to choose between calling i2c_add_numbered_adapter() and
>> > i2c_add_adapter().  This patch makes i2c_add_numbered_adapter()
>> > redirect to i2c_add_adapter() if the requested bus id is -1.
>> >
>> > Signed-off-by: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
>>
>> Oops, forgot to edit the email before sending the patch.
>>
>> This patch is as-yet untested other than build testing, but I want to
>> get feedback.  With the move to DT on ARM, there are going to be a lot
>> more i2c bus drivers that need to support both static and dynamically
>> allocated busses, and it is very likely that it will be needed in the
>> v3.1 merge window.
>>
>> Ben/Jean, *IF* this patch tests out okay, and *IF* I get an ack from
>> you, it will probably need to have this commit in my devicetree/next
>> branch.  If so, then I'll either need to commit it myself, or have it
>> put into a separate topic branch that both of us can merge into our
>> trees.  What is your preference.
>>
>> John: this is the patch that I asked you to write earlier today, but I
>> think one of the TI folks will run into the same issue, so I wanted to
>> get it drafted and onto the list ASAP.
>
> If this makes your life easier then I have no objection, you can go
> ahead. I don't expect any conflict with my tree as there is no i2c-core
> work going on on my end at the moment. So you can just take it in your
> tree and merge it yourself as you see fit.
>
> Acked-by: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>

Thanks Jean, will do.

g.

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

* Re: [PATCH] i2c: Allow i2c_add_numbered_adapter() to assign a bus id.
@ 2011-07-06  6:37       ` Grant Likely
  0 siblings, 0 replies; 12+ messages in thread
From: Grant Likely @ 2011-07-06  6:37 UTC (permalink / raw)
  To: Jean Delvare
  Cc: linux-i2c, Ben Dooks, linux-kernel, Dirk Brandewie,
	Sebastian Andrzej Siewior, John Bonesio, Stephen Warren

On Tue, Jul 05, 2011 at 10:53:30AM +0200, Jean Delvare wrote:
> Hi Grant,
> 
> Sorry for the late answer.
> 
> On Mon, 27 Jun 2011 13:02:45 -0600, Grant Likely wrote:
> > On Mon, Jun 27, 2011 at 12:55 PM, Grant Likely
> > <grant.likely@secretlab.ca> wrote:
> > > Currently, if an i2c bus driver supports both static and dynamic bus
> > > ids, it needs to choose between calling i2c_add_numbered_adapter() and
> > > i2c_add_adapter().  This patch makes i2c_add_numbered_adapter()
> > > redirect to i2c_add_adapter() if the requested bus id is -1.
> > >
> > > Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
> > 
> > Oops, forgot to edit the email before sending the patch.
> > 
> > This patch is as-yet untested other than build testing, but I want to
> > get feedback.  With the move to DT on ARM, there are going to be a lot
> > more i2c bus drivers that need to support both static and dynamically
> > allocated busses, and it is very likely that it will be needed in the
> > v3.1 merge window.
> > 
> > Ben/Jean, *IF* this patch tests out okay, and *IF* I get an ack from
> > you, it will probably need to have this commit in my devicetree/next
> > branch.  If so, then I'll either need to commit it myself, or have it
> > put into a separate topic branch that both of us can merge into our
> > trees.  What is your preference.
> > 
> > John: this is the patch that I asked you to write earlier today, but I
> > think one of the TI folks will run into the same issue, so I wanted to
> > get it drafted and onto the list ASAP.
> 
> If this makes your life easier then I have no objection, you can go
> ahead. I don't expect any conflict with my tree as there is no i2c-core
> work going on on my end at the moment. So you can just take it in your
> tree and merge it yourself as you see fit.
> 
> Acked-by: Jean Delvare <khali@linux-fr.org>

Actually, now that I'm looking at things, I don't think there will be
a conflict.  Go ahead and take it via your tree so that I don't make
Linus' life harder than it needs to be.

g.


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

* Re: [PATCH] i2c: Allow i2c_add_numbered_adapter() to assign a bus id.
@ 2011-07-06  6:37       ` Grant Likely
  0 siblings, 0 replies; 12+ messages in thread
From: Grant Likely @ 2011-07-06  6:37 UTC (permalink / raw)
  To: Jean Delvare
  Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA, Ben Dooks,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Dirk Brandewie,
	Sebastian Andrzej Siewior, John Bonesio, Stephen Warren

On Tue, Jul 05, 2011 at 10:53:30AM +0200, Jean Delvare wrote:
> Hi Grant,
> 
> Sorry for the late answer.
> 
> On Mon, 27 Jun 2011 13:02:45 -0600, Grant Likely wrote:
> > On Mon, Jun 27, 2011 at 12:55 PM, Grant Likely
> > <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org> wrote:
> > > Currently, if an i2c bus driver supports both static and dynamic bus
> > > ids, it needs to choose between calling i2c_add_numbered_adapter() and
> > > i2c_add_adapter().  This patch makes i2c_add_numbered_adapter()
> > > redirect to i2c_add_adapter() if the requested bus id is -1.
> > >
> > > Signed-off-by: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
> > 
> > Oops, forgot to edit the email before sending the patch.
> > 
> > This patch is as-yet untested other than build testing, but I want to
> > get feedback.  With the move to DT on ARM, there are going to be a lot
> > more i2c bus drivers that need to support both static and dynamically
> > allocated busses, and it is very likely that it will be needed in the
> > v3.1 merge window.
> > 
> > Ben/Jean, *IF* this patch tests out okay, and *IF* I get an ack from
> > you, it will probably need to have this commit in my devicetree/next
> > branch.  If so, then I'll either need to commit it myself, or have it
> > put into a separate topic branch that both of us can merge into our
> > trees.  What is your preference.
> > 
> > John: this is the patch that I asked you to write earlier today, but I
> > think one of the TI folks will run into the same issue, so I wanted to
> > get it drafted and onto the list ASAP.
> 
> If this makes your life easier then I have no objection, you can go
> ahead. I don't expect any conflict with my tree as there is no i2c-core
> work going on on my end at the moment. So you can just take it in your
> tree and merge it yourself as you see fit.
> 
> Acked-by: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>

Actually, now that I'm looking at things, I don't think there will be
a conflict.  Go ahead and take it via your tree so that I don't make
Linus' life harder than it needs to be.

g.

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

* Re: [PATCH] i2c: Allow i2c_add_numbered_adapter() to assign a bus id.
@ 2011-07-06  7:51         ` Jean Delvare
  0 siblings, 0 replies; 12+ messages in thread
From: Jean Delvare @ 2011-07-06  7:51 UTC (permalink / raw)
  To: Grant Likely
  Cc: linux-i2c, Ben Dooks, linux-kernel, Dirk Brandewie,
	Sebastian Andrzej Siewior, John Bonesio, Stephen Warren

On Wed, 6 Jul 2011 00:37:46 -0600, Grant Likely wrote:
> Actually, now that I'm looking at things, I don't think there will be
> a conflict.  Go ahead and take it via your tree so that I don't make
> Linus' life harder than it needs to be.

OK, I've added the patch to my quilt series for the time being, so
it'll be in linux-next. Let me know if you change your mind before I
send it to Linus during the 3.1 merge window.

-- 
Jean Delvare

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

* Re: [PATCH] i2c: Allow i2c_add_numbered_adapter() to assign a bus id.
@ 2011-07-06  7:51         ` Jean Delvare
  0 siblings, 0 replies; 12+ messages in thread
From: Jean Delvare @ 2011-07-06  7:51 UTC (permalink / raw)
  To: Grant Likely
  Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA, Ben Dooks,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Dirk Brandewie,
	Sebastian Andrzej Siewior, John Bonesio, Stephen Warren

On Wed, 6 Jul 2011 00:37:46 -0600, Grant Likely wrote:
> Actually, now that I'm looking at things, I don't think there will be
> a conflict.  Go ahead and take it via your tree so that I don't make
> Linus' life harder than it needs to be.

OK, I've added the patch to my quilt series for the time being, so
it'll be in linux-next. Let me know if you change your mind before I
send it to Linus during the 3.1 merge window.

-- 
Jean Delvare

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

end of thread, other threads:[~2011-07-06  7:51 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-27 18:55 [PATCH] i2c: Allow i2c_add_numbered_adapter() to assign a bus id Grant Likely
2011-06-27 18:55 ` Grant Likely
2011-06-27 19:02 ` Grant Likely
2011-06-27 19:02   ` Grant Likely
2011-07-05  8:53   ` Jean Delvare
2011-07-05  8:53     ` Jean Delvare
2011-07-05 13:31     ` Grant Likely
2011-07-05 13:31       ` Grant Likely
2011-07-06  6:37     ` Grant Likely
2011-07-06  6:37       ` Grant Likely
2011-07-06  7:51       ` Jean Delvare
2011-07-06  7:51         ` Jean Delvare

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.