From patchwork Wed Apr 4 08:38:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 10322225 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 98B41602C8 for ; Wed, 4 Apr 2018 08:38:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 85D8328E01 for ; Wed, 4 Apr 2018 08:38:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7A6E328E05; Wed, 4 Apr 2018 08:38:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2ABB428E01 for ; Wed, 4 Apr 2018 08:38:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751312AbeDDIin (ORCPT ); Wed, 4 Apr 2018 04:38:43 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:34997 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751239AbeDDIim (ORCPT ); Wed, 4 Apr 2018 04:38:42 -0400 Received: by mail-wm0-f68.google.com with SMTP id r82so40491350wme.0 for ; Wed, 04 Apr 2018 01:38:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=iUma/Ect6D3Nyd6+3ojer8fYnkFXRRwGktMFsOTBjng=; b=VeIN59YLCcc2klSqGCQ/rY6tnkCAXR/fKuYKML1bld5BytH+FNyHfcsebkCFTXhXwS gCuPg9g1cAlz0p+CQt2n3MW1Ki/X6nMxicUpaq8owilLdqlyvLArHrU3mLQTGIkq9gWE h3Vz835+x2H0/0aVU8nfSYLrWKqDoQvcvTHjUYUHRbj2CrQiGKMyHiN9DTS7eZO4RYlx +kcNE4bPoFIU84ayFbfcFC6nJBrFK6m5ox8Uco0eqxDUc/QC7b7EMtkhTa27Tv8vojWx K1A/hfvcbBIMq5/QhrSeVNd/kLddtXeDFfIP2IcFC1G3y7p2Kw1O7A7xz8NM3DyE6/St nj6w== X-Gm-Message-State: AElRT7Edty6xQsdRFkSBkqWoukPp2teXXiGX7I3Jd7uxevN8fLx688LA AMDGYceUSVjfMXcPNDKuQWWLv/BIK0k= X-Google-Smtp-Source: AIpwx4+Q/xXD8RICF+QkYefRKWfO6h4cu9NoeEkvzV1ReBICONMhvasMMO5nI48yucnjKOcL/Jq8oQ== X-Received: by 10.28.108.20 with SMTP id h20mr7020881wmc.69.1522831121536; Wed, 04 Apr 2018 01:38:41 -0700 (PDT) Received: from localhost.localdomain.com (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id n143sm4217875wmd.29.2018.04.04.01.38.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Apr 2018 01:38:41 -0700 (PDT) From: Lorenzo Bianconi To: nbd@nbd.name Cc: linux-wireless@vger.kernel.org Subject: [PATCH] mt76x2: set default values in TX_ALC_CFG_{1, 2} for tempetaure compensation Date: Wed, 4 Apr 2018 10:38:32 +0200 Message-Id: X-Mailer: git-send-email 2.14.3 In-Reply-To: References: Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Initialize default values for temperature compensation in TX_ALC_CFG_{1,2} if tssi has been enabled Signed-off-by: Lorenzo Bianconi --- drivers/net/wireless/mediatek/mt76/mt76x2_phy.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2_phy.c b/drivers/net/wireless/mediatek/mt76/mt76x2_phy.c index 42414c5fa01e..daecc7ea900a 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2_phy.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2_phy.c @@ -660,6 +660,14 @@ int mt76x2_phy_set_channel(struct mt76x2_dev *dev, memcpy(dev->cal.agc_gain_cur, dev->cal.agc_gain_init, sizeof(dev->cal.agc_gain_cur)); + /* init default values for temp compensation */ + if (mt76x2_tssi_enabled(dev)) { + mt76_rmw_field(dev, MT_TX_ALC_CFG_1, MT_TX_ALC_CFG_1_TEMP_COMP, + 0x38); + mt76_rmw_field(dev, MT_TX_ALC_CFG_2, MT_TX_ALC_CFG_2_TEMP_COMP, + 0x38); + } + ieee80211_queue_delayed_work(mt76_hw(dev), &dev->cal_work, MT_CALIBRATE_INTERVAL);