linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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 08/14] rt2x00: Align rt61pci MAC_CSR13 definition with datasheet.
Date: Thu, 30 Aug 2012 21:34:07 +0200	[thread overview]
Message-ID: <1346355248-5331-9-git-send-email-gwingerde@gmail.com> (raw)
In-Reply-To: <1346355248-5331-8-git-send-email-gwingerde@gmail.com>

Rename MAC_CSR13_BIT<x> to MAC_CSR13_VAL<x> and MAC_CSR13_DIR<x> to
represent the actual meaning better.
Clean up list to only mention the active GPIO pins, not just all bits.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Cc: <stable@vger.kernel.org>

diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index 3f7bc5c..d84b17f 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -243,7 +243,7 @@ static int rt61pci_rfkill_poll(struct rt2x00_dev *rt2x00dev)
 	u32 reg;
 
 	rt2x00pci_register_read(rt2x00dev, MAC_CSR13, &reg);
-	return rt2x00_get_field32(reg, MAC_CSR13_BIT5);
+	return rt2x00_get_field32(reg, MAC_CSR13_VAL5);
 }
 
 #ifdef CONFIG_RT2X00_LIB_LEDS
@@ -715,11 +715,11 @@ static void rt61pci_config_antenna_2529_rx(struct rt2x00_dev *rt2x00dev,
 
 	rt2x00pci_register_read(rt2x00dev, MAC_CSR13, &reg);
 
-	rt2x00_set_field32(&reg, MAC_CSR13_BIT4, p1);
-	rt2x00_set_field32(&reg, MAC_CSR13_BIT12, 0);
+	rt2x00_set_field32(&reg, MAC_CSR13_DIR4, 0);
+	rt2x00_set_field32(&reg, MAC_CSR13_VAL4, p1);
 
-	rt2x00_set_field32(&reg, MAC_CSR13_BIT3, !p2);
-	rt2x00_set_field32(&reg, MAC_CSR13_BIT11, 0);
+	rt2x00_set_field32(&reg, MAC_CSR13_DIR3, 0);
+	rt2x00_set_field32(&reg, MAC_CSR13_VAL3, !p2);
 
 	rt2x00pci_register_write(rt2x00dev, MAC_CSR13, reg);
 }
diff --git a/drivers/net/wireless/rt2x00/rt61pci.h b/drivers/net/wireless/rt2x00/rt61pci.h
index e3cd6db..9bc6b60 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.h
+++ b/drivers/net/wireless/rt2x00/rt61pci.h
@@ -357,21 +357,22 @@ struct hw_pairwise_ta_entry {
 
 /*
  * MAC_CSR13: GPIO.
+ *	MAC_CSR13_VALx: GPIO value
+ *	MAC_CSR13_DIRx: GPIO direction: 0 = output; 1 = input
  */
 #define MAC_CSR13			0x3034
-#define MAC_CSR13_BIT0			FIELD32(0x00000001)
-#define MAC_CSR13_BIT1			FIELD32(0x00000002)
-#define MAC_CSR13_BIT2			FIELD32(0x00000004)
-#define MAC_CSR13_BIT3			FIELD32(0x00000008)
-#define MAC_CSR13_BIT4			FIELD32(0x00000010)
-#define MAC_CSR13_BIT5			FIELD32(0x00000020)
-#define MAC_CSR13_BIT6			FIELD32(0x00000040)
-#define MAC_CSR13_BIT7			FIELD32(0x00000080)
-#define MAC_CSR13_BIT8			FIELD32(0x00000100)
-#define MAC_CSR13_BIT9			FIELD32(0x00000200)
-#define MAC_CSR13_BIT10			FIELD32(0x00000400)
-#define MAC_CSR13_BIT11			FIELD32(0x00000800)
-#define MAC_CSR13_BIT12			FIELD32(0x00001000)
+#define MAC_CSR13_VAL0			FIELD32(0x00000001)
+#define MAC_CSR13_VAL1			FIELD32(0x00000002)
+#define MAC_CSR13_VAL2			FIELD32(0x00000004)
+#define MAC_CSR13_VAL3			FIELD32(0x00000008)
+#define MAC_CSR13_VAL4			FIELD32(0x00000010)
+#define MAC_CSR13_VAL5			FIELD32(0x00000020)
+#define MAC_CSR13_DIR0			FIELD32(0x00000100)
+#define MAC_CSR13_DIR1			FIELD32(0x00000200)
+#define MAC_CSR13_DIR2			FIELD32(0x00000400)
+#define MAC_CSR13_DIR3			FIELD32(0x00000800)
+#define MAC_CSR13_DIR4			FIELD32(0x00001000)
+#define MAC_CSR13_DIR5			FIELD32(0x00002000)
 
 /*
  * MAC_CSR14: LED control register.
-- 
1.7.11.1


  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   ` [PATCH 02/14] rt2x00: Align rt2400pci GPIOCSR definition with datasheet Gertjan van Wingerde
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               ` Gertjan van Wingerde [this message]
2012-08-30 19:34                 ` [PATCH 09/14] rt2x00: Fix rt61pci " 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-9-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).