[PATCH 1/6] pinctrl: samsung: Decouple direction setting from pinctrl
Linus Walleij
linus.walleij at linaro.org
Tue Jul 8 01:54:19 PDT 2014
On Wed, Jul 2, 2014 at 5:40 PM, Tomasz Figa <t.figa at samsung.com> wrote:
> This patch makes the pinctrl-samsung driver configure GPIO direction on
> its own, without using the pinctrl_gpio_direction_*() "helpers". The
> rationale behind this change is as follows:
> - pinctrl-samsung does not need translation from GPIO namespace to
> pinctrl namespace to handle GPIO operations - GPIO chip and offset
> therein are enough to calculate necessary offsets and bit masks in
> constant time,
> - the pinctrl_gpio_direction_*() functions do not do anything useful
> other than translating the pin into pinctrl namespace and calling the
> .gpio_set_direction() from pinmux_ops of the controller,
> - the undesirable side effect of using those helpers is losing the
> ability to change GPIO direction in atomic context, because they
> explicitly use a mutex for synchronization,
>
> Results of this patch are:
> - fixed warnings about scheduling while atomic in code that needs to
> set GPIO direction in atomic context (e.g. interrupt handler),
> - reduced overhead of bitbanging drivers that use gpio_direction_*(),
> e.g. i2c-gpio.
>
> Signed-off-by: Tomasz Figa <t.figa at samsung.com>
Well the cross-call function is actually mostly for the case when
the pinctrl and GPIO drivers are in different files, or you combine
two IP blocks arbitrarily. It's a bit messy anyway.
Patch applied.
Yours,
Linus Walleij
More information about the linux-arm-kernel
mailing list