From: Daniel Golle <daniel@makrotopia.org>
To: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: linux-wireless@vger.kernel.org, "Mathias Kresin" <dev@kresin.me>,
"Felix Fietkau" <nbd@nbd.name>,
"Tomislav Požega" <pozega.tomislav@gmail.com>
Subject: Re: [PATCH v3 2/4] rt2x00: remove confusing AGC register
Date: Tue, 9 Oct 2018 15:07:15 +0200 [thread overview]
Message-ID: <20181009130713.GC2458@makrotopia.org> (raw)
In-Reply-To: <20181009124747.GA31203@redhat.com>
On Tue, Oct 09, 2018 at 02:47:48PM +0200, Stanislaw Gruszka wrote:
> Hi
>
> On Tue, Oct 09, 2018 at 02:27:22PM +0200, Daniel Golle wrote:
> > On Tue, Oct 09, 2018 at 01:56:08PM +0200, Gruszka wrote:
> > > Register 66 was causing issues on RT6352 if set to the same value as
> > > in MTK driver. With 1c reg value device was working fine in both HT20
> > > and HT40 modes.
> >
> > My guess is that this may change once we add proper TSSI which involes
> > parts of AGC init as well. I suggest to add a comment in the code to
> > reflect that.
>
> I don't understand what you suggest, could you be more specific ?
simply add these lines:
/*
* Despite the vendor driver using different values here, use 0x1c
* for now. This may have to be changed once TSSI got implemented
*/
>
> > > diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
> > > index 1a2bf6c49b82..3a04eaef8511 100644
> > > --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
> > > +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
> > > @@ -3981,11 +3981,7 @@ static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev,
> > > rt2800_bbp_write(rt2x00dev, 196, reg);
> > >
> > > /* AGC init */
> > > - if (rt2x00_rt(rt2x00dev, RT6352))
> > > - reg = 0x04;
> > > - else
> > > - reg = rf->channel <= 14 ? 0x1c : 0x24;
> > > -
> > > + reg = rf->channel <= 14 ? 0x1c : 0x24;
> > > reg += 2 * rt2x00dev->lna_gain;
> >
> > We can summerize the two lines into
> > reg = 0x1c + (2 * rt2x00dev->lna_gain);
> > which is also what is was before introducing support for MT7620.
>
> I think you mean
>
> reg = (rf->channel <= 14 ? 0x1c : 0x24) + 2 * rt2x00dev->lna_gain;
>
> to do not break 5GHz support for RT5592. I can change that in
> separate patch, since this one in not technically wrong.
>
> Thanks
> Stanislaw
>
next prev parent reply other threads:[~2018-10-09 13:07 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-09 11:56 [PATCH v3 1/4] rt2x00: remove unneeded check Stanislaw Gruszka
2018-10-09 11:56 ` [PATCH v3 2/4] rt2x00: remove confusing AGC register Stanislaw Gruszka
2018-10-09 12:27 ` Daniel Golle
2018-10-09 12:47 ` Stanislaw Gruszka
2018-10-09 13:07 ` Daniel Golle [this message]
2018-10-09 13:23 ` Stanislaw Gruszka
2018-10-09 11:56 ` [PATCH v3 3/4] rt2x00: update TX_SW_CFG2 value Stanislaw Gruszka
2018-10-09 11:56 ` [PATCH v3 4/4] rt2800: fix registers init for MT7620 Stanislaw Gruszka
2018-10-09 23:27 ` Tom Psyborg
2018-10-10 7:14 ` Stanislaw Gruszka
2018-10-10 12:06 ` Daniel Golle
2018-10-10 12:45 ` Stanislaw Gruszka
2018-10-10 14:11 ` Tom Psyborg
2018-10-10 15:40 ` Stanislaw Gruszka
2018-10-10 20:03 ` Tom Psyborg
2018-10-11 10:05 ` Stanislaw Gruszka
2018-10-11 12:39 ` Tom Psyborg
2018-10-12 8:50 ` Stanislaw Gruszka
2018-10-11 10:06 ` [PATCH v3 1/4] rt2x00: remove unneeded check Stanislaw Gruszka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181009130713.GC2458@makrotopia.org \
--to=daniel@makrotopia.org \
--cc=dev@kresin.me \
--cc=linux-wireless@vger.kernel.org \
--cc=nbd@nbd.name \
--cc=pozega.tomislav@gmail.com \
--cc=sgruszka@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).