All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] b43: use bcma_pmu_spuravoid_pllupdate()
@ 2013-03-21 17:11 Hauke Mehrtens
  2013-03-21 22:41 ` Julian Calaby
  2013-03-23 19:34   ` Rafał Miłecki
  0 siblings, 2 replies; 15+ messages in thread
From: Hauke Mehrtens @ 2013-03-21 17:11 UTC (permalink / raw)
  To: linville; +Cc: zajec5, linux-wireless, Hauke Mehrtens

Do not implement this in b43, but use bcma_pmu_spuravoid_pllupdate().

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 drivers/net/wireless/b43/phy_n.c |   92 ++++++++------------------------------
 1 file changed, 18 insertions(+), 74 deletions(-)

diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index 3c35382..4130c04 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -5101,76 +5101,6 @@ static void b43_chantab_phy_upload(struct b43_wldev *dev,
 	b43_phy_write(dev, B43_NPHY_BW6, e->phy_bw6);
 }
 
-/* http://bcm-v4.sipsolutions.net/802.11/PmuSpurAvoid */
-static void b43_nphy_pmu_spur_avoid(struct b43_wldev *dev, bool avoid)
-{
-	struct bcma_drv_cc __maybe_unused *cc;
-	u32 __maybe_unused pmu_ctl;
-
-	switch (dev->dev->bus_type) {
-#ifdef CONFIG_B43_BCMA
-	case B43_BUS_BCMA:
-		cc = &dev->dev->bdev->bus->drv_cc;
-		if (dev->dev->chip_id == 43224 || dev->dev->chip_id == 43225) {
-			if (avoid) {
-				bcma_chipco_pll_write(cc, 0x0, 0x11500010);
-				bcma_chipco_pll_write(cc, 0x1, 0x000C0C06);
-				bcma_chipco_pll_write(cc, 0x2, 0x0F600a08);
-				bcma_chipco_pll_write(cc, 0x3, 0x00000000);
-				bcma_chipco_pll_write(cc, 0x4, 0x2001E920);
-				bcma_chipco_pll_write(cc, 0x5, 0x88888815);
-			} else {
-				bcma_chipco_pll_write(cc, 0x0, 0x11100010);
-				bcma_chipco_pll_write(cc, 0x1, 0x000c0c06);
-				bcma_chipco_pll_write(cc, 0x2, 0x03000a08);
-				bcma_chipco_pll_write(cc, 0x3, 0x00000000);
-				bcma_chipco_pll_write(cc, 0x4, 0x200005c0);
-				bcma_chipco_pll_write(cc, 0x5, 0x88888815);
-			}
-			pmu_ctl = BCMA_CC_PMU_CTL_PLL_UPD;
-		} else if (dev->dev->chip_id == 0x4716) {
-			if (avoid) {
-				bcma_chipco_pll_write(cc, 0x0, 0x11500060);
-				bcma_chipco_pll_write(cc, 0x1, 0x080C0C06);
-				bcma_chipco_pll_write(cc, 0x2, 0x0F600000);
-				bcma_chipco_pll_write(cc, 0x3, 0x00000000);
-				bcma_chipco_pll_write(cc, 0x4, 0x2001E924);
-				bcma_chipco_pll_write(cc, 0x5, 0x88888815);
-			} else {
-				bcma_chipco_pll_write(cc, 0x0, 0x11100060);
-				bcma_chipco_pll_write(cc, 0x1, 0x080c0c06);
-				bcma_chipco_pll_write(cc, 0x2, 0x03000000);
-				bcma_chipco_pll_write(cc, 0x3, 0x00000000);
-				bcma_chipco_pll_write(cc, 0x4, 0x200005c0);
-				bcma_chipco_pll_write(cc, 0x5, 0x88888815);
-			}
-			pmu_ctl = BCMA_CC_PMU_CTL_PLL_UPD |
-				  BCMA_CC_PMU_CTL_NOILPONW;
-		} else if (dev->dev->chip_id == 0x4322 ||
-			   dev->dev->chip_id == 0x4340 ||
-			   dev->dev->chip_id == 0x4341) {
-			bcma_chipco_pll_write(cc, 0x0, 0x11100070);
-			bcma_chipco_pll_write(cc, 0x1, 0x1014140a);
-			bcma_chipco_pll_write(cc, 0x5, 0x88888854);
-			if (avoid)
-				bcma_chipco_pll_write(cc, 0x2, 0x05201828);
-			else
-				bcma_chipco_pll_write(cc, 0x2, 0x05001828);
-			pmu_ctl = BCMA_CC_PMU_CTL_PLL_UPD;
-		} else {
-			return;
-		}
-		bcma_cc_set32(cc, BCMA_CC_PMU_CTL, pmu_ctl);
-		break;
-#endif
-#ifdef CONFIG_B43_SSB
-	case B43_BUS_SSB:
-		/* FIXME */
-		break;
-#endif
-	}
-}
-
 /* http://bcm-v4.sipsolutions.net/802.11/PHY/N/ChanspecSetup */
 static void b43_nphy_channel_setup(struct b43_wldev *dev,
 				const struct b43_phy_n_sfo_cfg *e,
@@ -5220,19 +5150,33 @@ static void b43_nphy_channel_setup(struct b43_wldev *dev,
 
 	if (dev->phy.rev >= 3 &&
 	    dev->phy.n->spur_avoid != B43_SPUR_AVOID_DISABLE) {
-		bool avoid = false;
+		struct bcma_drv_cc __maybe_unused *cc;
+		int avoid = 0;
+
 		if (dev->phy.n->spur_avoid == B43_SPUR_AVOID_FORCE) {
-			avoid = true;
+			avoid = 1;
 		} else if (!b43_channel_type_is_40mhz(phy->channel_type)) {
 			if ((ch >= 5 && ch <= 8) || ch == 13 || ch == 14)
-				avoid = true;
+				avoid = 1;
 		} else { /* 40MHz */
 			if (nphy->aband_spurwar_en &&
 			    (ch == 38 || ch == 102 || ch == 118))
 				avoid = dev->dev->chip_id == 0x4716;
 		}
 
-		b43_nphy_pmu_spur_avoid(dev, avoid);
+		switch (dev->dev->bus_type) {
+#ifdef CONFIG_B43_BCMA
+		case B43_BUS_BCMA:
+			cc = &dev->dev->bdev->bus->drv_cc;
+			bcma_pmu_spuravoid_pllupdate(cc, avoid);
+			break;
+#endif
+#ifdef CONFIG_B43_SSB
+		case B43_BUS_SSB:
+			/* FIXME */
+			break;
+#endif
+		}
 
 		if (dev->dev->chip_id == 43222 || dev->dev->chip_id == 43224 ||
 		    dev->dev->chip_id == 43225) {
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH] b43: use bcma_pmu_spuravoid_pllupdate()
  2013-03-21 17:11 [PATCH] b43: use bcma_pmu_spuravoid_pllupdate() Hauke Mehrtens
@ 2013-03-21 22:41 ` Julian Calaby
  2013-03-23 14:46   ` Hauke Mehrtens
  2013-03-23 19:34   ` Rafał Miłecki
  1 sibling, 1 reply; 15+ messages in thread
From: Julian Calaby @ 2013-03-21 22:41 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: linville, zajec5, linux-wireless

Hi Hauke,

On Fri, Mar 22, 2013 at 4:11 AM, Hauke Mehrtens <hauke@hauke-m.de> wrote:
> Do not implement this in b43, but use bcma_pmu_spuravoid_pllupdate().
>
> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
> ---
>  drivers/net/wireless/b43/phy_n.c |   92 ++++++++------------------------------
>  1 file changed, 18 insertions(+), 74 deletions(-)
>
> diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
> index 3c35382..4130c04 100644
> --- a/drivers/net/wireless/b43/phy_n.c
> +++ b/drivers/net/wireless/b43/phy_n.c
> @@ -5220,19 +5150,33 @@ static void b43_nphy_channel_setup(struct b43_wldev *dev,
>
>         if (dev->phy.rev >= 3 &&
>             dev->phy.n->spur_avoid != B43_SPUR_AVOID_DISABLE) {
> -               bool avoid = false;
> +               struct bcma_drv_cc __maybe_unused *cc;

Could this go inside the #ifdef in the switch statement - that way the
__maybe_unused should be unnecessary?

> +               int avoid = 0;

I though that bools were converted to ints exactly as you've converted
the avoid variable here.

Thanks,

-- 
Julian Calaby

Email: julian.calaby@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/
.Plan: http://sites.google.com/site/juliancalaby/

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] b43: use bcma_pmu_spuravoid_pllupdate()
  2013-03-21 22:41 ` Julian Calaby
@ 2013-03-23 14:46   ` Hauke Mehrtens
  2013-03-23 15:29     ` Hauke Mehrtens
  0 siblings, 1 reply; 15+ messages in thread
From: Hauke Mehrtens @ 2013-03-23 14:46 UTC (permalink / raw)
  To: Julian Calaby; +Cc: linville, zajec5, linux-wireless

On 03/21/2013 11:41 PM, Julian Calaby wrote:
> Hi Hauke,
> 
> On Fri, Mar 22, 2013 at 4:11 AM, Hauke Mehrtens <hauke@hauke-m.de> wrote:
>> Do not implement this in b43, but use bcma_pmu_spuravoid_pllupdate().
>>
>> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
>> ---
>>  drivers/net/wireless/b43/phy_n.c |   92 ++++++++------------------------------
>>  1 file changed, 18 insertions(+), 74 deletions(-)
>>
>> diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
>> index 3c35382..4130c04 100644
>> --- a/drivers/net/wireless/b43/phy_n.c
>> +++ b/drivers/net/wireless/b43/phy_n.c
>> @@ -5220,19 +5150,33 @@ static void b43_nphy_channel_setup(struct b43_wldev *dev,
>>
>>         if (dev->phy.rev >= 3 &&
>>             dev->phy.n->spur_avoid != B43_SPUR_AVOID_DISABLE) {
>> -               bool avoid = false;
>> +               struct bcma_drv_cc __maybe_unused *cc;
> 
> Could this go inside the #ifdef in the switch statement - that way the
> __maybe_unused should be unnecessary?

No that is not possible, C forbids it there:

drivers/net/wireless/b43/phy_n.c: In function ‘b43_nphy_channel_setup’:
drivers/net/wireless/b43/phy_n.c:5169:4: error: a label can only be part
of a statement and a declaration is not a statement

> 
>> +               int avoid = 0;
> 
> I though that bools were converted to ints exactly as you've converted
> the avoid variable here.

Yes I will change that.

Hauke

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] b43: use bcma_pmu_spuravoid_pllupdate()
  2013-03-23 14:46   ` Hauke Mehrtens
@ 2013-03-23 15:29     ` Hauke Mehrtens
  0 siblings, 0 replies; 15+ messages in thread
From: Hauke Mehrtens @ 2013-03-23 15:29 UTC (permalink / raw)
  To: Julian Calaby; +Cc: linville, zajec5, linux-wireless

On 03/23/2013 03:46 PM, Hauke Mehrtens wrote:
> On 03/21/2013 11:41 PM, Julian Calaby wrote:
>> Hi Hauke,
>>
>> On Fri, Mar 22, 2013 at 4:11 AM, Hauke Mehrtens <hauke@hauke-m.de> wrote:
>>> Do not implement this in b43, but use bcma_pmu_spuravoid_pllupdate().
>>>
>>> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
>>> ---
>>>  drivers/net/wireless/b43/phy_n.c |   92 ++++++++------------------------------
>>>  1 file changed, 18 insertions(+), 74 deletions(-)
>>>
>>> diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
>>> index 3c35382..4130c04 100644
>>> --- a/drivers/net/wireless/b43/phy_n.c
>>> +++ b/drivers/net/wireless/b43/phy_n.c
>>> @@ -5220,19 +5150,33 @@ static void b43_nphy_channel_setup(struct b43_wldev *dev,
>>>
>>>         if (dev->phy.rev >= 3 &&
>>>             dev->phy.n->spur_avoid != B43_SPUR_AVOID_DISABLE) {
>>> -               bool avoid = false;
>>> +               struct bcma_drv_cc __maybe_unused *cc;
>>
>> Could this go inside the #ifdef in the switch statement - that way the
>> __maybe_unused should be unnecessary?
> 
> No that is not possible, C forbids it there:
> 
> drivers/net/wireless/b43/phy_n.c: In function ‘b43_nphy_channel_setup’:
> drivers/net/wireless/b43/phy_n.c:5169:4: error: a label can only be part
> of a statement and a declaration is not a statement
> 
>>
>>> +               int avoid = 0;
>>
>> I though that bools were converted to ints exactly as you've converted
>> the avoid variable here.
> 
> Yes I will change that.
> 
I thought about this and I would like to stay with int, because the
functions wants an int and bcma_pmu_spuravoid_pllupdate() also handles
avoid == 2.

Hauke

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] b43: use bcma_pmu_spuravoid_pllupdate()
  2013-03-21 17:11 [PATCH] b43: use bcma_pmu_spuravoid_pllupdate() Hauke Mehrtens
@ 2013-03-23 19:34   ` Rafał Miłecki
  2013-03-23 19:34   ` Rafał Miłecki
  1 sibling, 0 replies; 15+ messages in thread
From: Rafał Miłecki @ 2013-03-23 19:34 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: linville, linux-wireless, b43-dev

2013/3/21 Hauke Mehrtens <hauke@hauke-m.de>:
> Do not implement this in b43, but use bcma_pmu_spuravoid_pllupdate().

Can we wait with this patch few days, please? I'm in process of
debugging BCM4322 and channel 13 support, which may be related to this
part of driver.

Please Cc driver ML when touching it's code.

-- 
Rafał

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH] b43: use bcma_pmu_spuravoid_pllupdate()
@ 2013-03-23 19:34   ` Rafał Miłecki
  0 siblings, 0 replies; 15+ messages in thread
From: Rafał Miłecki @ 2013-03-23 19:34 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: linville, linux-wireless, b43-dev

2013/3/21 Hauke Mehrtens <hauke@hauke-m.de>:
> Do not implement this in b43, but use bcma_pmu_spuravoid_pllupdate().

Can we wait with this patch few days, please? I'm in process of
debugging BCM4322 and channel 13 support, which may be related to this
part of driver.

Please Cc driver ML when touching it's code.

-- 
Rafa?

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] b43: use bcma_pmu_spuravoid_pllupdate()
  2013-03-23 19:34   ` Rafał Miłecki
@ 2013-03-23 19:46     ` Hauke Mehrtens
  -1 siblings, 0 replies; 15+ messages in thread
From: Hauke Mehrtens @ 2013-03-23 19:46 UTC (permalink / raw)
  To: Rafał Miłecki; +Cc: linville, linux-wireless, b43-dev

On 03/23/2013 08:34 PM, Rafał Miłecki wrote:
> 2013/3/21 Hauke Mehrtens <hauke@hauke-m.de>:
>> Do not implement this in b43, but use bcma_pmu_spuravoid_pllupdate().
> 
> Can we wait with this patch few days, please? I'm in process of
> debugging BCM4322 and channel 13 support, which may be related to this
> part of driver.

I have not problem with waiting and rebasing my patch onto your fix as
this is not a fix just a code cleanup.

> Please Cc driver ML when touching it's code.

This was not intended, I just forgot to do so.

Hauke

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH] b43: use bcma_pmu_spuravoid_pllupdate()
@ 2013-03-23 19:46     ` Hauke Mehrtens
  0 siblings, 0 replies; 15+ messages in thread
From: Hauke Mehrtens @ 2013-03-23 19:46 UTC (permalink / raw)
  To: Rafał Miłecki; +Cc: linville, linux-wireless, b43-dev

On 03/23/2013 08:34 PM, Rafa? Mi?ecki wrote:
> 2013/3/21 Hauke Mehrtens <hauke@hauke-m.de>:
>> Do not implement this in b43, but use bcma_pmu_spuravoid_pllupdate().
> 
> Can we wait with this patch few days, please? I'm in process of
> debugging BCM4322 and channel 13 support, which may be related to this
> part of driver.

I have not problem with waiting and rebasing my patch onto your fix as
this is not a fix just a code cleanup.

> Please Cc driver ML when touching it's code.

This was not intended, I just forgot to do so.

Hauke

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] b43: use bcma_pmu_spuravoid_pllupdate()
  2013-03-23 19:46     ` Hauke Mehrtens
@ 2013-03-23 19:51       ` Rafał Miłecki
  -1 siblings, 0 replies; 15+ messages in thread
From: Rafał Miłecki @ 2013-03-23 19:51 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: linville, linux-wireless, b43-dev

2013/3/23 Hauke Mehrtens <hauke@hauke-m.de>:
> On 03/23/2013 08:34 PM, Rafał Miłecki wrote:
>> 2013/3/21 Hauke Mehrtens <hauke@hauke-m.de>:
>>> Do not implement this in b43, but use bcma_pmu_spuravoid_pllupdate().
>>
>> Can we wait with this patch few days, please? I'm in process of
>> debugging BCM4322 and channel 13 support, which may be related to this
>> part of driver.
>
> I have not problem with waiting and rebasing my patch onto your fix as
> this is not a fix just a code cleanup.
>
>> Please Cc driver ML when touching it's code.
>
> This was not intended, I just forgot to do so.

Great, thanks :) I'm really glad to see you improving b43, thanks for your work!

-- 
Rafał

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH] b43: use bcma_pmu_spuravoid_pllupdate()
@ 2013-03-23 19:51       ` Rafał Miłecki
  0 siblings, 0 replies; 15+ messages in thread
From: Rafał Miłecki @ 2013-03-23 19:51 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: linville, linux-wireless, b43-dev

2013/3/23 Hauke Mehrtens <hauke@hauke-m.de>:
> On 03/23/2013 08:34 PM, Rafa? Mi?ecki wrote:
>> 2013/3/21 Hauke Mehrtens <hauke@hauke-m.de>:
>>> Do not implement this in b43, but use bcma_pmu_spuravoid_pllupdate().
>>
>> Can we wait with this patch few days, please? I'm in process of
>> debugging BCM4322 and channel 13 support, which may be related to this
>> part of driver.
>
> I have not problem with waiting and rebasing my patch onto your fix as
> this is not a fix just a code cleanup.
>
>> Please Cc driver ML when touching it's code.
>
> This was not intended, I just forgot to do so.

Great, thanks :) I'm really glad to see you improving b43, thanks for your work!

-- 
Rafa?

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] b43: use bcma_pmu_spuravoid_pllupdate()
  2013-04-12  6:26   ` Rafał Miłecki
@ 2013-04-12 12:34     ` Hauke Mehrtens
  -1 siblings, 0 replies; 15+ messages in thread
From: Hauke Mehrtens @ 2013-04-12 12:34 UTC (permalink / raw)
  To: Rafał Miłecki; +Cc: linville, linux-wireless, b43-dev

On 04/12/2013 08:26 AM, Rafał Miłecki wrote:
> 2013/4/11 Hauke Mehrtens <hauke@hauke-m.de>:
>> Do not implement this in b43, but use bcma_pmu_spuravoid_pllupdate().
>>
>> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
>> ---
>>  drivers/net/wireless/b43/phy_n.c |   86 +++++++-------------------------------
>>  1 file changed, 14 insertions(+), 72 deletions(-)
>>
>> diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
>> index 7b557ad..05945da 100644
>> --- a/drivers/net/wireless/b43/phy_n.c
>> +++ b/drivers/net/wireless/b43/phy_n.c
>> @@ -5097,77 +5097,6 @@ static void b43_chantab_phy_upload(struct b43_wldev *dev,
>>         b43_phy_write(dev, B43_NPHY_BW6, e->phy_bw6);
>>  }
>>
>> -/* http://bcm-v4.sipsolutions.net/802.11/PmuSpurAvoid */
>> -static void b43_nphy_pmu_spur_avoid(struct b43_wldev *dev, bool avoid)
>> -{
> 
> I think it may be better to keep b43_nphy_pmu_spur_avoid, as some
> chipsets may need additional workarounds (that AFAIR can't be handled
> in ssb/bcma). I mean workarounds related to the spurious avoidance
> ofc, so it would be a good idea to put them in separated function.
> 
Ok, I will send a new version of this patch.

Hauke

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH] b43: use bcma_pmu_spuravoid_pllupdate()
@ 2013-04-12 12:34     ` Hauke Mehrtens
  0 siblings, 0 replies; 15+ messages in thread
From: Hauke Mehrtens @ 2013-04-12 12:34 UTC (permalink / raw)
  To: Rafał Miłecki; +Cc: linville, linux-wireless, b43-dev

On 04/12/2013 08:26 AM, Rafa? Mi?ecki wrote:
> 2013/4/11 Hauke Mehrtens <hauke@hauke-m.de>:
>> Do not implement this in b43, but use bcma_pmu_spuravoid_pllupdate().
>>
>> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
>> ---
>>  drivers/net/wireless/b43/phy_n.c |   86 +++++++-------------------------------
>>  1 file changed, 14 insertions(+), 72 deletions(-)
>>
>> diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
>> index 7b557ad..05945da 100644
>> --- a/drivers/net/wireless/b43/phy_n.c
>> +++ b/drivers/net/wireless/b43/phy_n.c
>> @@ -5097,77 +5097,6 @@ static void b43_chantab_phy_upload(struct b43_wldev *dev,
>>         b43_phy_write(dev, B43_NPHY_BW6, e->phy_bw6);
>>  }
>>
>> -/* http://bcm-v4.sipsolutions.net/802.11/PmuSpurAvoid */
>> -static void b43_nphy_pmu_spur_avoid(struct b43_wldev *dev, bool avoid)
>> -{
> 
> I think it may be better to keep b43_nphy_pmu_spur_avoid, as some
> chipsets may need additional workarounds (that AFAIR can't be handled
> in ssb/bcma). I mean workarounds related to the spurious avoidance
> ofc, so it would be a good idea to put them in separated function.
> 
Ok, I will send a new version of this patch.

Hauke

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] b43: use bcma_pmu_spuravoid_pllupdate()
  2013-04-11 12:39 Hauke Mehrtens
@ 2013-04-12  6:26   ` Rafał Miłecki
  0 siblings, 0 replies; 15+ messages in thread
From: Rafał Miłecki @ 2013-04-12  6:26 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: linville, linux-wireless, b43-dev

2013/4/11 Hauke Mehrtens <hauke@hauke-m.de>:
> Do not implement this in b43, but use bcma_pmu_spuravoid_pllupdate().
>
> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
> ---
>  drivers/net/wireless/b43/phy_n.c |   86 +++++++-------------------------------
>  1 file changed, 14 insertions(+), 72 deletions(-)
>
> diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
> index 7b557ad..05945da 100644
> --- a/drivers/net/wireless/b43/phy_n.c
> +++ b/drivers/net/wireless/b43/phy_n.c
> @@ -5097,77 +5097,6 @@ static void b43_chantab_phy_upload(struct b43_wldev *dev,
>         b43_phy_write(dev, B43_NPHY_BW6, e->phy_bw6);
>  }
>
> -/* http://bcm-v4.sipsolutions.net/802.11/PmuSpurAvoid */
> -static void b43_nphy_pmu_spur_avoid(struct b43_wldev *dev, bool avoid)
> -{

I think it may be better to keep b43_nphy_pmu_spur_avoid, as some
chipsets may need additional workarounds (that AFAIR can't be handled
in ssb/bcma). I mean workarounds related to the spurious avoidance
ofc, so it would be a good idea to put them in separated function.

-- 
Rafał

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH] b43: use bcma_pmu_spuravoid_pllupdate()
@ 2013-04-12  6:26   ` Rafał Miłecki
  0 siblings, 0 replies; 15+ messages in thread
From: Rafał Miłecki @ 2013-04-12  6:26 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: linville, linux-wireless, b43-dev

2013/4/11 Hauke Mehrtens <hauke@hauke-m.de>:
> Do not implement this in b43, but use bcma_pmu_spuravoid_pllupdate().
>
> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
> ---
>  drivers/net/wireless/b43/phy_n.c |   86 +++++++-------------------------------
>  1 file changed, 14 insertions(+), 72 deletions(-)
>
> diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
> index 7b557ad..05945da 100644
> --- a/drivers/net/wireless/b43/phy_n.c
> +++ b/drivers/net/wireless/b43/phy_n.c
> @@ -5097,77 +5097,6 @@ static void b43_chantab_phy_upload(struct b43_wldev *dev,
>         b43_phy_write(dev, B43_NPHY_BW6, e->phy_bw6);
>  }
>
> -/* http://bcm-v4.sipsolutions.net/802.11/PmuSpurAvoid */
> -static void b43_nphy_pmu_spur_avoid(struct b43_wldev *dev, bool avoid)
> -{

I think it may be better to keep b43_nphy_pmu_spur_avoid, as some
chipsets may need additional workarounds (that AFAIR can't be handled
in ssb/bcma). I mean workarounds related to the spurious avoidance
ofc, so it would be a good idea to put them in separated function.

-- 
Rafa?

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH] b43: use bcma_pmu_spuravoid_pllupdate()
@ 2013-04-11 12:39 Hauke Mehrtens
  2013-04-12  6:26   ` Rafał Miłecki
  0 siblings, 1 reply; 15+ messages in thread
From: Hauke Mehrtens @ 2013-04-11 12:39 UTC (permalink / raw)
  To: linville; +Cc: zajec5, linux-wireless, b43-dev, Hauke Mehrtens

Do not implement this in b43, but use bcma_pmu_spuravoid_pllupdate().

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 drivers/net/wireless/b43/phy_n.c |   86 +++++++-------------------------------
 1 file changed, 14 insertions(+), 72 deletions(-)

diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index 7b557ad..05945da 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -5097,77 +5097,6 @@ static void b43_chantab_phy_upload(struct b43_wldev *dev,
 	b43_phy_write(dev, B43_NPHY_BW6, e->phy_bw6);
 }
 
-/* http://bcm-v4.sipsolutions.net/802.11/PmuSpurAvoid */
-static void b43_nphy_pmu_spur_avoid(struct b43_wldev *dev, bool avoid)
-{
-	struct bcma_drv_cc __maybe_unused *cc;
-	u32 __maybe_unused pmu_ctl;
-
-	switch (dev->dev->bus_type) {
-#ifdef CONFIG_B43_BCMA
-	case B43_BUS_BCMA:
-		cc = &dev->dev->bdev->bus->drv_cc;
-		if (dev->dev->chip_id == 43224 || dev->dev->chip_id == 43225) {
-			if (avoid) {
-				bcma_chipco_pll_write(cc, 0x0, 0x11500010);
-				bcma_chipco_pll_write(cc, 0x1, 0x000C0C06);
-				bcma_chipco_pll_write(cc, 0x2, 0x0F600a08);
-				bcma_chipco_pll_write(cc, 0x3, 0x00000000);
-				bcma_chipco_pll_write(cc, 0x4, 0x2001E920);
-				bcma_chipco_pll_write(cc, 0x5, 0x88888815);
-			} else {
-				bcma_chipco_pll_write(cc, 0x0, 0x11100010);
-				bcma_chipco_pll_write(cc, 0x1, 0x000c0c06);
-				bcma_chipco_pll_write(cc, 0x2, 0x03000a08);
-				bcma_chipco_pll_write(cc, 0x3, 0x00000000);
-				bcma_chipco_pll_write(cc, 0x4, 0x200005c0);
-				bcma_chipco_pll_write(cc, 0x5, 0x88888815);
-			}
-			pmu_ctl = BCMA_CC_PMU_CTL_PLL_UPD;
-		} else if (dev->dev->chip_id == 0x4716) {
-			if (avoid) {
-				bcma_chipco_pll_write(cc, 0x0, 0x11500060);
-				bcma_chipco_pll_write(cc, 0x1, 0x080C0C06);
-				bcma_chipco_pll_write(cc, 0x2, 0x0F600000);
-				bcma_chipco_pll_write(cc, 0x3, 0x00000000);
-				bcma_chipco_pll_write(cc, 0x4, 0x2001E924);
-				bcma_chipco_pll_write(cc, 0x5, 0x88888815);
-			} else {
-				bcma_chipco_pll_write(cc, 0x0, 0x11100060);
-				bcma_chipco_pll_write(cc, 0x1, 0x080c0c06);
-				bcma_chipco_pll_write(cc, 0x2, 0x03000000);
-				bcma_chipco_pll_write(cc, 0x3, 0x00000000);
-				bcma_chipco_pll_write(cc, 0x4, 0x200005c0);
-				bcma_chipco_pll_write(cc, 0x5, 0x88888815);
-			}
-			pmu_ctl = BCMA_CC_PMU_CTL_PLL_UPD |
-				  BCMA_CC_PMU_CTL_NOILPONW;
-		} else if (dev->dev->chip_id == 0x4322 ||
-			   dev->dev->chip_id == 0x4340 ||
-			   dev->dev->chip_id == 0x4341) {
-			bcma_chipco_pll_write(cc, 0x0, 0x11100070);
-			bcma_chipco_pll_write(cc, 0x1, 0x1014140a);
-			bcma_chipco_pll_write(cc, 0x5, 0x88888854);
-			if (avoid)
-				bcma_chipco_pll_write(cc, 0x2, 0x05201828);
-			else
-				bcma_chipco_pll_write(cc, 0x2, 0x05001828);
-			pmu_ctl = BCMA_CC_PMU_CTL_PLL_UPD;
-		} else {
-			return;
-		}
-		bcma_cc_set32(cc, BCMA_CC_PMU_CTL, pmu_ctl);
-		break;
-#endif
-#ifdef CONFIG_B43_SSB
-	case B43_BUS_SSB:
-		ssb_pmu_spuravoid_pllupdate(&dev->dev->sdev->bus->chipco,
-					    avoid);
-		break;
-#endif
-	}
-}
-
 /* http://bcm-v4.sipsolutions.net/802.11/PHY/N/ChanspecSetup */
 static void b43_nphy_channel_setup(struct b43_wldev *dev,
 				const struct b43_phy_n_sfo_cfg *e,
@@ -5229,7 +5158,20 @@ static void b43_nphy_channel_setup(struct b43_wldev *dev,
 				avoid = dev->dev->chip_id == 0x4716;
 		}
 
-		b43_nphy_pmu_spur_avoid(dev, avoid);
+		switch (dev->dev->bus_type) {
+#ifdef CONFIG_B43_BCMA
+		case B43_BUS_BCMA:
+			bcma_pmu_spuravoid_pllupdate(&dev->dev->bdev->bus->drv_cc,
+						     avoid);
+			break;
+#endif
+#ifdef CONFIG_B43_SSB
+		case B43_BUS_SSB:
+			ssb_pmu_spuravoid_pllupdate(&dev->dev->sdev->bus->chipco,
+						    avoid);
+			break;
+#endif
+		}
 
 		if (dev->dev->chip_id == 43222 || dev->dev->chip_id == 43224 ||
 		    dev->dev->chip_id == 43225) {
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2013-04-12 12:35 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-21 17:11 [PATCH] b43: use bcma_pmu_spuravoid_pllupdate() Hauke Mehrtens
2013-03-21 22:41 ` Julian Calaby
2013-03-23 14:46   ` Hauke Mehrtens
2013-03-23 15:29     ` Hauke Mehrtens
2013-03-23 19:34 ` Rafał Miłecki
2013-03-23 19:34   ` Rafał Miłecki
2013-03-23 19:46   ` Hauke Mehrtens
2013-03-23 19:46     ` Hauke Mehrtens
2013-03-23 19:51     ` Rafał Miłecki
2013-03-23 19:51       ` Rafał Miłecki
2013-04-11 12:39 Hauke Mehrtens
2013-04-12  6:26 ` Rafał Miłecki
2013-04-12  6:26   ` Rafał Miłecki
2013-04-12 12:34   ` Hauke Mehrtens
2013-04-12 12:34     ` Hauke Mehrtens

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.