linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] i2c: pinctrl-ify i2c-omap.c
  2012-10-31 15:55 [PATCH] i2c: pinctrl-ify i2c-omap.c Pantelis Antoniou
@ 2012-10-30 18:17 ` Tony Lindgren
  2012-10-30 18:53 ` Felipe Balbi
       [not found] ` <1351698930-3797-1-git-send-email-panto-wVdstyuyKrO8r51toPun2/C9HSW9iNxf@public.gmane.org>
  2 siblings, 0 replies; 7+ messages in thread
From: Tony Lindgren @ 2012-10-30 18:17 UTC (permalink / raw)
  To: Pantelis Antoniou
  Cc: Ben Dooks (embedded platforms), Wolfram Sang (embedded platforms),
	linux-omap, linux-i2c, linux-kernel, Koen Kooi, Matt Porter,
	Russ Dill

* Pantelis Antoniou <panto@antoniou-consulting.com> [121030 11:04]:
> Enable pinctrl for i2c-omap.
> 
> Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>

Looks good to me:

Acked-by: Tony Lindgren <tony@atomide.com>

> ---
>  drivers/i2c/busses/i2c-omap.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
> index db31eae..4c38aa0 100644
> --- a/drivers/i2c/busses/i2c-omap.c
> +++ b/drivers/i2c/busses/i2c-omap.c
> @@ -44,6 +44,8 @@
>  #include <linux/i2c-omap.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/pm_qos.h>
> +#include <linux/pinctrl/consumer.h>
> +#include <linux/err.h>
>  
>  /* I2C controller revisions */
>  #define OMAP_I2C_OMAP1_REV_2		0x20
> @@ -1064,6 +1066,7 @@ omap_i2c_probe(struct platform_device *pdev)
>  	const struct of_device_id *match;
>  	int irq;
>  	int r;
> +	struct pinctrl *pinctrl;
>  
>  	/* NOTE: driver uses the static register mapping */
>  	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> @@ -1202,6 +1205,13 @@ omap_i2c_probe(struct platform_device *pdev)
>  
>  	of_i2c_register_devices(adap);
>  
> +	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
> +	if (IS_ERR(pinctrl))
> +		dev_warn(dev->dev, "unable to select pin group\n");
> +
> +	dev_info(dev->dev, "bus %d rev%d.%d.%d at %d kHz\n", adap->nr,
> +		 dev->dtrev, dev->rev >> 4, dev->rev & 0xf, dev->speed);
> +
>  	pm_runtime_mark_last_busy(dev->dev);
>  	pm_runtime_put_autosuspend(dev->dev);
>  
> -- 
> 1.7.12
> 

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

* Re: [PATCH] i2c: pinctrl-ify i2c-omap.c
  2012-10-31 15:55 [PATCH] i2c: pinctrl-ify i2c-omap.c Pantelis Antoniou
  2012-10-30 18:17 ` Tony Lindgren
@ 2012-10-30 18:53 ` Felipe Balbi
  2012-10-30 18:59   ` Pantelis Antoniou
       [not found]   ` <20121030185303.GD4804-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
       [not found] ` <1351698930-3797-1-git-send-email-panto-wVdstyuyKrO8r51toPun2/C9HSW9iNxf@public.gmane.org>
  2 siblings, 2 replies; 7+ messages in thread
From: Felipe Balbi @ 2012-10-30 18:53 UTC (permalink / raw)
  To: Pantelis Antoniou
  Cc: Tony Lindgren, Ben Dooks (embedded platforms),
	Wolfram Sang (embedded platforms), linux-omap, linux-i2c,
	linux-kernel, Koen Kooi, Matt Porter, Russ Dill

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

Hi,

On Wed, Oct 31, 2012 at 05:55:30PM +0200, Pantelis Antoniou wrote:
> Enable pinctrl for i2c-omap.
> 
> Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
> ---
>  drivers/i2c/busses/i2c-omap.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
> index db31eae..4c38aa0 100644
> --- a/drivers/i2c/busses/i2c-omap.c
> +++ b/drivers/i2c/busses/i2c-omap.c
> @@ -44,6 +44,8 @@
>  #include <linux/i2c-omap.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/pm_qos.h>
> +#include <linux/pinctrl/consumer.h>
> +#include <linux/err.h>
>  
>  /* I2C controller revisions */
>  #define OMAP_I2C_OMAP1_REV_2		0x20
> @@ -1064,6 +1066,7 @@ omap_i2c_probe(struct platform_device *pdev)
>  	const struct of_device_id *match;
>  	int irq;
>  	int r;
> +	struct pinctrl *pinctrl;
>  
>  	/* NOTE: driver uses the static register mapping */
>  	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> @@ -1202,6 +1205,13 @@ omap_i2c_probe(struct platform_device *pdev)
>  
>  	of_i2c_register_devices(adap);
>  
> +	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
> +	if (IS_ERR(pinctrl))
> +		dev_warn(dev->dev, "unable to select pin group\n");

if we continue anyway, should this be dev_warn() ? Would you consider
dev_dbg() instead ?

> +	dev_info(dev->dev, "bus %d rev%d.%d.%d at %d kHz\n", adap->nr,
> +		 dev->dtrev, dev->rev >> 4, dev->rev & 0xf, dev->speed);

this dev_info() doesn't look like it's part of $subject. Care to, at
least, add a reasoning for adding this to commit log ?

-- 
balbi

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

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

* Re: [PATCH] i2c: pinctrl-ify i2c-omap.c
  2012-10-30 18:53 ` Felipe Balbi
@ 2012-10-30 18:59   ` Pantelis Antoniou
       [not found]   ` <20121030185303.GD4804-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
  1 sibling, 0 replies; 7+ messages in thread
From: Pantelis Antoniou @ 2012-10-30 18:59 UTC (permalink / raw)
  To: balbi
  Cc: Tony Lindgren, Ben Dooks (embedded platforms),
	Wolfram Sang (embedded platforms), linux-omap, linux-i2c,
	linux-kernel, Koen Kooi, Matt Porter, Russ Dill

Hi Felipe,

On Oct 30, 2012, at 8:53 PM, Felipe Balbi wrote:

> Hi,
> 
> On Wed, Oct 31, 2012 at 05:55:30PM +0200, Pantelis Antoniou wrote:
>> Enable pinctrl for i2c-omap.
>> 
>> Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
>> ---
>> drivers/i2c/busses/i2c-omap.c | 10 ++++++++++
>> 1 file changed, 10 insertions(+)
>> 
>> diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
>> index db31eae..4c38aa0 100644
>> --- a/drivers/i2c/busses/i2c-omap.c
>> +++ b/drivers/i2c/busses/i2c-omap.c
>> @@ -44,6 +44,8 @@
>> #include <linux/i2c-omap.h>
>> #include <linux/pm_runtime.h>
>> #include <linux/pm_qos.h>
>> +#include <linux/pinctrl/consumer.h>
>> +#include <linux/err.h>
>> 
>> /* I2C controller revisions */
>> #define OMAP_I2C_OMAP1_REV_2		0x20
>> @@ -1064,6 +1066,7 @@ omap_i2c_probe(struct platform_device *pdev)
>> 	const struct of_device_id *match;
>> 	int irq;
>> 	int r;
>> +	struct pinctrl *pinctrl;
>> 
>> 	/* NOTE: driver uses the static register mapping */
>> 	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>> @@ -1202,6 +1205,13 @@ omap_i2c_probe(struct platform_device *pdev)
>> 
>> 	of_i2c_register_devices(adap);
>> 
>> +	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
>> +	if (IS_ERR(pinctrl))
>> +		dev_warn(dev->dev, "unable to select pin group\n");
> 
> if we continue anyway, should this be dev_warn() ? Would you consider
> dev_dbg() instead ?

Sure. No problem.

> 
>> +	dev_info(dev->dev, "bus %d rev%d.%d.%d at %d kHz\n", adap->nr,
>> +		 dev->dtrev, dev->rev >> 4, dev->rev & 0xf, dev->speed);
> 
> this dev_info() doesn't look like it's part of $subject. Care to, at
> least, add a reasoning for adding this to commit log ?
> 

I'll just remove it...

> -- 
> balbi

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

* Re: [PATCH] i2c: pinctrl-ify i2c-omap.c
       [not found]   ` <20121030185303.GD4804-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
@ 2012-10-30 19:13     ` Porter, Matt
  0 siblings, 0 replies; 7+ messages in thread
From: Porter, Matt @ 2012-10-30 19:13 UTC (permalink / raw)
  To: Balbi, Felipe
  Cc: Pantelis Antoniou, Tony Lindgren, Ben Dooks (embedded platforms),
	Wolfram Sang (embedded platforms),
	<linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	<linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Koen Kooi, Dill, Russ


On Oct 30, 2012, at 2:53 PM, Felipe Balbi wrote:

> Hi,
> 
> On Wed, Oct 31, 2012 at 05:55:30PM +0200, Pantelis Antoniou wrote:
>> Enable pinctrl for i2c-omap.
>> 
>> Signed-off-by: Pantelis Antoniou <panto-wVdstyuyKrO8r51toPun2/C9HSW9iNxf@public.gmane.org>
>> ---
>> drivers/i2c/busses/i2c-omap.c | 10 ++++++++++
>> 1 file changed, 10 insertions(+)
>> 
>> diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
>> index db31eae..4c38aa0 100644
>> --- a/drivers/i2c/busses/i2c-omap.c
>> +++ b/drivers/i2c/busses/i2c-omap.c
>> @@ -44,6 +44,8 @@
>> #include <linux/i2c-omap.h>
>> #include <linux/pm_runtime.h>
>> #include <linux/pm_qos.h>
>> +#include <linux/pinctrl/consumer.h>
>> +#include <linux/err.h>
>> 
>> /* I2C controller revisions */
>> #define OMAP_I2C_OMAP1_REV_2		0x20
>> @@ -1064,6 +1066,7 @@ omap_i2c_probe(struct platform_device *pdev)
>> 	const struct of_device_id *match;
>> 	int irq;
>> 	int r;
>> +	struct pinctrl *pinctrl;
>> 
>> 	/* NOTE: driver uses the static register mapping */
>> 	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>> @@ -1202,6 +1205,13 @@ omap_i2c_probe(struct platform_device *pdev)
>> 
>> 	of_i2c_register_devices(adap);
>> 
>> +	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
>> +	if (IS_ERR(pinctrl))
>> +		dev_warn(dev->dev, "unable to select pin group\n");
> 
> if we continue anyway, should this be dev_warn() ? Would you consider
> dev_dbg() instead ?

This has been the convention already in other drivers upstream. Discussed
previously in http://www.spinics.net/lists/arm-kernel/msg192856.html and
http://lkml.org/lkml/2012/9/11/369

That resulted in having dev_warn with a message of "pins are not configured
from the driver" in both leds-gpio and spi-omap2-mcspi. It seems there should
be a good reason to change reporting for the same case here.

-Matt

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

* Re: [PATCH] i2c: pinctrl-ify i2c-omap.c
       [not found] ` <1351698930-3797-1-git-send-email-panto-wVdstyuyKrO8r51toPun2/C9HSW9iNxf@public.gmane.org>
@ 2012-10-30 20:14   ` Sebastien Guiriec
  2012-10-30 20:18     ` Pantelis Antoniou
  0 siblings, 1 reply; 7+ messages in thread
From: Sebastien Guiriec @ 2012-10-30 20:14 UTC (permalink / raw)
  To: Pantelis Antoniou
  Cc: Tony Lindgren, Ben Dooks (embedded platforms),
	Wolfram Sang (embedded platforms),
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Koen Kooi, Matt Porter,
	Russ Dill

Hi Pantelis,

Can you look at the early thread?
   https://patchwork.kernel.org/patch/1601331/

I send a similar patch earlier with defer probe usage.

Best regards,

Sebastien
On 10/31/2012 04:55 PM, Pantelis Antoniou wrote:
> Enable pinctrl for i2c-omap.
>
> Signed-off-by: Pantelis Antoniou <panto-wVdstyuyKrO8r51toPun2/C9HSW9iNxf@public.gmane.org>
> ---
>   drivers/i2c/busses/i2c-omap.c | 10 ++++++++++
>   1 file changed, 10 insertions(+)
>
> diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
> index db31eae..4c38aa0 100644
> --- a/drivers/i2c/busses/i2c-omap.c
> +++ b/drivers/i2c/busses/i2c-omap.c
> @@ -44,6 +44,8 @@
>   #include <linux/i2c-omap.h>
>   #include <linux/pm_runtime.h>
>   #include <linux/pm_qos.h>
> +#include <linux/pinctrl/consumer.h>
> +#include <linux/err.h>
>
>   /* I2C controller revisions */
>   #define OMAP_I2C_OMAP1_REV_2		0x20
> @@ -1064,6 +1066,7 @@ omap_i2c_probe(struct platform_device *pdev)
>   	const struct of_device_id *match;
>   	int irq;
>   	int r;
> +	struct pinctrl *pinctrl;
>
>   	/* NOTE: driver uses the static register mapping */
>   	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> @@ -1202,6 +1205,13 @@ omap_i2c_probe(struct platform_device *pdev)
>
>   	of_i2c_register_devices(adap);
>
> +	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
> +	if (IS_ERR(pinctrl))
> +		dev_warn(dev->dev, "unable to select pin group\n");
> +
> +	dev_info(dev->dev, "bus %d rev%d.%d.%d at %d kHz\n", adap->nr,
> +		 dev->dtrev, dev->rev >> 4, dev->rev & 0xf, dev->speed);
> +
>   	pm_runtime_mark_last_busy(dev->dev);
>   	pm_runtime_put_autosuspend(dev->dev);
>
>

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

* Re: [PATCH] i2c: pinctrl-ify i2c-omap.c
  2012-10-30 20:14   ` Sebastien Guiriec
@ 2012-10-30 20:18     ` Pantelis Antoniou
  0 siblings, 0 replies; 7+ messages in thread
From: Pantelis Antoniou @ 2012-10-30 20:18 UTC (permalink / raw)
  To: Sebastien Guiriec
  Cc: Tony Lindgren, Ben Dooks (embedded platforms),
	Wolfram Sang (embedded platforms), linux-omap, linux-i2c,
	linux-kernel, Koen Kooi, Matt Porter, Russ Dill


On Oct 30, 2012, at 10:14 PM, Sebastien Guiriec wrote:

> Hi Pantelis,
> 
> Can you look at the early thread?
>  https://patchwork.kernel.org/patch/1601331/
> 
> I send a similar patch earlier with defer probe usage.
> 
> Best regards,
> 
> Sebastien

I see. Well let me drop the patch then. 

One less thing to worry about...

Regards

-- Pantelis

> On 10/31/2012 04:55 PM, Pantelis Antoniou wrote:
>> Enable pinctrl for i2c-omap.
>> 
>> Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
>> ---
>>  drivers/i2c/busses/i2c-omap.c | 10 ++++++++++
>>  1 file changed, 10 insertions(+)
>> 
>> diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
>> index db31eae..4c38aa0 100644
>> --- a/drivers/i2c/busses/i2c-omap.c
>> +++ b/drivers/i2c/busses/i2c-omap.c
>> @@ -44,6 +44,8 @@
>>  #include <linux/i2c-omap.h>
>>  #include <linux/pm_runtime.h>
>>  #include <linux/pm_qos.h>
>> +#include <linux/pinctrl/consumer.h>
>> +#include <linux/err.h>
>> 
>>  /* I2C controller revisions */
>>  #define OMAP_I2C_OMAP1_REV_2		0x20
>> @@ -1064,6 +1066,7 @@ omap_i2c_probe(struct platform_device *pdev)
>>  	const struct of_device_id *match;
>>  	int irq;
>>  	int r;
>> +	struct pinctrl *pinctrl;
>> 
>>  	/* NOTE: driver uses the static register mapping */
>>  	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>> @@ -1202,6 +1205,13 @@ omap_i2c_probe(struct platform_device *pdev)
>> 
>>  	of_i2c_register_devices(adap);
>> 
>> +	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
>> +	if (IS_ERR(pinctrl))
>> +		dev_warn(dev->dev, "unable to select pin group\n");
>> +
>> +	dev_info(dev->dev, "bus %d rev%d.%d.%d at %d kHz\n", adap->nr,
>> +		 dev->dtrev, dev->rev >> 4, dev->rev & 0xf, dev->speed);
>> +
>>  	pm_runtime_mark_last_busy(dev->dev);
>>  	pm_runtime_put_autosuspend(dev->dev);
>> 
>> 
> 


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

* [PATCH] i2c: pinctrl-ify i2c-omap.c
@ 2012-10-31 15:55 Pantelis Antoniou
  2012-10-30 18:17 ` Tony Lindgren
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Pantelis Antoniou @ 2012-10-31 15:55 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Pantelis Antoniou, Ben Dooks (embedded platforms),
	Wolfram Sang (embedded platforms),
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Koen Kooi, Matt Porter,
	Russ Dill

Enable pinctrl for i2c-omap.

Signed-off-by: Pantelis Antoniou <panto-wVdstyuyKrO8r51toPun2/C9HSW9iNxf@public.gmane.org>
---
 drivers/i2c/busses/i2c-omap.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index db31eae..4c38aa0 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -44,6 +44,8 @@
 #include <linux/i2c-omap.h>
 #include <linux/pm_runtime.h>
 #include <linux/pm_qos.h>
+#include <linux/pinctrl/consumer.h>
+#include <linux/err.h>
 
 /* I2C controller revisions */
 #define OMAP_I2C_OMAP1_REV_2		0x20
@@ -1064,6 +1066,7 @@ omap_i2c_probe(struct platform_device *pdev)
 	const struct of_device_id *match;
 	int irq;
 	int r;
+	struct pinctrl *pinctrl;
 
 	/* NOTE: driver uses the static register mapping */
 	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -1202,6 +1205,13 @@ omap_i2c_probe(struct platform_device *pdev)
 
 	of_i2c_register_devices(adap);
 
+	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
+	if (IS_ERR(pinctrl))
+		dev_warn(dev->dev, "unable to select pin group\n");
+
+	dev_info(dev->dev, "bus %d rev%d.%d.%d at %d kHz\n", adap->nr,
+		 dev->dtrev, dev->rev >> 4, dev->rev & 0xf, dev->speed);
+
 	pm_runtime_mark_last_busy(dev->dev);
 	pm_runtime_put_autosuspend(dev->dev);
 
-- 
1.7.12

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

end of thread, other threads:[~2012-10-31 15:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-31 15:55 [PATCH] i2c: pinctrl-ify i2c-omap.c Pantelis Antoniou
2012-10-30 18:17 ` Tony Lindgren
2012-10-30 18:53 ` Felipe Balbi
2012-10-30 18:59   ` Pantelis Antoniou
     [not found]   ` <20121030185303.GD4804-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
2012-10-30 19:13     ` Porter, Matt
     [not found] ` <1351698930-3797-1-git-send-email-panto-wVdstyuyKrO8r51toPun2/C9HSW9iNxf@public.gmane.org>
2012-10-30 20:14   ` Sebastien Guiriec
2012-10-30 20:18     ` Pantelis Antoniou

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