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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. From 0bffbc98e6999bba38d8185a0ddb1ee77369eaec 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. ---
  13. .../net/wireless/ralink/rt2x00/rt2800lib.c | 103 +++++++++---------
  14. 1 file changed, 50 insertions(+), 53 deletions(-)
  15. --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
  16. +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
  17. @@ -2966,6 +2966,7 @@ static void rt2800_config_channel_rf53xx
  18. struct channel_info *info)
  19. {
  20. u8 rfcsr;
  21. + int idx = rf->channel-1;
  22. rt2800_rfcsr_write(rt2x00dev, 8, rf->rf1);
  23. rt2800_rfcsr_write(rt2x00dev, 9, rf->rf3);
  24. @@ -3003,60 +3004,56 @@ static void rt2800_config_channel_rf53xx
  25. rt2800_freq_cal_mode1(rt2x00dev);
  26. - if (rf->channel <= 14) {
  27. - int idx = rf->channel-1;
  28. + if (rt2x00_has_cap_bt_coexist(rt2x00dev)) {
  29. + if (rt2x00_rt_rev_gte(rt2x00dev, RT5390, REV_RT5390F)) {
  30. + /* r55/r59 value array of channel 1~14 */
  31. + static const char r55_bt_rev[] = {0x83, 0x83,
  32. + 0x83, 0x73, 0x73, 0x63, 0x53, 0x53,
  33. + 0x53, 0x43, 0x43, 0x43, 0x43, 0x43};
  34. + static const char r59_bt_rev[] = {0x0e, 0x0e,
  35. + 0x0e, 0x0e, 0x0e, 0x0b, 0x0a, 0x09,
  36. + 0x07, 0x07, 0x07, 0x07, 0x07, 0x07};
  37. +
  38. + rt2800_rfcsr_write(rt2x00dev, 55,
  39. + r55_bt_rev[idx]);
  40. + rt2800_rfcsr_write(rt2x00dev, 59,
  41. + r59_bt_rev[idx]);
  42. + } else {
  43. + static const char r59_bt[] = {0x8b, 0x8b, 0x8b,
  44. + 0x8b, 0x8b, 0x8b, 0x8b, 0x8a, 0x89,
  45. + 0x88, 0x88, 0x86, 0x85, 0x84};
  46. - if (rt2x00_has_cap_bt_coexist(rt2x00dev)) {
  47. - if (rt2x00_rt_rev_gte(rt2x00dev, RT5390, REV_RT5390F)) {
  48. - /* r55/r59 value array of channel 1~14 */
  49. - static const char r55_bt_rev[] = {0x83, 0x83,
  50. - 0x83, 0x73, 0x73, 0x63, 0x53, 0x53,
  51. - 0x53, 0x43, 0x43, 0x43, 0x43, 0x43};
  52. - static const char r59_bt_rev[] = {0x0e, 0x0e,
  53. - 0x0e, 0x0e, 0x0e, 0x0b, 0x0a, 0x09,
  54. - 0x07, 0x07, 0x07, 0x07, 0x07, 0x07};
  55. -
  56. - rt2800_rfcsr_write(rt2x00dev, 55,
  57. - r55_bt_rev[idx]);
  58. - rt2800_rfcsr_write(rt2x00dev, 59,
  59. - r59_bt_rev[idx]);
  60. - } else {
  61. - static const char r59_bt[] = {0x8b, 0x8b, 0x8b,
  62. - 0x8b, 0x8b, 0x8b, 0x8b, 0x8a, 0x89,
  63. - 0x88, 0x88, 0x86, 0x85, 0x84};
  64. + rt2800_rfcsr_write(rt2x00dev, 59, r59_bt[idx]);
  65. + }
  66. + } else {
  67. + if (rt2x00_rt_rev_gte(rt2x00dev, RT5390, REV_RT5390F)) {
  68. + static const char r55_nonbt_rev[] = {0x23, 0x23,
  69. + 0x23, 0x23, 0x13, 0x13, 0x03, 0x03,
  70. + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03};
  71. + static const char r59_nonbt_rev[] = {0x07, 0x07,
  72. + 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
  73. + 0x07, 0x07, 0x06, 0x05, 0x04, 0x04};
  74. +
  75. + rt2800_rfcsr_write(rt2x00dev, 55,
  76. + r55_nonbt_rev[idx]);
  77. + rt2800_rfcsr_write(rt2x00dev, 59,
  78. + r59_nonbt_rev[idx]);
  79. + } else if (rt2x00_rt(rt2x00dev, RT5390) ||
  80. + rt2x00_rt(rt2x00dev, RT5392) ||
  81. + rt2x00_rt(rt2x00dev, RT6352)) {
  82. + static const char r59_non_bt[] = {0x8f, 0x8f,
  83. + 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8d,
  84. + 0x8a, 0x88, 0x88, 0x87, 0x87, 0x86};
  85. +
  86. + rt2800_rfcsr_write(rt2x00dev, 59,
  87. + r59_non_bt[idx]);
  88. + } else if (rt2x00_rt(rt2x00dev, RT5350)) {
  89. + static const char r59_non_bt[] = {0x0b, 0x0b,
  90. + 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0a,
  91. + 0x0a, 0x09, 0x08, 0x07, 0x07, 0x06};
  92. - rt2800_rfcsr_write(rt2x00dev, 59, r59_bt[idx]);
  93. - }
  94. - } else {
  95. - if (rt2x00_rt_rev_gte(rt2x00dev, RT5390, REV_RT5390F)) {
  96. - static const char r55_nonbt_rev[] = {0x23, 0x23,
  97. - 0x23, 0x23, 0x13, 0x13, 0x03, 0x03,
  98. - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03};
  99. - static const char r59_nonbt_rev[] = {0x07, 0x07,
  100. - 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
  101. - 0x07, 0x07, 0x06, 0x05, 0x04, 0x04};
  102. -
  103. - rt2800_rfcsr_write(rt2x00dev, 55,
  104. - r55_nonbt_rev[idx]);
  105. - rt2800_rfcsr_write(rt2x00dev, 59,
  106. - r59_nonbt_rev[idx]);
  107. - } else if (rt2x00_rt(rt2x00dev, RT5390) ||
  108. - rt2x00_rt(rt2x00dev, RT5392) ||
  109. - rt2x00_rt(rt2x00dev, RT6352)) {
  110. - static const char r59_non_bt[] = {0x8f, 0x8f,
  111. - 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8d,
  112. - 0x8a, 0x88, 0x88, 0x87, 0x87, 0x86};
  113. -
  114. - rt2800_rfcsr_write(rt2x00dev, 59,
  115. - r59_non_bt[idx]);
  116. - } else if (rt2x00_rt(rt2x00dev, RT5350)) {
  117. - static const char r59_non_bt[] = {0x0b, 0x0b,
  118. - 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0a,
  119. - 0x0a, 0x09, 0x08, 0x07, 0x07, 0x06};
  120. -
  121. - rt2800_rfcsr_write(rt2x00dev, 59,
  122. - r59_non_bt[idx]);
  123. - }
  124. + rt2800_rfcsr_write(rt2x00dev, 59,
  125. + r59_non_bt[idx]);
  126. }
  127. }
  128. }