Commit 3e5a7c98 authored by David S. Miller's avatar David S. Miller

Merge tag 'wireless-drivers-for-davem-2019-02-04' of...

Merge tag 'wireless-drivers-for-davem-2019-02-04' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers

Kalle Valo says:

====================
wireless-drivers fixes for 5.0

First set of small, but importnat, fixes for 5.0.

iwlwifi

* fix a build regression introduced in 5.0-rc1

wlcore

* fix a firmware regression from v4.18-rc1

mt76x0

* fix for configuring tx power from user space

ath10k

* fix wcn3990 regression from v4.20-rc1
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 277aa590 8c22d81d
...@@ -12873,6 +12873,13 @@ F: Documentation/devicetree/bindings/net/dsa/realtek-smi.txt ...@@ -12873,6 +12873,13 @@ F: Documentation/devicetree/bindings/net/dsa/realtek-smi.txt
F: drivers/net/dsa/realtek-smi* F: drivers/net/dsa/realtek-smi*
F: drivers/net/dsa/rtl83* F: drivers/net/dsa/rtl83*
REDPINE WIRELESS DRIVER
M: Amitkumar Karwar <amitkarwar@gmail.com>
M: Siva Rebbagondla <siva8118@gmail.com>
L: linux-wireless@vger.kernel.org
S: Maintained
F: drivers/net/wireless/rsi/
REGISTER MAP ABSTRACTION REGISTER MAP ABSTRACTION
M: Mark Brown <broonie@kernel.org> M: Mark Brown <broonie@kernel.org>
L: linux-kernel@vger.kernel.org L: linux-kernel@vger.kernel.org
......
...@@ -548,7 +548,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { ...@@ -548,7 +548,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
{ {
.id = WCN3990_HW_1_0_DEV_VERSION, .id = WCN3990_HW_1_0_DEV_VERSION,
.dev_id = 0, .dev_id = 0,
.bus = ATH10K_BUS_PCI, .bus = ATH10K_BUS_SNOC,
.name = "wcn3990 hw1.0", .name = "wcn3990 hw1.0",
.continuous_frag_desc = true, .continuous_frag_desc = true,
.tx_chain_mask = 0x7, .tx_chain_mask = 0x7,
......
config IWLWIFI config IWLWIFI
tristate "Intel Wireless WiFi Next Gen AGN - Wireless-N/Advanced-N/Ultimate-N (iwlwifi) " tristate "Intel Wireless WiFi Next Gen AGN - Wireless-N/Advanced-N/Ultimate-N (iwlwifi) "
depends on PCI && HAS_IOMEM depends on PCI && HAS_IOMEM && CFG80211
select FW_LOADER select FW_LOADER
---help--- ---help---
Select to build the driver supporting the: Select to build the driver supporting the:
...@@ -47,6 +47,7 @@ if IWLWIFI ...@@ -47,6 +47,7 @@ if IWLWIFI
config IWLWIFI_LEDS config IWLWIFI_LEDS
bool bool
depends on LEDS_CLASS=y || LEDS_CLASS=IWLWIFI depends on LEDS_CLASS=y || LEDS_CLASS=IWLWIFI
depends on IWLMVM || IWLDVM
select LEDS_TRIGGERS select LEDS_TRIGGERS
select MAC80211_LEDS select MAC80211_LEDS
default y default y
......
...@@ -212,24 +212,24 @@ void mt76x0_get_tx_power_per_rate(struct mt76x02_dev *dev) ...@@ -212,24 +212,24 @@ void mt76x0_get_tx_power_per_rate(struct mt76x02_dev *dev)
mt76x02_add_rate_power_offset(t, delta); mt76x02_add_rate_power_offset(t, delta);
} }
void mt76x0_get_power_info(struct mt76x02_dev *dev, u8 *info) void mt76x0_get_power_info(struct mt76x02_dev *dev, s8 *tp)
{ {
struct mt76x0_chan_map { struct mt76x0_chan_map {
u8 chan; u8 chan;
u8 offset; u8 offset;
} chan_map[] = { } chan_map[] = {
{ 2, 0 }, { 4, 1 }, { 6, 2 }, { 8, 3 }, { 2, 0 }, { 4, 2 }, { 6, 4 }, { 8, 6 },
{ 10, 4 }, { 12, 5 }, { 14, 6 }, { 38, 0 }, { 10, 8 }, { 12, 10 }, { 14, 12 }, { 38, 0 },
{ 44, 1 }, { 48, 2 }, { 54, 3 }, { 60, 4 }, { 44, 2 }, { 48, 4 }, { 54, 6 }, { 60, 8 },
{ 64, 5 }, { 102, 6 }, { 108, 7 }, { 112, 8 }, { 64, 10 }, { 102, 12 }, { 108, 14 }, { 112, 16 },
{ 118, 9 }, { 124, 10 }, { 128, 11 }, { 134, 12 }, { 118, 18 }, { 124, 20 }, { 128, 22 }, { 134, 24 },
{ 140, 13 }, { 151, 14 }, { 157, 15 }, { 161, 16 }, { 140, 26 }, { 151, 28 }, { 157, 30 }, { 161, 32 },
{ 167, 17 }, { 171, 18 }, { 173, 19 }, { 167, 34 }, { 171, 36 }, { 175, 38 },
}; };
struct ieee80211_channel *chan = dev->mt76.chandef.chan; struct ieee80211_channel *chan = dev->mt76.chandef.chan;
u8 offset, addr; u8 offset, addr;
int i, idx = 0;
u16 data; u16 data;
int i;
if (mt76x0_tssi_enabled(dev)) { if (mt76x0_tssi_enabled(dev)) {
s8 target_power; s8 target_power;
...@@ -239,14 +239,14 @@ void mt76x0_get_power_info(struct mt76x02_dev *dev, u8 *info) ...@@ -239,14 +239,14 @@ void mt76x0_get_power_info(struct mt76x02_dev *dev, u8 *info)
else else
data = mt76x02_eeprom_get(dev, MT_EE_2G_TARGET_POWER); data = mt76x02_eeprom_get(dev, MT_EE_2G_TARGET_POWER);
target_power = (data & 0xff) - dev->mt76.rate_power.ofdm[7]; target_power = (data & 0xff) - dev->mt76.rate_power.ofdm[7];
info[0] = target_power + mt76x0_get_delta(dev); *tp = target_power + mt76x0_get_delta(dev);
info[1] = 0;
return; return;
} }
for (i = 0; i < ARRAY_SIZE(chan_map); i++) { for (i = 0; i < ARRAY_SIZE(chan_map); i++) {
if (chan_map[i].chan <= chan->hw_value) { if (chan->hw_value <= chan_map[i].chan) {
idx = (chan->hw_value == chan_map[i].chan);
offset = chan_map[i].offset; offset = chan_map[i].offset;
break; break;
} }
...@@ -258,13 +258,16 @@ void mt76x0_get_power_info(struct mt76x02_dev *dev, u8 *info) ...@@ -258,13 +258,16 @@ void mt76x0_get_power_info(struct mt76x02_dev *dev, u8 *info)
addr = MT_EE_TX_POWER_DELTA_BW80 + offset; addr = MT_EE_TX_POWER_DELTA_BW80 + offset;
} else { } else {
switch (chan->hw_value) { switch (chan->hw_value) {
case 42:
offset = 2;
break;
case 58: case 58:
offset = 8; offset = 8;
break; break;
case 106: case 106:
offset = 14; offset = 14;
break; break;
case 112: case 122:
offset = 20; offset = 20;
break; break;
case 155: case 155:
...@@ -277,14 +280,9 @@ void mt76x0_get_power_info(struct mt76x02_dev *dev, u8 *info) ...@@ -277,14 +280,9 @@ void mt76x0_get_power_info(struct mt76x02_dev *dev, u8 *info)
} }
data = mt76x02_eeprom_get(dev, addr); data = mt76x02_eeprom_get(dev, addr);
*tp = data >> (8 * idx);
info[0] = data; if (*tp < 0 || *tp > 0x3f)
if (!info[0] || info[0] > 0x3f) *tp = 5;
info[0] = 5;
info[1] = data >> 8;
if (!info[1] || info[1] > 0x3f)
info[1] = 5;
} }
static int mt76x0_check_eeprom(struct mt76x02_dev *dev) static int mt76x0_check_eeprom(struct mt76x02_dev *dev)
......
...@@ -26,7 +26,7 @@ struct mt76x02_dev; ...@@ -26,7 +26,7 @@ struct mt76x02_dev;
int mt76x0_eeprom_init(struct mt76x02_dev *dev); int mt76x0_eeprom_init(struct mt76x02_dev *dev);
void mt76x0_read_rx_gain(struct mt76x02_dev *dev); void mt76x0_read_rx_gain(struct mt76x02_dev *dev);
void mt76x0_get_tx_power_per_rate(struct mt76x02_dev *dev); void mt76x0_get_tx_power_per_rate(struct mt76x02_dev *dev);
void mt76x0_get_power_info(struct mt76x02_dev *dev, u8 *info); void mt76x0_get_power_info(struct mt76x02_dev *dev, s8 *tp);
static inline s8 s6_to_s8(u32 val) static inline s8 s6_to_s8(u32 val)
{ {
......
...@@ -845,17 +845,17 @@ static void mt76x0_phy_tssi_calibrate(struct mt76x02_dev *dev) ...@@ -845,17 +845,17 @@ static void mt76x0_phy_tssi_calibrate(struct mt76x02_dev *dev)
void mt76x0_phy_set_txpower(struct mt76x02_dev *dev) void mt76x0_phy_set_txpower(struct mt76x02_dev *dev)
{ {
struct mt76_rate_power *t = &dev->mt76.rate_power; struct mt76_rate_power *t = &dev->mt76.rate_power;
u8 info[2]; s8 info;
mt76x0_get_tx_power_per_rate(dev); mt76x0_get_tx_power_per_rate(dev);
mt76x0_get_power_info(dev, info); mt76x0_get_power_info(dev, &info);
mt76x02_add_rate_power_offset(t, info[0]); mt76x02_add_rate_power_offset(t, info);
mt76x02_limit_rate_power(t, dev->mt76.txpower_conf); mt76x02_limit_rate_power(t, dev->mt76.txpower_conf);
dev->mt76.txpower_cur = mt76x02_get_max_rate_power(t); dev->mt76.txpower_cur = mt76x02_get_max_rate_power(t);
mt76x02_add_rate_power_offset(t, -info[0]); mt76x02_add_rate_power_offset(t, -info);
mt76x02_phy_set_txpower(dev, info[0], info[1]); mt76x02_phy_set_txpower(dev, info, info);
} }
void mt76x0_phy_calibrate(struct mt76x02_dev *dev, bool power_on) void mt76x0_phy_calibrate(struct mt76x02_dev *dev, bool power_on)
......
...@@ -164,6 +164,12 @@ static int wl12xx_sdio_power_on(struct wl12xx_sdio_glue *glue) ...@@ -164,6 +164,12 @@ static int wl12xx_sdio_power_on(struct wl12xx_sdio_glue *glue)
} }
sdio_claim_host(func); sdio_claim_host(func);
/*
* To guarantee that the SDIO card is power cycled, as required to make
* the FW programming to succeed, let's do a brute force HW reset.
*/
mmc_hw_reset(card->host);
sdio_enable_func(func); sdio_enable_func(func);
sdio_release_host(func); sdio_release_host(func);
...@@ -174,20 +180,13 @@ static int wl12xx_sdio_power_off(struct wl12xx_sdio_glue *glue) ...@@ -174,20 +180,13 @@ static int wl12xx_sdio_power_off(struct wl12xx_sdio_glue *glue)
{ {
struct sdio_func *func = dev_to_sdio_func(glue->dev); struct sdio_func *func = dev_to_sdio_func(glue->dev);
struct mmc_card *card = func->card; struct mmc_card *card = func->card;
int error;
sdio_claim_host(func); sdio_claim_host(func);
sdio_disable_func(func); sdio_disable_func(func);
sdio_release_host(func); sdio_release_host(func);
/* Let runtime PM know the card is powered off */ /* Let runtime PM know the card is powered off */
error = pm_runtime_put(&card->dev); pm_runtime_put(&card->dev);
if (error < 0 && error != -EBUSY) {
dev_err(&card->dev, "%s failed: %i\n", __func__, error);
return error;
}
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment