Re: [PATCH 2/4 v6] pinmux: add a driver for the U300 pinmux

From: Barry Song
Date: Tue Sep 13 2011 - 21:48:39 EST


2011/9/13 Linus Walleij <linus.walleij@xxxxxxxxxx>:
> On Fri, Sep 2, 2011 at 6:04 PM, Stephen Warren <swarren@xxxxxxxxxx> wrote:
>> Linus Walleij wrote at Friday, September 02, 2011 2:12 AM:
>>> On Thu, Sep 1, 2011 at 11:33 PM, Stephen Warren <swarren@xxxxxxxxxx> wrote:
>>>
>>> >> +static const struct u300_pmx_func u300_pmx_functions[] = {
>>> >> + Â Â {
>>> >> + Â Â Â Â Â Â .name = "power",
>>> >> + Â Â Â Â Â Â .groups = { POWERGRP_INDEX },
>>> >> + Â Â Â Â Â Â /* Mask is N/A */
>>> >> + Â Â },
>>> >
>>> > Hmmm. That's a lot of _INDEX defines that'd need to be set up, at least
>>> > to fully represent a chip like Tegra. Can the pinmux core be modified
>>> > such that the group list is an array of names (char*) rather than the
>>> > actual numeric IDs of the groups? Still, perhaps we could use the enum
>>> > we already have for this, so perhaps it isn't a big deal...
>>>
>>> Well I could think about a lot of ways to do this, but it's basically up
>>> to the driver, the U300 is just some simple example of what you can
>>> do, it's just trying to satisfy the API.
>>>
>>> Maybe as part of writing the nVidia driver you find a clever
>>> mechanism for doing this, if it's looking generally useful at that
>>> point then let's move it to the core I'd say.
>>
>> The reason I asked about the pinmux core handling this is because the
>> driver op get_function_groups:
>>
>> + Â Â Â int (*get_function_groups) (struct pinctrl_dev *pctldev,
>> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â unsigned selector,
>> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â unsigned ** const groups,
>> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â unsigned * const num_groups);
>>
>> returns an array of integer indexes. I think the only way to get rid of
>> the index definitions in the drivers is to allow get_function_groups to
>> return an array of strings instead.
>
> OK good idea, I reworked this interface to get an array of strings
> instead, I've been told several times to use strings rather than numbers
> when possible, so I think this is the right thing to do.
>
> Check it out in v7!

well. we'll rebase prima2 pinmux on v7.

>
> Yours,
> Linus Walleij
>
-barry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/