[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdZ7H=yApLia7-OeM4RMPdM0Upk3wohGHgMYfhe3DiaPgg@mail.gmail.com>
Date: Tue, 28 Oct 2014 16:40:40 +0100
From: Linus Walleij <linus.walleij@...aro.org>
To: Antoine Tenart <antoine.tenart@...e-electrons.com>
Cc: Sebastian Hesselbarth <sebastian.hesselbarth@...il.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 3/4] pinctrl: add a generic way to map node to map for
group based drivers
On Mon, Oct 20, 2014 at 10:04 AM, Antoine Tenart
<antoine.tenart@...e-electrons.com> wrote:
> This patch add a generic function to use a standard callback to
> .dt_node_to_map for group based pinctrl drivers.
>
> It parses nodes of the form:
>
> foo_pmux: foo-pmux {
> function = "foo";
> groups = "g0", "g1", "g2";
> }
>
> Signed-off-by: Antoine Tenart <antoine.tenart@...e-electrons.com>
Really nice! :)
> +int pinconf_generic_function_groups_dt_node_to_map(struct pinctrl_dev *pctldev,
> + struct device_node *node, struct pinctrl_map **map,
> + unsigned *num_maps)
> +{
> + struct property *prop;
> + unsigned reserved_maps = 0;
> + const char *function_name, *group_name;
> + int ngroups, ret;
> +
> + *map = NULL;
> + *num_maps = 0;
> +
> + ret = of_pinctrl_utils_read_function(pctldev, node, &function_name,
> + &ngroups);
> + if (ret)
> + return ret;
So maybe you want this not to print errors as I said in the first patch.
Or add a function of_pinctrl_utils_is_mux()?
> + ret = pinctrl_utils_reserve_map(pctldev, map, &reserved_maps, num_maps,
> + ngroups);
> + if (ret)
> + return ret;
> +
> + of_pinctrl_for_each_function_group(node, prop, group_name) {
> + ret = pinctrl_utils_add_map_mux(pctldev, map, &reserved_maps,
> + num_maps, group_name,
> + function_name);
> + if (ret) {
> + dev_err(pctldev->dev, "cannot add map: %d\n", ret);
> + return ret;
> + }
> + }
> +
> + return 0;
> +}
> +EXPORT_SYMBOL_GPL(pinconf_generic_function_groups_dt_node_to_map);
The rest looks really good.
Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists