diff mbox

[02/14] rt2x00: Align rt2400pci GPIOCSR definition with datasheet.

Message ID 1346355248-5331-3-git-send-email-gwingerde@gmail.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Gertjan van Wingerde Aug. 30, 2012, 7:34 p.m. UTC
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>

Comments

Jonathan Nieder Aug. 30, 2012, 9:05 p.m. UTC | #1
Hi,

Gertjan van Wingerde wrote:

> 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.

Micronit: could the latter be split into a separate patch from the
former, to make life easier e.g. when bisecting?

Only the first part would be needed for stable@.

Thanks,
Jonathan
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Gertjan van Wingerde Aug. 30, 2012, 9:08 p.m. UTC | #2
On 08/30/12 23:05, Jonathan Nieder wrote:
> Hi,
> 
> Gertjan van Wingerde wrote:
> 
>> 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.
> 
> Micronit: could the latter be split into a separate patch from the
> former, to make life easier e.g. when bisecting?
> 
> Only the first part would be needed for stable@.
> 

I guess it could be split up, but I don't see the point. Technically
this patch is not needed in stable, but the next patch in the series
depends on this one and that one is targeted at stable, so therefore
this one is targeted at stable as well.

---
Gertjan
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jonathan Nieder Aug. 31, 2012, 2:21 a.m. UTC | #3
Gertjan van Wingerde wrote:

> I guess it could be split up, but I don't see the point. Technically
> this patch is not needed in stable, but the next patch in the series
> depends on this one and that one is targeted at stable, so therefore
> this one is targeted at stable as well.

If I were to reroll the series without unnecessary changes, would that
be useful to you?

The whole point of point releases is to fix bugs while avoiding
pointless changes, providing a stable codebase that is easy to build
on and keeping the volume of new changes to sift through when
regressions are introduced low.

Thanks,
Jonathan
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Gertjan van Wingerde Aug. 31, 2012, 11:14 a.m. UTC | #4
Hi Jonathan,

On Fri, Aug 31, 2012 at 4:21 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:
> Gertjan van Wingerde wrote:
>
>> I guess it could be split up, but I don't see the point. Technically
>> this patch is not needed in stable, but the next patch in the series
>> depends on this one and that one is targeted at stable, so therefore
>> this one is targeted at stable as well.
>
> If I were to reroll the series without unnecessary changes, would that
> be useful to you?

Nevermind, I'll refactor the series myself to reduce the number of
patches and to better separate the fixes from the clean-ups.
I can probably do that much faster (within an hour) than you can.

>
> The whole point of point releases is to fix bugs while avoiding
> pointless changes, providing a stable codebase that is easy to build
> on and keeping the volume of new changes to sift through when
> regressions are introduced low.
>

I agree. However, in this case I tried to balance new development with
bug fixing to prevent a lot of double work (and failed to do so).

---
Gertjan
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jonathan Nieder Aug. 31, 2012, 8:59 p.m. UTC | #5
Gertjan van Wingerde wrote:

>            I'll refactor the series myself to reduce the number of
> patches and to better separate the fixes from the clean-ups.

The result looks good.  Thanks!

Jonathan
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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, &reg);
-	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.