From: Gertjan van Wingerde <gwingerde@gmail.com>
To: <linux-wireless@vger.kernel.org>,
"John W. Linville" <linville@tuxdriver.com>
Cc: <users@rt2x00.serialmonkey.com>,
Ivo van Doorn <IvDoorn@gmail.com>,
Helmut Schaa <helmut.schaa@googlemail.com>,
Gertjan van Wingerde <gwingerde@gmail.com>,
<stable@vger.kernel.org>
Subject: [PATCH 02/14] rt2x00: Align rt2400pci GPIOCSR definition with datasheet.
Date: Thu, 30 Aug 2012 21:34:01 +0200 [thread overview]
Message-ID: <1346355248-5331-3-git-send-email-gwingerde@gmail.com> (raw)
In-Reply-To: <1346355248-5331-2-git-send-email-gwingerde@gmail.com>
Datasheet indicates additional fields to set the GPIO direction.
At the same time rename GPIOCSR_BIT<x> to GPIOCSR_VAL<x> to represent the
actual meaning better.
Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Cc: <stable@vger.kernel.org>
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
index 8b9dbd7..94f9aa2 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -205,7 +205,7 @@ static int rt2400pci_rfkill_poll(struct rt2x00_dev *rt2x00dev)
u32 reg;
rt2x00pci_register_read(rt2x00dev, GPIOCSR, ®);
- return rt2x00_get_field32(reg, GPIOCSR_BIT0);
+ return rt2x00_get_field32(reg, GPIOCSR_VAL0);
}
#ifdef CONFIG_RT2X00_LIB_LEDS
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.h b/drivers/net/wireless/rt2x00/rt2400pci.h
index d3a4a68..e4b07f0 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.h
+++ b/drivers/net/wireless/rt2x00/rt2400pci.h
@@ -660,16 +660,26 @@
/*
* GPIOCSR: GPIO control register.
+ * GPIOCSR_VALx: Actual GPIO pin x value
+ * GPIOCSR_DIRx: GPIO direction: 0 = output; 1 = input
*/
#define GPIOCSR 0x0120
-#define GPIOCSR_BIT0 FIELD32(0x00000001)
-#define GPIOCSR_BIT1 FIELD32(0x00000002)
-#define GPIOCSR_BIT2 FIELD32(0x00000004)
-#define GPIOCSR_BIT3 FIELD32(0x00000008)
-#define GPIOCSR_BIT4 FIELD32(0x00000010)
-#define GPIOCSR_BIT5 FIELD32(0x00000020)
-#define GPIOCSR_BIT6 FIELD32(0x00000040)
-#define GPIOCSR_BIT7 FIELD32(0x00000080)
+#define GPIOCSR_VAL0 FIELD32(0x00000001)
+#define GPIOCSR_VAL1 FIELD32(0x00000002)
+#define GPIOCSR_VAL2 FIELD32(0x00000004)
+#define GPIOCSR_VAL3 FIELD32(0x00000008)
+#define GPIOCSR_VAL4 FIELD32(0x00000010)
+#define GPIOCSR_VAL5 FIELD32(0x00000020)
+#define GPIOCSR_VAL6 FIELD32(0x00000040)
+#define GPIOCSR_VAL7 FIELD32(0x00000080)
+#define GPIOCSR_DIR0 FIELD32(0x00000100)
+#define GPIOCSR_DIR1 FIELD32(0x00000200)
+#define GPIOCSR_DIR2 FIELD32(0x00000400)
+#define GPIOCSR_DIR3 FIELD32(0x00000800)
+#define GPIOCSR_DIR4 FIELD32(0x00001000)
+#define GPIOCSR_DIR5 FIELD32(0x00002000)
+#define GPIOCSR_DIR6 FIELD32(0x00004000)
+#define GPIOCSR_DIR7 FIELD32(0x00008000)
/*
* BBPPCSR: BBP Pin control register.
--
1.7.11.1
next prev parent reply other threads:[~2012-08-30 19:40 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-30 19:33 [PATCH 00/14] rt2x00: Fixes and cleanups Gertjan van Wingerde
2012-08-30 19:34 ` [PATCH 01/14] rt2x00: Identify ASUS USB-N53 device Gertjan van Wingerde
2012-08-30 19:34 ` Gertjan van Wingerde [this message]
2012-08-30 19:34 ` [PATCH 03/14] rt2x00: Fix rt2400pci rfkill polling prior to interface start Gertjan van Wingerde
2012-08-30 19:34 ` [PATCH 04/14] rt2x00: Align rt2500pci GPIOCSR definition with datasheet Gertjan van Wingerde
2012-08-30 19:34 ` [PATCH 05/14] rt2x00: Fix rt2500pci rfkill polling prior to interface start Gertjan van Wingerde
2012-08-30 19:34 ` [PATCH 06/14] rt2x00: Align rt2500usb MAC_CSR19 definition with datasheet Gertjan van Wingerde
2012-08-30 19:34 ` [PATCH 07/14] rt2x00: Fix rt2500usb rfkill polling prior to interface start Gertjan van Wingerde
2012-08-30 19:34 ` [PATCH 08/14] rt2x00: Align rt61pci MAC_CSR13 definition with datasheet Gertjan van Wingerde
2012-08-30 19:34 ` [PATCH 09/14] rt2x00: Fix rt61pci rfkill polling prior to interface start Gertjan van Wingerde
2012-08-30 21:04 ` [PATCH 10/14] rt2x00: Align rt73usb MAC_CSR13 definition with datasheet Gertjan van Wingerde
2012-08-30 21:04 ` [PATCH 10/17] rt2x00: Fix rt2500usb rfkill polling prior to interface start Gertjan van Wingerde
2012-08-30 21:04 ` [PATCH 11/17] rt2x00: Align rt61pci MAC_CSR13 definition with datasheet Gertjan van Wingerde
2012-08-30 21:04 ` [PATCH 11/14] rt2x00: Fix rt73usb rfkill polling prior to interface start Gertjan van Wingerde
2012-08-30 21:04 ` [PATCH 12/14] rt2x00: Align rt2800 GPIO_CTRL definition with datasheet Gertjan van Wingerde
2012-08-30 21:04 ` [PATCH 12/17] rt2x00: Fix rt61pci rfkill polling prior to interface start Gertjan van Wingerde
2012-08-30 21:04 ` [PATCH 13/17] rt2x00: Align rt73usb MAC_CSR13 definition with datasheet Gertjan van Wingerde
2012-08-30 21:04 ` [PATCH 13/14] rt2x00: Fix rt2800 rfkill polling prior to interface start Gertjan van Wingerde
2012-08-30 21:04 ` [PATCH 14/17] rt2x00: Fix rt73usb " Gertjan van Wingerde
2012-08-30 21:04 ` [PATCH 14/14] rt2x00: rt2800 - Make probe_hw function common between PCI and USB Gertjan van Wingerde
2012-08-30 21:04 ` [PATCH 15/17] rt2x00: Align rt2800 GPIO_CTRL definition with datasheet Gertjan van Wingerde
2012-08-30 21:04 ` [PATCH 16/17] rt2x00: Fix rt2800 rfkill polling prior to interface start Gertjan van Wingerde
2012-08-30 21:04 ` [PATCH 17/17] rt2x00: rt2800 - Make probe_hw function common between PCI and USB Gertjan van Wingerde
2012-08-30 21:14 ` [PATCH 10/17] rt2x00: Fix rt2500usb rfkill polling prior to interface start Gertjan van Wingerde
2012-08-30 21:06 ` [PATCH 04/14] rt2x00: Align rt2500pci GPIOCSR definition with datasheet Jonathan Nieder
2012-08-30 21:05 ` [PATCH 02/14] rt2x00: Align rt2400pci " Jonathan Nieder
2012-08-30 21:08 ` Gertjan van Wingerde
2012-08-31 2:21 ` Jonathan Nieder
2012-08-31 11:14 ` Gertjan van Wingerde
2012-08-31 20:59 ` Jonathan Nieder
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=1346355248-5331-3-git-send-email-gwingerde@gmail.com \
--to=gwingerde@gmail.com \
--cc=IvDoorn@gmail.com \
--cc=helmut.schaa@googlemail.com \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=stable@vger.kernel.org \
--cc=users@rt2x00.serialmonkey.com \
/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).