015-rt2x00-remove-unneeded-check.patch 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. From 17ae2acd1a6f5148edd80d84194e5d7c80be360e Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Tomislav=20Po=C5=BEega?= <[email protected]>
  3. Date: Wed, 13 Feb 2019 11:09:12 +0100
  4. Subject: [PATCH 15/28] rt2x00: remove unneeded check
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. Remove band check from rf53xx channel config routine since all chips
  9. using it are single band.
  10. Signed-off-by: Tomislav Požega <[email protected]>
  11. Signed-off-by: Stanislaw Gruszka <[email protected]>
  12. Signed-off-by: Kalle Valo <[email protected]>
  13. ---
  14. .../net/wireless/ralink/rt2x00/rt2800lib.c | 103 +++++++++---------
  15. 1 file changed, 50 insertions(+), 53 deletions(-)
  16. --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
  17. +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
  18. @@ -2966,6 +2966,7 @@ static void rt2800_config_channel_rf53xx
  19. struct channel_info *info)
  20. {
  21. u8 rfcsr;
  22. + int idx = rf->channel-1;
  23. rt2800_rfcsr_write(rt2x00dev, 8, rf->rf1);
  24. rt2800_rfcsr_write(rt2x00dev, 9, rf->rf3);
  25. @@ -3003,60 +3004,56 @@ static void rt2800_config_channel_rf53xx
  26. rt2800_freq_cal_mode1(rt2x00dev);
  27. - if (rf->channel <= 14) {
  28. - int idx = rf->channel-1;
  29. + if (rt2x00_has_cap_bt_coexist(rt2x00dev)) {
  30. + if (rt2x00_rt_rev_gte(rt2x00dev, RT5390, REV_RT5390F)) {
  31. + /* r55/r59 value array of channel 1~14 */
  32. + static const char r55_bt_rev[] = {0x83, 0x83,
  33. + 0x83, 0x73, 0x73, 0x63, 0x53, 0x53,
  34. + 0x53, 0x43, 0x43, 0x43, 0x43, 0x43};
  35. + static const char r59_bt_rev[] = {0x0e, 0x0e,
  36. + 0x0e, 0x0e, 0x0e, 0x0b, 0x0a, 0x09,
  37. + 0x07, 0x07, 0x07, 0x07, 0x07, 0x07};
  38. +
  39. + rt2800_rfcsr_write(rt2x00dev, 55,
  40. + r55_bt_rev[idx]);
  41. + rt2800_rfcsr_write(rt2x00dev, 59,
  42. + r59_bt_rev[idx]);
  43. + } else {
  44. + static const char r59_bt[] = {0x8b, 0x8b, 0x8b,
  45. + 0x8b, 0x8b, 0x8b, 0x8b, 0x8a, 0x89,
  46. + 0x88, 0x88, 0x86, 0x85, 0x84};
  47. - if (rt2x00_has_cap_bt_coexist(rt2x00dev)) {
  48. - if (rt2x00_rt_rev_gte(rt2x00dev, RT5390, REV_RT5390F)) {
  49. - /* r55/r59 value array of channel 1~14 */
  50. - static const char r55_bt_rev[] = {0x83, 0x83,
  51. - 0x83, 0x73, 0x73, 0x63, 0x53, 0x53,
  52. - 0x53, 0x43, 0x43, 0x43, 0x43, 0x43};
  53. - static const char r59_bt_rev[] = {0x0e, 0x0e,
  54. - 0x0e, 0x0e, 0x0e, 0x0b, 0x0a, 0x09,
  55. - 0x07, 0x07, 0x07, 0x07, 0x07, 0x07};
  56. -
  57. - rt2800_rfcsr_write(rt2x00dev, 55,
  58. - r55_bt_rev[idx]);
  59. - rt2800_rfcsr_write(rt2x00dev, 59,
  60. - r59_bt_rev[idx]);
  61. - } else {
  62. - static const char r59_bt[] = {0x8b, 0x8b, 0x8b,
  63. - 0x8b, 0x8b, 0x8b, 0x8b, 0x8a, 0x89,
  64. - 0x88, 0x88, 0x86, 0x85, 0x84};
  65. + rt2800_rfcsr_write(rt2x00dev, 59, r59_bt[idx]);
  66. + }
  67. + } else {
  68. + if (rt2x00_rt_rev_gte(rt2x00dev, RT5390, REV_RT5390F)) {
  69. + static const char r55_nonbt_rev[] = {0x23, 0x23,
  70. + 0x23, 0x23, 0x13, 0x13, 0x03, 0x03,
  71. + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03};
  72. + static const char r59_nonbt_rev[] = {0x07, 0x07,
  73. + 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
  74. + 0x07, 0x07, 0x06, 0x05, 0x04, 0x04};
  75. +
  76. + rt2800_rfcsr_write(rt2x00dev, 55,
  77. + r55_nonbt_rev[idx]);
  78. + rt2800_rfcsr_write(rt2x00dev, 59,
  79. + r59_nonbt_rev[idx]);
  80. + } else if (rt2x00_rt(rt2x00dev, RT5390) ||
  81. + rt2x00_rt(rt2x00dev, RT5392) ||
  82. + rt2x00_rt(rt2x00dev, RT6352)) {
  83. + static const char r59_non_bt[] = {0x8f, 0x8f,
  84. + 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8d,
  85. + 0x8a, 0x88, 0x88, 0x87, 0x87, 0x86};
  86. +
  87. + rt2800_rfcsr_write(rt2x00dev, 59,
  88. + r59_non_bt[idx]);
  89. + } else if (rt2x00_rt(rt2x00dev, RT5350)) {
  90. + static const char r59_non_bt[] = {0x0b, 0x0b,
  91. + 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0a,
  92. + 0x0a, 0x09, 0x08, 0x07, 0x07, 0x06};
  93. - rt2800_rfcsr_write(rt2x00dev, 59, r59_bt[idx]);
  94. - }
  95. - } else {
  96. - if (rt2x00_rt_rev_gte(rt2x00dev, RT5390, REV_RT5390F)) {
  97. - static const char r55_nonbt_rev[] = {0x23, 0x23,
  98. - 0x23, 0x23, 0x13, 0x13, 0x03, 0x03,
  99. - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03};
  100. - static const char r59_nonbt_rev[] = {0x07, 0x07,
  101. - 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
  102. - 0x07, 0x07, 0x06, 0x05, 0x04, 0x04};
  103. -
  104. - rt2800_rfcsr_write(rt2x00dev, 55,
  105. - r55_nonbt_rev[idx]);
  106. - rt2800_rfcsr_write(rt2x00dev, 59,
  107. - r59_nonbt_rev[idx]);
  108. - } else if (rt2x00_rt(rt2x00dev, RT5390) ||
  109. - rt2x00_rt(rt2x00dev, RT5392) ||
  110. - rt2x00_rt(rt2x00dev, RT6352)) {
  111. - static const char r59_non_bt[] = {0x8f, 0x8f,
  112. - 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8d,
  113. - 0x8a, 0x88, 0x88, 0x87, 0x87, 0x86};
  114. -
  115. - rt2800_rfcsr_write(rt2x00dev, 59,
  116. - r59_non_bt[idx]);
  117. - } else if (rt2x00_rt(rt2x00dev, RT5350)) {
  118. - static const char r59_non_bt[] = {0x0b, 0x0b,
  119. - 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0a,
  120. - 0x0a, 0x09, 0x08, 0x07, 0x07, 0x06};
  121. -
  122. - rt2800_rfcsr_write(rt2x00dev, 59,
  123. - r59_non_bt[idx]);
  124. - }
  125. + rt2800_rfcsr_write(rt2x00dev, 59,
  126. + r59_non_bt[idx]);
  127. }
  128. }
  129. }