From: Tony Lindgren <tony@atomide.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Jon Hunter <jonathanh@nvidia.com>,
Mark Rutland <mark.rutland@arm.com>,
Rob Herring <robh+dt@kernel.org>,
Grygorii Strashko <grygorii.strashko@ti.com>,
Nishanth Menon <nm@ti.com>,
linux-gpio@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org
Subject: Re: [PATCH 2/4] pinctrl: single: Use generic parser and #pinctrl-cells for pinctrl-single,pins
Date: Wed, 26 Oct 2016 07:16:28 -0700 [thread overview]
Message-ID: <20161026141628.x42rbn5o2ekdoluk@atomide.com> (raw)
In-Reply-To: <20161025164538.453-3-tony@atomide.com>
* Tony Lindgren <tony@atomide.com> [161025 09:51]:
> We can now use generic parser. To support the legacy binding without
> #pinctrl-cells, add pcs_quirk_missing_pinctrl_cells() and warn about
> missing #pinctrl-cells.
...
> +/**
> + * pcs_quirk_missing_pinctrl_cells - handle legacy binding
> + * @pcs: pinctrl driver instance
> + * @np: device tree node
> + * @cells: number of cells
> + *
> + * Handle legacy binding with no #pinctrl-cells. This should be
> + * always two pinctrl-single,bit-per-mux and one for others.
> + * At some point we may want to consider removing this.
> + */
> +static int pcs_quirk_missing_pinctrl_cells(struct pcs_device *pcs,
> + struct device_node *np,
> + int cells)
> +{
> + struct property *p;
> + const char *name = "#pinctrl-cells";
> + int error;
> + u32 val;
> +
> + error = of_property_read_u32(np, name, &val);
> + if (!error)
> + return 0;
> +
> + dev_warn(pcs->dev, "please update dts to use %s = <%i>\n",
> + name, cells);
> +
> + p = devm_kzalloc(pcs->dev, sizeof(*p), GFP_KERNEL);
> + if (!p)
> + return -ENOMEM;
> +
> + p->length = sizeof(__be32);
> + p->value = devm_kzalloc(pcs->dev, sizeof(__be32), GFP_KERNEL);
> + if (!p->value)
> + return -ENOMEM;
> + *(__be32 *)p->value = cpu_to_be32(cells);
> +
> + p->name = devm_kstrdup(pcs->dev, name, GFP_KERNEL);
> + if (!p->name)
> + return -ENOMEM;
> +
> + pcs->missing_nr_pinctrl_cells = p;
> +
> + return of_add_property(np, pcs->missing_nr_pinctrl_cells);
> +}
Looking at some make randconfig results, looks like we don't have
of_add_property() and of_remove_property() exported. Is there some
reason not to export them?
Regards,
Tony
next prev parent reply other threads:[~2016-10-26 14:16 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-25 16:45 [PATCH 0/4] Generic #pinctrl-cells and and pinctrl_parse_index_with_args Tony Lindgren
2016-10-25 16:45 ` [PATCH 1/4] pinctrl: Introduce generic #pinctrl-cells " Tony Lindgren
2016-10-27 7:56 ` Linus Walleij
[not found] ` <CACRpkdYWB4aa2XvW-yT39cKqy3XChSwCiFRy1mVWhbhse63=3A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-10-27 14:11 ` Tony Lindgren
2016-10-28 16:53 ` Tony Lindgren
[not found] ` <20161028165338.y5fyavbw5xfxweg3-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2016-10-31 6:13 ` Rob Herring
2016-11-04 21:36 ` Linus Walleij
2016-10-25 16:45 ` [PATCH 2/4] pinctrl: single: Use generic parser and #pinctrl-cells for pinctrl-single,pins Tony Lindgren
2016-10-26 14:16 ` Tony Lindgren [this message]
2016-10-28 16:55 ` Tony Lindgren
2016-11-04 21:41 ` Linus Walleij
2016-10-25 16:45 ` [PATCH 3/4] pinctrl: single: Use generic parser and #pinctrl-cells for pinctrl-single,bits Tony Lindgren
2016-10-25 16:45 ` [PATCH 4/4] ARM: dts: Add #pinctrl-cells for pinctrl-single instances Tony Lindgren
2016-10-31 3:06 ` Rob Herring
2016-10-27 8:15 ` [PATCH 0/4] Generic #pinctrl-cells and and pinctrl_parse_index_with_args Linus Walleij
-- strict thread matches above, loose matches on Subject: below --
2016-11-03 16:35 [PATCHv2 " Tony Lindgren
2016-11-03 16:35 ` [PATCH 2/4] pinctrl: single: Use generic parser and #pinctrl-cells for pinctrl-single,pins Tony Lindgren
2016-11-04 21:52 ` 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=20161026141628.x42rbn5o2ekdoluk@atomide.com \
--to=tony@atomide.com \
--cc=devicetree@vger.kernel.org \
--cc=grygorii.strashko@ti.com \
--cc=jonathanh@nvidia.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=nm@ti.com \
--cc=robh+dt@kernel.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 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).