linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: tomasz.figa@gmail.com (Tomasz Figa)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/6] pinctrl: samsung: Handle banks with two configuration registers
Date: Mon, 18 Mar 2013 22:31:54 +0100	[thread overview]
Message-ID: <1363642315-10331-6-git-send-email-tomasz.figa@gmail.com> (raw)
In-Reply-To: <1363642315-10331-1-git-send-email-tomasz.figa@gmail.com>

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>
---
 drivers/pinctrl/pinctrl-samsung.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/pinctrl/pinctrl-samsung.c b/drivers/pinctrl/pinctrl-samsung.c
index 45a9939..b738b7b 100644
--- a/drivers/pinctrl/pinctrl-samsung.c
+++ b/drivers/pinctrl/pinctrl-samsung.c
@@ -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);
 
@@ -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);
 
-- 
1.8.1.5

  parent reply	other threads:[~2013-03-18 21:31 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-18 21:31 [PATCH 0/6] pinctrl: Add support for pin control on S3C64xx Tomasz Figa
2013-03-18 21:31 ` [PATCH 1/6] pinctrl: samsung: Protect bank registers with a spinlock Tomasz Figa
2013-04-09  7:37   ` Linus Walleij
2013-03-18 21:31 ` [PATCH 2/6] pinctrl: samsung: Include pinctrl-exynos driver data conditionally Tomasz Figa
2013-03-18 21:38   ` Tomasz Figa
2013-04-09  7:40     ` Linus Walleij
2013-03-18 21:31 ` [PATCH 3/6] pinctrl: samsung: Split pin bank description into two structures Tomasz Figa
2013-04-03 21:05   ` Linus Walleij
2013-04-09  7:41   ` Linus Walleij
2013-03-18 21:31 ` [PATCH 4/6] pinctrl: samsung: Remove hardcoded register offsets Tomasz Figa
2013-04-09  7:43   ` Linus Walleij
2013-03-18 21:31 ` Tomasz Figa [this message]
2013-04-09  7:44   ` [PATCH 5/6] pinctrl: samsung: Handle banks with two configuration registers Linus Walleij
2013-03-18 21:31 ` [PATCH 6/6] pinctrl: Add pinctrl-s3c64xx driver Tomasz Figa
2013-04-09  7:47   ` Linus Walleij
2013-04-02  8:00 ` [PATCH 0/6] pinctrl: Add support for pin control on S3C64xx Tomasz Figa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1363642315-10331-6-git-send-email-tomasz.figa@gmail.com \
    --to=tomasz.figa@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).