]> git.karo-electronics.de Git - karo-tx-linux.git/commit
pinctrl: add a pin_base for sparse gpio-ranges
authorChanho Park <chanho61.park@samsung.com>
Fri, 11 Nov 2011 09:47:58 +0000 (18:47 +0900)
committerLinus Walleij <linus.walleij@linaro.org>
Fri, 9 Dec 2011 10:58:46 +0000 (11:58 +0100)
commit2f7366bfc59c291afc00f26b7a0e580df385022c
tree9e2b5d49e8414eaf71689c2ebb16115c5f333a7e
parent244e4b3fe990ce4b542ed5db0705446c728c0bc8
pinctrl: add a pin_base for sparse gpio-ranges

This patch enables mapping a base offset of gpio ranges with
a pin offset even if does'nt matched. A base of pinctrl_gpio_range
means a base offset of gpio. However, we cannot convert gpio to pin
number for sparse gpio ranges just only using a gpio base offset.
We can convert a gpio to real pin number(even if not matched) using
a new pin_base which means a base pin offset of requested gpio range.
Now, the pin control subsystem passes the pin base offset to the
pinmux driver.

For example, let's assume below two gpio ranges in the system.

static struct pinctrl_gpio_range gpio_range_a = {
    .name = "chip a",
    .id = 0,
    .base = 32,
    .pin_base = 32,
    .npins = 16,
    .gc = &chip_a;
};

static struct pinctrl_gpio_range gpio_range_b = {
    .name = "chip b",
    .id = 0,
    .base = 48,
    .pin_base = 64,
    .npins = 8,
    .gc = &chip_b;
};

We can calucalate a exact pin ranges even if doesn't matched with gpio ranges.

chip a:
    gpio-range : [32 .. 47]
    pin-range  : [32 .. 47]
chip b:
    gpio-range : [48 .. 55]
    pin-range  : [64 .. 71]

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Documentation/pinctrl.txt
drivers/pinctrl/pinmux-sirf.c
drivers/pinctrl/pinmux-u300.c
drivers/pinctrl/pinmux.c
include/linux/pinctrl/pinctrl.h
include/linux/pinctrl/pinmux.h