get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/817717/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 817717,
    "url": "http://patchwork.ozlabs.org/api/patches/817717/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/20170922212930.620249-4-arnd@arndb.de/",
    "project": {
        "id": 7,
        "url": "http://patchwork.ozlabs.org/api/projects/7/?format=api",
        "name": "Linux network development",
        "link_name": "netdev",
        "list_id": "netdev.vger.kernel.org",
        "list_email": "netdev@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20170922212930.620249-4-arnd@arndb.de>",
    "list_archive_url": null,
    "date": "2017-09-22T21:29:14",
    "name": "[v4,3/9] brcmsmac: reindent split functions",
    "commit_ref": null,
    "pull_url": null,
    "state": "awaiting-upstream",
    "archived": true,
    "hash": "71af3946614e314f96578e8e4792019489e2340e",
    "submitter": {
        "id": 30,
        "url": "http://patchwork.ozlabs.org/api/people/30/?format=api",
        "name": "Arnd Bergmann",
        "email": "arnd@arndb.de"
    },
    "delegate": {
        "id": 34,
        "url": "http://patchwork.ozlabs.org/api/users/34/?format=api",
        "username": "davem",
        "first_name": "David",
        "last_name": "Miller",
        "email": "davem@davemloft.net"
    },
    "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/20170922212930.620249-4-arnd@arndb.de/mbox/",
    "series": [
        {
            "id": 4712,
            "url": "http://patchwork.ozlabs.org/api/series/4712/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=4712",
            "date": "2017-09-22T21:29:16",
            "name": "bring back stack frame warning with KASAN",
            "version": 4,
            "mbox": "http://patchwork.ozlabs.org/series/4712/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/817717/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/817717/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<netdev-owner@vger.kernel.org>",
        "X-Original-To": "patchwork-incoming@ozlabs.org",
        "Delivered-To": "patchwork-incoming@ozlabs.org",
        "Authentication-Results": "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)",
        "Received": [
            "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xzRXR07FKz9s9Y\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSat, 23 Sep 2017 07:32:39 +1000 (AEST)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752616AbdIVVbA (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tFri, 22 Sep 2017 17:31:00 -0400",
            "from mout.kundenserver.de ([212.227.126.131]:49513 \"EHLO\n\tmout.kundenserver.de\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1752554AbdIVVay (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Fri, 22 Sep 2017 17:30:54 -0400",
            "from wuerfel.lan ([95.208.190.237]) by mrelayeu.kundenserver.de\n\t(mreue002 [212.227.15.129]) with ESMTPA (Nemesis) id\n\t0MCUTZ-1e44ET1xTt-0097p1; Fri, 22 Sep 2017 23:30:24 +0200"
        ],
        "From": "Arnd Bergmann <arnd@arndb.de>",
        "To": "Arend van Spriel <arend.vanspriel@broadcom.com>,\n\tFranky Lin <franky.lin@broadcom.com>,\n\tHante Meuleman <hante.meuleman@broadcom.com>,\n\tChi-Hsien Lin <chi-hsien.lin@cypress.com>,\n\tWright Feng <wright.feng@cypress.com>, Kalle Valo <kvalo@codeaurora.org>",
        "Cc": "Arnd Bergmann <arnd@arndb.de>,\n\tMauro Carvalho Chehab <mchehab@kernel.org>, Jiri Pirko\n\t<jiri@resnulli.us>,         \"David S. Miller\" <davem@davemloft.net>,\n\tAndrey Ryabinin <aryabinin@virtuozzo.com>, \n\tAlexander Potapenko <glider@google.com>, Dmitry Vyukov\n\t<dvyukov@google.com>, Masahiro Yamada <yamada.masahiro@socionext.com>,\n\tMichal Marek <mmarek@suse.com>, \n\tAndrew Morton <akpm@linux-foundation.org>, Kees Cook\n\t<keescook@chromium.org>, Geert Uytterhoeven <geert@linux-m68k.org>,\n\tGreg Kroah-Hartman <gregkh@linuxfoundation.org>, \n\tlinux-media@vger.kernel.org, linux-kernel@vger.kernel.org, \n\tnetdev@vger.kernel.org, linux-wireless@vger.kernel.org, \n\tbrcm80211-dev-list.pdl@broadcom.com, brcm80211-dev-list@cypress.com,\n\tkasan-dev@googlegroups.com, linux-kbuild@vger.kernel.org,\n\tJakub Jelinek <jakub@gcc.gnu.org>, =?utf-8?q?Martin_Li=C5=A1ka?=\n\t<marxin@gcc.gnu.org>",
        "Subject": "[PATCH v4 3/9] brcmsmac: reindent split functions",
        "Date": "Fri, 22 Sep 2017 23:29:14 +0200",
        "Message-Id": "<20170922212930.620249-4-arnd@arndb.de>",
        "X-Mailer": "git-send-email 2.9.0",
        "In-Reply-To": "<20170922212930.620249-1-arnd@arndb.de>",
        "References": "<20170922212930.620249-1-arnd@arndb.de>",
        "X-Provags-ID": "V03:K0:O7r2FNCcfy34Y6Z9wRZrnxYVasC6J9c6SV2Ry6I1KOQ6g/H9/su\n\tAmiKMLIEWG4tSTjHU4hUSLggNyqo2MqdBUsqfpQRjNnT4fsTjDc9TNLIePe5x4tS3YAvM05\n\t9nvA7QZjnHlBUvo1eF+t0MSwUpjAJh3EMcd+in0UirSd0He4u2HjIUw6cXiKAjRKXJG2og4\n\t5vk2nGbpvLwOgRyGYi0Iw==",
        "X-UI-Out-Filterresults": "notjunk:1; V01:K0:5XX9/iD9m0k=:rvcj/5rG2BhBdI0D7S1vgU\n\t1RZ39bb18a6qmO8TpfLdv5RljXMHoS/TWlLJn6HJ4A/IrvYx9r9O1msG1tcOeFRUNMJ1M9Aev\n\tbjV8QDa2UQlrttZHbdfeNL3hiHJYSSYHpV5qmuBddjywRNAAvVs0/I+Pl8WBpyeKO56PityDu\n\t34jBcsy+xE+2FUxcujr84OEMMXo4GhFoSi804vA+GkeKC2IA+xh7EVmk9FqLs3tZvCouX92OO\n\tAC0NM4ymEI3zEFLKevWcoYpM4abgu/UcuXEV8Pe8NTFYxGxtcCAV8WHstxatd4v9CEovxR8kM\n\tYG2957wx+8xTXcFT9RAR/UCpZDIYiyxfPWJsB9muOoAQ+eHkldNGLdsEUbT7vBLNIdFPA08ad\n\td2dncOhIrZtzSMIDRT4fgsf0bVntDO1RKq6oQWh+OrOmGnsPWf2POkKCaYaCpiS0eNOXDAI5L\n\tQBpghu/mePhq2HEN/Cfqo1nwFv6eIpt+lqERHXrY/5Q5PUhQrLejPo3slVLWhLr823AucSzZv\n\tNwSvB8THplcaPzLdvFvF592rmBnw+O+lPn43OgchMvoLaOXtIi9Joez1zF2p4qvvu66UP7IPO\n\tmPrs/ZQrWLWeZrQ3TqXRDS/Sl4w4OF9fPItr1jLLMPJ6Oyg6d+IzMpNKHXQQlUzE+Ddxqqhdd\n\tNazignMUIqzCejQFzFu7xsFfrYPg3yjFFoyrhqZH/vrDJKSKPwY4gCmCj7TWMpcnIKx0xR1PL\n\t3unrK08Iix32Uk4uQo1huo/kUK7ky3K7SrEACA==",
        "Sender": "netdev-owner@vger.kernel.org",
        "Precedence": "bulk",
        "List-ID": "<netdev.vger.kernel.org>",
        "X-Mailing-List": "netdev@vger.kernel.org"
    },
    "content": "In the previous commit I left the indentation alone to help reviewing\nthe patch, this one now runs the three new functions through 'indent -kr -8'\nwith some manual fixups to avoid silliness.\n\nNo changes other than whitespace are intended here.\n\nSigned-off-by: Arnd Bergmann <arnd@arndb.de>\nAcked-by: Arend van Spriel <arend.vanspriel@broadcom.com>\n---\n .../broadcom/brcm80211/brcmsmac/phy/phy_n.c        | 1507 +++++++++-----------\n 1 file changed, 697 insertions(+), 810 deletions(-)",
    "diff": "diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.c b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.c\nindex ed409a80f3d2..763e8ba6b178 100644\n--- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.c\n+++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.c\n@@ -16074,7 +16074,8 @@ static void wlc_phy_workarounds_nphy_rev7(struct brcms_phy *pi)\n \t\tNPHY_REV3_RFSEQ_CMD_INT_PA_PU,\n \t\tNPHY_REV3_RFSEQ_CMD_END\n \t};\n-\tstatic const u8 rfseq_rx2tx_dlys_rev3_ipa[] = { 8, 6, 6, 4, 4, 16, 43, 1, 1 };\n+\tstatic const u8 rfseq_rx2tx_dlys_rev3_ipa[] =\n+\t\t{ 8, 6, 6, 4, 4, 16, 43, 1, 1 };\n \tstatic const u16 rfseq_rx2tx_dacbufpu_rev7[] = { 0x10f, 0x10f };\n \tu32 leg_data_weights;\n \tu8 chan_freq_range = 0;\n@@ -16114,526 +16115,452 @@ static void wlc_phy_workarounds_nphy_rev7(struct brcms_phy *pi)\n \tint coreNum;\n \n \n-\t\tif (NREV_IS(pi->pubpi.phy_rev, 7)) {\n-\t\t\tmod_phy_reg(pi, 0x221, (0x1 << 4), (1 << 4));\n-\n-\t\t\tmod_phy_reg(pi, 0x160, (0x7f << 0), (32 << 0));\n-\t\t\tmod_phy_reg(pi, 0x160, (0x7f << 8), (39 << 8));\n-\t\t\tmod_phy_reg(pi, 0x161, (0x7f << 0), (46 << 0));\n-\t\t\tmod_phy_reg(pi, 0x161, (0x7f << 8), (51 << 8));\n-\t\t\tmod_phy_reg(pi, 0x162, (0x7f << 0), (55 << 0));\n-\t\t\tmod_phy_reg(pi, 0x162, (0x7f << 8), (58 << 8));\n-\t\t\tmod_phy_reg(pi, 0x163, (0x7f << 0), (60 << 0));\n-\t\t\tmod_phy_reg(pi, 0x163, (0x7f << 8), (62 << 8));\n-\t\t\tmod_phy_reg(pi, 0x164, (0x7f << 0), (62 << 0));\n-\t\t\tmod_phy_reg(pi, 0x164, (0x7f << 8), (63 << 8));\n-\t\t\tmod_phy_reg(pi, 0x165, (0x7f << 0), (63 << 0));\n-\t\t\tmod_phy_reg(pi, 0x165, (0x7f << 8), (64 << 8));\n-\t\t\tmod_phy_reg(pi, 0x166, (0x7f << 0), (64 << 0));\n-\t\t\tmod_phy_reg(pi, 0x166, (0x7f << 8), (64 << 8));\n-\t\t\tmod_phy_reg(pi, 0x167, (0x7f << 0), (64 << 0));\n-\t\t\tmod_phy_reg(pi, 0x167, (0x7f << 8), (64 << 8));\n-\t\t}\n-\n-\t\tif (NREV_LE(pi->pubpi.phy_rev, 8)) {\n-\t\t\twrite_phy_reg(pi, 0x23f, 0x1b0);\n-\t\t\twrite_phy_reg(pi, 0x240, 0x1b0);\n-\t\t}\n+\tif (NREV_IS(pi->pubpi.phy_rev, 7)) {\n+\t\tmod_phy_reg(pi, 0x221, (0x1 << 4), (1 << 4));\n+\n+\t\tmod_phy_reg(pi, 0x160, (0x7f << 0), (32 << 0));\n+\t\tmod_phy_reg(pi, 0x160, (0x7f << 8), (39 << 8));\n+\t\tmod_phy_reg(pi, 0x161, (0x7f << 0), (46 << 0));\n+\t\tmod_phy_reg(pi, 0x161, (0x7f << 8), (51 << 8));\n+\t\tmod_phy_reg(pi, 0x162, (0x7f << 0), (55 << 0));\n+\t\tmod_phy_reg(pi, 0x162, (0x7f << 8), (58 << 8));\n+\t\tmod_phy_reg(pi, 0x163, (0x7f << 0), (60 << 0));\n+\t\tmod_phy_reg(pi, 0x163, (0x7f << 8), (62 << 8));\n+\t\tmod_phy_reg(pi, 0x164, (0x7f << 0), (62 << 0));\n+\t\tmod_phy_reg(pi, 0x164, (0x7f << 8), (63 << 8));\n+\t\tmod_phy_reg(pi, 0x165, (0x7f << 0), (63 << 0));\n+\t\tmod_phy_reg(pi, 0x165, (0x7f << 8), (64 << 8));\n+\t\tmod_phy_reg(pi, 0x166, (0x7f << 0), (64 << 0));\n+\t\tmod_phy_reg(pi, 0x166, (0x7f << 8), (64 << 8));\n+\t\tmod_phy_reg(pi, 0x167, (0x7f << 0), (64 << 0));\n+\t\tmod_phy_reg(pi, 0x167, (0x7f << 8), (64 << 8));\n+\t}\n \n-\t\tif (NREV_GE(pi->pubpi.phy_rev, 8))\n-\t\t\tmod_phy_reg(pi, 0xbd, (0xff << 0), (114 << 0));\n+\tif (NREV_LE(pi->pubpi.phy_rev, 8)) {\n+\t\twrite_phy_reg(pi, 0x23f, 0x1b0);\n+\t\twrite_phy_reg(pi, 0x240, 0x1b0);\n+\t}\n \n-\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 0x00, 16,\n-\t\t\t\t\t &dac_control);\n-\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 0x10, 16,\n-\t\t\t\t\t &dac_control);\n+\tif (NREV_GE(pi->pubpi.phy_rev, 8))\n+\t\tmod_phy_reg(pi, 0xbd, (0xff << 0), (114 << 0));\n \n-\t\twlc_phy_table_read_nphy(pi, NPHY_TBL_ID_CMPMETRICDATAWEIGHTTBL,\n-\t\t\t\t\t1, 0, 32, &leg_data_weights);\n-\t\tleg_data_weights = leg_data_weights & 0xffffff;\n-\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_CMPMETRICDATAWEIGHTTBL,\n-\t\t\t\t\t 1, 0, 32, &leg_data_weights);\n+\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 0x00, 16,\n+\t\t\t\t &dac_control);\n+\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 0x10, 16,\n+\t\t\t\t &dac_control);\n \n-\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ,\n-\t\t\t\t\t 2, 0x15e, 16,\n-\t\t\t\t\t rfseq_rx2tx_dacbufpu_rev7);\n-\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, 2, 0x16e, 16,\n-\t\t\t\t\t rfseq_rx2tx_dacbufpu_rev7);\n+\twlc_phy_table_read_nphy(pi, NPHY_TBL_ID_CMPMETRICDATAWEIGHTTBL,\n+\t\t\t\t1, 0, 32, &leg_data_weights);\n+\tleg_data_weights = leg_data_weights & 0xffffff;\n+\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_CMPMETRICDATAWEIGHTTBL,\n+\t\t\t\t 1, 0, 32, &leg_data_weights);\n \n-\t\tif (PHY_IPA(pi))\n-\t\t\twlc_phy_set_rfseq_nphy(pi, NPHY_RFSEQ_RX2TX,\n-\t\t\t\t\t       rfseq_rx2tx_events_rev3_ipa,\n-\t\t\t\t\t       rfseq_rx2tx_dlys_rev3_ipa,\n-\t\t\t\t\t       ARRAY_SIZE(rfseq_rx2tx_events_rev3_ipa));\n+\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ,\n+\t\t\t\t 2, 0x15e, 16, rfseq_rx2tx_dacbufpu_rev7);\n+\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, 2, 0x16e, 16,\n+\t\t\t\t rfseq_rx2tx_dacbufpu_rev7);\n \n-\t\tmod_phy_reg(pi, 0x299, (0x3 << 14), (0x1 << 14));\n-\t\tmod_phy_reg(pi, 0x29d, (0x3 << 14), (0x1 << 14));\n+\tif (PHY_IPA(pi))\n+\t\twlc_phy_set_rfseq_nphy(pi, NPHY_RFSEQ_RX2TX,\n+\t\t\t\t       rfseq_rx2tx_events_rev3_ipa,\n+\t\t\t\t       rfseq_rx2tx_dlys_rev3_ipa,\n+\t\t\t\t       ARRAY_SIZE\n+\t\t\t\t       (rfseq_rx2tx_events_rev3_ipa));\n \n-\t\ttx_lpf_bw_ofdm_20mhz = wlc_phy_read_lpf_bw_ctl_nphy(pi, 0x154);\n-\t\ttx_lpf_bw_ofdm_40mhz = wlc_phy_read_lpf_bw_ctl_nphy(pi, 0x159);\n-\t\ttx_lpf_bw_11b = wlc_phy_read_lpf_bw_ctl_nphy(pi, 0x152);\n+\tmod_phy_reg(pi, 0x299, (0x3 << 14), (0x1 << 14));\n+\tmod_phy_reg(pi, 0x29d, (0x3 << 14), (0x1 << 14));\n \n-\t\tif (PHY_IPA(pi)) {\n+\ttx_lpf_bw_ofdm_20mhz = wlc_phy_read_lpf_bw_ctl_nphy(pi, 0x154);\n+\ttx_lpf_bw_ofdm_40mhz = wlc_phy_read_lpf_bw_ctl_nphy(pi, 0x159);\n+\ttx_lpf_bw_11b = wlc_phy_read_lpf_bw_ctl_nphy(pi, 0x152);\n \n-\t\t\tif (((pi->pubpi.radiorev == 5)\n-\t\t\t     && (CHSPEC_IS40(pi->radio_chanspec) == 1))\n-\t\t\t    || (pi->pubpi.radiorev == 7)\n-\t\t\t    || (pi->pubpi.radiorev == 8)) {\n+\tif (PHY_IPA(pi)) {\n \n-\t\t\t\trccal_bcap_val =\n-\t\t\t\t\tread_radio_reg(\n-\t\t\t\t\t\tpi,\n-\t\t\t\t\t\tRADIO_2057_RCCAL_BCAP_VAL);\n-\t\t\t\trccal_scap_val =\n-\t\t\t\t\tread_radio_reg(\n-\t\t\t\t\t\tpi,\n-\t\t\t\t\t\tRADIO_2057_RCCAL_SCAP_VAL);\n+\t\tif (((pi->pubpi.radiorev == 5)\n+\t\t     && (CHSPEC_IS40(pi->radio_chanspec) == 1))\n+\t\t    || (pi->pubpi.radiorev == 7)\n+\t\t    || (pi->pubpi.radiorev == 8)) {\n \n-\t\t\t\trccal_tx20_11b_bcap = rccal_bcap_val;\n-\t\t\t\trccal_tx20_11b_scap = rccal_scap_val;\n+\t\t\trccal_bcap_val =\n+\t\t\t    read_radio_reg(pi, RADIO_2057_RCCAL_BCAP_VAL);\n+\t\t\trccal_scap_val =\n+\t\t\t    read_radio_reg(pi, RADIO_2057_RCCAL_SCAP_VAL);\n \n-\t\t\t\tif ((pi->pubpi.radiorev == 5) &&\n-\t\t\t\t    (CHSPEC_IS40(pi->radio_chanspec) == 1)) {\n+\t\t\trccal_tx20_11b_bcap = rccal_bcap_val;\n+\t\t\trccal_tx20_11b_scap = rccal_scap_val;\n \n-\t\t\t\t\trccal_tx20_11n_bcap = rccal_bcap_val;\n-\t\t\t\t\trccal_tx20_11n_scap = rccal_scap_val;\n-\t\t\t\t\trccal_tx40_11n_bcap = 0xc;\n-\t\t\t\t\trccal_tx40_11n_scap = 0xc;\n+\t\t\tif ((pi->pubpi.radiorev == 5) &&\n+\t\t\t    (CHSPEC_IS40(pi->radio_chanspec) == 1)) {\n \n-\t\t\t\t\trccal_ovrd = true;\n+\t\t\t\trccal_tx20_11n_bcap = rccal_bcap_val;\n+\t\t\t\trccal_tx20_11n_scap = rccal_scap_val;\n+\t\t\t\trccal_tx40_11n_bcap = 0xc;\n+\t\t\t\trccal_tx40_11n_scap = 0xc;\n \n-\t\t\t\t} else if ((pi->pubpi.radiorev == 7)\n-\t\t\t\t\t   || (pi->pubpi.radiorev == 8)) {\n+\t\t\t\trccal_ovrd = true;\n \n-\t\t\t\t\ttx_lpf_bw_ofdm_20mhz = 4;\n-\t\t\t\t\ttx_lpf_bw_11b = 1;\n+\t\t\t} else if ((pi->pubpi.radiorev == 7)\n+\t\t\t\t   || (pi->pubpi.radiorev == 8)) {\n \n-\t\t\t\t\tif (CHSPEC_IS2G(pi->radio_chanspec)) {\n-\t\t\t\t\t\trccal_tx20_11n_bcap = 0xc;\n-\t\t\t\t\t\trccal_tx20_11n_scap = 0xc;\n-\t\t\t\t\t\trccal_tx40_11n_bcap = 0xa;\n-\t\t\t\t\t\trccal_tx40_11n_scap = 0xa;\n-\t\t\t\t\t} else {\n-\t\t\t\t\t\trccal_tx20_11n_bcap = 0x14;\n-\t\t\t\t\t\trccal_tx20_11n_scap = 0x14;\n-\t\t\t\t\t\trccal_tx40_11n_bcap = 0xf;\n-\t\t\t\t\t\trccal_tx40_11n_scap = 0xf;\n-\t\t\t\t\t}\n+\t\t\t\ttx_lpf_bw_ofdm_20mhz = 4;\n+\t\t\t\ttx_lpf_bw_11b = 1;\n \n-\t\t\t\t\trccal_ovrd = true;\n+\t\t\t\tif (CHSPEC_IS2G(pi->radio_chanspec)) {\n+\t\t\t\t\trccal_tx20_11n_bcap = 0xc;\n+\t\t\t\t\trccal_tx20_11n_scap = 0xc;\n+\t\t\t\t\trccal_tx40_11n_bcap = 0xa;\n+\t\t\t\t\trccal_tx40_11n_scap = 0xa;\n+\t\t\t\t} else {\n+\t\t\t\t\trccal_tx20_11n_bcap = 0x14;\n+\t\t\t\t\trccal_tx20_11n_scap = 0x14;\n+\t\t\t\t\trccal_tx40_11n_bcap = 0xf;\n+\t\t\t\t\trccal_tx40_11n_scap = 0xf;\n \t\t\t\t}\n+\n+\t\t\t\trccal_ovrd = true;\n \t\t\t}\n+\t\t}\n \n-\t\t} else {\n+\t} else {\n \n-\t\t\tif (pi->pubpi.radiorev == 5) {\n+\t\tif (pi->pubpi.radiorev == 5) {\n \n-\t\t\t\ttx_lpf_bw_ofdm_20mhz = 1;\n-\t\t\t\ttx_lpf_bw_ofdm_40mhz = 3;\n+\t\t\ttx_lpf_bw_ofdm_20mhz = 1;\n+\t\t\ttx_lpf_bw_ofdm_40mhz = 3;\n \n-\t\t\t\trccal_bcap_val =\n-\t\t\t\t\tread_radio_reg(\n-\t\t\t\t\t\tpi,\n-\t\t\t\t\t\tRADIO_2057_RCCAL_BCAP_VAL);\n-\t\t\t\trccal_scap_val =\n-\t\t\t\t\tread_radio_reg(\n-\t\t\t\t\t\tpi,\n-\t\t\t\t\t\tRADIO_2057_RCCAL_SCAP_VAL);\n+\t\t\trccal_bcap_val =\n+\t\t\t    read_radio_reg(pi, RADIO_2057_RCCAL_BCAP_VAL);\n+\t\t\trccal_scap_val =\n+\t\t\t    read_radio_reg(pi, RADIO_2057_RCCAL_SCAP_VAL);\n \n-\t\t\t\trccal_tx20_11b_bcap = rccal_bcap_val;\n-\t\t\t\trccal_tx20_11b_scap = rccal_scap_val;\n+\t\t\trccal_tx20_11b_bcap = rccal_bcap_val;\n+\t\t\trccal_tx20_11b_scap = rccal_scap_val;\n \n-\t\t\t\trccal_tx20_11n_bcap = 0x13;\n-\t\t\t\trccal_tx20_11n_scap = 0x11;\n-\t\t\t\trccal_tx40_11n_bcap = 0x13;\n-\t\t\t\trccal_tx40_11n_scap = 0x11;\n+\t\t\trccal_tx20_11n_bcap = 0x13;\n+\t\t\trccal_tx20_11n_scap = 0x11;\n+\t\t\trccal_tx40_11n_bcap = 0x13;\n+\t\t\trccal_tx40_11n_scap = 0x11;\n \n-\t\t\t\trccal_ovrd = true;\n-\t\t\t}\n+\t\t\trccal_ovrd = true;\n \t\t}\n+\t}\n \n-\t\tif (rccal_ovrd) {\n-\n-\t\t\trx2tx_lpf_rc_lut_tx20_11b =\n-\t\t\t\t(rccal_tx20_11b_bcap << 8) |\n-\t\t\t\t(rccal_tx20_11b_scap << 3) |\n-\t\t\t\ttx_lpf_bw_11b;\n-\t\t\trx2tx_lpf_rc_lut_tx20_11n =\n-\t\t\t\t(rccal_tx20_11n_bcap << 8) |\n-\t\t\t\t(rccal_tx20_11n_scap << 3) |\n-\t\t\t\ttx_lpf_bw_ofdm_20mhz;\n-\t\t\trx2tx_lpf_rc_lut_tx40_11n =\n-\t\t\t\t(rccal_tx40_11n_bcap << 8) |\n-\t\t\t\t(rccal_tx40_11n_scap << 3) |\n-\t\t\t\ttx_lpf_bw_ofdm_40mhz;\n+\tif (rccal_ovrd) {\n \n-\t\t\tfor (coreNum = 0; coreNum <= 1; coreNum++) {\n-\t\t\t\twlc_phy_table_write_nphy(\n-\t\t\t\t\tpi, NPHY_TBL_ID_RFSEQ,\n-\t\t\t\t\t1,\n-\t\t\t\t\t0x152 + coreNum * 0x10,\n-\t\t\t\t\t16,\n-\t\t\t\t\t&rx2tx_lpf_rc_lut_tx20_11b);\n-\t\t\t\twlc_phy_table_write_nphy(\n-\t\t\t\t\tpi, NPHY_TBL_ID_RFSEQ,\n-\t\t\t\t\t1,\n-\t\t\t\t\t0x153 + coreNum * 0x10,\n-\t\t\t\t\t16,\n-\t\t\t\t\t&rx2tx_lpf_rc_lut_tx20_11n);\n-\t\t\t\twlc_phy_table_write_nphy(\n-\t\t\t\t\tpi, NPHY_TBL_ID_RFSEQ,\n-\t\t\t\t\t1,\n-\t\t\t\t\t0x154 + coreNum * 0x10,\n-\t\t\t\t\t16,\n-\t\t\t\t\t&rx2tx_lpf_rc_lut_tx20_11n);\n-\t\t\t\twlc_phy_table_write_nphy(\n-\t\t\t\t\tpi, NPHY_TBL_ID_RFSEQ,\n-\t\t\t\t\t1,\n-\t\t\t\t\t0x155 + coreNum * 0x10,\n-\t\t\t\t\t16,\n-\t\t\t\t\t&rx2tx_lpf_rc_lut_tx40_11n);\n-\t\t\t\twlc_phy_table_write_nphy(\n-\t\t\t\t\tpi, NPHY_TBL_ID_RFSEQ,\n-\t\t\t\t\t1,\n-\t\t\t\t\t0x156 + coreNum * 0x10,\n-\t\t\t\t\t16,\n-\t\t\t\t\t&rx2tx_lpf_rc_lut_tx40_11n);\n-\t\t\t\twlc_phy_table_write_nphy(\n-\t\t\t\t\tpi, NPHY_TBL_ID_RFSEQ,\n-\t\t\t\t\t1,\n-\t\t\t\t\t0x157 + coreNum * 0x10,\n-\t\t\t\t\t16,\n-\t\t\t\t\t&rx2tx_lpf_rc_lut_tx40_11n);\n-\t\t\t\twlc_phy_table_write_nphy(\n-\t\t\t\t\tpi, NPHY_TBL_ID_RFSEQ,\n-\t\t\t\t\t1,\n-\t\t\t\t\t0x158 + coreNum * 0x10,\n-\t\t\t\t\t16,\n-\t\t\t\t\t&rx2tx_lpf_rc_lut_tx40_11n);\n-\t\t\t\twlc_phy_table_write_nphy(\n-\t\t\t\t\tpi, NPHY_TBL_ID_RFSEQ,\n-\t\t\t\t\t1,\n-\t\t\t\t\t0x159 + coreNum * 0x10,\n-\t\t\t\t\t16,\n-\t\t\t\t\t&rx2tx_lpf_rc_lut_tx40_11n);\n-\t\t\t}\n+\t\trx2tx_lpf_rc_lut_tx20_11b =\n+\t\t    (rccal_tx20_11b_bcap << 8) |\n+\t\t    (rccal_tx20_11b_scap << 3) | tx_lpf_bw_11b;\n+\t\trx2tx_lpf_rc_lut_tx20_11n =\n+\t\t    (rccal_tx20_11n_bcap << 8) |\n+\t\t    (rccal_tx20_11n_scap << 3) | tx_lpf_bw_ofdm_20mhz;\n+\t\trx2tx_lpf_rc_lut_tx40_11n =\n+\t\t    (rccal_tx40_11n_bcap << 8) |\n+\t\t    (rccal_tx40_11n_scap << 3) | tx_lpf_bw_ofdm_40mhz;\n \n-\t\t\twlc_phy_rfctrl_override_nphy_rev7(\n-\t\t\t\tpi, (0x1 << 4),\n-\t\t\t\t1, 0x3, 0,\n-\t\t\t\tNPHY_REV7_RFCTRLOVERRIDE_ID2);\n+\t\tfor (coreNum = 0; coreNum <= 1; coreNum++) {\n+\t\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, 1,\n+\t\t\t\t\t\t 0x152 + coreNum * 0x10, 16,\n+\t\t\t\t\t\t &rx2tx_lpf_rc_lut_tx20_11b);\n+\t\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, 1,\n+\t\t\t\t\t\t 0x153 + coreNum * 0x10, 16,\n+\t\t\t\t\t\t &rx2tx_lpf_rc_lut_tx20_11n);\n+\t\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, 1,\n+\t\t\t\t\t\t 0x154 + coreNum * 0x10, 16,\n+\t\t\t\t\t\t &rx2tx_lpf_rc_lut_tx20_11n);\n+\t\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, 1,\n+\t\t\t\t\t\t 0x155 + coreNum * 0x10, 16,\n+\t\t\t\t\t\t &rx2tx_lpf_rc_lut_tx40_11n);\n+\t\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, 1,\n+\t\t\t\t\t\t 0x156 + coreNum * 0x10, 16,\n+\t\t\t\t\t\t &rx2tx_lpf_rc_lut_tx40_11n);\n+\t\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, 1,\n+\t\t\t\t\t\t 0x157 + coreNum * 0x10, 16,\n+\t\t\t\t\t\t &rx2tx_lpf_rc_lut_tx40_11n);\n+\t\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, 1,\n+\t\t\t\t\t\t 0x158 + coreNum * 0x10, 16,\n+\t\t\t\t\t\t &rx2tx_lpf_rc_lut_tx40_11n);\n+\t\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, 1,\n+\t\t\t\t\t\t 0x159 + coreNum * 0x10, 16,\n+\t\t\t\t\t\t &rx2tx_lpf_rc_lut_tx40_11n);\n \t\t}\n \n-\t\twrite_phy_reg(pi, 0x32f, 0x3);\n+\t\twlc_phy_rfctrl_override_nphy_rev7(pi, (0x1 << 4), 1, 0x3, 0,\n+\t\t\t\t\t\t  NPHY_REV7_RFCTRLOVERRIDE_ID2);\n+\t}\n \n-\t\tif ((pi->pubpi.radiorev == 4) || (pi->pubpi.radiorev == 6))\n-\t\t\twlc_phy_rfctrl_override_nphy_rev7(\n-\t\t\t\tpi, (0x1 << 2),\n-\t\t\t\t1, 0x3, 0,\n-\t\t\t\tNPHY_REV7_RFCTRLOVERRIDE_ID0);\n+\twrite_phy_reg(pi, 0x32f, 0x3);\n \n-\t\tif ((pi->pubpi.radiorev == 3) || (pi->pubpi.radiorev == 4) ||\n-\t\t    (pi->pubpi.radiorev == 6)) {\n-\t\t\tif ((pi->sh->sromrev >= 8)\n-\t\t\t    && (pi->sh->boardflags2 & BFL2_IPALVLSHIFT_3P3))\n-\t\t\t\tipalvlshift_3p3_war_en = 1;\n-\n-\t\t\tif (ipalvlshift_3p3_war_en) {\n-\t\t\t\twrite_radio_reg(pi, RADIO_2057_GPAIO_CONFIG,\n-\t\t\t\t\t\t0x5);\n-\t\t\t\twrite_radio_reg(pi, RADIO_2057_GPAIO_SEL1,\n-\t\t\t\t\t\t0x30);\n-\t\t\t\twrite_radio_reg(pi, RADIO_2057_GPAIO_SEL0, 0x0);\n-\t\t\t\tor_radio_reg(pi,\n-\t\t\t\t\t     RADIO_2057_RXTXBIAS_CONFIG_CORE0,\n-\t\t\t\t\t     0x1);\n-\t\t\t\tor_radio_reg(pi,\n-\t\t\t\t\t     RADIO_2057_RXTXBIAS_CONFIG_CORE1,\n-\t\t\t\t\t     0x1);\n-\n-\t\t\t\tipa2g_mainbias = 0x1f;\n-\n-\t\t\t\tipa2g_casconv = 0x6f;\n-\n-\t\t\t\tipa2g_biasfilt = 0xaa;\n-\t\t\t} else {\n+\tif ((pi->pubpi.radiorev == 4) || (pi->pubpi.radiorev == 6))\n+\t\twlc_phy_rfctrl_override_nphy_rev7(pi, (0x1 << 2), 1, 0x3, 0,\n+\t\t\t\t\t\t  NPHY_REV7_RFCTRLOVERRIDE_ID0);\n \n-\t\t\t\tipa2g_mainbias = 0x2b;\n+\tif ((pi->pubpi.radiorev == 3) || (pi->pubpi.radiorev == 4) ||\n+\t    (pi->pubpi.radiorev == 6)) {\n+\t\tif ((pi->sh->sromrev >= 8)\n+\t\t    && (pi->sh->boardflags2 & BFL2_IPALVLSHIFT_3P3))\n+\t\t\tipalvlshift_3p3_war_en = 1;\n \n-\t\t\t\tipa2g_casconv = 0x7f;\n+\t\tif (ipalvlshift_3p3_war_en) {\n+\t\t\twrite_radio_reg(pi, RADIO_2057_GPAIO_CONFIG, 0x5);\n+\t\t\twrite_radio_reg(pi, RADIO_2057_GPAIO_SEL1, 0x30);\n+\t\t\twrite_radio_reg(pi, RADIO_2057_GPAIO_SEL0, 0x0);\n+\t\t\tor_radio_reg(pi, RADIO_2057_RXTXBIAS_CONFIG_CORE0, 0x1);\n+\t\t\tor_radio_reg(pi, RADIO_2057_RXTXBIAS_CONFIG_CORE1, 0x1);\n \n-\t\t\t\tipa2g_biasfilt = 0xee;\n-\t\t\t}\n+\t\t\tipa2g_mainbias = 0x1f;\n \n-\t\t\tif (CHSPEC_IS2G(pi->radio_chanspec)) {\n-\t\t\t\tfor (coreNum = 0; coreNum <= 1; coreNum++) {\n-\t\t\t\t\tWRITE_RADIO_REG4(pi, RADIO_2057, CORE,\n-\t\t\t\t\t\t\t coreNum, IPA2G_IMAIN,\n-\t\t\t\t\t\t\t ipa2g_mainbias);\n-\t\t\t\t\tWRITE_RADIO_REG4(pi, RADIO_2057, CORE,\n-\t\t\t\t\t\t\t coreNum, IPA2G_CASCONV,\n-\t\t\t\t\t\t\t ipa2g_casconv);\n-\t\t\t\t\tWRITE_RADIO_REG4(pi, RADIO_2057, CORE,\n-\t\t\t\t\t\t\t coreNum,\n-\t\t\t\t\t\t\t IPA2G_BIAS_FILTER,\n-\t\t\t\t\t\t\t ipa2g_biasfilt);\n-\t\t\t\t}\n-\t\t\t}\n-\t\t}\n+\t\t\tipa2g_casconv = 0x6f;\n \n-\t\tif (PHY_IPA(pi)) {\n-\t\t\tif (CHSPEC_IS2G(pi->radio_chanspec)) {\n-\t\t\t\tif ((pi->pubpi.radiorev == 3)\n-\t\t\t\t    || (pi->pubpi.radiorev == 4)\n-\t\t\t\t    || (pi->pubpi.radiorev == 6))\n-\t\t\t\t\ttxgm_idac_bleed = 0x7f;\n+\t\t\tipa2g_biasfilt = 0xaa;\n+\t\t} else {\n \n-\t\t\t\tfor (coreNum = 0; coreNum <= 1; coreNum++) {\n-\t\t\t\t\tif (txgm_idac_bleed != 0)\n-\t\t\t\t\t\tWRITE_RADIO_REG4(\n-\t\t\t\t\t\t\tpi, RADIO_2057,\n-\t\t\t\t\t\t\tCORE, coreNum,\n-\t\t\t\t\t\t\tTXGM_IDAC_BLEED,\n-\t\t\t\t\t\t\ttxgm_idac_bleed);\n-\t\t\t\t}\n+\t\t\tipa2g_mainbias = 0x2b;\n \n-\t\t\t\tif (pi->pubpi.radiorev == 5) {\n-\n-\t\t\t\t\tfor (coreNum = 0; coreNum <= 1;\n-\t\t\t\t\t     coreNum++) {\n-\t\t\t\t\t\tWRITE_RADIO_REG4(pi, RADIO_2057,\n-\t\t\t\t\t\t\t\t CORE, coreNum,\n-\t\t\t\t\t\t\t\t IPA2G_CASCONV,\n-\t\t\t\t\t\t\t\t 0x13);\n-\t\t\t\t\t\tWRITE_RADIO_REG4(pi, RADIO_2057,\n-\t\t\t\t\t\t\t\t CORE, coreNum,\n-\t\t\t\t\t\t\t\t IPA2G_IMAIN,\n-\t\t\t\t\t\t\t\t 0x1f);\n-\t\t\t\t\t\tWRITE_RADIO_REG4(\n-\t\t\t\t\t\t\tpi, RADIO_2057,\n-\t\t\t\t\t\t\tCORE, coreNum,\n-\t\t\t\t\t\t\tIPA2G_BIAS_FILTER,\n-\t\t\t\t\t\t\t0xee);\n-\t\t\t\t\t\tWRITE_RADIO_REG4(pi, RADIO_2057,\n-\t\t\t\t\t\t\t\t CORE, coreNum,\n-\t\t\t\t\t\t\t\t PAD2G_IDACS,\n-\t\t\t\t\t\t\t\t 0x8a);\n-\t\t\t\t\t\tWRITE_RADIO_REG4(\n-\t\t\t\t\t\t\tpi, RADIO_2057,\n-\t\t\t\t\t\t\tCORE, coreNum,\n-\t\t\t\t\t\t\tPAD_BIAS_FILTER_BWS,\n-\t\t\t\t\t\t\t0x3e);\n-\t\t\t\t\t}\n+\t\t\tipa2g_casconv = 0x7f;\n \n-\t\t\t\t} else if ((pi->pubpi.radiorev == 7)\n-\t\t\t\t\t   || (pi->pubpi.radiorev == 8)) {\n+\t\t\tipa2g_biasfilt = 0xee;\n+\t\t}\n \n-\t\t\t\t\tif (CHSPEC_IS40(pi->radio_chanspec) ==\n-\t\t\t\t\t    0) {\n-\t\t\t\t\t\tWRITE_RADIO_REG4(pi, RADIO_2057,\n-\t\t\t\t\t\t\t\t CORE, 0,\n-\t\t\t\t\t\t\t\t IPA2G_IMAIN,\n-\t\t\t\t\t\t\t\t 0x14);\n-\t\t\t\t\t\tWRITE_RADIO_REG4(pi, RADIO_2057,\n-\t\t\t\t\t\t\t\t CORE, 1,\n-\t\t\t\t\t\t\t\t IPA2G_IMAIN,\n-\t\t\t\t\t\t\t\t 0x12);\n-\t\t\t\t\t} else {\n-\t\t\t\t\t\tWRITE_RADIO_REG4(pi, RADIO_2057,\n-\t\t\t\t\t\t\t\t CORE, 0,\n-\t\t\t\t\t\t\t\t IPA2G_IMAIN,\n-\t\t\t\t\t\t\t\t 0x16);\n-\t\t\t\t\t\tWRITE_RADIO_REG4(pi, RADIO_2057,\n-\t\t\t\t\t\t\t\t CORE, 1,\n-\t\t\t\t\t\t\t\t IPA2G_IMAIN,\n-\t\t\t\t\t\t\t\t 0x16);\n-\t\t\t\t\t}\n-\t\t\t\t}\n+\t\tif (CHSPEC_IS2G(pi->radio_chanspec)) {\n+\t\t\tfor (coreNum = 0; coreNum <= 1; coreNum++) {\n+\t\t\t\tWRITE_RADIO_REG4(pi, RADIO_2057, CORE,\n+\t\t\t\t\t\t coreNum, IPA2G_IMAIN,\n+\t\t\t\t\t\t ipa2g_mainbias);\n+\t\t\t\tWRITE_RADIO_REG4(pi, RADIO_2057, CORE,\n+\t\t\t\t\t\t coreNum, IPA2G_CASCONV,\n+\t\t\t\t\t\t ipa2g_casconv);\n+\t\t\t\tWRITE_RADIO_REG4(pi, RADIO_2057, CORE,\n+\t\t\t\t\t\t coreNum,\n+\t\t\t\t\t\t IPA2G_BIAS_FILTER,\n+\t\t\t\t\t\t ipa2g_biasfilt);\n+\t\t\t}\n+\t\t}\n+\t}\n \n-\t\t\t} else {\n-\t\t\t\tfreq = CHAN5G_FREQ(CHSPEC_CHANNEL(\n-\t\t\t\t\t\t\tpi->radio_chanspec));\n-\t\t\t\tif (((freq >= 5180) && (freq <= 5230))\n-\t\t\t\t    || ((freq >= 5745) && (freq <= 5805))) {\n-\t\t\t\t\tWRITE_RADIO_REG4(pi, RADIO_2057, CORE,\n-\t\t\t\t\t\t\t 0, IPA5G_BIAS_FILTER,\n-\t\t\t\t\t\t\t 0xff);\n-\t\t\t\t\tWRITE_RADIO_REG4(pi, RADIO_2057, CORE,\n-\t\t\t\t\t\t\t 1, IPA5G_BIAS_FILTER,\n-\t\t\t\t\t\t\t 0xff);\n-\t\t\t\t}\n+\tif (PHY_IPA(pi)) {\n+\t\tif (CHSPEC_IS2G(pi->radio_chanspec)) {\n+\t\t\tif ((pi->pubpi.radiorev == 3)\n+\t\t\t    || (pi->pubpi.radiorev == 4)\n+\t\t\t    || (pi->pubpi.radiorev == 6))\n+\t\t\t\ttxgm_idac_bleed = 0x7f;\n+\n+\t\t\tfor (coreNum = 0; coreNum <= 1; coreNum++) {\n+\t\t\t\tif (txgm_idac_bleed != 0)\n+\t\t\t\t\tWRITE_RADIO_REG4(pi, RADIO_2057,\n+\t\t\t\t\t\t\t CORE, coreNum,\n+\t\t\t\t\t\t\t TXGM_IDAC_BLEED,\n+\t\t\t\t\t\t\t txgm_idac_bleed);\n \t\t\t}\n-\t\t} else {\n \n-\t\t\tif (pi->pubpi.radiorev != 5) {\n+\t\t\tif (pi->pubpi.radiorev == 5) {\n \t\t\t\tfor (coreNum = 0; coreNum <= 1; coreNum++) {\n+\t\t\t\t\tWRITE_RADIO_REG4(pi, RADIO_2057,\n+\t\t\t\t\t\t\t CORE, coreNum,\n+\t\t\t\t\t\t\t IPA2G_CASCONV,\n+\t\t\t\t\t\t\t 0x13);\n+\t\t\t\t\tWRITE_RADIO_REG4(pi, RADIO_2057,\n+\t\t\t\t\t\t\t CORE, coreNum,\n+\t\t\t\t\t\t\t IPA2G_IMAIN,\n+\t\t\t\t\t\t\t 0x1f);\n+\t\t\t\t\tWRITE_RADIO_REG4(pi, RADIO_2057,\n+\t\t\t\t\t\t\t CORE, coreNum,\n+\t\t\t\t\t\t\t IPA2G_BIAS_FILTER,\n+\t\t\t\t\t\t\t 0xee);\n+\t\t\t\t\tWRITE_RADIO_REG4(pi, RADIO_2057,\n+\t\t\t\t\t\t\t CORE, coreNum,\n+\t\t\t\t\t\t\t PAD2G_IDACS,\n+\t\t\t\t\t\t\t 0x8a);\n+\t\t\t\t\tWRITE_RADIO_REG4(pi, RADIO_2057,\n+\t\t\t\t\t\t\t CORE, coreNum,\n+\t\t\t\t\t\t\t PAD_BIAS_FILTER_BWS,\n+\t\t\t\t\t\t\t 0x3e);\n+\t\t\t\t}\n+\t\t\t} else if ((pi->pubpi.radiorev == 7) ||\n+\t\t\t\t   (pi->pubpi.radiorev == 8)) {\n+\n+\t\t\t\tif (CHSPEC_IS40(pi->radio_chanspec) == 0) {\n+\t\t\t\t\tWRITE_RADIO_REG4(pi, RADIO_2057, CORE,\n+\t\t\t\t\t\t\t 0, IPA2G_IMAIN, 0x14);\n+\t\t\t\t\tWRITE_RADIO_REG4(pi, RADIO_2057, CORE,\n+\t\t\t\t\t\t\t 1, IPA2G_IMAIN, 0x12);\n+\t\t\t\t} else {\n \t\t\t\t\tWRITE_RADIO_REG4(pi, RADIO_2057, CORE,\n-\t\t\t\t\t\t\t coreNum,\n-\t\t\t\t\t\t\t TXMIX2G_TUNE_BOOST_PU,\n-\t\t\t\t\t\t\t 0x61);\n+\t\t\t\t\t\t\t 0, IPA2G_IMAIN, 0x16);\n \t\t\t\t\tWRITE_RADIO_REG4(pi, RADIO_2057, CORE,\n-\t\t\t\t\t\t\t coreNum,\n-\t\t\t\t\t\t\t TXGM_IDAC_BLEED, 0x70);\n+\t\t\t\t\t\t\t 1, IPA2G_IMAIN, 0x16);\n \t\t\t\t}\n \t\t\t}\n-\t\t}\n \n-\t\tif (pi->pubpi.radiorev == 4) {\n-\t\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 1,\n-\t\t\t\t\t\t 0x05, 16,\n-\t\t\t\t\t\t &afectrl_adc_ctrl1_rev7);\n-\t\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 1,\n-\t\t\t\t\t\t 0x15, 16,\n-\t\t\t\t\t\t &afectrl_adc_ctrl1_rev7);\n+\t\t} else {\n+\t\t\tfreq =\n+\t\t\t    CHAN5G_FREQ(CHSPEC_CHANNEL\n+\t\t\t\t\t(pi->radio_chanspec));\n+\t\t\tif (((freq >= 5180) && (freq <= 5230))\n+\t\t\t    || ((freq >= 5745) && (freq <= 5805))) {\n+\t\t\t\tWRITE_RADIO_REG4(pi, RADIO_2057, CORE,\n+\t\t\t\t\t\t 0, IPA5G_BIAS_FILTER, 0xff);\n+\t\t\t\tWRITE_RADIO_REG4(pi, RADIO_2057, CORE,\n+\t\t\t\t\t\t 1, IPA5G_BIAS_FILTER, 0xff);\n+\t\t\t}\n+\t\t}\n+\t} else {\n \n+\t\tif (pi->pubpi.radiorev != 5) {\n \t\t\tfor (coreNum = 0; coreNum <= 1; coreNum++) {\n \t\t\t\tWRITE_RADIO_REG4(pi, RADIO_2057, CORE, coreNum,\n-\t\t\t\t\t\t AFE_VCM_CAL_MASTER, 0x0);\n-\t\t\t\tWRITE_RADIO_REG4(pi, RADIO_2057, CORE, coreNum,\n-\t\t\t\t\t\t AFE_SET_VCM_I, 0x3f);\n+\t\t\t\t\t\t TXMIX2G_TUNE_BOOST_PU, 0x61);\n \t\t\t\tWRITE_RADIO_REG4(pi, RADIO_2057, CORE, coreNum,\n-\t\t\t\t\t\t AFE_SET_VCM_Q, 0x3f);\n+\t\t\t\t\t\t TXGM_IDAC_BLEED, 0x70);\n \t\t\t}\n-\t\t} else {\n-\t\t\tmod_phy_reg(pi, 0xa6, (0x1 << 2), (0x1 << 2));\n-\t\t\tmod_phy_reg(pi, 0x8f, (0x1 << 2), (0x1 << 2));\n-\t\t\tmod_phy_reg(pi, 0xa7, (0x1 << 2), (0x1 << 2));\n-\t\t\tmod_phy_reg(pi, 0xa5, (0x1 << 2), (0x1 << 2));\n-\n-\t\t\tmod_phy_reg(pi, 0xa6, (0x1 << 0), 0);\n-\t\t\tmod_phy_reg(pi, 0x8f, (0x1 << 0), (0x1 << 0));\n-\t\t\tmod_phy_reg(pi, 0xa7, (0x1 << 0), 0);\n-\t\t\tmod_phy_reg(pi, 0xa5, (0x1 << 0), (0x1 << 0));\n-\n-\t\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 1,\n-\t\t\t\t\t\t 0x05, 16,\n-\t\t\t\t\t\t &afectrl_adc_ctrl2_rev7);\n-\t\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 1,\n-\t\t\t\t\t\t 0x15, 16,\n-\t\t\t\t\t\t &afectrl_adc_ctrl2_rev7);\n-\n-\t\t\tmod_phy_reg(pi, 0xa6, (0x1 << 2), 0);\n-\t\t\tmod_phy_reg(pi, 0x8f, (0x1 << 2), 0);\n-\t\t\tmod_phy_reg(pi, 0xa7, (0x1 << 2), 0);\n-\t\t\tmod_phy_reg(pi, 0xa5, (0x1 << 2), 0);\n \t\t}\n+\t}\n \n-\t\twrite_phy_reg(pi, 0x6a, 0x2);\n+\tif (pi->pubpi.radiorev == 4) {\n+\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 0x05, 16,\n+\t\t\t\t\t &afectrl_adc_ctrl1_rev7);\n+\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 0x15, 16,\n+\t\t\t\t\t &afectrl_adc_ctrl1_rev7);\n \n-\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_NOISEVAR, 1, 256, 32,\n-\t\t\t\t\t &min_nvar_offset_6mbps);\n+\t\tfor (coreNum = 0; coreNum <= 1; coreNum++) {\n+\t\t\tWRITE_RADIO_REG4(pi, RADIO_2057, CORE, coreNum,\n+\t\t\t\t\t AFE_VCM_CAL_MASTER, 0x0);\n+\t\t\tWRITE_RADIO_REG4(pi, RADIO_2057, CORE, coreNum,\n+\t\t\t\t\t AFE_SET_VCM_I, 0x3f);\n+\t\t\tWRITE_RADIO_REG4(pi, RADIO_2057, CORE, coreNum,\n+\t\t\t\t\t AFE_SET_VCM_Q, 0x3f);\n+\t\t}\n+\t} else {\n+\t\tmod_phy_reg(pi, 0xa6, (0x1 << 2), (0x1 << 2));\n+\t\tmod_phy_reg(pi, 0x8f, (0x1 << 2), (0x1 << 2));\n+\t\tmod_phy_reg(pi, 0xa7, (0x1 << 2), (0x1 << 2));\n+\t\tmod_phy_reg(pi, 0xa5, (0x1 << 2), (0x1 << 2));\n \n-\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, 2, 0x138, 16,\n-\t\t\t\t\t &rfseq_pktgn_lpf_hpc_rev7);\n+\t\tmod_phy_reg(pi, 0xa6, (0x1 << 0), 0);\n+\t\tmod_phy_reg(pi, 0x8f, (0x1 << 0), (0x1 << 0));\n+\t\tmod_phy_reg(pi, 0xa7, (0x1 << 0), 0);\n+\t\tmod_phy_reg(pi, 0xa5, (0x1 << 0), (0x1 << 0));\n \n-\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, 1, 0x141, 16,\n-\t\t\t\t\t &rfseq_pktgn_lpf_h_hpc_rev7);\n+\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 0x05, 16,\n+\t\t\t\t\t &afectrl_adc_ctrl2_rev7);\n+\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 0x15, 16,\n+\t\t\t\t\t &afectrl_adc_ctrl2_rev7);\n \n-\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, 3, 0x133, 16,\n-\t\t\t\t\t &rfseq_htpktgn_lpf_hpc_rev7);\n+\t\tmod_phy_reg(pi, 0xa6, (0x1 << 2), 0);\n+\t\tmod_phy_reg(pi, 0x8f, (0x1 << 2), 0);\n+\t\tmod_phy_reg(pi, 0xa7, (0x1 << 2), 0);\n+\t\tmod_phy_reg(pi, 0xa5, (0x1 << 2), 0);\n+\t}\n \n-\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, 2, 0x146, 16,\n-\t\t\t\t\t &rfseq_cckpktgn_lpf_hpc_rev7);\n+\twrite_phy_reg(pi, 0x6a, 0x2);\n \n-\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, 1, 0x123, 16,\n-\t\t\t\t\t &rfseq_tx2rx_lpf_h_hpc_rev7);\n+\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_NOISEVAR, 1, 256, 32,\n+\t\t\t\t &min_nvar_offset_6mbps);\n \n-\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, 1, 0x12A, 16,\n-\t\t\t\t\t &rfseq_rx2tx_lpf_h_hpc_rev7);\n+\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, 2, 0x138, 16,\n+\t\t\t\t &rfseq_pktgn_lpf_hpc_rev7);\n \n-\t\tif (CHSPEC_IS40(pi->radio_chanspec) == 0) {\n-\t\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_NOISEVAR, 1, 3,\n-\t\t\t\t\t\t 32, &min_nvar_val);\n-\t\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_NOISEVAR, 1,\n-\t\t\t\t\t\t 127, 32, &min_nvar_val);\n-\t\t} else {\n-\t\t\tmin_nvar_val = noise_var_tbl_rev7[3];\n-\t\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_NOISEVAR, 1, 3,\n-\t\t\t\t\t\t 32, &min_nvar_val);\n+\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, 1, 0x141, 16,\n+\t\t\t\t &rfseq_pktgn_lpf_h_hpc_rev7);\n \n-\t\t\tmin_nvar_val = noise_var_tbl_rev7[127];\n-\t\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_NOISEVAR, 1,\n-\t\t\t\t\t\t 127, 32, &min_nvar_val);\n-\t\t}\n+\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, 3, 0x133, 16,\n+\t\t\t\t &rfseq_htpktgn_lpf_hpc_rev7);\n \n-\t\twlc_phy_workarounds_nphy_gainctrl(pi);\n+\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, 2, 0x146, 16,\n+\t\t\t\t &rfseq_cckpktgn_lpf_hpc_rev7);\n \n-\t\tpdetrange =\n-\t\t\t(CHSPEC_IS5G(pi->radio_chanspec)) ? pi->srom_fem5g.\n-\t\t\tpdetrange : pi->srom_fem2g.pdetrange;\n+\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, 1, 0x123, 16,\n+\t\t\t\t &rfseq_tx2rx_lpf_h_hpc_rev7);\n \n-\t\tif (pdetrange == 0) {\n-\t\t\tchan_freq_range =\n-\t\t\t\twlc_phy_get_chan_freq_range_nphy(pi, 0);\n-\t\t\tif (chan_freq_range != WL_CHAN_FREQ_RANGE_2G) {\n-\t\t\t\taux_adc_vmid_rev7_core0[3] = 0x70;\n-\t\t\t\taux_adc_vmid_rev7_core1[3] = 0x70;\n-\t\t\t\taux_adc_gain_rev7[3] = 2;\n-\t\t\t} else {\n-\t\t\t\taux_adc_vmid_rev7_core0[3] = 0x80;\n-\t\t\t\taux_adc_vmid_rev7_core1[3] = 0x80;\n-\t\t\t\taux_adc_gain_rev7[3] = 3;\n-\t\t\t}\n-\t\t} else if (pdetrange == 1) {\n-\t\t\tif (chan_freq_range != WL_CHAN_FREQ_RANGE_2G) {\n-\t\t\t\taux_adc_vmid_rev7_core0[3] = 0x7c;\n-\t\t\t\taux_adc_vmid_rev7_core1[3] = 0x7c;\n-\t\t\t\taux_adc_gain_rev7[3] = 2;\n-\t\t\t} else {\n-\t\t\t\taux_adc_vmid_rev7_core0[3] = 0x8c;\n-\t\t\t\taux_adc_vmid_rev7_core1[3] = 0x8c;\n-\t\t\t\taux_adc_gain_rev7[3] = 1;\n-\t\t\t}\n-\t\t} else if (pdetrange == 2) {\n-\t\t\tif (pi->pubpi.radioid == BCM2057_ID) {\n-\t\t\t\tif ((pi->pubpi.radiorev == 5)\n-\t\t\t\t    || (pi->pubpi.radiorev == 7)\n-\t\t\t\t    || (pi->pubpi.radiorev == 8)) {\n-\t\t\t\t\tif (chan_freq_range ==\n-\t\t\t\t\t    WL_CHAN_FREQ_RANGE_2G) {\n-\t\t\t\t\t\taux_adc_vmid_rev7_core0[3] =\n-\t\t\t\t\t\t\t0x8c;\n-\t\t\t\t\t\taux_adc_vmid_rev7_core1[3] =\n-\t\t\t\t\t\t\t0x8c;\n-\t\t\t\t\t\taux_adc_gain_rev7[3] = 0;\n-\t\t\t\t\t} else {\n-\t\t\t\t\t\taux_adc_vmid_rev7_core0[3] =\n-\t\t\t\t\t\t\t0x96;\n-\t\t\t\t\t\taux_adc_vmid_rev7_core1[3] =\n-\t\t\t\t\t\t\t0x96;\n-\t\t\t\t\t\taux_adc_gain_rev7[3] = 0;\n-\t\t\t\t\t}\n+\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, 1, 0x12A, 16,\n+\t\t\t\t &rfseq_rx2tx_lpf_h_hpc_rev7);\n+\n+\tif (CHSPEC_IS40(pi->radio_chanspec) == 0) {\n+\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_NOISEVAR, 1, 3,\n+\t\t\t\t\t 32, &min_nvar_val);\n+\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_NOISEVAR, 1,\n+\t\t\t\t\t 127, 32, &min_nvar_val);\n+\t} else {\n+\t\tmin_nvar_val = noise_var_tbl_rev7[3];\n+\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_NOISEVAR, 1, 3,\n+\t\t\t\t\t 32, &min_nvar_val);\n+\n+\t\tmin_nvar_val = noise_var_tbl_rev7[127];\n+\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_NOISEVAR, 1,\n+\t\t\t\t\t 127, 32, &min_nvar_val);\n+\t}\n+\n+\twlc_phy_workarounds_nphy_gainctrl(pi);\n+\n+\tpdetrange = (CHSPEC_IS5G(pi->radio_chanspec)) ?\n+\t\t    pi->srom_fem5g.pdetrange : pi->srom_fem2g.pdetrange;\n+\n+\tif (pdetrange == 0) {\n+\t\tchan_freq_range = wlc_phy_get_chan_freq_range_nphy(pi, 0);\n+\t\tif (chan_freq_range != WL_CHAN_FREQ_RANGE_2G) {\n+\t\t\taux_adc_vmid_rev7_core0[3] = 0x70;\n+\t\t\taux_adc_vmid_rev7_core1[3] = 0x70;\n+\t\t\taux_adc_gain_rev7[3] = 2;\n+\t\t} else {\n+\t\t\taux_adc_vmid_rev7_core0[3] = 0x80;\n+\t\t\taux_adc_vmid_rev7_core1[3] = 0x80;\n+\t\t\taux_adc_gain_rev7[3] = 3;\n+\t\t}\n+\t} else if (pdetrange == 1) {\n+\t\tif (chan_freq_range != WL_CHAN_FREQ_RANGE_2G) {\n+\t\t\taux_adc_vmid_rev7_core0[3] = 0x7c;\n+\t\t\taux_adc_vmid_rev7_core1[3] = 0x7c;\n+\t\t\taux_adc_gain_rev7[3] = 2;\n+\t\t} else {\n+\t\t\taux_adc_vmid_rev7_core0[3] = 0x8c;\n+\t\t\taux_adc_vmid_rev7_core1[3] = 0x8c;\n+\t\t\taux_adc_gain_rev7[3] = 1;\n+\t\t}\n+\t} else if (pdetrange == 2) {\n+\t\tif (pi->pubpi.radioid == BCM2057_ID) {\n+\t\t\tif ((pi->pubpi.radiorev == 5)\n+\t\t\t    || (pi->pubpi.radiorev == 7)\n+\t\t\t    || (pi->pubpi.radiorev == 8)) {\n+\t\t\t\tif (chan_freq_range ==\n+\t\t\t\t    WL_CHAN_FREQ_RANGE_2G) {\n+\t\t\t\t\taux_adc_vmid_rev7_core0[3] = 0x8c;\n+\t\t\t\t\taux_adc_vmid_rev7_core1[3] = 0x8c;\n+\t\t\t\t\taux_adc_gain_rev7[3] = 0;\n+\t\t\t\t} else {\n+\t\t\t\t\taux_adc_vmid_rev7_core0[3] = 0x96;\n+\t\t\t\t\taux_adc_vmid_rev7_core1[3] = 0x96;\n+\t\t\t\t\taux_adc_gain_rev7[3] = 0;\n \t\t\t\t}\n \t\t\t}\n+\t\t}\n \n-\t\t} else if (pdetrange == 3) {\n-\t\t\tif (chan_freq_range == WL_CHAN_FREQ_RANGE_2G) {\n-\t\t\t\taux_adc_vmid_rev7_core0[3] = 0x89;\n-\t\t\t\taux_adc_vmid_rev7_core1[3] = 0x89;\n-\t\t\t\taux_adc_gain_rev7[3] = 0;\n-\t\t\t}\n+\t} else if (pdetrange == 3) {\n+\t\tif (chan_freq_range == WL_CHAN_FREQ_RANGE_2G) {\n+\t\t\taux_adc_vmid_rev7_core0[3] = 0x89;\n+\t\t\taux_adc_vmid_rev7_core1[3] = 0x89;\n+\t\t\taux_adc_gain_rev7[3] = 0;\n+\t\t}\n \n-\t\t} else if (pdetrange == 5) {\n+\t} else if (pdetrange == 5) {\n \n-\t\t\tif (chan_freq_range != WL_CHAN_FREQ_RANGE_2G) {\n-\t\t\t\taux_adc_vmid_rev7_core0[3] = 0x80;\n-\t\t\t\taux_adc_vmid_rev7_core1[3] = 0x80;\n-\t\t\t\taux_adc_gain_rev7[3] = 3;\n-\t\t\t} else {\n-\t\t\t\taux_adc_vmid_rev7_core0[3] = 0x70;\n-\t\t\t\taux_adc_vmid_rev7_core1[3] = 0x70;\n-\t\t\t\taux_adc_gain_rev7[3] = 2;\n-\t\t\t}\n+\t\tif (chan_freq_range != WL_CHAN_FREQ_RANGE_2G) {\n+\t\t\taux_adc_vmid_rev7_core0[3] = 0x80;\n+\t\t\taux_adc_vmid_rev7_core1[3] = 0x80;\n+\t\t\taux_adc_gain_rev7[3] = 3;\n+\t\t} else {\n+\t\t\taux_adc_vmid_rev7_core0[3] = 0x70;\n+\t\t\taux_adc_vmid_rev7_core1[3] = 0x70;\n+\t\t\taux_adc_gain_rev7[3] = 2;\n \t\t}\n+\t}\n \n-\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4, 0x08, 16,\n-\t\t\t\t\t &aux_adc_vmid_rev7_core0);\n-\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4, 0x18, 16,\n-\t\t\t\t\t &aux_adc_vmid_rev7_core1);\n-\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4, 0x0c, 16,\n-\t\t\t\t\t &aux_adc_gain_rev7);\n-\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4, 0x1c, 16,\n-\t\t\t\t\t &aux_adc_gain_rev7);\n+\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4, 0x08, 16,\n+\t\t\t\t &aux_adc_vmid_rev7_core0);\n+\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4, 0x18, 16,\n+\t\t\t\t &aux_adc_vmid_rev7_core1);\n+\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4, 0x0c, 16,\n+\t\t\t\t &aux_adc_gain_rev7);\n+\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4, 0x1c, 16,\n+\t\t\t\t &aux_adc_gain_rev7);\n }\n \n static void wlc_phy_workarounds_nphy_rev3(struct brcms_phy *pi)\n@@ -16672,7 +16599,8 @@ static void wlc_phy_workarounds_nphy_rev3(struct brcms_phy *pi)\n \t\tNPHY_REV3_RFSEQ_CMD_INT_PA_PU,\n \t\tNPHY_REV3_RFSEQ_CMD_END\n \t};\n-\tstatic const u8 rfseq_rx2tx_dlys_rev3_ipa[] = { 8, 6, 6, 4, 4, 16, 43, 1, 1 };\n+\tstatic const u8 rfseq_rx2tx_dlys_rev3_ipa[] =\n+\t    { 8, 6, 6, 4, 4, 16, 43, 1, 1 };\n \ts16 alpha0, alpha1, alpha2;\n \ts16 beta0, beta1, beta2;\n \tu32 leg_data_weights, ht_data_weights, nss1_data_weights,\n@@ -16691,330 +16619,290 @@ static void wlc_phy_workarounds_nphy_rev3(struct brcms_phy *pi)\n \tu8 pdetrange;\n \tu8 triso;\n \n-\t\twrite_phy_reg(pi, 0x23f, 0x1f8);\n-\t\twrite_phy_reg(pi, 0x240, 0x1f8);\n-\n-\t\twlc_phy_table_read_nphy(pi, NPHY_TBL_ID_CMPMETRICDATAWEIGHTTBL,\n-\t\t\t\t\t1, 0, 32, &leg_data_weights);\n-\t\tleg_data_weights = leg_data_weights & 0xffffff;\n-\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_CMPMETRICDATAWEIGHTTBL,\n-\t\t\t\t\t 1, 0, 32, &leg_data_weights);\n-\n-\t\talpha0 = 293;\n-\t\talpha1 = 435;\n-\t\talpha2 = 261;\n-\t\tbeta0 = 366;\n-\t\tbeta1 = 205;\n-\t\tbeta2 = 32;\n-\t\twrite_phy_reg(pi, 0x145, alpha0);\n-\t\twrite_phy_reg(pi, 0x146, alpha1);\n-\t\twrite_phy_reg(pi, 0x147, alpha2);\n-\t\twrite_phy_reg(pi, 0x148, beta0);\n-\t\twrite_phy_reg(pi, 0x149, beta1);\n-\t\twrite_phy_reg(pi, 0x14a, beta2);\n-\n-\t\twrite_phy_reg(pi, 0x38, 0xC);\n-\t\twrite_phy_reg(pi, 0x2ae, 0xC);\n-\n-\t\twlc_phy_set_rfseq_nphy(pi, NPHY_RFSEQ_TX2RX,\n-\t\t\t\t       rfseq_tx2rx_events_rev3,\n-\t\t\t\t       rfseq_tx2rx_dlys_rev3,\n-\t\t\t\t       ARRAY_SIZE(rfseq_tx2rx_events_rev3));\n-\n-\t\tif (PHY_IPA(pi))\n-\t\t\twlc_phy_set_rfseq_nphy(pi, NPHY_RFSEQ_RX2TX,\n-\t\t\t\t\t       rfseq_rx2tx_events_rev3_ipa,\n-\t\t\t\t\t       rfseq_rx2tx_dlys_rev3_ipa,\n-\t\t\t\t\t       ARRAY_SIZE(rfseq_rx2tx_events_rev3_ipa));\n-\n-\t\tif ((pi->sh->hw_phyrxchain != 0x3) &&\n-\t\t    (pi->sh->hw_phyrxchain != pi->sh->hw_phytxchain)) {\n-\n-\t\t\tif (PHY_IPA(pi)) {\n-\t\t\t\trfseq_rx2tx_dlys_rev3[5] = 59;\n-\t\t\t\trfseq_rx2tx_dlys_rev3[6] = 1;\n-\t\t\t\trfseq_rx2tx_events_rev3[7] =\n-\t\t\t\t\tNPHY_REV3_RFSEQ_CMD_END;\n-\t\t\t}\n-\n-\t\t\twlc_phy_set_rfseq_nphy(\n-\t\t\t\tpi, NPHY_RFSEQ_RX2TX,\n-\t\t\t\trfseq_rx2tx_events_rev3,\n-\t\t\t\trfseq_rx2tx_dlys_rev3,\n-\t\t\t\tARRAY_SIZE(rfseq_rx2tx_events_rev3));\n-\t\t}\n+\twrite_phy_reg(pi, 0x23f, 0x1f8);\n+\twrite_phy_reg(pi, 0x240, 0x1f8);\n+\n+\twlc_phy_table_read_nphy(pi, NPHY_TBL_ID_CMPMETRICDATAWEIGHTTBL,\n+\t\t\t\t1, 0, 32, &leg_data_weights);\n+\tleg_data_weights = leg_data_weights & 0xffffff;\n+\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_CMPMETRICDATAWEIGHTTBL,\n+\t\t\t\t 1, 0, 32, &leg_data_weights);\n+\n+\talpha0 = 293;\n+\talpha1 = 435;\n+\talpha2 = 261;\n+\tbeta0 = 366;\n+\tbeta1 = 205;\n+\tbeta2 = 32;\n+\twrite_phy_reg(pi, 0x145, alpha0);\n+\twrite_phy_reg(pi, 0x146, alpha1);\n+\twrite_phy_reg(pi, 0x147, alpha2);\n+\twrite_phy_reg(pi, 0x148, beta0);\n+\twrite_phy_reg(pi, 0x149, beta1);\n+\twrite_phy_reg(pi, 0x14a, beta2);\n+\n+\twrite_phy_reg(pi, 0x38, 0xC);\n+\twrite_phy_reg(pi, 0x2ae, 0xC);\n+\n+\twlc_phy_set_rfseq_nphy(pi, NPHY_RFSEQ_TX2RX,\n+\t\t\t       rfseq_tx2rx_events_rev3,\n+\t\t\t       rfseq_tx2rx_dlys_rev3,\n+\t\t\t       ARRAY_SIZE(rfseq_tx2rx_events_rev3));\n \n-\t\tif (CHSPEC_IS2G(pi->radio_chanspec))\n-\t\t\twrite_phy_reg(pi, 0x6a, 0x2);\n-\t\telse\n-\t\t\twrite_phy_reg(pi, 0x6a, 0x9c40);\n-\n-\t\tmod_phy_reg(pi, 0x294, (0xf << 8), (7 << 8));\n+\tif (PHY_IPA(pi))\n+\t\twlc_phy_set_rfseq_nphy(pi, NPHY_RFSEQ_RX2TX,\n+\t\t\t\t       rfseq_rx2tx_events_rev3_ipa,\n+\t\t\t\t       rfseq_rx2tx_dlys_rev3_ipa,\n+\t\t\t\t       ARRAY_SIZE (rfseq_rx2tx_events_rev3_ipa));\n \n-\t\tif (CHSPEC_IS40(pi->radio_chanspec) == 0) {\n-\t\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_NOISEVAR, 1, 3,\n-\t\t\t\t\t\t 32, &min_nvar_val);\n-\t\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_NOISEVAR, 1,\n-\t\t\t\t\t\t 127, 32, &min_nvar_val);\n-\t\t} else {\n-\t\t\tmin_nvar_val = noise_var_tbl_rev3[3];\n-\t\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_NOISEVAR, 1, 3,\n-\t\t\t\t\t\t 32, &min_nvar_val);\n+\tif ((pi->sh->hw_phyrxchain != 0x3) &&\n+\t    (pi->sh->hw_phyrxchain != pi->sh->hw_phytxchain)) {\n \n-\t\t\tmin_nvar_val = noise_var_tbl_rev3[127];\n-\t\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_NOISEVAR, 1,\n-\t\t\t\t\t\t 127, 32, &min_nvar_val);\n+\t\tif (PHY_IPA(pi)) {\n+\t\t\trfseq_rx2tx_dlys_rev3[5] = 59;\n+\t\t\trfseq_rx2tx_dlys_rev3[6] = 1;\n+\t\t\trfseq_rx2tx_events_rev3[7] = NPHY_REV3_RFSEQ_CMD_END;\n \t\t}\n \n-\t\twlc_phy_workarounds_nphy_gainctrl(pi);\n+\t\twlc_phy_set_rfseq_nphy(pi, NPHY_RFSEQ_RX2TX,\n+\t\t\t\t       rfseq_rx2tx_events_rev3,\n+\t\t\t\t       rfseq_rx2tx_dlys_rev3,\n+\t\t\t\t       ARRAY_SIZE (rfseq_rx2tx_events_rev3));\n+\t}\n \n-\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 0x00, 16,\n-\t\t\t\t\t &dac_control);\n-\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 0x10, 16,\n-\t\t\t\t\t &dac_control);\n+\tif (CHSPEC_IS2G(pi->radio_chanspec))\n+\t\twrite_phy_reg(pi, 0x6a, 0x2);\n+\telse\n+\t\twrite_phy_reg(pi, 0x6a, 0x9c40);\n \n-\t\tpdetrange =\n-\t\t\t(CHSPEC_IS5G(pi->radio_chanspec)) ? pi->srom_fem5g.\n-\t\t\tpdetrange : pi->srom_fem2g.pdetrange;\n+\tmod_phy_reg(pi, 0x294, (0xf << 8), (7 << 8));\n \n-\t\tif (pdetrange == 0) {\n-\t\t\tif (NREV_GE(pi->pubpi.phy_rev, 4)) {\n-\t\t\t\taux_adc_vmid = aux_adc_vmid_rev4;\n-\t\t\t\taux_adc_gain = aux_adc_gain_rev4;\n-\t\t\t} else {\n-\t\t\t\taux_adc_vmid = aux_adc_vmid_rev3;\n-\t\t\t\taux_adc_gain = aux_adc_gain_rev3;\n-\t\t\t}\n-\t\t\tchan_freq_range =\n-\t\t\t\twlc_phy_get_chan_freq_range_nphy(pi, 0);\n-\t\t\tif (chan_freq_range != WL_CHAN_FREQ_RANGE_2G) {\n-\t\t\t\tswitch (chan_freq_range) {\n-\t\t\t\tcase WL_CHAN_FREQ_RANGE_5GL:\n-\t\t\t\t\taux_adc_vmid[3] = 0x89;\n-\t\t\t\t\taux_adc_gain[3] = 0;\n-\t\t\t\t\tbreak;\n-\t\t\t\tcase WL_CHAN_FREQ_RANGE_5GM:\n-\t\t\t\t\taux_adc_vmid[3] = 0x89;\n-\t\t\t\t\taux_adc_gain[3] = 0;\n-\t\t\t\t\tbreak;\n-\t\t\t\tcase WL_CHAN_FREQ_RANGE_5GH:\n-\t\t\t\t\taux_adc_vmid[3] = 0x89;\n-\t\t\t\t\taux_adc_gain[3] = 0;\n-\t\t\t\t\tbreak;\n-\t\t\t\tdefault:\n-\t\t\t\t\tbreak;\n-\t\t\t\t}\n-\t\t\t}\n-\t\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4,\n-\t\t\t\t\t\t 0x08, 16, aux_adc_vmid);\n-\t\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4,\n-\t\t\t\t\t\t 0x18, 16, aux_adc_vmid);\n-\t\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4,\n-\t\t\t\t\t\t 0x0c, 16, aux_adc_gain);\n-\t\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4,\n-\t\t\t\t\t\t 0x1c, 16, aux_adc_gain);\n-\t\t} else if (pdetrange == 1) {\n-\t\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4,\n-\t\t\t\t\t\t 0x08, 16, sk_adc_vmid);\n-\t\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4,\n-\t\t\t\t\t\t 0x18, 16, sk_adc_vmid);\n-\t\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4,\n-\t\t\t\t\t\t 0x0c, 16, sk_adc_gain);\n-\t\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4,\n-\t\t\t\t\t\t 0x1c, 16, sk_adc_gain);\n-\t\t} else if (pdetrange == 2) {\n+\tif (CHSPEC_IS40(pi->radio_chanspec) == 0) {\n+\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_NOISEVAR, 1, 3,\n+\t\t\t\t\t 32, &min_nvar_val);\n+\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_NOISEVAR, 1,\n+\t\t\t\t\t 127, 32, &min_nvar_val);\n+\t} else {\n+\t\tmin_nvar_val = noise_var_tbl_rev3[3];\n+\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_NOISEVAR, 1, 3,\n+\t\t\t\t\t 32, &min_nvar_val);\n \n-\t\t\tu16 bcm_adc_vmid[] = { 0xa2, 0xb4, 0xb4, 0x74 };\n-\t\t\tu16 bcm_adc_gain[] = { 0x02, 0x02, 0x02, 0x04 };\n+\t\tmin_nvar_val = noise_var_tbl_rev3[127];\n+\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_NOISEVAR, 1,\n+\t\t\t\t\t 127, 32, &min_nvar_val);\n+\t}\n \n-\t\t\tif (NREV_GE(pi->pubpi.phy_rev, 6)) {\n-\t\t\t\tchan_freq_range =\n-\t\t\t\t\twlc_phy_get_chan_freq_range_nphy(pi, 0);\n-\t\t\t\tif (chan_freq_range != WL_CHAN_FREQ_RANGE_2G) {\n-\t\t\t\t\tbcm_adc_vmid[3] = 0x8e;\n-\t\t\t\t\tbcm_adc_gain[3] = 0x03;\n-\t\t\t\t} else {\n-\t\t\t\t\tbcm_adc_vmid[3] = 0x94;\n-\t\t\t\t\tbcm_adc_gain[3] = 0x03;\n-\t\t\t\t}\n-\t\t\t} else if (NREV_IS(pi->pubpi.phy_rev, 5)) {\n-\t\t\t\tbcm_adc_vmid[3] = 0x84;\n-\t\t\t\tbcm_adc_gain[3] = 0x02;\n-\t\t\t}\n+\twlc_phy_workarounds_nphy_gainctrl(pi);\n \n-\t\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4,\n-\t\t\t\t\t\t 0x08, 16, bcm_adc_vmid);\n-\t\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4,\n-\t\t\t\t\t\t 0x18, 16, bcm_adc_vmid);\n-\t\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4,\n-\t\t\t\t\t\t 0x0c, 16, bcm_adc_gain);\n-\t\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4,\n-\t\t\t\t\t\t 0x1c, 16, bcm_adc_gain);\n-\t\t} else if (pdetrange == 3) {\n-\t\t\tchan_freq_range =\n-\t\t\t\twlc_phy_get_chan_freq_range_nphy(pi, 0);\n-\t\t\tif ((NREV_GE(pi->pubpi.phy_rev, 4))\n-\t\t\t    && (chan_freq_range == WL_CHAN_FREQ_RANGE_2G)) {\n+\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 0x00, 16,\n+\t\t\t\t &dac_control);\n+\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 0x10, 16,\n+\t\t\t\t &dac_control);\n \n-\t\t\t\tu16 auxadc_vmid[] = {\n-\t\t\t\t\t0xa2, 0xb4, 0xb4, 0x270\n-\t\t\t\t};\n-\t\t\t\tu16 auxadc_gain[] = {\n-\t\t\t\t\t0x02, 0x02, 0x02, 0x00\n-\t\t\t\t};\n+\tpdetrange = (CHSPEC_IS5G(pi->radio_chanspec)) ?\n+\t\t\tpi->srom_fem5g.pdetrange : pi->srom_fem2g.pdetrange;\n \n-\t\t\t\twlc_phy_table_write_nphy(pi,\n-\t\t\t\t\t\t\t NPHY_TBL_ID_AFECTRL, 4,\n-\t\t\t\t\t\t\t 0x08, 16, auxadc_vmid);\n-\t\t\t\twlc_phy_table_write_nphy(pi,\n-\t\t\t\t\t\t\t NPHY_TBL_ID_AFECTRL, 4,\n-\t\t\t\t\t\t\t 0x18, 16, auxadc_vmid);\n-\t\t\t\twlc_phy_table_write_nphy(pi,\n-\t\t\t\t\t\t\t NPHY_TBL_ID_AFECTRL, 4,\n-\t\t\t\t\t\t\t 0x0c, 16, auxadc_gain);\n-\t\t\t\twlc_phy_table_write_nphy(pi,\n-\t\t\t\t\t\t\t NPHY_TBL_ID_AFECTRL, 4,\n-\t\t\t\t\t\t\t 0x1c, 16, auxadc_gain);\n+\tif (pdetrange == 0) {\n+\t\tif (NREV_GE(pi->pubpi.phy_rev, 4)) {\n+\t\t\taux_adc_vmid = aux_adc_vmid_rev4;\n+\t\t\taux_adc_gain = aux_adc_gain_rev4;\n+\t\t} else {\n+\t\t\taux_adc_vmid = aux_adc_vmid_rev3;\n+\t\t\taux_adc_gain = aux_adc_gain_rev3;\n+\t\t}\n+\t\tchan_freq_range = wlc_phy_get_chan_freq_range_nphy(pi, 0);\n+\t\tif (chan_freq_range != WL_CHAN_FREQ_RANGE_2G) {\n+\t\t\tswitch (chan_freq_range) {\n+\t\t\tcase WL_CHAN_FREQ_RANGE_5GL:\n+\t\t\t\taux_adc_vmid[3] = 0x89;\n+\t\t\t\taux_adc_gain[3] = 0;\n+\t\t\t\tbreak;\n+\t\t\tcase WL_CHAN_FREQ_RANGE_5GM:\n+\t\t\t\taux_adc_vmid[3] = 0x89;\n+\t\t\t\taux_adc_gain[3] = 0;\n+\t\t\t\tbreak;\n+\t\t\tcase WL_CHAN_FREQ_RANGE_5GH:\n+\t\t\t\taux_adc_vmid[3] = 0x89;\n+\t\t\t\taux_adc_gain[3] = 0;\n+\t\t\t\tbreak;\n+\t\t\tdefault:\n+\t\t\t\tbreak;\n \t\t\t}\n-\t\t} else if ((pdetrange == 4) || (pdetrange == 5)) {\n-\t\t\tu16 bcm_adc_vmid[] = { 0xa2, 0xb4, 0xb4, 0x0 };\n-\t\t\tu16 bcm_adc_gain[] = { 0x02, 0x02, 0x02, 0x0 };\n-\t\t\tu16 Vmid[2], Av[2];\n+\t\t}\n+\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4,\n+\t\t\t\t\t 0x08, 16, aux_adc_vmid);\n+\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4,\n+\t\t\t\t\t 0x18, 16, aux_adc_vmid);\n+\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4,\n+\t\t\t\t\t 0x0c, 16, aux_adc_gain);\n+\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4,\n+\t\t\t\t\t 0x1c, 16, aux_adc_gain);\n+\t} else if (pdetrange == 1) {\n+\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4,\n+\t\t\t\t\t 0x08, 16, sk_adc_vmid);\n+\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4,\n+\t\t\t\t\t 0x18, 16, sk_adc_vmid);\n+\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4,\n+\t\t\t\t\t 0x0c, 16, sk_adc_gain);\n+\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4,\n+\t\t\t\t\t 0x1c, 16, sk_adc_gain);\n+\t} else if (pdetrange == 2) {\n+\n+\t\tu16 bcm_adc_vmid[] = { 0xa2, 0xb4, 0xb4, 0x74 };\n+\t\tu16 bcm_adc_gain[] = { 0x02, 0x02, 0x02, 0x04 };\n \n+\t\tif (NREV_GE(pi->pubpi.phy_rev, 6)) {\n \t\t\tchan_freq_range =\n-\t\t\t\twlc_phy_get_chan_freq_range_nphy(pi, 0);\n+\t\t\t    wlc_phy_get_chan_freq_range_nphy(pi, 0);\n \t\t\tif (chan_freq_range != WL_CHAN_FREQ_RANGE_2G) {\n-\t\t\t\tVmid[0] = (pdetrange == 4) ? 0x8e : 0x89;\n-\t\t\t\tVmid[1] = (pdetrange == 4) ? 0x96 : 0x89;\n-\t\t\t\tAv[0] = (pdetrange == 4) ? 2 : 0;\n-\t\t\t\tAv[1] = (pdetrange == 4) ? 2 : 0;\n+\t\t\t\tbcm_adc_vmid[3] = 0x8e;\n+\t\t\t\tbcm_adc_gain[3] = 0x03;\n \t\t\t} else {\n-\t\t\t\tVmid[0] = (pdetrange == 4) ? 0x89 : 0x74;\n-\t\t\t\tVmid[1] = (pdetrange == 4) ? 0x8b : 0x70;\n-\t\t\t\tAv[0] = (pdetrange == 4) ? 2 : 0;\n-\t\t\t\tAv[1] = (pdetrange == 4) ? 2 : 0;\n+\t\t\t\tbcm_adc_vmid[3] = 0x94;\n+\t\t\t\tbcm_adc_gain[3] = 0x03;\n \t\t\t}\n+\t\t} else if (NREV_IS(pi->pubpi.phy_rev, 5)) {\n+\t\t\tbcm_adc_vmid[3] = 0x84;\n+\t\t\tbcm_adc_gain[3] = 0x02;\n+\t\t}\n+\n+\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4,\n+\t\t\t\t\t 0x08, 16, bcm_adc_vmid);\n+\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4,\n+\t\t\t\t\t 0x18, 16, bcm_adc_vmid);\n+\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4,\n+\t\t\t\t\t 0x0c, 16, bcm_adc_gain);\n+\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4,\n+\t\t\t\t\t 0x1c, 16, bcm_adc_gain);\n+\t} else if (pdetrange == 3) {\n+\t\tchan_freq_range = wlc_phy_get_chan_freq_range_nphy(pi, 0);\n+\t\tif ((NREV_GE(pi->pubpi.phy_rev, 4)) &&\n+\t\t    (chan_freq_range == WL_CHAN_FREQ_RANGE_2G)) {\n+\t\t\tu16 auxadc_vmid[] = { 0xa2, 0xb4, 0xb4, 0x270 };\n+\t\t\tu16 auxadc_gain[] = { 0x02, 0x02, 0x02, 0x00 };\n \n-\t\t\tbcm_adc_vmid[3] = Vmid[0];\n-\t\t\tbcm_adc_gain[3] = Av[0];\n \t\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4,\n-\t\t\t\t\t\t 0x08, 16, bcm_adc_vmid);\n+\t\t\t\t\t\t 0x08, 16, auxadc_vmid);\n \t\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4,\n-\t\t\t\t\t\t 0x0c, 16, bcm_adc_gain);\n-\n-\t\t\tbcm_adc_vmid[3] = Vmid[1];\n-\t\t\tbcm_adc_gain[3] = Av[1];\n+\t\t\t\t\t\t 0x18, 16, auxadc_vmid);\n \t\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4,\n-\t\t\t\t\t\t 0x18, 16, bcm_adc_vmid);\n+\t\t\t\t\t\t 0x0c, 16, auxadc_gain);\n \t\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4,\n-\t\t\t\t\t\t 0x1c, 16, bcm_adc_gain);\n+\t\t\t\t\t\t 0x1c, 16, auxadc_gain);\n \t\t}\n+\t} else if ((pdetrange == 4) || (pdetrange == 5)) {\n+\t\tu16 bcm_adc_vmid[] = { 0xa2, 0xb4, 0xb4, 0x0 };\n+\t\tu16 bcm_adc_gain[] = { 0x02, 0x02, 0x02, 0x0 };\n+\t\tu16 Vmid[2], Av[2];\n \n-\t\twrite_radio_reg(pi,\n-\t\t\t\t(RADIO_2056_RX_MIXA_MAST_BIAS | RADIO_2056_RX0),\n-\t\t\t\t0x0);\n-\t\twrite_radio_reg(pi,\n-\t\t\t\t(RADIO_2056_RX_MIXA_MAST_BIAS | RADIO_2056_RX1),\n-\t\t\t\t0x0);\n+\t\tchan_freq_range = wlc_phy_get_chan_freq_range_nphy(pi, 0);\n+\t\tif (chan_freq_range != WL_CHAN_FREQ_RANGE_2G) {\n+\t\t\tVmid[0] = (pdetrange == 4) ? 0x8e : 0x89;\n+\t\t\tVmid[1] = (pdetrange == 4) ? 0x96 : 0x89;\n+\t\t\tAv[0] = (pdetrange == 4) ? 2 : 0;\n+\t\t\tAv[1] = (pdetrange == 4) ? 2 : 0;\n+\t\t} else {\n+\t\t\tVmid[0] = (pdetrange == 4) ? 0x89 : 0x74;\n+\t\t\tVmid[1] = (pdetrange == 4) ? 0x8b : 0x70;\n+\t\t\tAv[0] = (pdetrange == 4) ? 2 : 0;\n+\t\t\tAv[1] = (pdetrange == 4) ? 2 : 0;\n+\t\t}\n \n-\t\twrite_radio_reg(pi,\n-\t\t\t\t(RADIO_2056_RX_MIXA_BIAS_MAIN | RADIO_2056_RX0),\n-\t\t\t\t0x6);\n-\t\twrite_radio_reg(pi,\n-\t\t\t\t(RADIO_2056_RX_MIXA_BIAS_MAIN | RADIO_2056_RX1),\n-\t\t\t\t0x6);\n+\t\tbcm_adc_vmid[3] = Vmid[0];\n+\t\tbcm_adc_gain[3] = Av[0];\n+\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4,\n+\t\t\t\t\t 0x08, 16, bcm_adc_vmid);\n+\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4,\n+\t\t\t\t\t 0x0c, 16, bcm_adc_gain);\n+\n+\t\tbcm_adc_vmid[3] = Vmid[1];\n+\t\tbcm_adc_gain[3] = Av[1];\n+\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4,\n+\t\t\t\t\t 0x18, 16, bcm_adc_vmid);\n+\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 4,\n+\t\t\t\t\t 0x1c, 16, bcm_adc_gain);\n+\t}\n \n-\t\twrite_radio_reg(pi,\n-\t\t\t\t(RADIO_2056_RX_MIXA_BIAS_AUX | RADIO_2056_RX0),\n-\t\t\t\t0x7);\n-\t\twrite_radio_reg(pi,\n-\t\t\t\t(RADIO_2056_RX_MIXA_BIAS_AUX | RADIO_2056_RX1),\n-\t\t\t\t0x7);\n+\twrite_radio_reg(pi, (RADIO_2056_RX_MIXA_MAST_BIAS | RADIO_2056_RX0), 0x0);\n+\twrite_radio_reg(pi, (RADIO_2056_RX_MIXA_MAST_BIAS | RADIO_2056_RX1), 0x0);\n \n-\t\twrite_radio_reg(pi,\n-\t\t\t\t(RADIO_2056_RX_MIXA_LOB_BIAS | RADIO_2056_RX0),\n-\t\t\t\t0x88);\n-\t\twrite_radio_reg(pi,\n-\t\t\t\t(RADIO_2056_RX_MIXA_LOB_BIAS | RADIO_2056_RX1),\n-\t\t\t\t0x88);\n+\twrite_radio_reg(pi, (RADIO_2056_RX_MIXA_BIAS_MAIN | RADIO_2056_RX0), 0x6);\n+\twrite_radio_reg(pi, (RADIO_2056_RX_MIXA_BIAS_MAIN | RADIO_2056_RX1), 0x6);\n \n-\t\twrite_radio_reg(pi,\n-\t\t\t\t(RADIO_2056_RX_MIXA_CMFB_IDAC | RADIO_2056_RX0),\n-\t\t\t\t0x0);\n-\t\twrite_radio_reg(pi,\n-\t\t\t\t(RADIO_2056_RX_MIXA_CMFB_IDAC | RADIO_2056_RX1),\n-\t\t\t\t0x0);\n+\twrite_radio_reg(pi, (RADIO_2056_RX_MIXA_BIAS_AUX | RADIO_2056_RX0), 0x7);\n+\twrite_radio_reg(pi, (RADIO_2056_RX_MIXA_BIAS_AUX | RADIO_2056_RX1), 0x7);\n \n-\t\twrite_radio_reg(pi,\n-\t\t\t\t(RADIO_2056_RX_MIXG_CMFB_IDAC | RADIO_2056_RX0),\n-\t\t\t\t0x0);\n-\t\twrite_radio_reg(pi,\n-\t\t\t\t(RADIO_2056_RX_MIXG_CMFB_IDAC | RADIO_2056_RX1),\n-\t\t\t\t0x0);\n+\twrite_radio_reg(pi, (RADIO_2056_RX_MIXA_LOB_BIAS | RADIO_2056_RX0), 0x88);\n+\twrite_radio_reg(pi, (RADIO_2056_RX_MIXA_LOB_BIAS | RADIO_2056_RX1), 0x88);\n \n-\t\ttriso =\n-\t\t\t(CHSPEC_IS5G(pi->radio_chanspec)) ? pi->srom_fem5g.\n-\t\t\ttriso : pi->srom_fem2g.triso;\n-\t\tif (triso == 7) {\n-\t\t\twlc_phy_war_force_trsw_to_R_cliplo_nphy(pi, PHY_CORE_0);\n-\t\t\twlc_phy_war_force_trsw_to_R_cliplo_nphy(pi, PHY_CORE_1);\n-\t\t}\n+\twrite_radio_reg(pi, (RADIO_2056_RX_MIXA_CMFB_IDAC | RADIO_2056_RX0), 0x0);\n+\twrite_radio_reg(pi, (RADIO_2056_RX_MIXA_CMFB_IDAC | RADIO_2056_RX1), 0x0);\n \n-\t\twlc_phy_war_txchain_upd_nphy(pi, pi->sh->hw_phytxchain);\n+\twrite_radio_reg(pi, (RADIO_2056_RX_MIXG_CMFB_IDAC | RADIO_2056_RX0), 0x0);\n+\twrite_radio_reg(pi, (RADIO_2056_RX_MIXG_CMFB_IDAC | RADIO_2056_RX1), 0x0);\n \n-\t\tif (((pi->sh->boardflags2 & BFL2_APLL_WAR) &&\n-\t\t     (CHSPEC_IS5G(pi->radio_chanspec))) ||\n-\t\t    (((pi->sh->boardflags2 & BFL2_GPLL_WAR) ||\n-\t\t      (pi->sh->boardflags2 & BFL2_GPLL_WAR2)) &&\n-\t\t     (CHSPEC_IS2G(pi->radio_chanspec)))) {\n-\t\t\tnss1_data_weights = 0x00088888;\n-\t\t\tht_data_weights = 0x00088888;\n-\t\t\tstbc_data_weights = 0x00088888;\n-\t\t} else {\n-\t\t\tnss1_data_weights = 0x88888888;\n-\t\t\tht_data_weights = 0x88888888;\n-\t\t\tstbc_data_weights = 0x88888888;\n-\t\t}\n-\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_CMPMETRICDATAWEIGHTTBL,\n-\t\t\t\t\t 1, 1, 32, &nss1_data_weights);\n-\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_CMPMETRICDATAWEIGHTTBL,\n-\t\t\t\t\t 1, 2, 32, &ht_data_weights);\n-\t\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_CMPMETRICDATAWEIGHTTBL,\n-\t\t\t\t\t 1, 3, 32, &stbc_data_weights);\n-\n-\t\tif (NREV_IS(pi->pubpi.phy_rev, 4)) {\n-\t\t\tif (CHSPEC_IS5G(pi->radio_chanspec)) {\n-\t\t\t\twrite_radio_reg(pi,\n-\t\t\t\t\t\tRADIO_2056_TX_GMBB_IDAC |\n-\t\t\t\t\t\tRADIO_2056_TX0, 0x70);\n-\t\t\t\twrite_radio_reg(pi,\n-\t\t\t\t\t\tRADIO_2056_TX_GMBB_IDAC |\n-\t\t\t\t\t\tRADIO_2056_TX1, 0x70);\n-\t\t\t}\n-\t\t}\n+\ttriso = (CHSPEC_IS5G(pi->radio_chanspec)) ?\n+\t\t pi->srom_fem5g.triso : pi->srom_fem2g.triso;\n+\tif (triso == 7) {\n+\t\twlc_phy_war_force_trsw_to_R_cliplo_nphy(pi, PHY_CORE_0);\n+\t\twlc_phy_war_force_trsw_to_R_cliplo_nphy(pi, PHY_CORE_1);\n+\t}\n \n-\t\tif (!pi->edcrs_threshold_lock) {\n-\t\t\twrite_phy_reg(pi, 0x224, 0x3eb);\n-\t\t\twrite_phy_reg(pi, 0x225, 0x3eb);\n-\t\t\twrite_phy_reg(pi, 0x226, 0x341);\n-\t\t\twrite_phy_reg(pi, 0x227, 0x341);\n-\t\t\twrite_phy_reg(pi, 0x228, 0x42b);\n-\t\t\twrite_phy_reg(pi, 0x229, 0x42b);\n-\t\t\twrite_phy_reg(pi, 0x22a, 0x381);\n-\t\t\twrite_phy_reg(pi, 0x22b, 0x381);\n-\t\t\twrite_phy_reg(pi, 0x22c, 0x42b);\n-\t\t\twrite_phy_reg(pi, 0x22d, 0x42b);\n-\t\t\twrite_phy_reg(pi, 0x22e, 0x381);\n-\t\t\twrite_phy_reg(pi, 0x22f, 0x381);\n+\twlc_phy_war_txchain_upd_nphy(pi, pi->sh->hw_phytxchain);\n+\n+\tif (((pi->sh->boardflags2 & BFL2_APLL_WAR) &&\n+\t     (CHSPEC_IS5G(pi->radio_chanspec))) ||\n+\t    (((pi->sh->boardflags2 & BFL2_GPLL_WAR) ||\n+\t      (pi->sh->boardflags2 & BFL2_GPLL_WAR2)) &&\n+\t     (CHSPEC_IS2G(pi->radio_chanspec)))) {\n+\t\tnss1_data_weights = 0x00088888;\n+\t\tht_data_weights = 0x00088888;\n+\t\tstbc_data_weights = 0x00088888;\n+\t} else {\n+\t\tnss1_data_weights = 0x88888888;\n+\t\tht_data_weights = 0x88888888;\n+\t\tstbc_data_weights = 0x88888888;\n+\t}\n+\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_CMPMETRICDATAWEIGHTTBL,\n+\t\t\t\t 1, 1, 32, &nss1_data_weights);\n+\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_CMPMETRICDATAWEIGHTTBL,\n+\t\t\t\t 1, 2, 32, &ht_data_weights);\n+\twlc_phy_table_write_nphy(pi, NPHY_TBL_ID_CMPMETRICDATAWEIGHTTBL,\n+\t\t\t\t 1, 3, 32, &stbc_data_weights);\n+\n+\tif (NREV_IS(pi->pubpi.phy_rev, 4)) {\n+\t\tif (CHSPEC_IS5G(pi->radio_chanspec)) {\n+\t\t\twrite_radio_reg(pi,\n+\t\t\t\t\tRADIO_2056_TX_GMBB_IDAC |\n+\t\t\t\t\tRADIO_2056_TX0, 0x70);\n+\t\t\twrite_radio_reg(pi,\n+\t\t\t\t\tRADIO_2056_TX_GMBB_IDAC |\n+\t\t\t\t\tRADIO_2056_TX1, 0x70);\n \t\t}\n+\t}\n \n-\t\tif (NREV_GE(pi->pubpi.phy_rev, 6)) {\n+\tif (!pi->edcrs_threshold_lock) {\n+\t\twrite_phy_reg(pi, 0x224, 0x3eb);\n+\t\twrite_phy_reg(pi, 0x225, 0x3eb);\n+\t\twrite_phy_reg(pi, 0x226, 0x341);\n+\t\twrite_phy_reg(pi, 0x227, 0x341);\n+\t\twrite_phy_reg(pi, 0x228, 0x42b);\n+\t\twrite_phy_reg(pi, 0x229, 0x42b);\n+\t\twrite_phy_reg(pi, 0x22a, 0x381);\n+\t\twrite_phy_reg(pi, 0x22b, 0x381);\n+\t\twrite_phy_reg(pi, 0x22c, 0x42b);\n+\t\twrite_phy_reg(pi, 0x22d, 0x42b);\n+\t\twrite_phy_reg(pi, 0x22e, 0x381);\n+\t\twrite_phy_reg(pi, 0x22f, 0x381);\n+\t}\n \n-\t\t\tif (pi->sh->boardflags2 & BFL2_SINGLEANT_CCK)\n-\t\t\t\twlapi_bmac_mhf(pi->sh->physhim, MHF4,\n-\t\t\t\t\t      MHF4_BPHY_TXCORE0,\n-\t\t\t\t\t      MHF4_BPHY_TXCORE0, BRCM_BAND_ALL);\n-\t\t}\n+\tif (NREV_GE(pi->pubpi.phy_rev, 6)) {\n+\n+\t\tif (pi->sh->boardflags2 & BFL2_SINGLEANT_CCK)\n+\t\t\twlapi_bmac_mhf(pi->sh->physhim, MHF4,\n+\t\t\t\t       MHF4_BPHY_TXCORE0,\n+\t\t\t\t       MHF4_BPHY_TXCORE0, BRCM_BAND_ALL);\n+\t}\n }\n \n void wlc_phy_workarounds_nphy_rev1(struct brcms_phy *pi)\n@@ -17043,102 +16931,101 @@ void wlc_phy_workarounds_nphy_rev1(struct brcms_phy *pi)\n \ts16 beta0, beta1, beta2;\n \tu16 regval;\n \n-\t\tif (pi->sh->boardflags2 & BFL2_SKWRKFEM_BRD ||\n-\t\t    (pi->sh->boardtype == 0x8b)) {\n-\t\t\tuint i;\n-\t\t\tu8 war_dlys[] = { 1, 6, 6, 2, 4, 20, 1 };\n-\t\t\tfor (i = 0; i < ARRAY_SIZE(rfseq_rx2tx_dlys); i++)\n-\t\t\t\trfseq_rx2tx_dlys[i] = war_dlys[i];\n-\t\t}\n+\tif (pi->sh->boardflags2 & BFL2_SKWRKFEM_BRD ||\n+\t    (pi->sh->boardtype == 0x8b)) {\n+\t\tuint i;\n+\t\tu8 war_dlys[] = { 1, 6, 6, 2, 4, 20, 1 };\n+\t\tfor (i = 0; i < ARRAY_SIZE(rfseq_rx2tx_dlys); i++)\n+\t\t\trfseq_rx2tx_dlys[i] = war_dlys[i];\n+\t}\n \n-\t\tif (CHSPEC_IS5G(pi->radio_chanspec) && pi->phy_5g_pwrgain) {\n-\t\t\tand_radio_reg(pi, RADIO_2055_CORE1_TX_RF_SPARE, 0xf7);\n-\t\t\tand_radio_reg(pi, RADIO_2055_CORE2_TX_RF_SPARE, 0xf7);\n-\t\t} else {\n-\t\t\tor_radio_reg(pi, RADIO_2055_CORE1_TX_RF_SPARE, 0x8);\n-\t\t\tor_radio_reg(pi, RADIO_2055_CORE2_TX_RF_SPARE, 0x8);\n-\t\t}\n+\tif (CHSPEC_IS5G(pi->radio_chanspec) && pi->phy_5g_pwrgain) {\n+\t\tand_radio_reg(pi, RADIO_2055_CORE1_TX_RF_SPARE, 0xf7);\n+\t\tand_radio_reg(pi, RADIO_2055_CORE2_TX_RF_SPARE, 0xf7);\n+\t} else {\n+\t\tor_radio_reg(pi, RADIO_2055_CORE1_TX_RF_SPARE, 0x8);\n+\t\tor_radio_reg(pi, RADIO_2055_CORE2_TX_RF_SPARE, 0x8);\n+\t}\n \n-\t\tregval = 0x000a;\n-\t\twlc_phy_table_write_nphy(pi, 8, 1, 0, 16, &regval);\n-\t\twlc_phy_table_write_nphy(pi, 8, 1, 0x10, 16, &regval);\n+\tregval = 0x000a;\n+\twlc_phy_table_write_nphy(pi, 8, 1, 0, 16, &regval);\n+\twlc_phy_table_write_nphy(pi, 8, 1, 0x10, 16, &regval);\n \n-\t\tif (NREV_LT(pi->pubpi.phy_rev, 3)) {\n-\t\t\tregval = 0xcdaa;\n-\t\t\twlc_phy_table_write_nphy(pi, 8, 1, 0x02, 16, &regval);\n-\t\t\twlc_phy_table_write_nphy(pi, 8, 1, 0x12, 16, &regval);\n-\t\t}\n+\tif (NREV_LT(pi->pubpi.phy_rev, 3)) {\n+\t\tregval = 0xcdaa;\n+\t\twlc_phy_table_write_nphy(pi, 8, 1, 0x02, 16, &regval);\n+\t\twlc_phy_table_write_nphy(pi, 8, 1, 0x12, 16, &regval);\n+\t}\n \n-\t\tif (NREV_LT(pi->pubpi.phy_rev, 2)) {\n-\t\t\tregval = 0x0000;\n-\t\t\twlc_phy_table_write_nphy(pi, 8, 1, 0x08, 16, &regval);\n-\t\t\twlc_phy_table_write_nphy(pi, 8, 1, 0x18, 16, &regval);\n+\tif (NREV_LT(pi->pubpi.phy_rev, 2)) {\n+\t\tregval = 0x0000;\n+\t\twlc_phy_table_write_nphy(pi, 8, 1, 0x08, 16, &regval);\n+\t\twlc_phy_table_write_nphy(pi, 8, 1, 0x18, 16, &regval);\n \n-\t\t\tregval = 0x7aab;\n-\t\t\twlc_phy_table_write_nphy(pi, 8, 1, 0x07, 16, &regval);\n-\t\t\twlc_phy_table_write_nphy(pi, 8, 1, 0x17, 16, &regval);\n+\t\tregval = 0x7aab;\n+\t\twlc_phy_table_write_nphy(pi, 8, 1, 0x07, 16, &regval);\n+\t\twlc_phy_table_write_nphy(pi, 8, 1, 0x17, 16, &regval);\n \n-\t\t\tregval = 0x0800;\n-\t\t\twlc_phy_table_write_nphy(pi, 8, 1, 0x06, 16, &regval);\n-\t\t\twlc_phy_table_write_nphy(pi, 8, 1, 0x16, 16, &regval);\n-\t\t}\n+\t\tregval = 0x0800;\n+\t\twlc_phy_table_write_nphy(pi, 8, 1, 0x06, 16, &regval);\n+\t\twlc_phy_table_write_nphy(pi, 8, 1, 0x16, 16, &regval);\n+\t}\n \n-\t\twrite_phy_reg(pi, 0xf8, 0x02d8);\n-\t\twrite_phy_reg(pi, 0xf9, 0x0301);\n-\t\twrite_phy_reg(pi, 0xfa, 0x02d8);\n-\t\twrite_phy_reg(pi, 0xfb, 0x0301);\n+\twrite_phy_reg(pi, 0xf8, 0x02d8);\n+\twrite_phy_reg(pi, 0xf9, 0x0301);\n+\twrite_phy_reg(pi, 0xfa, 0x02d8);\n+\twrite_phy_reg(pi, 0xfb, 0x0301);\n \n-\t\twlc_phy_set_rfseq_nphy(pi, NPHY_RFSEQ_RX2TX, rfseq_rx2tx_events,\n-\t\t\t\t       rfseq_rx2tx_dlys,\n-\t\t\t\t       ARRAY_SIZE(rfseq_rx2tx_events));\n+\twlc_phy_set_rfseq_nphy(pi, NPHY_RFSEQ_RX2TX, rfseq_rx2tx_events,\n+\t\t\t       rfseq_rx2tx_dlys,\n+\t\t\t       ARRAY_SIZE(rfseq_rx2tx_events));\n \n-\t\twlc_phy_set_rfseq_nphy(pi, NPHY_RFSEQ_TX2RX, rfseq_tx2rx_events,\n-\t\t\t\t       rfseq_tx2rx_dlys,\n-\t\t\t\t       ARRAY_SIZE(rfseq_tx2rx_events));\n+\twlc_phy_set_rfseq_nphy(pi, NPHY_RFSEQ_TX2RX, rfseq_tx2rx_events,\n+\t\t\t       rfseq_tx2rx_dlys,\n+\t\t\t       ARRAY_SIZE(rfseq_tx2rx_events));\n \n-\t\twlc_phy_workarounds_nphy_gainctrl(pi);\n+\twlc_phy_workarounds_nphy_gainctrl(pi);\n \n-\t\tif (NREV_LT(pi->pubpi.phy_rev, 2)) {\n+\tif (NREV_LT(pi->pubpi.phy_rev, 2)) {\n \n-\t\t\tif (read_phy_reg(pi, 0xa0) & NPHY_MLenable)\n-\t\t\t\twlapi_bmac_mhf(pi->sh->physhim, MHF3,\n-\t\t\t\t\t       MHF3_NPHY_MLADV_WAR,\n-\t\t\t\t\t       MHF3_NPHY_MLADV_WAR,\n-\t\t\t\t\t       BRCM_BAND_ALL);\n+\t\tif (read_phy_reg(pi, 0xa0) & NPHY_MLenable)\n+\t\t\twlapi_bmac_mhf(pi->sh->physhim, MHF3,\n+\t\t\t\t       MHF3_NPHY_MLADV_WAR,\n+\t\t\t\t       MHF3_NPHY_MLADV_WAR, BRCM_BAND_ALL);\n \n-\t\t} else if (NREV_IS(pi->pubpi.phy_rev, 2)) {\n-\t\t\twrite_phy_reg(pi, 0x1e3, 0x0);\n-\t\t\twrite_phy_reg(pi, 0x1e4, 0x0);\n-\t\t}\n+\t} else if (NREV_IS(pi->pubpi.phy_rev, 2)) {\n+\t\twrite_phy_reg(pi, 0x1e3, 0x0);\n+\t\twrite_phy_reg(pi, 0x1e4, 0x0);\n+\t}\n \n-\t\tif (NREV_LT(pi->pubpi.phy_rev, 2))\n-\t\t\tmod_phy_reg(pi, 0x90, (0x1 << 7), 0);\n-\n-\t\talpha0 = 293;\n-\t\talpha1 = 435;\n-\t\talpha2 = 261;\n-\t\tbeta0 = 366;\n-\t\tbeta1 = 205;\n-\t\tbeta2 = 32;\n-\t\twrite_phy_reg(pi, 0x145, alpha0);\n-\t\twrite_phy_reg(pi, 0x146, alpha1);\n-\t\twrite_phy_reg(pi, 0x147, alpha2);\n-\t\twrite_phy_reg(pi, 0x148, beta0);\n-\t\twrite_phy_reg(pi, 0x149, beta1);\n-\t\twrite_phy_reg(pi, 0x14a, beta2);\n-\n-\t\tif (NREV_LT(pi->pubpi.phy_rev, 3)) {\n-\t\t\tmod_phy_reg(pi, 0x142, (0xf << 12), 0);\n-\n-\t\t\twrite_phy_reg(pi, 0x192, 0xb5);\n-\t\t\twrite_phy_reg(pi, 0x193, 0xa4);\n-\t\t\twrite_phy_reg(pi, 0x194, 0x0);\n-\t\t}\n+\tif (NREV_LT(pi->pubpi.phy_rev, 2))\n+\t\tmod_phy_reg(pi, 0x90, (0x1 << 7), 0);\n+\n+\talpha0 = 293;\n+\talpha1 = 435;\n+\talpha2 = 261;\n+\tbeta0 = 366;\n+\tbeta1 = 205;\n+\tbeta2 = 32;\n+\twrite_phy_reg(pi, 0x145, alpha0);\n+\twrite_phy_reg(pi, 0x146, alpha1);\n+\twrite_phy_reg(pi, 0x147, alpha2);\n+\twrite_phy_reg(pi, 0x148, beta0);\n+\twrite_phy_reg(pi, 0x149, beta1);\n+\twrite_phy_reg(pi, 0x14a, beta2);\n+\n+\tif (NREV_LT(pi->pubpi.phy_rev, 3)) {\n+\t\tmod_phy_reg(pi, 0x142, (0xf << 12), 0);\n+\n+\t\twrite_phy_reg(pi, 0x192, 0xb5);\n+\t\twrite_phy_reg(pi, 0x193, 0xa4);\n+\t\twrite_phy_reg(pi, 0x194, 0x0);\n+\t}\n \n-\t\tif (NREV_IS(pi->pubpi.phy_rev, 2))\n-\t\t\tmod_phy_reg(pi, 0x221,\n-\t\t\t\t    NPHY_FORCESIG_DECODEGATEDCLKS,\n-\t\t\t\t    NPHY_FORCESIG_DECODEGATEDCLKS);\n+\tif (NREV_IS(pi->pubpi.phy_rev, 2))\n+\t\tmod_phy_reg(pi, 0x221,\n+\t\t\t    NPHY_FORCESIG_DECODEGATEDCLKS,\n+\t\t\t    NPHY_FORCESIG_DECODEGATEDCLKS);\n }\n \n static void wlc_phy_workarounds_nphy(struct brcms_phy *pi)\n",
    "prefixes": [
        "v4",
        "3/9"
    ]
}