ath9k: Remove redundant variable assignment
Set main_gaintb and alt_gaintb once instead of zero'ing them in every case. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
915154b62b
commit
d85ed4196e
|
@ -311,6 +311,9 @@ static void ath_ant_div_conf_fast_divbias(struct ath_hw_antcomb_conf *ant_conf,
|
||||||
struct ath_ant_comb *antcomb,
|
struct ath_ant_comb *antcomb,
|
||||||
int alt_ratio)
|
int alt_ratio)
|
||||||
{
|
{
|
||||||
|
ant_conf->main_gaintb = 0;
|
||||||
|
ant_conf->alt_gaintb = 0;
|
||||||
|
|
||||||
if (ant_conf->div_group == 0) {
|
if (ant_conf->div_group == 0) {
|
||||||
/* Adjust the fast_div_bias based on main and alt lna conf */
|
/* Adjust the fast_div_bias based on main and alt lna conf */
|
||||||
switch ((ant_conf->main_lna_conf << 4) |
|
switch ((ant_conf->main_lna_conf << 4) |
|
||||||
|
@ -360,18 +363,12 @@ static void ath_ant_div_conf_fast_divbias(struct ath_hw_antcomb_conf *ant_conf,
|
||||||
ant_conf->alt_lna_conf) {
|
ant_conf->alt_lna_conf) {
|
||||||
case 0x01: /* A-B LNA2 */
|
case 0x01: /* A-B LNA2 */
|
||||||
ant_conf->fast_div_bias = 0x1;
|
ant_conf->fast_div_bias = 0x1;
|
||||||
ant_conf->main_gaintb = 0;
|
|
||||||
ant_conf->alt_gaintb = 0;
|
|
||||||
break;
|
break;
|
||||||
case 0x02: /* A-B LNA1 */
|
case 0x02: /* A-B LNA1 */
|
||||||
ant_conf->fast_div_bias = 0x1;
|
ant_conf->fast_div_bias = 0x1;
|
||||||
ant_conf->main_gaintb = 0;
|
|
||||||
ant_conf->alt_gaintb = 0;
|
|
||||||
break;
|
break;
|
||||||
case 0x03: /* A-B A+B */
|
case 0x03: /* A-B A+B */
|
||||||
ant_conf->fast_div_bias = 0x1;
|
ant_conf->fast_div_bias = 0x1;
|
||||||
ant_conf->main_gaintb = 0;
|
|
||||||
ant_conf->alt_gaintb = 0;
|
|
||||||
break;
|
break;
|
||||||
case 0x10: /* LNA2 A-B */
|
case 0x10: /* LNA2 A-B */
|
||||||
if (!(antcomb->scan) &&
|
if (!(antcomb->scan) &&
|
||||||
|
@ -379,13 +376,9 @@ static void ath_ant_div_conf_fast_divbias(struct ath_hw_antcomb_conf *ant_conf,
|
||||||
ant_conf->fast_div_bias = 0x3f;
|
ant_conf->fast_div_bias = 0x3f;
|
||||||
else
|
else
|
||||||
ant_conf->fast_div_bias = 0x1;
|
ant_conf->fast_div_bias = 0x1;
|
||||||
ant_conf->main_gaintb = 0;
|
|
||||||
ant_conf->alt_gaintb = 0;
|
|
||||||
break;
|
break;
|
||||||
case 0x12: /* LNA2 LNA1 */
|
case 0x12: /* LNA2 LNA1 */
|
||||||
ant_conf->fast_div_bias = 0x1;
|
ant_conf->fast_div_bias = 0x1;
|
||||||
ant_conf->main_gaintb = 0;
|
|
||||||
ant_conf->alt_gaintb = 0;
|
|
||||||
break;
|
break;
|
||||||
case 0x13: /* LNA2 A+B */
|
case 0x13: /* LNA2 A+B */
|
||||||
if (!(antcomb->scan) &&
|
if (!(antcomb->scan) &&
|
||||||
|
@ -393,8 +386,6 @@ static void ath_ant_div_conf_fast_divbias(struct ath_hw_antcomb_conf *ant_conf,
|
||||||
ant_conf->fast_div_bias = 0x3f;
|
ant_conf->fast_div_bias = 0x3f;
|
||||||
else
|
else
|
||||||
ant_conf->fast_div_bias = 0x1;
|
ant_conf->fast_div_bias = 0x1;
|
||||||
ant_conf->main_gaintb = 0;
|
|
||||||
ant_conf->alt_gaintb = 0;
|
|
||||||
break;
|
break;
|
||||||
case 0x20: /* LNA1 A-B */
|
case 0x20: /* LNA1 A-B */
|
||||||
if (!(antcomb->scan) &&
|
if (!(antcomb->scan) &&
|
||||||
|
@ -402,13 +393,9 @@ static void ath_ant_div_conf_fast_divbias(struct ath_hw_antcomb_conf *ant_conf,
|
||||||
ant_conf->fast_div_bias = 0x3f;
|
ant_conf->fast_div_bias = 0x3f;
|
||||||
else
|
else
|
||||||
ant_conf->fast_div_bias = 0x1;
|
ant_conf->fast_div_bias = 0x1;
|
||||||
ant_conf->main_gaintb = 0;
|
|
||||||
ant_conf->alt_gaintb = 0;
|
|
||||||
break;
|
break;
|
||||||
case 0x21: /* LNA1 LNA2 */
|
case 0x21: /* LNA1 LNA2 */
|
||||||
ant_conf->fast_div_bias = 0x1;
|
ant_conf->fast_div_bias = 0x1;
|
||||||
ant_conf->main_gaintb = 0;
|
|
||||||
ant_conf->alt_gaintb = 0;
|
|
||||||
break;
|
break;
|
||||||
case 0x23: /* LNA1 A+B */
|
case 0x23: /* LNA1 A+B */
|
||||||
if (!(antcomb->scan) &&
|
if (!(antcomb->scan) &&
|
||||||
|
@ -416,23 +403,15 @@ static void ath_ant_div_conf_fast_divbias(struct ath_hw_antcomb_conf *ant_conf,
|
||||||
ant_conf->fast_div_bias = 0x3f;
|
ant_conf->fast_div_bias = 0x3f;
|
||||||
else
|
else
|
||||||
ant_conf->fast_div_bias = 0x1;
|
ant_conf->fast_div_bias = 0x1;
|
||||||
ant_conf->main_gaintb = 0;
|
|
||||||
ant_conf->alt_gaintb = 0;
|
|
||||||
break;
|
break;
|
||||||
case 0x30: /* A+B A-B */
|
case 0x30: /* A+B A-B */
|
||||||
ant_conf->fast_div_bias = 0x1;
|
ant_conf->fast_div_bias = 0x1;
|
||||||
ant_conf->main_gaintb = 0;
|
|
||||||
ant_conf->alt_gaintb = 0;
|
|
||||||
break;
|
break;
|
||||||
case 0x31: /* A+B LNA2 */
|
case 0x31: /* A+B LNA2 */
|
||||||
ant_conf->fast_div_bias = 0x1;
|
ant_conf->fast_div_bias = 0x1;
|
||||||
ant_conf->main_gaintb = 0;
|
|
||||||
ant_conf->alt_gaintb = 0;
|
|
||||||
break;
|
break;
|
||||||
case 0x32: /* A+B LNA1 */
|
case 0x32: /* A+B LNA1 */
|
||||||
ant_conf->fast_div_bias = 0x1;
|
ant_conf->fast_div_bias = 0x1;
|
||||||
ant_conf->main_gaintb = 0;
|
|
||||||
ant_conf->alt_gaintb = 0;
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -443,18 +422,12 @@ static void ath_ant_div_conf_fast_divbias(struct ath_hw_antcomb_conf *ant_conf,
|
||||||
ant_conf->alt_lna_conf) {
|
ant_conf->alt_lna_conf) {
|
||||||
case 0x01: /* A-B LNA2 */
|
case 0x01: /* A-B LNA2 */
|
||||||
ant_conf->fast_div_bias = 0x1;
|
ant_conf->fast_div_bias = 0x1;
|
||||||
ant_conf->main_gaintb = 0;
|
|
||||||
ant_conf->alt_gaintb = 0;
|
|
||||||
break;
|
break;
|
||||||
case 0x02: /* A-B LNA1 */
|
case 0x02: /* A-B LNA1 */
|
||||||
ant_conf->fast_div_bias = 0x1;
|
ant_conf->fast_div_bias = 0x1;
|
||||||
ant_conf->main_gaintb = 0;
|
|
||||||
ant_conf->alt_gaintb = 0;
|
|
||||||
break;
|
break;
|
||||||
case 0x03: /* A-B A+B */
|
case 0x03: /* A-B A+B */
|
||||||
ant_conf->fast_div_bias = 0x1;
|
ant_conf->fast_div_bias = 0x1;
|
||||||
ant_conf->main_gaintb = 0;
|
|
||||||
ant_conf->alt_gaintb = 0;
|
|
||||||
break;
|
break;
|
||||||
case 0x10: /* LNA2 A-B */
|
case 0x10: /* LNA2 A-B */
|
||||||
if (!(antcomb->scan) &&
|
if (!(antcomb->scan) &&
|
||||||
|
@ -462,13 +435,9 @@ static void ath_ant_div_conf_fast_divbias(struct ath_hw_antcomb_conf *ant_conf,
|
||||||
ant_conf->fast_div_bias = 0x1;
|
ant_conf->fast_div_bias = 0x1;
|
||||||
else
|
else
|
||||||
ant_conf->fast_div_bias = 0x2;
|
ant_conf->fast_div_bias = 0x2;
|
||||||
ant_conf->main_gaintb = 0;
|
|
||||||
ant_conf->alt_gaintb = 0;
|
|
||||||
break;
|
break;
|
||||||
case 0x12: /* LNA2 LNA1 */
|
case 0x12: /* LNA2 LNA1 */
|
||||||
ant_conf->fast_div_bias = 0x1;
|
ant_conf->fast_div_bias = 0x1;
|
||||||
ant_conf->main_gaintb = 0;
|
|
||||||
ant_conf->alt_gaintb = 0;
|
|
||||||
break;
|
break;
|
||||||
case 0x13: /* LNA2 A+B */
|
case 0x13: /* LNA2 A+B */
|
||||||
if (!(antcomb->scan) &&
|
if (!(antcomb->scan) &&
|
||||||
|
@ -476,8 +445,6 @@ static void ath_ant_div_conf_fast_divbias(struct ath_hw_antcomb_conf *ant_conf,
|
||||||
ant_conf->fast_div_bias = 0x1;
|
ant_conf->fast_div_bias = 0x1;
|
||||||
else
|
else
|
||||||
ant_conf->fast_div_bias = 0x2;
|
ant_conf->fast_div_bias = 0x2;
|
||||||
ant_conf->main_gaintb = 0;
|
|
||||||
ant_conf->alt_gaintb = 0;
|
|
||||||
break;
|
break;
|
||||||
case 0x20: /* LNA1 A-B */
|
case 0x20: /* LNA1 A-B */
|
||||||
if (!(antcomb->scan) &&
|
if (!(antcomb->scan) &&
|
||||||
|
@ -485,13 +452,9 @@ static void ath_ant_div_conf_fast_divbias(struct ath_hw_antcomb_conf *ant_conf,
|
||||||
ant_conf->fast_div_bias = 0x1;
|
ant_conf->fast_div_bias = 0x1;
|
||||||
else
|
else
|
||||||
ant_conf->fast_div_bias = 0x2;
|
ant_conf->fast_div_bias = 0x2;
|
||||||
ant_conf->main_gaintb = 0;
|
|
||||||
ant_conf->alt_gaintb = 0;
|
|
||||||
break;
|
break;
|
||||||
case 0x21: /* LNA1 LNA2 */
|
case 0x21: /* LNA1 LNA2 */
|
||||||
ant_conf->fast_div_bias = 0x1;
|
ant_conf->fast_div_bias = 0x1;
|
||||||
ant_conf->main_gaintb = 0;
|
|
||||||
ant_conf->alt_gaintb = 0;
|
|
||||||
break;
|
break;
|
||||||
case 0x23: /* LNA1 A+B */
|
case 0x23: /* LNA1 A+B */
|
||||||
if (!(antcomb->scan) &&
|
if (!(antcomb->scan) &&
|
||||||
|
@ -499,23 +462,15 @@ static void ath_ant_div_conf_fast_divbias(struct ath_hw_antcomb_conf *ant_conf,
|
||||||
ant_conf->fast_div_bias = 0x1;
|
ant_conf->fast_div_bias = 0x1;
|
||||||
else
|
else
|
||||||
ant_conf->fast_div_bias = 0x2;
|
ant_conf->fast_div_bias = 0x2;
|
||||||
ant_conf->main_gaintb = 0;
|
|
||||||
ant_conf->alt_gaintb = 0;
|
|
||||||
break;
|
break;
|
||||||
case 0x30: /* A+B A-B */
|
case 0x30: /* A+B A-B */
|
||||||
ant_conf->fast_div_bias = 0x1;
|
ant_conf->fast_div_bias = 0x1;
|
||||||
ant_conf->main_gaintb = 0;
|
|
||||||
ant_conf->alt_gaintb = 0;
|
|
||||||
break;
|
break;
|
||||||
case 0x31: /* A+B LNA2 */
|
case 0x31: /* A+B LNA2 */
|
||||||
ant_conf->fast_div_bias = 0x1;
|
ant_conf->fast_div_bias = 0x1;
|
||||||
ant_conf->main_gaintb = 0;
|
|
||||||
ant_conf->alt_gaintb = 0;
|
|
||||||
break;
|
break;
|
||||||
case 0x32: /* A+B LNA1 */
|
case 0x32: /* A+B LNA1 */
|
||||||
ant_conf->fast_div_bias = 0x1;
|
ant_conf->fast_div_bias = 0x1;
|
||||||
ant_conf->main_gaintb = 0;
|
|
||||||
ant_conf->alt_gaintb = 0;
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue