Re: Pulls and drive strengths in the pinctrl world

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05/15/2013 06:13 PM, Tomasz Figa wrote:
> On Wednesday 15 of May 2013 16:55:37 Doug Anderson wrote:
>> Tomasz / Linus,
>>
>> On Wed, May 15, 2013 at 3:06 PM, Tomasz Figa <tomasz.figa@xxxxxxxxx> 
> wrote:
>>> Yes. I don't like the current way too much either, duplication being
>>> one of the reasons.
>>
>> Do you have any other ideas?  It sounds like Linus didn't like my
>> suggestion and makes some good points...
> 
> I don't have anything interesting at the moment. It's a bit late now here 
> (2 AM), so I'm going to get some sleep first.
> 
> Also after reading Stephen's reply, I'm wondering if hogging wouldn't 
> solve the problem indeed. (It might have to be fixed on pinctrl-samsung 
> first, as last time I tried to use it, it caused some errors from pinctrl 
> core, but haven't time to track them down, as it wasn't anything important 
> at that time).

One issue I noticed with the DT fragments earlier in this thread. It
looks like hogs in the Samsung pinctrl bingings end up looking like:

pinctrl {
    pina {
        samsung,pins = <PIN_A PIN_B PIN_C>;
        samsung,pin-function = <0xf>;
        samsung,pin-pud = <0>;
        ...
    };
    pinp {
        samsung,pins = <PIN_P PIN_Q>;
        samsung,pin-function = <0xe>;
        samsung,pin-pud = <1>;
        ...
    };
    pinx {
        samsung,pins = <PIN_X PIN_Y PIN_Z>;
        samsung,pin-function = <0xd>;
        samsung,pin-pud = <2>;
        ...
    };

    pinctrl-names = "default";
    pinctrl-0 = <&pina &pinp &pinx>;
};

That pinctrl-0 property could get rather large (hard to write/maintain,
unwieldy) if it needs to set up lots of different configurations. That's
why I made the equivalent Tegra bindings be:

pinctrl {
    pins_default {
        pina {
            samsung,pins = <PIN_A PIN_B PIN_C>;
            samsung,pin-function = <0xf>;
            samsung,pin-pud = <0>;
            ...
        };
        pinp {
            samsung,pins = <PIN_P PIN_Q>;
            samsung,pin-function = <0xe>;
            samsung,pin-pud = <1>;
            ...
        };
        pinx {
            samsung,pins = <PIN_X PIN_Y PIN_Z>;
            samsung,pin-function = <0xd>;
            samsung,pin-pud = <2>;
            ...
        };
    };

    pinctrl-names = "default";
    pinctrl-0 = <&pins_default>;
};

The extra level within the "pinctrl configuration node" ("pins_default"
here) makes the pinctrl-0 property a lot easier to write, and the
advantage happens at every use-site that needs to configure different
subsets of the relevant pins in different ways.

If you're changing all the bindings anyway, introducing this extra level
might be something to think about.

I did try to explain my philosophy here when we all got together to
design the pinctrl bindings, but I obviously didn't explain it well
enough, or people didn't like it anyway.
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SoC Development]     [Linux Rockchip Development]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Linux SCSI]     [Yosemite News]

  Powered by Linux