rt2x00: Introduce capability flag for Bluetooth co-existence.
Use flag instead of re-reading the eeprom every time. Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
9328fdac49
commit
fdbc7b0a26
|
@ -1640,7 +1640,6 @@ static void rt2800_config_channel_rf53xx(struct rt2x00_dev *rt2x00dev,
|
||||||
struct channel_info *info)
|
struct channel_info *info)
|
||||||
{
|
{
|
||||||
u8 rfcsr;
|
u8 rfcsr;
|
||||||
u16 eeprom;
|
|
||||||
|
|
||||||
rt2800_rfcsr_write(rt2x00dev, 8, rf->rf1);
|
rt2800_rfcsr_write(rt2x00dev, 8, rf->rf1);
|
||||||
rt2800_rfcsr_write(rt2x00dev, 9, rf->rf3);
|
rt2800_rfcsr_write(rt2x00dev, 9, rf->rf3);
|
||||||
|
@ -1670,11 +1669,10 @@ static void rt2800_config_channel_rf53xx(struct rt2x00_dev *rt2x00dev,
|
||||||
rt2x00_set_field8(&rfcsr, RFCSR17_CODE, rt2x00dev->freq_offset);
|
rt2x00_set_field8(&rfcsr, RFCSR17_CODE, rt2x00dev->freq_offset);
|
||||||
rt2800_rfcsr_write(rt2x00dev, 17, rfcsr);
|
rt2800_rfcsr_write(rt2x00dev, 17, rfcsr);
|
||||||
|
|
||||||
rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC_CONF1, &eeprom);
|
|
||||||
if (rf->channel <= 14) {
|
if (rf->channel <= 14) {
|
||||||
int idx = rf->channel-1;
|
int idx = rf->channel-1;
|
||||||
|
|
||||||
if (rt2x00_get_field16(eeprom, EEPROM_NIC_CONF1_BT_COEXIST)) {
|
if (test_bit(CAPABILITY_BT_COEXIST, &rt2x00dev->cap_flags)) {
|
||||||
if (rt2x00_rt_rev_gte(rt2x00dev, RT5390, REV_RT5390F)) {
|
if (rt2x00_rt_rev_gte(rt2x00dev, RT5390, REV_RT5390F)) {
|
||||||
/* r55/r59 value array of channel 1~14 */
|
/* r55/r59 value array of channel 1~14 */
|
||||||
static const char r55_bt_rev[] = {0x83, 0x83,
|
static const char r55_bt_rev[] = {0x83, 0x83,
|
||||||
|
@ -2917,8 +2915,7 @@ static int rt2800_init_bbp(struct rt2x00_dev *rt2x00dev)
|
||||||
ant = (div_mode == 3) ? 1 : 0;
|
ant = (div_mode == 3) ? 1 : 0;
|
||||||
|
|
||||||
/* check if this is a Bluetooth combo card */
|
/* check if this is a Bluetooth combo card */
|
||||||
rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC_CONF1, &eeprom);
|
if (test_bit(CAPABILITY_BT_COEXIST, &rt2x00dev->cap_flags)) {
|
||||||
if (rt2x00_get_field16(eeprom, EEPROM_NIC_CONF1_BT_COEXIST)) {
|
|
||||||
u32 reg;
|
u32 reg;
|
||||||
|
|
||||||
rt2800_register_read(rt2x00dev, GPIO_CTRL_CFG, ®);
|
rt2800_register_read(rt2x00dev, GPIO_CTRL_CFG, ®);
|
||||||
|
@ -3740,6 +3737,12 @@ int rt2800_init_eeprom(struct rt2x00_dev *rt2x00dev)
|
||||||
if (rt2x00_get_field16(eeprom, EEPROM_NIC_CONF1_HW_RADIO))
|
if (rt2x00_get_field16(eeprom, EEPROM_NIC_CONF1_HW_RADIO))
|
||||||
__set_bit(CAPABILITY_HW_BUTTON, &rt2x00dev->cap_flags);
|
__set_bit(CAPABILITY_HW_BUTTON, &rt2x00dev->cap_flags);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Detect if this device has Bluetooth co-existence.
|
||||||
|
*/
|
||||||
|
if (rt2x00_get_field16(eeprom, EEPROM_NIC_CONF1_BT_COEXIST))
|
||||||
|
__set_bit(CAPABILITY_BT_COEXIST, &rt2x00dev->cap_flags);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Read frequency offset and RF programming sequence.
|
* Read frequency offset and RF programming sequence.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -697,6 +697,7 @@ enum rt2x00_capability_flags {
|
||||||
CAPABILITY_EXTERNAL_LNA_A,
|
CAPABILITY_EXTERNAL_LNA_A,
|
||||||
CAPABILITY_EXTERNAL_LNA_BG,
|
CAPABILITY_EXTERNAL_LNA_BG,
|
||||||
CAPABILITY_DOUBLE_ANTENNA,
|
CAPABILITY_DOUBLE_ANTENNA,
|
||||||
|
CAPABILITY_BT_COEXIST,
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue