[PATCH v2] gpio: rewrite U300 GPIO to use gpiolib

Linus Walleij linus.walleij at linaro.org
Wed Sep 7 15:23:45 EDT 2011


2011/9/7 Barry Song <21cnbao at gmail.com>:

>> -       /* Enable or disable the internal pull-ups in the GPIO ASIC block */
>> -       for (i = 0; i < U300_GPIO_MAX; i++) {
>> -               val = 0;
>> -               for (j = 0; j < 8; j++)
>> -                       val |= (u32)((u300_gpio_config[i][j].pull_up == DISABLE_PULL_UP) << j);
>> -               local_irq_save(flags);
>> -               writel(val, virtbase + U300_GPIO_PXPER + i * U300_GPIO_PORTX_SPACING);
>> -               local_irq_restore(flags);
>
> this has used array/table to set the pull of gpio. so what's our plan
> about api to config GPIO pull dynamically?

My plan is as follows:

1) Introduce the pin control subsystem, support pinmux in it to
  begin with

2) Add support for biasing and driving (etc) through pin control

3) Move the driver over to drivers/pinctrl, have it register both
  a pin control and a GPIO interface as well

Sounds OK?

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list