diff --git a/arch/x86/include/asm/apicdef.h b/arch/x86/include/asm/apicdef.h index 05e694ed838642..4f65434cf2c9f2 100644 --- a/arch/x86/include/asm/apicdef.h +++ b/arch/x86/include/asm/apicdef.h @@ -16,7 +16,7 @@ * This is the IO-APIC register space as specified * by Intel docs: */ -#define IO_APIC_SLOT_SIZE 1024 +#define IO_APIC_SLOT_SIZE 68 #define APIC_ID 0x20 diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c b/drivers/gpu/drm/radeon/atombios_encoders.c index e67ed383e11b12..9ddf80040cb229 100644 --- a/drivers/gpu/drm/radeon/atombios_encoders.c +++ b/drivers/gpu/drm/radeon/atombios_encoders.c @@ -140,6 +140,7 @@ atombios_set_backlight_level(struct radeon_encoder *radeon_encoder, u8 level) static u8 radeon_atom_bl_level(struct backlight_device *bd) { + struct radeon_backlight_privdata *pdata = bl_get_data(bd); u8 level; /* Convert brightness to hardware level */ @@ -150,6 +151,9 @@ static u8 radeon_atom_bl_level(struct backlight_device *bd) else level = bd->props.brightness; + if (pdata->negative) + level = RADEON_MAX_BL_LEVEL - level; + return level; } @@ -169,8 +173,11 @@ static int radeon_atom_backlight_get_brightness(struct backlight_device *bd) struct radeon_encoder *radeon_encoder = pdata->encoder; struct drm_device *dev = radeon_encoder->base.dev; struct radeon_device *rdev = dev->dev_private; + u8 backlight_level; - return radeon_atom_get_backlight_level_from_reg(rdev); + backlight_level = radeon_atom_get_backlight_level_from_reg(rdev); + + return pdata->negative ? RADEON_MAX_BL_LEVEL - backlight_level : backlight_level; } static const struct backlight_ops radeon_atom_backlight_ops = { @@ -212,7 +219,7 @@ void radeon_atom_backlight_init(struct radeon_encoder *radeon_encoder, } memset(&props, 0, sizeof(props)); - props.max_brightness = RADEON_MAX_BL_LEVEL; + props.max_brightness = pdata->negative ? RADEON_MAX_BL_LEVEL - 1 : RADEON_MAX_BL_LEVEL; props.type = BACKLIGHT_RAW; snprintf(bl_name, sizeof(bl_name), "radeon_bl%d", dev->primary->index); diff --git a/drivers/net/wireless/ath/ath.h b/drivers/net/wireless/ath/ath.h index 7a364eca46d642..56d62587139e80 100644 --- a/drivers/net/wireless/ath/ath.h +++ b/drivers/net/wireless/ath/ath.h @@ -149,6 +149,7 @@ struct ath_common { int debug_mask; enum ath_device_state state; unsigned long op_flags; + u32 chan_bw; struct ath_ani ani; diff --git a/drivers/net/wireless/ath/ath9k/common-debug.c b/drivers/net/wireless/ath/ath9k/common-debug.c index 239429f103781c..0c60cfafd390aa 100644 --- a/drivers/net/wireless/ath/ath9k/common-debug.c +++ b/drivers/net/wireless/ath/ath9k/common-debug.c @@ -258,3 +258,33 @@ void ath9k_cmn_debug_phy_err(struct dentry *debugfs_phy, &fops_phy_err); } EXPORT_SYMBOL(ath9k_cmn_debug_phy_err); + +#ifdef CONFIG_ATH9K_DYNACK +static ssize_t read_file_ackto(struct file *file, char __user *user_buf, + size_t count, loff_t *ppos) +{ + struct ath_hw *ah = file->private_data; + char buf[32]; + unsigned int len; + + len = sprintf(buf, "%u %c\n", ah->dynack.ackto, + (ah->dynack.enabled) ? 'A' : 'S'); + + return simple_read_from_buffer(user_buf, count, ppos, buf, len); +} + +static const struct file_operations fops_ackto = { + .read = read_file_ackto, + .open = simple_open, + .owner = THIS_MODULE, + .llseek = default_llseek, +}; + +void ath9k_cmn_debug_ack_to(struct dentry *debugfs_phy, + struct ath_hw *ah) +{ + debugfs_create_file("ack_to", 0400, debugfs_phy, ah, &fops_ackto); +} +EXPORT_SYMBOL(ath9k_cmn_debug_ack_to); + +#endif diff --git a/drivers/net/wireless/ath/ath9k/common-debug.h b/drivers/net/wireless/ath/ath9k/common-debug.h index 3376990d3a2480..fc7bc43c61eece 100644 --- a/drivers/net/wireless/ath/ath9k/common-debug.h +++ b/drivers/net/wireless/ath/ath9k/common-debug.h @@ -71,6 +71,8 @@ void ath9k_cmn_debug_recv(struct dentry *debugfs_phy, struct ath_rx_stats *rxstats); void ath9k_cmn_debug_phy_err(struct dentry *debugfs_phy, struct ath_rx_stats *rxstats); +void ath9k_cmn_debug_ack_to(struct dentry *debugfs_phy, + struct ath_hw *ah); #else static inline void ath9k_cmn_debug_modal_eeprom(struct dentry *debugfs_phy, struct ath_hw *ah) @@ -96,4 +98,8 @@ static inline void ath9k_cmn_debug_phy_err(struct dentry *debugfs_phy, struct ath_rx_stats *rxstats) { } +static inline void ath9k_cmn_debug_ack_to(struct dentry *debugfs_phy, + struct ath_hw *ah); +{ +} #endif /* CONFIG_ATH9K_COMMON_DEBUG */ diff --git a/drivers/net/wireless/ath/ath9k/common.c b/drivers/net/wireless/ath/ath9k/common.c index 099f3d45c594d7..86d4a503ef553a 100644 --- a/drivers/net/wireless/ath/ath9k/common.c +++ b/drivers/net/wireless/ath/ath9k/common.c @@ -297,11 +297,13 @@ EXPORT_SYMBOL(ath9k_cmn_get_hw_crypto_keytype); /* * Update internal channel flags. */ -static void ath9k_cmn_update_ichannel(struct ath9k_channel *ichan, +static void ath9k_cmn_update_ichannel(struct ath_common *common, + struct ath9k_channel *ichan, struct cfg80211_chan_def *chandef) { struct ieee80211_channel *chan = chandef->chan; u16 flags = 0; + int width; ichan->channel = chan->center_freq; ichan->chan = chan; @@ -309,7 +311,19 @@ static void ath9k_cmn_update_ichannel(struct ath9k_channel *ichan, if (chan->band == NL80211_BAND_5GHZ) flags |= CHANNEL_5GHZ; - switch (chandef->width) { + switch (common->chan_bw) { + case 5: + width = NL80211_CHAN_WIDTH_5; + break; + case 10: + width = NL80211_CHAN_WIDTH_10; + break; + default: + width = chandef->width; + break; + } + + switch (width) { case NL80211_CHAN_WIDTH_5: flags |= CHANNEL_QUARTER; break; @@ -342,10 +356,11 @@ struct ath9k_channel *ath9k_cmn_get_channel(struct ieee80211_hw *hw, struct cfg80211_chan_def *chandef) { struct ieee80211_channel *curchan = chandef->chan; + struct ath_common *common = ath9k_hw_common(ah); struct ath9k_channel *channel; channel = &ah->channels[curchan->hw_value]; - ath9k_cmn_update_ichannel(channel, chandef); + ath9k_cmn_update_ichannel(common, channel, chandef); return channel; } diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c index f685843a2ff3bf..3485847f8d7ae2 100644 --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c @@ -1038,29 +1038,6 @@ static const struct file_operations fops_btcoex = { }; #endif -#ifdef CONFIG_ATH9K_DYNACK -static ssize_t read_file_ackto(struct file *file, char __user *user_buf, - size_t count, loff_t *ppos) -{ - struct ath_softc *sc = file->private_data; - struct ath_hw *ah = sc->sc_ah; - char buf[32]; - unsigned int len; - - len = sprintf(buf, "%u %c\n", ah->dynack.ackto, - (ah->dynack.enabled) ? 'A' : 'S'); - - return simple_read_from_buffer(user_buf, count, ppos, buf, len); -} - -static const struct file_operations fops_ackto = { - .read = read_file_ackto, - .open = simple_open, - .owner = THIS_MODULE, - .llseek = default_llseek, -}; -#endif - #ifdef CONFIG_ATH9K_WOW static ssize_t read_file_wow(struct file *file, char __user *user_buf, @@ -1374,6 +1351,50 @@ void ath9k_deinit_debug(struct ath_softc *sc) ath9k_cmn_spectral_deinit_debug(&sc->spec_priv); } +static ssize_t read_file_chan_bw(struct file *file, char __user *user_buf, + size_t count, loff_t *ppos) +{ + struct ath_softc *sc = file->private_data; + struct ath_common *common = ath9k_hw_common(sc->sc_ah); + char buf[32]; + unsigned int len; + + len = sprintf(buf, "0x%08x\n", common->chan_bw); + return simple_read_from_buffer(user_buf, count, ppos, buf, len); +} + +static ssize_t write_file_chan_bw(struct file *file, const char __user *user_buf, + size_t count, loff_t *ppos) +{ + struct ath_softc *sc = file->private_data; + struct ath_common *common = ath9k_hw_common(sc->sc_ah); + unsigned long chan_bw; + char buf[32]; + ssize_t len; + + len = min(count, sizeof(buf) - 1); + if (copy_from_user(buf, user_buf, len)) + return -EFAULT; + + buf[len] = '\0'; + if (kstrtoul(buf, 0, &chan_bw)) + return -EINVAL; + + common->chan_bw = chan_bw; + if (!test_bit(ATH_OP_INVALID, &common->op_flags)) + ath9k_ops.config(sc->hw, IEEE80211_CONF_CHANGE_CHANNEL); + + return count; +} + +static const struct file_operations fops_chanbw = { + .read = read_file_chan_bw, + .write = write_file_chan_bw, + .open = simple_open, + .owner = THIS_MODULE, + .llseek = default_llseek, +}; + int ath9k_init_debug(struct ath_hw *ah) { struct ath_common *common = ath9k_hw_common(ah); @@ -1451,9 +1472,9 @@ int ath9k_init_debug(struct ath_hw *ah) #endif #ifdef CONFIG_ATH9K_DYNACK - debugfs_create_file("ack_to", 0400, sc->debug.debugfs_phy, - sc, &fops_ackto); + ath9k_cmn_debug_ack_to(sc->debug.debugfs_phy, sc->sc_ah); #endif + debugfs_create_file("tpc", 0600, sc->debug.debugfs_phy, sc, &fops_tpc); debugfs_create_u16("airtime_flags", 0600, diff --git a/drivers/net/wireless/ath/ath9k/htc.h b/drivers/net/wireless/ath/ath9k/htc.h index 9f64e32381f945..b6c577bbeae874 100644 --- a/drivers/net/wireless/ath/ath9k/htc.h +++ b/drivers/net/wireless/ath/ath9k/htc.h @@ -197,8 +197,8 @@ struct ath9k_htc_target_rx_stats { __be32 host_done; } __packed; -#define ATH9K_HTC_MAX_VIF 2 -#define ATH9K_HTC_MAX_BCN_VIF 2 +#define ATH9K_HTC_MAX_VIF 8 +#define ATH9K_HTC_MAX_BCN_VIF 8 #define INC_VIF(_priv, _type) do { \ switch (_type) { \ @@ -251,8 +251,8 @@ struct ath9k_vif_iter_data { u8 mask[ETH_ALEN]; }; -#define ATH9K_HTC_MAX_STA 8 -#define ATH9K_HTC_MAX_TID 8 +#define ATH9K_HTC_MAX_STA 128 +#define ATH9K_HTC_MAX_TID 16 enum tid_aggr_state { AGGR_STOP = 0, @@ -564,6 +564,7 @@ void ath9k_htc_beaconep(void *drv_priv, struct sk_buff *skb, int ath9k_htc_update_cap_target(struct ath9k_htc_priv *priv, u8 enable_coex); void ath9k_htc_ani_work(struct work_struct *work); +void ath9k_htc_check_ani(struct ath9k_htc_priv *priv); void ath9k_htc_start_ani(struct ath9k_htc_priv *priv); void ath9k_htc_stop_ani(struct ath9k_htc_priv *priv); diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_debug.c b/drivers/net/wireless/ath/ath9k/htc_drv_debug.c index b3ed65e5c4da81..912da9ebe623c6 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_debug.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_debug.c @@ -357,6 +357,50 @@ static const struct file_operations fops_queue = { .llseek = default_llseek, }; +static ssize_t read_file_chan_bw(struct file *file, char __user *user_buf, + size_t count, loff_t *ppos) +{ + struct ath9k_htc_priv *priv = file->private_data; + struct ath_common *common = ath9k_hw_common(priv->ah); + char buf[32]; + unsigned int len; + + len = sprintf(buf, "0x%08x\n", common->chan_bw); + return simple_read_from_buffer(user_buf, count, ppos, buf, len); +} + +static ssize_t write_file_chan_bw(struct file *file, const char __user *user_buf, + size_t count, loff_t *ppos) +{ + struct ath9k_htc_priv *priv = file->private_data; + struct ath_common *common = ath9k_hw_common(priv->ah); + unsigned long chan_bw; + char buf[32]; + ssize_t len; + + len = min(count, sizeof(buf) - 1); + if (copy_from_user(buf, user_buf, len)) + return -EFAULT; + + buf[len] = '\0'; + if (kstrtoul(buf, 0, &chan_bw)) + return -EINVAL; + + common->chan_bw = chan_bw; + if (!test_bit(ATH_OP_INVALID, &common->op_flags)) + ath9k_htc_ops.config(priv->hw, IEEE80211_CONF_CHANGE_CHANNEL); + + return count; +} + +static const struct file_operations fops_chanbw = { + .read = read_file_chan_bw, + .write = write_file_chan_bw, + .open = simple_open, + .owner = THIS_MODULE, + .llseek = default_llseek, +}; + static ssize_t read_file_debug(struct file *file, char __user *user_buf, size_t count, loff_t *ppos) { @@ -398,6 +442,101 @@ static const struct file_operations fops_debug = { .llseek = default_llseek, }; +static ssize_t read_file_ani(struct file *file, char __user *user_buf, + size_t count, loff_t *ppos) +{ + struct ath9k_htc_priv *priv = file->private_data; + struct ath_common *common = ath9k_hw_common(priv->ah); + unsigned int len = 0; + const unsigned int size = 1024; + ssize_t retval = 0; + char *buf; + int i; + struct { + const char *name; + unsigned int val; + } ani_info[] = { + { "ANI RESET", priv->ah->stats.ast_ani_reset }, + { "OFDM LEVEL", priv->ah->ani.ofdmNoiseImmunityLevel }, + { "CCK LEVEL", priv->ah->ani.cckNoiseImmunityLevel }, + { "SPUR UP", priv->ah->stats.ast_ani_spurup }, + { "SPUR DOWN", priv->ah->stats.ast_ani_spurup }, + { "OFDM WS-DET ON", priv->ah->stats.ast_ani_ofdmon }, + { "OFDM WS-DET OFF", priv->ah->stats.ast_ani_ofdmoff }, + { "MRC-CCK ON", priv->ah->stats.ast_ani_ccklow }, + { "MRC-CCK OFF", priv->ah->stats.ast_ani_cckhigh }, + { "FIR-STEP UP", priv->ah->stats.ast_ani_stepup }, + { "FIR-STEP DOWN", priv->ah->stats.ast_ani_stepdown }, + { "INV LISTENTIME", priv->ah->stats.ast_ani_lneg_or_lzero }, + { "OFDM ERRORS", priv->ah->stats.ast_ani_ofdmerrs }, + { "CCK ERRORS", priv->ah->stats.ast_ani_cckerrs }, + }; + + buf = kzalloc(size, GFP_KERNEL); + if (buf == NULL) + return -ENOMEM; + + len += scnprintf(buf + len, size - len, "%15s: %s\n", "ANI", + common->disable_ani ? "DISABLED" : "ENABLED"); + + if (common->disable_ani) + goto exit; + + for (i = 0; i < ARRAY_SIZE(ani_info); i++) + len += scnprintf(buf + len, size - len, "%15s: %u\n", + ani_info[i].name, ani_info[i].val); + +exit: + if (len > size) + len = size; + + retval = simple_read_from_buffer(user_buf, count, ppos, buf, len); + kfree(buf); + + return retval; +} + +static ssize_t write_file_ani(struct file *file, + const char __user *user_buf, + size_t count, loff_t *ppos) +{ + struct ath9k_htc_priv *priv = file->private_data; + struct ath_common *common = ath9k_hw_common(priv->ah); + unsigned long ani; + char buf[32]; + ssize_t len; + + len = min(count, sizeof(buf) - 1); + if (copy_from_user(buf, user_buf, len)) + return -EFAULT; + + buf[len] = '\0'; + if (kstrtoul(buf, 0, &ani)) + return -EINVAL; + + if (ani > 1) + return -EINVAL; + + common->disable_ani = !ani; + + if (common->disable_ani) { + clear_bit(ATH_OP_ANI_RUN, &common->op_flags); + ath9k_htc_stop_ani(priv); + } else { + ath9k_htc_check_ani(priv); + } + + return count; +} + +static const struct file_operations fops_ani = { + .read = read_file_ani, + .write = write_file_ani, + .open = simple_open, + .owner = THIS_MODULE, + .llseek = default_llseek, +}; + /* Ethtool support for get-stats */ #define AMKSTR(nm) #nm "_BE", #nm "_BK", #nm "_VI", #nm "_VO" static const char ath9k_htc_gstrings_stats[][ETH_GSTRING_LEN] = { @@ -516,9 +655,17 @@ int ath9k_htc_init_debug(struct ath_hw *ah) priv, &fops_queue); debugfs_create_file("debug", 0600, priv->debug.debugfs_phy, priv, &fops_debug); + debugfs_create_file("chanbw", 0600, priv->debug.debugfs_phy, + priv, &fops_chanbw); ath9k_cmn_debug_base_eeprom(priv->debug.debugfs_phy, priv->ah); ath9k_cmn_debug_modal_eeprom(priv->debug.debugfs_phy, priv->ah); +#ifdef CONFIG_ATH9K_DYNACK + ath9k_cmn_debug_ack_to(priv->debug.debugfs_phy, priv->ah); +#endif + + debugfs_create_file("ani", 0600, priv->debug.debugfs_phy, priv, &fops_ani); + return 0; } diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c index 214c68269a69f7..b50ea90c45413a 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c @@ -697,9 +697,9 @@ static int ath9k_init_priv(struct ath9k_htc_priv *priv, } static const struct ieee80211_iface_limit if_limits[] = { - { .max = 2, .types = BIT(NL80211_IFTYPE_STATION) | + { .max = 8, .types = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_P2P_CLIENT) }, - { .max = 2, .types = BIT(NL80211_IFTYPE_AP) | + { .max = 8, .types = BIT(NL80211_IFTYPE_AP) | #ifdef CONFIG_MAC80211_MESH BIT(NL80211_IFTYPE_MESH_POINT) | #endif @@ -709,7 +709,7 @@ static const struct ieee80211_iface_limit if_limits[] = { static const struct ieee80211_iface_combination if_comb = { .limits = if_limits, .n_limits = ARRAY_SIZE(if_limits), - .max_interfaces = 2, + .max_interfaces = 8, .num_different_channels = 1, }; @@ -730,6 +730,7 @@ static void ath9k_set_hw_capab(struct ath9k_htc_priv *priv, ieee80211_hw_set(hw, SIGNAL_DBM); ieee80211_hw_set(hw, AMPDU_AGGREGATION); ieee80211_hw_set(hw, DOESNT_SUPPORT_QOS_NDP); + ieee80211_hw_set(hw, SUPPORT_FAST_XMIT); if (ath9k_ps_enable) ieee80211_hw_set(hw, SUPPORTS_PS); @@ -750,9 +751,9 @@ static void ath9k_set_hw_capab(struct ath9k_htc_priv *priv, hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN | WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL | - WIPHY_FLAG_HAS_CHANNEL_SWITCH; - - hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_TDLS; + WIPHY_FLAG_HAS_CHANNEL_SWITCH | + WIPHY_FLAG_SUPPORTS_5_10_MHZ | + WIPHY_FLAG_SUPPORTS_TDLS; hw->queues = 4; hw->max_listen_interval = 1; diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c index a82ad739ab8065..73f6fe1a0069a1 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c @@ -1505,11 +1505,55 @@ static void ath9k_htc_choose_set_bssid(struct ath9k_htc_priv *priv) } } +void ath9k_htc_check_ani(struct ath9k_htc_priv *priv) +{ + struct ath_hw *ah = priv->ah; + struct ath_common *common = ath9k_hw_common(ah); + struct ath_beacon_config *cur_conf = &priv->cur_beacon_conf; + + /* + * Check for the various conditions in which ANI has to + * be stopped. + */ + if (ah->opmode == NL80211_IFTYPE_ADHOC) { + if (!cur_conf->enable_beacon) + goto stop_ani; + } else if (ah->opmode == NL80211_IFTYPE_AP) { + if (!cur_conf->enable_beacon) { + /* + * Disable ANI only when there are no + * associated stations. + */ + if (!test_bit(ATH_OP_PRIM_STA_VIF, &common->op_flags)) + goto stop_ani; + } + } else if (ah->opmode == NL80211_IFTYPE_STATION) { + if (!test_bit(ATH_OP_PRIM_STA_VIF, &common->op_flags)) + goto stop_ani; + } + + if (!test_bit(ATH_OP_ANI_RUN, &common->op_flags)) { + set_bit(ATH_OP_ANI_RUN, &common->op_flags); + ath9k_htc_start_ani(priv); + } + + return; + +stop_ani: + clear_bit(ATH_OP_ANI_RUN, &common->op_flags); + ath9k_htc_stop_ani(priv); +} + static void ath9k_htc_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_bss_conf *bss_conf, u32 changed) { +#define CHECK_ANI \ + (BSS_CHANGED_ASSOC | \ + BSS_CHANGED_IBSS | \ + BSS_CHANGED_BEACON_ENABLED) + struct ath9k_htc_priv *priv = hw->priv; struct ath_hw *ah = priv->ah; struct ath_common *common = ath9k_hw_common(ah); @@ -1609,8 +1653,13 @@ static void ath9k_htc_bss_info_changed(struct ieee80211_hw *hw, if (changed & BSS_CHANGED_HT) ath9k_htc_update_rate(priv, vif, bss_conf); + if (changed & CHECK_ANI) + ath9k_htc_check_ani(priv); + ath9k_htc_ps_restore(priv); mutex_unlock(&priv->mutex); + +#undef CHECK_ANI } static u64 ath9k_htc_get_tsf(struct ieee80211_hw *hw, diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c index a567bc273ffc6c..ff777f14b1d8ea 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c @@ -5304,11 +5304,16 @@ static int rt2800_init_registers(struct rt2x00_dev *rt2x00dev) 0x00000000); } } else if (rt2x00_rt(rt2x00dev, RT5390) || - rt2x00_rt(rt2x00dev, RT5392) || - rt2x00_rt(rt2x00dev, RT6352)) { + rt2x00_rt(rt2x00dev, RT5392)) { +#ifdef CONFIG_RT2800SOC + rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000401); + rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x000C0000); + rt2800_register_write(rt2x00dev, TX_SW_CFG2, 0x000C0408); +#else rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000404); rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x00080606); rt2800_register_write(rt2x00dev, TX_SW_CFG2, 0x00000000); +#endif } else if (rt2x00_rt(rt2x00dev, RT5592)) { rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000404); rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x00000000); @@ -5316,9 +5321,6 @@ static int rt2800_init_registers(struct rt2x00_dev *rt2x00dev) } else if (rt2x00_rt(rt2x00dev, RT5350)) { rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000404); } else if (rt2x00_rt(rt2x00dev, RT6352)) { - rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000401); - rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x000C0000); - rt2800_register_write(rt2x00dev, TX_SW_CFG2, 0x00000000); rt2800_register_write(rt2x00dev, MIMO_PS_CFG, 0x00000002); rt2800_register_write(rt2x00dev, TX_PIN_CFG, 0x00150F0F); rt2800_register_write(rt2x00dev, TX_ALC_VGA3, 0x06060606); diff --git a/drivers/thermal/step_wise.c b/drivers/thermal/step_wise.c index ee047ca43084dc..528cdb5f877ec0 100644 --- a/drivers/thermal/step_wise.c +++ b/drivers/thermal/step_wise.c @@ -31,7 +31,8 @@ * If the temperature is higher than a trip point, * a. if the trend is THERMAL_TREND_RAISING, use higher cooling * state for this trip point - * b. if the trend is THERMAL_TREND_DROPPING, do nothing + * b. if the trend is THERMAL_TREND_DROPPING, use lower cooling + * state for this trip point * c. if the trend is THERMAL_TREND_RAISE_FULL, use upper limit * for this trip point * d. if the trend is THERMAL_TREND_DROP_FULL, use lower limit @@ -93,11 +94,9 @@ static unsigned long get_target_state(struct thermal_instance *instance, if (!throttle) next_target = THERMAL_NO_TARGET; } else { - if (!throttle) { - next_target = cur_state - 1; - if (next_target > instance->upper) - next_target = instance->upper; - } + next_target = cur_state - 1; + if (next_target > instance->upper) + next_target = instance->upper; } break; case THERMAL_TREND_DROP_FULL: @@ -163,9 +162,6 @@ static void thermal_zone_trip_update(struct thermal_zone_device *tz, int trip) dev_dbg(&instance->cdev->device, "old_target=%d, target=%d\n", old_target, (int)instance->target); - if (instance->initialized && old_target == instance->target) - continue; - /* Activate a passive thermal instance */ if (old_target == THERMAL_NO_TARGET && instance->target != THERMAL_NO_TARGET)