diff options
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2800lib.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2800lib.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c index 5cd096e2ae36..790afd3ed946 100644 --- a/drivers/net/wireless/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/rt2x00/rt2800lib.c | |||
@@ -1640,7 +1640,6 @@ static void rt2800_config_channel_rf53xx(struct rt2x00_dev *rt2x00dev, | |||
1640 | struct channel_info *info) | 1640 | struct channel_info *info) |
1641 | { | 1641 | { |
1642 | u8 rfcsr; | 1642 | u8 rfcsr; |
1643 | u16 eeprom; | ||
1644 | 1643 | ||
1645 | rt2800_rfcsr_write(rt2x00dev, 8, rf->rf1); | 1644 | rt2800_rfcsr_write(rt2x00dev, 8, rf->rf1); |
1646 | rt2800_rfcsr_write(rt2x00dev, 9, rf->rf3); | 1645 | rt2800_rfcsr_write(rt2x00dev, 9, rf->rf3); |
@@ -1670,11 +1669,10 @@ static void rt2800_config_channel_rf53xx(struct rt2x00_dev *rt2x00dev, | |||
1670 | rt2x00_set_field8(&rfcsr, RFCSR17_CODE, rt2x00dev->freq_offset); | 1669 | rt2x00_set_field8(&rfcsr, RFCSR17_CODE, rt2x00dev->freq_offset); |
1671 | rt2800_rfcsr_write(rt2x00dev, 17, rfcsr); | 1670 | rt2800_rfcsr_write(rt2x00dev, 17, rfcsr); |
1672 | 1671 | ||
1673 | rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC_CONF1, &eeprom); | ||
1674 | if (rf->channel <= 14) { | 1672 | if (rf->channel <= 14) { |
1675 | int idx = rf->channel-1; | 1673 | int idx = rf->channel-1; |
1676 | 1674 | ||
1677 | if (rt2x00_get_field16(eeprom, EEPROM_NIC_CONF1_BT_COEXIST)) { | 1675 | if (test_bit(CAPABILITY_BT_COEXIST, &rt2x00dev->cap_flags)) { |
1678 | if (rt2x00_rt_rev_gte(rt2x00dev, RT5390, REV_RT5390F)) { | 1676 | if (rt2x00_rt_rev_gte(rt2x00dev, RT5390, REV_RT5390F)) { |
1679 | /* r55/r59 value array of channel 1~14 */ | 1677 | /* r55/r59 value array of channel 1~14 */ |
1680 | static const char r55_bt_rev[] = {0x83, 0x83, | 1678 | static const char r55_bt_rev[] = {0x83, 0x83, |
@@ -2917,8 +2915,7 @@ static int rt2800_init_bbp(struct rt2x00_dev *rt2x00dev) | |||
2917 | ant = (div_mode == 3) ? 1 : 0; | 2915 | ant = (div_mode == 3) ? 1 : 0; |
2918 | 2916 | ||
2919 | /* check if this is a Bluetooth combo card */ | 2917 | /* check if this is a Bluetooth combo card */ |
2920 | rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC_CONF1, &eeprom); | 2918 | if (test_bit(CAPABILITY_BT_COEXIST, &rt2x00dev->cap_flags)) { |
2921 | if (rt2x00_get_field16(eeprom, EEPROM_NIC_CONF1_BT_COEXIST)) { | ||
2922 | u32 reg; | 2919 | u32 reg; |
2923 | 2920 | ||
2924 | rt2800_register_read(rt2x00dev, GPIO_CTRL_CFG, ®); | 2921 | rt2800_register_read(rt2x00dev, GPIO_CTRL_CFG, ®); |
@@ -3727,16 +3724,8 @@ int rt2800_init_eeprom(struct rt2x00_dev *rt2x00dev) | |||
3727 | } | 3724 | } |
3728 | 3725 | ||
3729 | /* | 3726 | /* |
3730 | * Read frequency offset and RF programming sequence. | 3727 | * Determine external LNA informations. |
3731 | */ | ||
3732 | rt2x00_eeprom_read(rt2x00dev, EEPROM_FREQ, &eeprom); | ||
3733 | rt2x00dev->freq_offset = rt2x00_get_field16(eeprom, EEPROM_FREQ_OFFSET); | ||
3734 | |||
3735 | /* | ||
3736 | * Read external LNA informations. | ||
3737 | */ | 3728 | */ |
3738 | rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC_CONF1, &eeprom); | ||
3739 | |||
3740 | if (rt2x00_get_field16(eeprom, EEPROM_NIC_CONF1_EXTERNAL_LNA_5G)) | 3729 | if (rt2x00_get_field16(eeprom, EEPROM_NIC_CONF1_EXTERNAL_LNA_5G)) |
3741 | __set_bit(CAPABILITY_EXTERNAL_LNA_A, &rt2x00dev->cap_flags); | 3730 | __set_bit(CAPABILITY_EXTERNAL_LNA_A, &rt2x00dev->cap_flags); |
3742 | if (rt2x00_get_field16(eeprom, EEPROM_NIC_CONF1_EXTERNAL_LNA_2G)) | 3731 | if (rt2x00_get_field16(eeprom, EEPROM_NIC_CONF1_EXTERNAL_LNA_2G)) |
@@ -3749,6 +3738,18 @@ int rt2800_init_eeprom(struct rt2x00_dev *rt2x00dev) | |||
3749 | __set_bit(CAPABILITY_HW_BUTTON, &rt2x00dev->cap_flags); | 3738 | __set_bit(CAPABILITY_HW_BUTTON, &rt2x00dev->cap_flags); |
3750 | 3739 | ||
3751 | /* | 3740 | /* |
3741 | * Detect if this device has Bluetooth co-existence. | ||
3742 | */ | ||
3743 | if (rt2x00_get_field16(eeprom, EEPROM_NIC_CONF1_BT_COEXIST)) | ||
3744 | __set_bit(CAPABILITY_BT_COEXIST, &rt2x00dev->cap_flags); | ||
3745 | |||
3746 | /* | ||
3747 | * Read frequency offset and RF programming sequence. | ||
3748 | */ | ||
3749 | rt2x00_eeprom_read(rt2x00dev, EEPROM_FREQ, &eeprom); | ||
3750 | rt2x00dev->freq_offset = rt2x00_get_field16(eeprom, EEPROM_FREQ_OFFSET); | ||
3751 | |||
3752 | /* | ||
3752 | * Store led settings, for correct led behaviour. | 3753 | * Store led settings, for correct led behaviour. |
3753 | */ | 3754 | */ |
3754 | #ifdef CONFIG_RT2X00_LIB_LEDS | 3755 | #ifdef CONFIG_RT2X00_LIB_LEDS |
@@ -3756,7 +3757,7 @@ int rt2800_init_eeprom(struct rt2x00_dev *rt2x00dev) | |||
3756 | rt2800_init_led(rt2x00dev, &rt2x00dev->led_assoc, LED_TYPE_ASSOC); | 3757 | rt2800_init_led(rt2x00dev, &rt2x00dev->led_assoc, LED_TYPE_ASSOC); |
3757 | rt2800_init_led(rt2x00dev, &rt2x00dev->led_qual, LED_TYPE_QUALITY); | 3758 | rt2800_init_led(rt2x00dev, &rt2x00dev->led_qual, LED_TYPE_QUALITY); |
3758 | 3759 | ||
3759 | rt2x00_eeprom_read(rt2x00dev, EEPROM_FREQ, &rt2x00dev->led_mcu_reg); | 3760 | rt2x00dev->led_mcu_reg = eeprom; |
3760 | #endif /* CONFIG_RT2X00_LIB_LEDS */ | 3761 | #endif /* CONFIG_RT2X00_LIB_LEDS */ |
3761 | 3762 | ||
3762 | /* | 3763 | /* |