[GIT PULL] SPEAr pinctrl updates for v-3.5

Linus Walleij linus.walleij at linaro.org
Tue Sep 4 03:17:03 EDT 2012


On Tue, Sep 4, 2012 at 6:19 AM, Shiraz Hashim <shiraz.hashim at st.com> wrote:
> [Me]
>> So the basic problem with the patch is that you cannot hard-code it
>> to use *only* device tree, it must also accept ranges registered
>> directly, not using of_*.
>
> For describing gpio pin ranges, we need to know corresponding pinctrl
> implementation handling this range, base pin and number of pins
> belonging to the range. Further there can be multiple such ranges for
> a gpio driver.
>
> With devicetree it was easy to provide this information and parse it
> inside gpiolib itself. Without DT how do you suggest gpio drivers must
> pass range information to gpiolib ?

That's the real trick right. You need a key to search pinctrldev_list
in pinctrl/core.c, so use the name of the pinctrl device and
you get a function like this:

void gpiochip_add_pin_range(char *name, struct gpio_chip *chip);

Loop over pinctrldev_list until dev_name(pctldev->dev) == name
then add the range.

The remove function can look like this however:

void gpiochip_remove_pin_range(struct gpio_chip *chip);

In this case you just look for all pin controllers with the matching
gpiochip pointer.

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list