From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 3/9] pinctrl: single: support pinconf generic
Date: Fri, 9 Nov 2012 13:53:27 -0800 [thread overview]
Message-ID: <20121109215327.GT6801@atomide.com> (raw)
In-Reply-To: <1352301582-12244-4-git-send-email-haojian.zhuang@gmail.com>
Hi Haojian,
One more comment on this one..
* Haojian Zhuang <haojian.zhuang@gmail.com> [121107 07:21]:
> --- a/drivers/pinctrl/pinctrl-single.c
> +++ b/drivers/pinctrl/pinctrl-single.c
> @@ -1009,6 +1186,46 @@ static int __devinit pcs_probe(struct platform_device *pdev)
> pcs->bits_per_mux = of_property_read_bool(np,
> "pinctrl-single,bit-per-mux");
>
> + if (conf->nconfs) {
> + pcs_pinconf_ops.is_generic = true;
> + ret = of_property_read_u32(np,
> + "pinctrl-single,power-source-mask",
> + &pcs->psmask);
> + if (ret) {
> + pcs->psmask = PCS_OFF_DISABLED;
> + pcs->psshift = PCS_OFF_DISABLED;
> + } else
> + pcs->psshift = ffs(pcs->psmask) - 1;
> + ret = of_property_read_u32(np,
> + "pinctrl-single,bias-mask", &pcs->bmask);
> + if (ret) {
> + pcs->bmask = PCS_OFF_DISABLED;
> + pcs->bshift = PCS_OFF_DISABLED;
> + } else
> + pcs->bshift = ffs(pcs->bmask) - 1;
> + ret = of_property_read_u32(np,
> + "pinctrl-single,bias-disable", &pcs->bdis);
> + if (ret)
> + pcs->bdis = PCS_OFF_DISABLED;
> + ret = of_property_read_u32(np,
> + "pinctrl-single,bias-pull-up", &pcs->bpullup);
> + if (ret)
> + pcs->bpullup = PCS_OFF_DISABLED;
> + ret = of_property_read_u32(np,
> + "pinctrl-single,bias-pull-down",
> + &pcs->bpulldown);
> + if (ret)
> + pcs->bpulldown = PCS_OFF_DISABLED;
> + ret = of_property_read_u32(np,
> + "pinctrl-single,input-schmitt-mask",
> + &pcs->ismask);
> + if (ret) {
> + pcs->ismask = PCS_OFF_DISABLED;
> + pcs->isshift = PCS_OFF_DISABLED;
> + } else
> + pcs->isshift = ffs(pcs->ismask) - 1;
> + }
> +
> res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> if (!res) {
> dev_err(pcs->dev, "could not get resource\n");
I tried to make pinconf work with the omap CONTROL_PBIASLITE
register, but noticed that we need to change the binding to make
pinctrl-single,bits type controllers work.
Basically we need to move the pinconf properties to be defined
under pinctrl-single,pins and pinctrl-single,bits rather than being
pinmux controller instance specific properties.
In the pinctrl-single,bits case we have multiple pinconf masks
for a single register, like in the omap CONTROL_PBIASLITE example
we discussed earlier.
Then let's just have a single pinctrl driver instance specific
property pinctrl-single,pinconf that we can use to optimize out
the pinconf parsing for ranges that don't support pinconf.
Other than that, I think I'm finally done with my comments for
this patch, sorry it took so long and took so many emails.
Regards,
Tony
next prev parent reply other threads:[~2012-11-09 21:53 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-07 15:19 [PATCH v4 0/9] use pinctrl-single in arch mmp Haojian Zhuang
2012-11-07 15:19 ` [PATCH v4 1/9] ARM: mmp: select pinctrl driver Haojian Zhuang
2012-11-08 1:38 ` Tony Lindgren
2012-11-10 14:53 ` Haojian Zhuang
2012-11-13 13:37 ` Linus Walleij
2012-11-07 15:19 ` [PATCH v4 2/9] pinctrl: single: support gpio request and free Haojian Zhuang
2012-11-07 22:27 ` Tony Lindgren
2012-11-13 13:07 ` Linus Walleij
2012-11-13 17:34 ` Tony Lindgren
2012-11-14 1:44 ` Haojian Zhuang
2012-11-07 15:19 ` [PATCH v4 3/9] pinctrl: single: support pinconf generic Haojian Zhuang
2012-11-08 0:25 ` Tony Lindgren
2012-11-08 22:55 ` Tony Lindgren
2012-11-08 23:13 ` Tony Lindgren
2012-11-09 21:53 ` Tony Lindgren [this message]
2012-11-07 15:19 ` [PATCH v4 4/9] ARM: dts: support pinctrl single in pxa910 Haojian Zhuang
2012-11-09 22:48 ` Tony Lindgren
2012-11-10 5:37 ` Haojian Zhuang
2012-11-10 20:04 ` Tony Lindgren
2012-11-07 15:19 ` [PATCH v4 5/9] document: devicetree: bind pinconf with pin-single Haojian Zhuang
2012-11-08 1:37 ` Tony Lindgren
2012-11-12 20:37 ` Stephen Warren
2012-11-15 8:27 ` Haojian Zhuang
2012-11-15 8:30 ` Haojian Zhuang
2012-11-07 15:19 ` [PATCH v4 6/9] tty: pxa: configure pin Haojian Zhuang
2012-11-07 15:19 ` [PATCH v4 7/9] i2c: pxa: use devm_kzalloc Haojian Zhuang
2012-11-07 15:19 ` [PATCH v4 8/9] i2c: pxa: configure pinmux Haojian Zhuang
2012-11-07 15:19 ` [PATCH v4 9/9] pinctrl: single: dump pinmux register value Haojian Zhuang
2012-11-08 1:25 ` Tony Lindgren
2012-11-13 13:08 ` Linus Walleij
2012-11-13 17:34 ` Tony Lindgren
2012-11-14 1:45 ` Haojian Zhuang
2012-11-15 14:11 ` Linus Walleij
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=20121109215327.GT6801@atomide.com \
--to=tony@atomide.com \
--cc=linux-arm-kernel@lists.infradead.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.