From: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>
To: Sebastien Guiriec <s-guiriec-l0cyMroinI0@public.gmane.org>
Cc: Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>,
Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>,
Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>,
Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>,
Shubhrajyoti Datta <shubhrajyoti-l0cyMroinI0@public.gmane.org>
Subject: Re: [PATCH] i2c: omap: adopt pinctrl support
Date: Mon, 22 Oct 2012 10:42:01 +0300 [thread overview]
Message-ID: <20121022074201.GW14033@arwen.pp.htv.fi> (raw)
In-Reply-To: <1350401000-9453-1-git-send-email-s-guiriec-l0cyMroinI0@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 2335 bytes --]
Hi,
On Tue, Oct 16, 2012 at 05:23:20PM +0200, Sebastien Guiriec wrote:
> Some GPIO expanders need some early pin control muxing. Due to
> legacy boards sometimes the driver uses subsys_initcall instead of
> module_init. This patch takes advantage of defer probe feature
> and pin control in order to wait until pin control probing before
> GPIO driver probing. It has been tested on OMAP5 board with TCA6424
> driver.
>
> log:
>
> [0.482299] omap_i2c i2c.15: could not find pctldev for node /ocp/pinmux@4a00
> 2840/pinmux_i2c5_pins, deferring probe
> [0.482330] platform i2c.15: Driver omap_i2c requests probe deferral
> [0.484466] Advanced Linux Sound Architecture Driver Initialized.
>
> [4.746917] omap_i2c i2c.15: bus 4 rev2.4.0 at 100 kHz
> [4.755279] gpiochip_find_base: found new base at 477
> [4.761169] gpiochip_add: registered GPIOs 477 to 500 on device: tca6424a
>
> Signed-off-by: Sebastien Guiriec <s-guiriec-l0cyMroinI0@public.gmane.org>
looks good to me also, should go in v3.8 merge window:
Reviewed-by: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>
> ---
> drivers/i2c/busses/i2c-omap.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
> index db31eae..661d8a2 100644
> --- a/drivers/i2c/busses/i2c-omap.c
> +++ b/drivers/i2c/busses/i2c-omap.c
> @@ -44,6 +44,7 @@
> #include <linux/i2c-omap.h>
> #include <linux/pm_runtime.h>
> #include <linux/pm_qos.h>
> +#include <linux/pinctrl/consumer.h>
>
> /* I2C controller revisions */
> #define OMAP_I2C_OMAP1_REV_2 0x20
> @@ -213,6 +214,8 @@ struct omap_i2c_dev {
> u16 syscstate;
> u16 westate;
> u16 errata;
> +
> + struct pinctrl *pins;
> };
>
> static const u8 reg_map_ip_v1[] = {
> @@ -1107,6 +1110,16 @@ omap_i2c_probe(struct platform_device *pdev)
> dev->dtrev = pdata->rev;
> }
>
> + dev->pins = devm_pinctrl_get_select_default(&pdev->dev);
> + if (IS_ERR(dev->pins)) {
> + if (PTR_ERR(dev->pins) == -EPROBE_DEFER)
> + return -EPROBE_DEFER;
> +
> + dev_warn(&pdev->dev, "did not get pins for i2c error: %li\n",
> + PTR_ERR(dev->pins));
> + dev->pins = NULL;
> + }
> +
> dev->dev = &pdev->dev;
> dev->irq = irq;
>
> --
> 1.7.10.4
>
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: Felipe Balbi <balbi@ti.com>
To: Sebastien Guiriec <s-guiriec@ti.com>
Cc: Tony Lindgren <tony@atomide.com>,
Jean Delvare <khali@linux-fr.org>,
Ben Dooks <ben-linux@fluff.org>,
Wolfram Sang <w.sang@pengutronix.de>,
<linux-omap@vger.kernel.org>, <linux-i2c@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, Felipe Balbi <balbi@ti.com>,
Shubhrajyoti Datta <shubhrajyoti@ti.com>
Subject: Re: [PATCH] i2c: omap: adopt pinctrl support
Date: Mon, 22 Oct 2012 10:42:01 +0300 [thread overview]
Message-ID: <20121022074201.GW14033@arwen.pp.htv.fi> (raw)
In-Reply-To: <1350401000-9453-1-git-send-email-s-guiriec@ti.com>
[-- Attachment #1: Type: text/plain, Size: 2291 bytes --]
Hi,
On Tue, Oct 16, 2012 at 05:23:20PM +0200, Sebastien Guiriec wrote:
> Some GPIO expanders need some early pin control muxing. Due to
> legacy boards sometimes the driver uses subsys_initcall instead of
> module_init. This patch takes advantage of defer probe feature
> and pin control in order to wait until pin control probing before
> GPIO driver probing. It has been tested on OMAP5 board with TCA6424
> driver.
>
> log:
>
> [0.482299] omap_i2c i2c.15: could not find pctldev for node /ocp/pinmux@4a00
> 2840/pinmux_i2c5_pins, deferring probe
> [0.482330] platform i2c.15: Driver omap_i2c requests probe deferral
> [0.484466] Advanced Linux Sound Architecture Driver Initialized.
>
> [4.746917] omap_i2c i2c.15: bus 4 rev2.4.0 at 100 kHz
> [4.755279] gpiochip_find_base: found new base at 477
> [4.761169] gpiochip_add: registered GPIOs 477 to 500 on device: tca6424a
>
> Signed-off-by: Sebastien Guiriec <s-guiriec@ti.com>
looks good to me also, should go in v3.8 merge window:
Reviewed-by: Felipe Balbi <balbi@ti.com>
> ---
> drivers/i2c/busses/i2c-omap.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
> index db31eae..661d8a2 100644
> --- a/drivers/i2c/busses/i2c-omap.c
> +++ b/drivers/i2c/busses/i2c-omap.c
> @@ -44,6 +44,7 @@
> #include <linux/i2c-omap.h>
> #include <linux/pm_runtime.h>
> #include <linux/pm_qos.h>
> +#include <linux/pinctrl/consumer.h>
>
> /* I2C controller revisions */
> #define OMAP_I2C_OMAP1_REV_2 0x20
> @@ -213,6 +214,8 @@ struct omap_i2c_dev {
> u16 syscstate;
> u16 westate;
> u16 errata;
> +
> + struct pinctrl *pins;
> };
>
> static const u8 reg_map_ip_v1[] = {
> @@ -1107,6 +1110,16 @@ omap_i2c_probe(struct platform_device *pdev)
> dev->dtrev = pdata->rev;
> }
>
> + dev->pins = devm_pinctrl_get_select_default(&pdev->dev);
> + if (IS_ERR(dev->pins)) {
> + if (PTR_ERR(dev->pins) == -EPROBE_DEFER)
> + return -EPROBE_DEFER;
> +
> + dev_warn(&pdev->dev, "did not get pins for i2c error: %li\n",
> + PTR_ERR(dev->pins));
> + dev->pins = NULL;
> + }
> +
> dev->dev = &pdev->dev;
> dev->irq = irq;
>
> --
> 1.7.10.4
>
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2012-10-22 7:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-16 15:23 [PATCH] i2c: omap: adopt pinctrl support Sebastien Guiriec
2012-10-16 15:23 ` Sebastien Guiriec
2012-10-17 16:35 ` Shubhrajyoti Datta
[not found] ` <1350401000-9453-1-git-send-email-s-guiriec-l0cyMroinI0@public.gmane.org>
2012-10-22 7:42 ` Felipe Balbi [this message]
2012-10-22 7:42 ` Felipe Balbi
2012-11-14 11:14 ` Wolfram Sang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121022074201.GW14033@arwen.pp.htv.fi \
--to=balbi-l0cymroini0@public.gmane.org \
--cc=ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org \
--cc=khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=s-guiriec-l0cyMroinI0@public.gmane.org \
--cc=shubhrajyoti-l0cyMroinI0@public.gmane.org \
--cc=tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org \
--cc=w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.