All of lore.kernel.org
 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 06/14] rt2x00: Align rt2500usb MAC_CSR19 definition with datasheet.
Date: Thu, 30 Aug 2012 21:34:05 +0200	[thread overview]
Message-ID: <1346355248-5331-7-git-send-email-gwingerde@gmail.com> (raw)
In-Reply-To: <1346355248-5331-6-git-send-email-gwingerde@gmail.com>

Datasheet indicates additional fields to set the GPIO direction.
At the same time rename MAC_CSR19_BIT<x> to MAC_CSR19_VAL<x> to represent
the actual meaning better.
Also, rt2500usb has 16-bit register values, not 32-bit register values.

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

diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index 3aae36b..5742ce9 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -283,7 +283,7 @@ static int rt2500usb_rfkill_poll(struct rt2x00_dev *rt2x00dev)
 	u16 reg;
 
 	rt2500usb_register_read(rt2x00dev, MAC_CSR19, &reg);
-	return rt2x00_get_field32(reg, MAC_CSR19_BIT7);
+	return rt2x00_get_field16(reg, MAC_CSR19_VAL7);
 }
 
 #ifdef CONFIG_RT2X00_LIB_LEDS
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.h b/drivers/net/wireless/rt2x00/rt2500usb.h
index b493306..ef7b420 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.h
+++ b/drivers/net/wireless/rt2x00/rt2500usb.h
@@ -187,16 +187,26 @@
 
 /*
  * MAC_CSR19: GPIO control register.
+ *	MAC_CSR19_VALx: GPIO value
+ *	MAC_CSR19_DIRx: GPIO direction: 0 = input; 1 = output
  */
 #define MAC_CSR19			0x0426
-#define MAC_CSR19_BIT0			FIELD32(0x0001)
-#define MAC_CSR19_BIT1			FIELD32(0x0002)
-#define MAC_CSR19_BIT2			FIELD32(0x0004)
-#define MAC_CSR19_BIT3			FIELD32(0x0008)
-#define MAC_CSR19_BIT4			FIELD32(0x0010)
-#define MAC_CSR19_BIT5			FIELD32(0x0020)
-#define MAC_CSR19_BIT6			FIELD32(0x0040)
-#define MAC_CSR19_BIT7			FIELD32(0x0080)
+#define MAC_CSR19_VAL0			FIELD16(0x0001)
+#define MAC_CSR19_VAL1			FIELD16(0x0002)
+#define MAC_CSR19_VAL2			FIELD16(0x0004)
+#define MAC_CSR19_VAL3			FIELD16(0x0008)
+#define MAC_CSR19_VAL4			FIELD16(0x0010)
+#define MAC_CSR19_VAL5			FIELD16(0x0020)
+#define MAC_CSR19_VAL6			FIELD16(0x0040)
+#define MAC_CSR19_VAL7			FIELD16(0x0080)
+#define MAC_CSR19_DIR0			FIELD16(0x0100)
+#define MAC_CSR19_DIR1			FIELD16(0x0200)
+#define MAC_CSR19_DIR2			FIELD16(0x0400)
+#define MAC_CSR19_DIR3			FIELD16(0x0800)
+#define MAC_CSR19_DIR4			FIELD32(0x1000)
+#define MAC_CSR19_DIR5			FIELD16(0x2000)
+#define MAC_CSR19_DIR6			FIELD16(0x4000)
+#define MAC_CSR19_DIR7			FIELD16(0x8000)
 
 /*
  * MAC_CSR20: 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           ` Gertjan van Wingerde [this message]
2012-08-30 19:34             ` [PATCH 07/14] rt2x00: Fix rt2500usb " 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-7-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.