From: Haojian Zhuang <haojian.zhuang@gmail.com>
To: Tony Lindgren <tony@atomide.com>
Cc: Walleij Linus <linus.walleij@linaro.org>,
devicetree-discuss@lists.ozlabs.org,
Peter Ujfalusi <peter.ujfalusi@ti.com>,
linux-omap@vger.kernel.org,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
Roger Quadros <rogerq@ti.com>
Subject: Re: [PATCH 1/4] pinctrl: single: Prepare for supporting SoC specific features
Date: Sat, 8 Jun 2013 17:37:36 +0800 [thread overview]
Message-ID: <CAN1soZzLYpiakcgPR7mBOC7_mLFW=mZwOG98Dq6JpO+JHUW=cw@mail.gmail.com> (raw)
In-Reply-To: <20130607205037.16513.84242.stgit@localhost>
On Sat, Jun 8, 2013 at 4:50 AM, Tony Lindgren <tony@atomide.com> wrote:
> Let's replace is_pinconf with flags and add struct pcs_soc so we
> can support also other features like pin wake-up events. Let's
> export the probe so the SoC specific modules can pass their
> SoC specific data to pinctrl-single if needed.
>
> Done in collaboration with Roger Quadros <rogerq@ti.com>.
>
Manjunathappa's pinctrl-single patch on enhancing bits is already merged.
This patch conflicts with his patch.
Could you rebase your patches?
> Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
> Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
> Cc: devicetree-discuss@lists.ozlabs.org
> Signed-off-by: Roger Quadros <rogerq@ti.com>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
> drivers/pinctrl/pinctrl-single.c | 53 +++++++++++++++++++++++++++-----------
> drivers/pinctrl/pinctrl-single.h | 15 +++++++++++
> 2 files changed, 52 insertions(+), 16 deletions(-)
> create mode 100644 drivers/pinctrl/pinctrl-single.h
>
> diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
> index b9fa046..0f178d1 100644
> --- a/drivers/pinctrl/pinctrl-single.c
> +++ b/drivers/pinctrl/pinctrl-single.c
> @@ -1368,7 +1367,8 @@ static int pcs_probe(struct platform_device *pdev)
> INIT_LIST_HEAD(&pcs->pingroups);
> INIT_LIST_HEAD(&pcs->functions);
> INIT_LIST_HEAD(&pcs->gpiofuncs);
> - pcs->is_pinconf = match->data;
> + pcs->flags = soc->flags;
> + pcs->soc = soc;
>
> PCS_GET_PROP_U32("pinctrl-single,register-width", &pcs->width,
> "register width not specified\n");
> @@ -1437,7 +1437,7 @@ static int pcs_probe(struct platform_device *pdev)
> pcs->desc.name = DRIVER_NAME;
> pcs->desc.pctlops = &pcs_pinctrl_ops;
> pcs->desc.pmxops = &pcs_pinmux_ops;
> - if (pcs->is_pinconf)
> + if (pcs->flags & PCS_HAS_PINCONF)
> pcs->desc.confops = &pcs_pinconf_ops;
> pcs->desc.owner = THIS_MODULE;
>
> @@ -1466,8 +1466,20 @@ free:
>
> return ret;
> }
> +EXPORT_SYMBOL_GPL(pinctrl_single_probe);
> +
> +static int pcs_probe(struct platform_device *pdev)
> +{
> + const struct of_device_id *match;
> +
> + match = of_match_device(pcs_of_match, &pdev->dev);
> + if (!match)
> + return -EINVAL;
> +
> + return pinctrl_single_probe(pdev, (struct pcs_soc *)match->data);
> +}
I think that you should declare pcs_probe() as EXPORT_SYMBOL_GPL.
Is it right?
>
> -static int pcs_remove(struct platform_device *pdev)
> +int pinctrl_single_remove(struct platform_device *pdev)
> {
> struct pcs_device *pcs = platform_get_drvdata(pdev);
>
> @@ -1478,17 +1490,26 @@ static int pcs_remove(struct platform_device *pdev)
>
> return 0;
> }
> +EXPORT_SYMBOL_GPL(pinctrl_single_remove);
Since you redefined pcs_probe(), you needn't change pcs_remove to
pinctrl_single_remove().
> +
> +static struct pcs_soc pinctrl_single = {
> + .flags = 0,
> +};
> +
> +static struct pcs_soc pinconf_single = {
> + .flags = PCS_HAS_PINCONF,
> +};
>
> static struct of_device_id pcs_of_match[] = {
> - { .compatible = "pinctrl-single", .data = (void *)false },
> - { .compatible = "pinconf-single", .data = (void *)true },
> + { .compatible = "pinctrl-single", .data = &pinctrl_single },
> + { .compatible = "pinconf-single", .data = &pinconf_single },
> { },
> };
> MODULE_DEVICE_TABLE(of, pcs_of_match);
>
> static struct platform_driver pcs_driver = {
> .probe = pcs_probe,
> - .remove = pcs_remove,
> + .remove = pinctrl_single_remove,
> .driver = {
> .owner = THIS_MODULE,
> .name = DRIVER_NAME,
> diff --git a/drivers/pinctrl/pinctrl-single.h b/drivers/pinctrl/pinctrl-single.h
> new file mode 100644
> index 0000000..18f3205
> --- /dev/null
> +++ b/drivers/pinctrl/pinctrl-single.h
> @@ -0,0 +1,15 @@
Do you need append "#ifndef __XX_H" to protect head file
over loading?
> +#define PCS_HAS_PINCONF (1 << 0)
> +
> +/**
> + * struct pcs_soc - SoC specific interface to pinctrl-single
> + * @data: SoC specific data pointer
> + * @flags: mask of PCS_HAS_xxx values
> + */
> +struct pcs_soc {
> + void *data;
> + unsigned flags;
> +};
> +
> +extern int pinctrl_single_probe(struct platform_device *pdev,
> + const struct pcs_soc *soc);
> +extern int pinctrl_single_remove(struct platform_device *pdev);
>
next prev parent reply other threads:[~2013-06-08 9:37 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20130607203936.16513.57494.stgit@localhost>
2013-06-07 20:50 ` [PATCH 1/4] pinctrl: single: Prepare for supporting SoC specific features Tony Lindgren
2013-06-08 9:37 ` Haojian Zhuang [this message]
2013-06-08 15:27 ` Tony Lindgren
2013-06-09 5:21 ` Haojian Zhuang
2013-07-22 21:15 ` Linus Walleij
2013-07-29 8:57 ` Tony Lindgren
2013-06-07 20:50 ` [PATCH 2/4] pinctrl: single: Add hardware specific hooks for IRQ and GPIO wake-up events Tony Lindgren
2013-06-09 4:46 ` Haojian Zhuang
2013-06-10 15:36 ` Tony Lindgren
2013-07-22 21:44 ` Linus Walleij
2013-07-29 8:50 ` Tony Lindgren
2013-06-07 20:50 ` [PATCH 3/4] pinctrl: single: omap: Add SoC specific module for " Tony Lindgren
2013-06-08 15:29 ` Tony Lindgren
2013-06-09 5:28 ` Haojian Zhuang
2013-06-10 10:03 ` Quadros, Roger
2013-06-10 15:21 ` Tony Lindgren
2013-06-11 12:51 ` Roger Quadros
2013-06-12 13:33 ` Tony Lindgren
2013-07-22 22:03 ` Linus Walleij
2013-07-22 22:06 ` Linus Walleij
2013-06-07 20:50 ` [PATCH 4/4] ARM: OMAP: Move DT wake-up event handling over to use pinctrl-single-omap Tony Lindgren
2013-06-07 20:52 ` Tony Lindgren
2013-06-10 15:36 ` Tony Lindgren
2013-06-10 12:31 ` Quadros, Roger
2013-06-10 14:25 ` Tony Lindgren
2013-06-11 9:08 ` Roger Quadros
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='CAN1soZzLYpiakcgPR7mBOC7_mLFW=mZwOG98Dq6JpO+JHUW=cw@mail.gmail.com' \
--to=haojian.zhuang@gmail.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=peter.ujfalusi@ti.com \
--cc=rogerq@ti.com \
--cc=tony@atomide.com \
/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 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).