Thread (42 messages) 42 messages, 6 authors, 2014-11-27

[PATCH 3/7] pinctrl: pinconf-generic: Allow driver to specify DT params

From: Ivan T. Ivanov <hidden>
Date: 2014-11-19 07:49:21
Also in: linux-sh, lkml

On Tue, 2014-11-18 at 09:25 -0800, S?ren Brinkmann wrote:
On Tue, 2014-11-18 at 10:50AM +0200, Ivan T. Ivanov wrote:
quoted
On Tue, 2014-11-11 at 15:53 +0100, Linus Walleij wrote:
quoted
On Mon, Nov 3, 2014 at 8:05 PM, Soren Brinkmann
brinkmann at xilinx.com> wrote:
quoted
Additionally to the generic DT parameters, allow drivers to 
provide driver-specific DT parameters to be used with the 
generic parser infrastructure.

Signed-off-by: Soren Brinkmann brinkmann at xilinx.com>
I like the looks of this, but the patch description is a bit 
terse. I'd like it to describe some of the refactorings being 
done
to the intrinsics, because I have a hard time following the 
patch.

First please rebase onto the "devel" branch in the pin control 
tree, and notice that drivers/pinctrl/qcom/pinctrl-spmi-gpio.c 
which is merged there is actually doing this already:


        for_each_child_of_node(np_config, np) {
                ret = pinconf_generic_dt_subnode_to_map(pctldev, 
np, map,
                                                        &reserv, 
nmaps, type);
                if (ret)
                        break;

                ret = pmic_gpio_dt_subnode_to_map(pctldev, np, 
map, &reserv,
                                                  nmaps, type);
                if (ret)
                        break;
        }

So it should be patched to illustrate the point of this code.
I like the idea, but have issues with implementations :-).
 
It is supposed that additional parameters are not generic,
otherwise they will be part of enum pin_config_param, right?

Probably it will be better if clients could pass array with
driver specific dt bindings to pinconf_generic_dt_node_to_map()?
My idea was to hide that API from the driver. You just pass those 
parameters as part of the struct pctldev and the parser - whether 
this generic one or anything else - would do the right thing. I 
don't think calling the parser from the driver is the right approach.
Drivers already know about dt_node_to_map(). My proposal will make
drivers, which register non-standard bindings, little bit simpler.

With your approach probably we can remove dt_node_to_map() and
dt_free_map() callbacks?

Regards,
Ivan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help