* Re: [PATCH 04/14] rt2x00: Align rt2500pci GPIOCSR definition with datasheet.
@ 2012-08-30 21:13 Gertjan van Wingerde
0 siblings, 0 replies; 3+ messages in thread
From: Gertjan van Wingerde @ 2012-08-30 21:13 UTC (permalink / raw)
To: Jonathan Nieder
Cc: linux-wireless, John W Linville, Ivo Van Doorn, Helmut Schaa,
users@rt2x00.serialmonkey.com
On 08/30/12 23:06, Jonathan Nieder wrote:
>> Rename GPIOCSR_BIT<x> to GPIOCSR_VAL<x> to represent the actual
>> meaning better.
>>
>> Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
>
> Sounds good.
>
>> Cc: <stable@vger.kernel.org>
>
> Should not be needed.
>
This one is the same as the previous one you commented on. Technically
this patch is not needed in stable, but the next patch in the series is.
Unfortunately that patch depends on this one, so therefore this one is
targeted at stable as well.
---
Gertjan
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 00/14] rt2x00: Fixes and cleanups.
@ 2012-08-30 19:33 Gertjan van Wingerde
2012-08-30 19:34 ` [PATCH 01/14] rt2x00: Identify ASUS USB-N53 device Gertjan van Wingerde
0 siblings, 1 reply; 3+ messages in thread
From: Gertjan van Wingerde @ 2012-08-30 19:33 UTC (permalink / raw)
To: linux-wireless, John W. Linville
Cc: users, Ivo van Doorn, Helmut Schaa, Gertjan van Wingerde
This patch series contains:
1. Moving the ASUS USB-N53 device ID from the set of unknown devices to the
set of RT3572 devices.
2. A large set of fixes for the various rt2x00 drivers to fix the issue that
the value of the rfkill switch wasn't read properly at device startup,
preventing users to create an interface on the device and start that
interface.
Thanks to Andreas Messer for reporting the issue and
finding the root cause of the issue.
3. A clean-up of the rt2800 drivers, in which now more code is shared
between rt2800pci and rt2800usb.
John, all but the last patches are marked to be included in stable as well,
so the logical tree would be wireless for them. The last patch is a
cleanup, however, which would be targetted at wireless-next. Unfortunately,
that patch depends on the first 13 in the series.
I'll leave it up to you to decide how that handle the series.
---
Gertjan.
Gertjan van Wingerde (14):
rt2x00: Identify ASUS USB-N53 device.
rt2x00: Align rt2400pci GPIOCSR definition with datasheet.
rt2x00: Fix rt2400pci rfkill polling prior to interface start.
rt2x00: Align rt2500pci GPIOCSR definition with datasheet.
rt2x00: Fix rt2500pci rfkill polling prior to interface start.
rt2x00: Align rt2500usb MAC_CSR19 definition with datasheet.
rt2x00: Fix rt2500usb rfkill polling prior to interface start.
rt2x00: Align rt61pci MAC_CSR13 definition with datasheet.
rt2x00: Fix rt61pci rfkill polling prior to interface start.
rt2x00: Align rt73usb MAC_CSR13 definition with datasheet.
rt2x00: Fix rt73usb rfkill polling prior to interface start.
rt2x00: Align rt2800 GPIO_CTRL definition with datasheet.
rt2x00: Fix rt2800 rfkill polling prior to interface start.
rt2x00: rt2800 - Make probe_hw function common between PCI and USB.
drivers/net/wireless/rt2x00/rt2400pci.c | 11 ++-
drivers/net/wireless/rt2x00/rt2400pci.h | 26 +++++--
drivers/net/wireless/rt2x00/rt2500pci.c | 11 ++-
drivers/net/wireless/rt2x00/rt2500pci.h | 18 +++--
drivers/net/wireless/rt2x00/rt2500usb.c | 11 ++-
drivers/net/wireless/rt2x00/rt2500usb.h | 26 +++++--
drivers/net/wireless/rt2x00/rt2800.h | 47 +++++++-----
drivers/net/wireless/rt2x00/rt2800lib.c | 125 +++++++++++++++++++++++++-------
drivers/net/wireless/rt2x00/rt2800lib.h | 14 +++-
drivers/net/wireless/rt2x00/rt2800pci.c | 74 +------------------
drivers/net/wireless/rt2x00/rt2800usb.c | 56 ++------------
drivers/net/wireless/rt2x00/rt61pci.c | 19 +++--
drivers/net/wireless/rt2x00/rt61pci.h | 27 +++----
drivers/net/wireless/rt2x00/rt73usb.c | 11 ++-
drivers/net/wireless/rt2x00/rt73usb.h | 31 ++++----
15 files changed, 280 insertions(+), 227 deletions(-)
--
1.7.11.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 01/14] rt2x00: Identify ASUS USB-N53 device.
2012-08-30 19:33 [PATCH 00/14] rt2x00: Fixes and cleanups Gertjan van Wingerde
@ 2012-08-30 19:34 ` Gertjan van Wingerde
2012-08-30 19:34 ` [PATCH 02/14] rt2x00: Align rt2400pci GPIOCSR definition with datasheet Gertjan van Wingerde
0 siblings, 1 reply; 3+ messages in thread
From: Gertjan van Wingerde @ 2012-08-30 19:34 UTC (permalink / raw)
To: linux-wireless, John W. Linville
Cc: users, Ivo van Doorn, Helmut Schaa, Gertjan van Wingerde,
Maximilian Engelhardt, stable
This is an RT3572 based device.
Signed-off-by: Maximilian Engelhardt <maxi@daemonizer.de>
Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Cc: <stable@vger.kernel.org>
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c
index 6cf3365..6681bfc 100644
--- a/drivers/net/wireless/rt2x00/rt2800usb.c
+++ b/drivers/net/wireless/rt2x00/rt2800usb.c
@@ -1157,6 +1157,8 @@ static struct usb_device_id rt2800usb_device_table[] = {
{ USB_DEVICE(0x1690, 0x0744) },
{ USB_DEVICE(0x1690, 0x0761) },
{ USB_DEVICE(0x1690, 0x0764) },
+ /* ASUS */
+ { USB_DEVICE(0x0b05, 0x179d) },
/* Cisco */
{ USB_DEVICE(0x167b, 0x4001) },
/* EnGenius */
@@ -1222,7 +1224,6 @@ static struct usb_device_id rt2800usb_device_table[] = {
{ USB_DEVICE(0x0b05, 0x1760) },
{ USB_DEVICE(0x0b05, 0x1761) },
{ USB_DEVICE(0x0b05, 0x1790) },
- { USB_DEVICE(0x0b05, 0x179d) },
/* AzureWave */
{ USB_DEVICE(0x13d3, 0x3262) },
{ USB_DEVICE(0x13d3, 0x3284) },
--
1.7.11.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* [PATCH 02/14] rt2x00: Align rt2400pci GPIOCSR definition with datasheet.
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
2012-08-30 19:34 ` [PATCH 03/14] rt2x00: Fix rt2400pci rfkill polling prior to interface start Gertjan van Wingerde
0 siblings, 1 reply; 3+ messages in thread
From: Gertjan van Wingerde @ 2012-08-30 19:34 UTC (permalink / raw)
To: linux-wireless, John W. Linville
Cc: users, Ivo van Doorn, Helmut Schaa, Gertjan van Wingerde, stable
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 03/14] rt2x00: Fix rt2400pci rfkill polling prior to interface start.
2012-08-30 19:34 ` [PATCH 02/14] rt2x00: Align rt2400pci GPIOCSR definition with datasheet Gertjan van Wingerde
@ 2012-08-30 19:34 ` Gertjan van Wingerde
2012-08-30 19:34 ` [PATCH 04/14] rt2x00: Align rt2500pci GPIOCSR definition with datasheet Gertjan van Wingerde
0 siblings, 1 reply; 3+ messages in thread
From: Gertjan van Wingerde @ 2012-08-30 19:34 UTC (permalink / raw)
To: linux-wireless, John W. Linville
Cc: users, Ivo van Doorn, Helmut Schaa, Gertjan van Wingerde, stable
We need to program the rfkill switch GPIO pin direction to input at
device initialization time, not only when the interface is brought up.
Doing this only when the interface is brought up could lead to rfkill
detecting the switch is turned on erroneously and inability to create
the interface and bringing it up.
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 94f9aa2..6458ab8 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -1611,6 +1611,7 @@ static int rt2400pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
static int rt2400pci_probe_hw(struct rt2x00_dev *rt2x00dev)
{
int retval;
+ u32 reg;
/*
* Allocate eeprom data.
@@ -1624,6 +1625,14 @@ static int rt2400pci_probe_hw(struct rt2x00_dev *rt2x00dev)
return retval;
/*
+ * Enable rfkill polling by setting GPIO direction of the
+ * rfkill switch GPIO pin correctly.
+ */
+ rt2x00pci_register_read(rt2x00dev, GPIOCSR, ®);
+ rt2x00_set_field32(®, GPIOCSR_DIR0, 1);
+ rt2x00pci_register_write(rt2x00dev, GPIOCSR, reg);
+
+ /*
* Initialize hw specifications.
*/
retval = rt2400pci_probe_hw_mode(rt2x00dev);
--
1.7.11.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* [PATCH 04/14] rt2x00: Align rt2500pci GPIOCSR definition with datasheet.
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 ` Gertjan van Wingerde
2012-08-30 21:06 ` Jonathan Nieder
0 siblings, 1 reply; 3+ messages in thread
From: Gertjan van Wingerde @ 2012-08-30 19:34 UTC (permalink / raw)
To: linux-wireless, John W. Linville
Cc: users, Ivo van Doorn, Helmut Schaa, Gertjan van Wingerde, stable
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/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c
index d2cf8a4..959d565 100644
--- a/drivers/net/wireless/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/rt2x00/rt2500pci.c
@@ -205,7 +205,7 @@ static int rt2500pci_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/rt2500pci.h b/drivers/net/wireless/rt2x00/rt2500pci.h
index 2aad7ba..9c10068 100644
--- a/drivers/net/wireless/rt2x00/rt2500pci.h
+++ b/drivers/net/wireless/rt2x00/rt2500pci.h
@@ -789,16 +789,18 @@
/*
* GPIOCSR: GPIO control register.
+ * GPIOCSR_VALx: GPIO 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)
--
1.7.11.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-08-30 21:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-30 21:13 [PATCH 04/14] rt2x00: Align rt2500pci GPIOCSR definition with datasheet Gertjan van Wingerde
-- strict thread matches above, loose matches on Subject: below --
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 21:06 ` Jonathan Nieder
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).