123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- From 0bffbc98e6999bba38d8185a0ddb1ee77369eaec Mon Sep 17 00:00:00 2001
- From: =?UTF-8?q?Tomislav=20Po=C5=BEega?= <[email protected]>
- Date: Wed, 13 Feb 2019 11:09:12 +0100
- Subject: [PATCH 15/28] rt2x00: remove unneeded check
- MIME-Version: 1.0
- Content-Type: text/plain; charset=UTF-8
- Content-Transfer-Encoding: 8bit
- Remove band check from rf53xx channel config routine since all chips
- using it are single band.
- Signed-off-by: Tomislav Požega <[email protected]>
- Signed-off-by: Stanislaw Gruszka <[email protected]>
- ---
- .../net/wireless/ralink/rt2x00/rt2800lib.c | 103 +++++++++---------
- 1 file changed, 50 insertions(+), 53 deletions(-)
- --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
- +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
- @@ -2966,6 +2966,7 @@ static void rt2800_config_channel_rf53xx
- struct channel_info *info)
- {
- u8 rfcsr;
- + int idx = rf->channel-1;
-
- rt2800_rfcsr_write(rt2x00dev, 8, rf->rf1);
- rt2800_rfcsr_write(rt2x00dev, 9, rf->rf3);
- @@ -3003,60 +3004,56 @@ static void rt2800_config_channel_rf53xx
-
- rt2800_freq_cal_mode1(rt2x00dev);
-
- - if (rf->channel <= 14) {
- - int idx = rf->channel-1;
- + if (rt2x00_has_cap_bt_coexist(rt2x00dev)) {
- + if (rt2x00_rt_rev_gte(rt2x00dev, RT5390, REV_RT5390F)) {
- + /* r55/r59 value array of channel 1~14 */
- + static const char r55_bt_rev[] = {0x83, 0x83,
- + 0x83, 0x73, 0x73, 0x63, 0x53, 0x53,
- + 0x53, 0x43, 0x43, 0x43, 0x43, 0x43};
- + static const char r59_bt_rev[] = {0x0e, 0x0e,
- + 0x0e, 0x0e, 0x0e, 0x0b, 0x0a, 0x09,
- + 0x07, 0x07, 0x07, 0x07, 0x07, 0x07};
- +
- + rt2800_rfcsr_write(rt2x00dev, 55,
- + r55_bt_rev[idx]);
- + rt2800_rfcsr_write(rt2x00dev, 59,
- + r59_bt_rev[idx]);
- + } else {
- + static const char r59_bt[] = {0x8b, 0x8b, 0x8b,
- + 0x8b, 0x8b, 0x8b, 0x8b, 0x8a, 0x89,
- + 0x88, 0x88, 0x86, 0x85, 0x84};
-
- - if (rt2x00_has_cap_bt_coexist(rt2x00dev)) {
- - if (rt2x00_rt_rev_gte(rt2x00dev, RT5390, REV_RT5390F)) {
- - /* r55/r59 value array of channel 1~14 */
- - static const char r55_bt_rev[] = {0x83, 0x83,
- - 0x83, 0x73, 0x73, 0x63, 0x53, 0x53,
- - 0x53, 0x43, 0x43, 0x43, 0x43, 0x43};
- - static const char r59_bt_rev[] = {0x0e, 0x0e,
- - 0x0e, 0x0e, 0x0e, 0x0b, 0x0a, 0x09,
- - 0x07, 0x07, 0x07, 0x07, 0x07, 0x07};
- -
- - rt2800_rfcsr_write(rt2x00dev, 55,
- - r55_bt_rev[idx]);
- - rt2800_rfcsr_write(rt2x00dev, 59,
- - r59_bt_rev[idx]);
- - } else {
- - static const char r59_bt[] = {0x8b, 0x8b, 0x8b,
- - 0x8b, 0x8b, 0x8b, 0x8b, 0x8a, 0x89,
- - 0x88, 0x88, 0x86, 0x85, 0x84};
- + rt2800_rfcsr_write(rt2x00dev, 59, r59_bt[idx]);
- + }
- + } else {
- + if (rt2x00_rt_rev_gte(rt2x00dev, RT5390, REV_RT5390F)) {
- + static const char r55_nonbt_rev[] = {0x23, 0x23,
- + 0x23, 0x23, 0x13, 0x13, 0x03, 0x03,
- + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03};
- + static const char r59_nonbt_rev[] = {0x07, 0x07,
- + 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
- + 0x07, 0x07, 0x06, 0x05, 0x04, 0x04};
- +
- + rt2800_rfcsr_write(rt2x00dev, 55,
- + r55_nonbt_rev[idx]);
- + rt2800_rfcsr_write(rt2x00dev, 59,
- + r59_nonbt_rev[idx]);
- + } else if (rt2x00_rt(rt2x00dev, RT5390) ||
- + rt2x00_rt(rt2x00dev, RT5392) ||
- + rt2x00_rt(rt2x00dev, RT6352)) {
- + static const char r59_non_bt[] = {0x8f, 0x8f,
- + 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8d,
- + 0x8a, 0x88, 0x88, 0x87, 0x87, 0x86};
- +
- + rt2800_rfcsr_write(rt2x00dev, 59,
- + r59_non_bt[idx]);
- + } else if (rt2x00_rt(rt2x00dev, RT5350)) {
- + static const char r59_non_bt[] = {0x0b, 0x0b,
- + 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0a,
- + 0x0a, 0x09, 0x08, 0x07, 0x07, 0x06};
-
- - rt2800_rfcsr_write(rt2x00dev, 59, r59_bt[idx]);
- - }
- - } else {
- - if (rt2x00_rt_rev_gte(rt2x00dev, RT5390, REV_RT5390F)) {
- - static const char r55_nonbt_rev[] = {0x23, 0x23,
- - 0x23, 0x23, 0x13, 0x13, 0x03, 0x03,
- - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03};
- - static const char r59_nonbt_rev[] = {0x07, 0x07,
- - 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
- - 0x07, 0x07, 0x06, 0x05, 0x04, 0x04};
- -
- - rt2800_rfcsr_write(rt2x00dev, 55,
- - r55_nonbt_rev[idx]);
- - rt2800_rfcsr_write(rt2x00dev, 59,
- - r59_nonbt_rev[idx]);
- - } else if (rt2x00_rt(rt2x00dev, RT5390) ||
- - rt2x00_rt(rt2x00dev, RT5392) ||
- - rt2x00_rt(rt2x00dev, RT6352)) {
- - static const char r59_non_bt[] = {0x8f, 0x8f,
- - 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8d,
- - 0x8a, 0x88, 0x88, 0x87, 0x87, 0x86};
- -
- - rt2800_rfcsr_write(rt2x00dev, 59,
- - r59_non_bt[idx]);
- - } else if (rt2x00_rt(rt2x00dev, RT5350)) {
- - static const char r59_non_bt[] = {0x0b, 0x0b,
- - 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0a,
- - 0x0a, 0x09, 0x08, 0x07, 0x07, 0x06};
- -
- - rt2800_rfcsr_write(rt2x00dev, 59,
- - r59_non_bt[idx]);
- - }
- + rt2800_rfcsr_write(rt2x00dev, 59,
- + r59_non_bt[idx]);
- }
- }
- }
|