diff mbox series

[4/4] rt2800: comment and simplify AGC init for RT6352

Message ID 1539186380-31949-5-git-send-email-sgruszka@redhat.com (mailing list archive)
State Changes Requested
Delegated to: Kalle Valo
Headers show
Series rt2800: more register programing tweaks | expand

Commit Message

Stanislaw Gruszka Oct. 10, 2018, 3:46 p.m. UTC
We do not need separate lines for calculating register values.
Also add comment that value is different than in vendor driver.

Suggested-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
 drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Comments

Tom Psyborg Oct. 10, 2018, 8:09 p.m. UTC | #1
it's 6352 dude

On 10/10/2018, Stanislaw Gruszka <sgruszka@redhat.com> wrote:
> We do not need separate lines for calculating register values.
> Also add comment that value is different than in vendor driver.
>
> Suggested-by: Daniel Golle <daniel@makrotopia.org>
> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
> ---
>  drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
> b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
> index a2cdd3a5034a..7b6effaa0740 100644
> --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
> +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
> @@ -3986,9 +3986,12 @@ static void rt2800_config_channel(struct rt2x00_dev
> *rt2x00dev,
>  		rt2800_bbp_write(rt2x00dev, 195, 141);
>  		rt2800_bbp_write(rt2x00dev, 196, reg);
>
> -		/* AGC init */
> -		reg = rf->channel <= 14 ? 0x1c : 0x24;
> -		reg += 2 * rt2x00dev->lna_gain;
> +		/* AGC init.
> +		 * Despite the vendor driver using different values here for
> +		 * RT6362 chip, we use 0x1c for now. This may have to be changed
> +		 * once TSSI got implemented.
> +		 */
> +		reg = (rf->channel <= 14 ? 0x1c : 0x24) + 2*rt2x00dev->lna_gain;
>  		rt2800_bbp_write_with_rx_chain(rt2x00dev, 66, reg);
>
>  		rt2800_iq_calibrate(rt2x00dev, rf->channel);
> --
> 2.7.5
>
>
Daniel Golle Oct. 10, 2018, 8:11 p.m. UTC | #2
On Wed, Oct 10, 2018 at 10:09:14PM +0200, Tom Psyborg wrote:
> it's 6352 dude

true. thanks for the review!

> 
> On 10/10/2018, Stanislaw Gruszka <sgruszka@redhat.com> wrote:
> > We do not need separate lines for calculating register values.
> > Also add comment that value is different than in vendor driver.
> >
> > Suggested-by: Daniel Golle <daniel@makrotopia.org>
> > Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
> > ---
> >  drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 9 ++++++---
> >  1 file changed, 6 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
> > b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
> > index a2cdd3a5034a..7b6effaa0740 100644
> > --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
> > +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
> > @@ -3986,9 +3986,12 @@ static void rt2800_config_channel(struct rt2x00_dev
> > *rt2x00dev,
> >  		rt2800_bbp_write(rt2x00dev, 195, 141);
> >  		rt2800_bbp_write(rt2x00dev, 196, reg);
> >
> > -		/* AGC init */
> > -		reg = rf->channel <= 14 ? 0x1c : 0x24;
> > -		reg += 2 * rt2x00dev->lna_gain;
> > +		/* AGC init.
> > +		 * Despite the vendor driver using different values here for
> > +		 * RT6362 chip, we use 0x1c for now. This may have to be changed
> > +		 * once TSSI got implemented.
> > +		 */
> > +		reg = (rf->channel <= 14 ? 0x1c : 0x24) + 2*rt2x00dev->lna_gain;
> >  		rt2800_bbp_write_with_rx_chain(rt2x00dev, 66, reg);
> >
> >  		rt2800_iq_calibrate(rt2x00dev, rf->channel);
> > --
> > 2.7.5
> >
> >
diff mbox series

Patch

diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
index a2cdd3a5034a..7b6effaa0740 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
@@ -3986,9 +3986,12 @@  static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev,
 		rt2800_bbp_write(rt2x00dev, 195, 141);
 		rt2800_bbp_write(rt2x00dev, 196, reg);
 
-		/* AGC init */
-		reg = rf->channel <= 14 ? 0x1c : 0x24;
-		reg += 2 * rt2x00dev->lna_gain;
+		/* AGC init.
+		 * Despite the vendor driver using different values here for
+		 * RT6362 chip, we use 0x1c for now. This may have to be changed
+		 * once TSSI got implemented.
+		 */
+		reg = (rf->channel <= 14 ? 0x1c : 0x24) + 2*rt2x00dev->lna_gain;
 		rt2800_bbp_write_with_rx_chain(rt2x00dev, 66, reg);
 
 		rt2800_iq_calibrate(rt2x00dev, rf->channel);