Skip to content

Commit

Permalink
pinctrl: samsung: Handle banks with two configuration registers
Browse files Browse the repository at this point in the history
This patch adds support for banks that have more than one function
configuration registers, e.g. some of the banks of S3C64xx SoCs.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
Tomasz Figa authored and Linus Walleij committed Apr 9, 2013
1 parent 43fc9e7 commit c16150d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/pinctrl/pinctrl-samsung.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,11 @@ static void samsung_pinmux_setup(struct pinctrl_dev *pctldev, unsigned selector,
type = bank->type;
mask = (1 << type->fld_width[PINCFG_TYPE_FUNC]) - 1;
shift = pin_offset * type->fld_width[PINCFG_TYPE_FUNC];
if (shift >= 32) {
/* Some banks have two config registers */
shift -= 32;
reg += 4;
}

spin_lock_irqsave(&bank->slock, flags);

Expand Down Expand Up @@ -356,6 +361,11 @@ static int samsung_pinmux_gpio_set_direction(struct pinctrl_dev *pctldev,

mask = (1 << type->fld_width[PINCFG_TYPE_FUNC]) - 1;
shift = pin_offset * type->fld_width[PINCFG_TYPE_FUNC];
if (shift >= 32) {
/* Some banks have two config registers */
shift -= 32;
reg += 4;
}

spin_lock_irqsave(&bank->slock, flags);

Expand Down

0 comments on commit c16150d

Please sign in to comment.