diff mbox series

[15/21] rt2x00: rt2800lib: hardcode txmixer gain values to zero for RT3883

Message ID 1554809828-13500-16-git-send-email-sgruszka@redhat.com (mailing list archive)
State Changes Requested
Delegated to: Kalle Valo
Headers show
Series RT3883 support from OpenWrt | expand

Commit Message

Stanislaw Gruszka April 9, 2019, 11:37 a.m. UTC
From: Gabor Juhos <juhosg@openwrt.org>

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
 drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Tom Psyborg April 9, 2019, 3:26 p.m. UTC | #1
On 09/04/2019, Stanislaw Gruszka <sgruszka@redhat.com> wrote:
> From: Gabor Juhos <juhosg@openwrt.org>
>
> Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
> ---
>  drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
> b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
> index 0687bef990e1..4ea94c62d439 100644
> --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
> +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
> @@ -9128,7 +9128,8 @@ static u8 rt2800_get_txmixer_gain_24g(struct
> rt2x00_dev *rt2x00dev)
>  {
>  	u16 word;
>
> -	if (rt2x00_rt(rt2x00dev, RT3593))
> +	if (rt2x00_rt(rt2x00dev, RT3593) ||
> +	    rt2x00_rt(rt2x00dev, RT3883))
>  		return 0;
>
>  	word = rt2800_eeprom_read(rt2x00dev, EEPROM_TXMIXER_GAIN_BG);
> @@ -9142,7 +9143,8 @@ static u8 rt2800_get_txmixer_gain_5g(struct rt2x00_dev
> *rt2x00dev)
>  {
>  	u16 word;
>
> -	if (rt2x00_rt(rt2x00dev, RT3593))
> +	if (rt2x00_rt(rt2x00dev, RT3593) ||
> +	    rt2x00_rt(rt2x00dev, RT3883))
>  		return 0;
>
>  	word = rt2800_eeprom_read(rt2x00dev, EEPROM_TXMIXER_GAIN_A);
> --
> 2.7.5
>
>

Did someone actually verified this is correct?
Stanislaw Gruszka April 10, 2019, 8:22 a.m. UTC | #2
On Tue, Apr 09, 2019 at 05:26:46PM +0200, Tom Psyborg wrote:
> On 09/04/2019, Stanislaw Gruszka <sgruszka@redhat.com> wrote:
> > From: Gabor Juhos <juhosg@openwrt.org>
> >
> > Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
> > Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
> > ---
> >  drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 6 ++++--
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
> > b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
> > index 0687bef990e1..4ea94c62d439 100644
> > --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
> > +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
> > @@ -9128,7 +9128,8 @@ static u8 rt2800_get_txmixer_gain_24g(struct
> > rt2x00_dev *rt2x00dev)
> >  {
> >  	u16 word;
> >
> > -	if (rt2x00_rt(rt2x00dev, RT3593))
> > +	if (rt2x00_rt(rt2x00dev, RT3593) ||
> > +	    rt2x00_rt(rt2x00dev, RT3883))
> >  		return 0;
> >
> >  	word = rt2800_eeprom_read(rt2x00dev, EEPROM_TXMIXER_GAIN_BG);
> > @@ -9142,7 +9143,8 @@ static u8 rt2800_get_txmixer_gain_5g(struct rt2x00_dev
> > *rt2x00dev)
> >  {
> >  	u16 word;
> >
> > -	if (rt2x00_rt(rt2x00dev, RT3593))
> > +	if (rt2x00_rt(rt2x00dev, RT3593) ||
> > +	    rt2x00_rt(rt2x00dev, RT3883))
> >  		return 0;
> >
> >  	word = rt2800_eeprom_read(rt2x00dev, EEPROM_TXMIXER_GAIN_A);
> > --
> > 2.7.5
> >
> >
> 
> Did someone actually verified this is correct?

I don't know if it was verified or not.

Stanislaw
Daniel Golle April 10, 2019, 1:12 p.m. UTC | #3
On Wed, Apr 10, 2019 at 10:22:42AM +0200, Stanislaw Gruszka wrote:
> On Tue, Apr 09, 2019 at 05:26:46PM +0200, Tom Psyborg wrote:
> > On 09/04/2019, Stanislaw Gruszka <sgruszka@redhat.com> wrote:
> > > From: Gabor Juhos <juhosg@openwrt.org>
> > >
> > > Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
> > > Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
> > > ---
> > >  drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 6 ++++--
> > >  1 file changed, 4 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
> > > b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
> > > index 0687bef990e1..4ea94c62d439 100644
> > > --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
> > > +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
> > > @@ -9128,7 +9128,8 @@ static u8 rt2800_get_txmixer_gain_24g(struct
> > > rt2x00_dev *rt2x00dev)
> > >  {
> > >  	u16 word;
> > >
> > > -	if (rt2x00_rt(rt2x00dev, RT3593))
> > > +	if (rt2x00_rt(rt2x00dev, RT3593) ||
> > > +	    rt2x00_rt(rt2x00dev, RT3883))
> > >  		return 0;
> > >
> > >  	word = rt2800_eeprom_read(rt2x00dev, EEPROM_TXMIXER_GAIN_BG);
> > > @@ -9142,7 +9143,8 @@ static u8 rt2800_get_txmixer_gain_5g(struct rt2x00_dev
> > > *rt2x00dev)
> > >  {
> > >  	u16 word;
> > >
> > > -	if (rt2x00_rt(rt2x00dev, RT3593))
> > > +	if (rt2x00_rt(rt2x00dev, RT3593) ||
> > > +	    rt2x00_rt(rt2x00dev, RT3883))
> > >  		return 0;
> > >
> > >  	word = rt2800_eeprom_read(rt2x00dev, EEPROM_TXMIXER_GAIN_A);
> > > --
> > > 2.7.5
> > >
> > >
> > 
> > Did someone actually verified this is correct?
> 
> I don't know if it was verified or not.

Gabor supposedly verified this when he wrote that patch 6 years ago,
it was reviewed and merged by John Crispin back then:

commit 6e3de004f9cf6724b1ad950e7cb3b98f1b4af54d
Author: John Crispin <blogic@openwrt.org>
Date:   Wed Apr 23 07:52:18 2014 +0000

    mac80211: rt2x00: add support for the RT3662/RT3883 SoCs
    
    Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
    
    git-svn-id: svn://svn.openwrt.org/openwrt/trunk@40558 3c298f89-4303-0410-b956-a3cf2f4a3e73

Since when we carry it in OpenWrt and supposedly everyone with Rt3xx3
WiSoC devices is using it and there haven't been any complains so far.


Cheers


Daniel

> 
> Stanislaw
diff mbox series

Patch

diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
index 0687bef990e1..4ea94c62d439 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
@@ -9128,7 +9128,8 @@  static u8 rt2800_get_txmixer_gain_24g(struct rt2x00_dev *rt2x00dev)
 {
 	u16 word;
 
-	if (rt2x00_rt(rt2x00dev, RT3593))
+	if (rt2x00_rt(rt2x00dev, RT3593) ||
+	    rt2x00_rt(rt2x00dev, RT3883))
 		return 0;
 
 	word = rt2800_eeprom_read(rt2x00dev, EEPROM_TXMIXER_GAIN_BG);
@@ -9142,7 +9143,8 @@  static u8 rt2800_get_txmixer_gain_5g(struct rt2x00_dev *rt2x00dev)
 {
 	u16 word;
 
-	if (rt2x00_rt(rt2x00dev, RT3593))
+	if (rt2x00_rt(rt2x00dev, RT3593) ||
+	    rt2x00_rt(rt2x00dev, RT3883))
 		return 0;
 
 	word = rt2800_eeprom_read(rt2x00dev, EEPROM_TXMIXER_GAIN_A);