From: alexanders83@web.de (Alexander Stein)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] pinctrl/at91: Fix pin_to_mask
Date: Fri, 11 Apr 2014 17:35:37 +0200 [thread overview]
Message-ID: <1397230537-8727-1-git-send-email-alexanders83@web.de> (raw)
We need first to reduce the pin number to only a GPIO bank before we can
create the mask.
Otherwise only GPIO bank 0 has correct masks as the bits in the other
banks are shifted out of range.
Signed-off-by: Alexander Stein <alexanders83@web.de>
---
drivers/pinctrl/pinctrl-at91.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c
index 63176f2..6669e13 100644
--- a/drivers/pinctrl/pinctrl-at91.c
+++ b/drivers/pinctrl/pinctrl-at91.c
@@ -316,7 +316,7 @@ static inline int pin_to_bank(unsigned pin)
static unsigned pin_to_mask(unsigned int pin)
{
- return 1 << pin;
+ return 1 << (pin % MAX_NB_GPIO_PER_BANK);
}
static void at91_mux_disable_interrupt(void __iomem *pio, unsigned mask)
--
1.9.2
next reply other threads:[~2014-04-11 15:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-11 15:35 Alexander Stein [this message]
2014-04-11 15:42 ` [PATCH] pinctrl/at91: Fix pin_to_mask Jean-Christophe PLAGNIOL-VILLARD
2014-04-11 15:45 ` Alexander Stein
2014-04-11 17:53 ` Mark Roszko
2014-04-11 18:33 ` [PATCH] pinctrl/at91: Fix mask creation in at91_gpio_dbg_show Alexander Stein
2014-04-14 8:14 ` Alexandre Belloni
2014-04-14 18:53 ` [PATCH v2] " Alexander Stein
2014-04-16 7:55 ` Nicolas Ferre
2014-04-22 21:46 ` Linus Walleij
2014-04-14 8:19 ` [PATCH] " Nicolas Ferre
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=1397230537-8727-1-git-send-email-alexanders83@web.de \
--to=alexanders83@web.de \
--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).