From patchwork Tue Feb 7 05:28:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steev Klimaszewski X-Patchwork-Id: 651470 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 77C6CC6379F for ; Tue, 7 Feb 2023 05:28:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230075AbjBGF2f (ORCPT ); Tue, 7 Feb 2023 00:28:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229954AbjBGF2e (ORCPT ); Tue, 7 Feb 2023 00:28:34 -0500 Received: from mail-oo1-xc33.google.com (mail-oo1-xc33.google.com [IPv6:2607:f8b0:4864:20::c33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 643C323C5B for ; Mon, 6 Feb 2023 21:28:33 -0800 (PST) Received: by mail-oo1-xc33.google.com with SMTP id z138-20020a4a4990000000b005175b8ae66cso1327811ooa.6 for ; Mon, 06 Feb 2023 21:28:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kali.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7LZT5UqZL/4spyb4nQBTM+1EEn8n81bydAtyWcmYTa8=; b=nWEuSWJuoU4uTeKtMWdUTK4BktXnZg1Ds96UmMNyFTL0oe+Z6vz1u/K2VmavcRVEMs JbCF3sUAg8WsED0egHoV4VqEdkvvT4IUh5avtKeSHrZQGFMgbgG4xsu2xh7xOBM+rQHX AWGR7kO+T5GrgqTW+7LYChBQTPERx9fa5i2JcRwKQWefAUU986urHoIAW3WIXlBIrNQv IqiwQ8McjhH8Ar9dC0HJaBD5HVPkWzM/hInsoWDirbCxETvLTZQw6+RD6YkI6XK37fIb JjFkbgLOpBaPWo/+k2QJNuUuTjVl6XEnMvbR276Nkc5oihaCxNUDp/84/rInGbk3ZZZi gdMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7LZT5UqZL/4spyb4nQBTM+1EEn8n81bydAtyWcmYTa8=; b=0nPcnOvfT6nQUaqR16IESV/pi6dlUDVKziI1jm71FSSRRxqq3Ir3nDEfcrrq9IvEM7 kZQx1fMdqoVVS+spDsF+K/yKZ5TeGsf3ydUehHqMLXS+oTKJ0lJiasWokp8hyNtxUw+T BTsD7h7QBQUusnZyMUoKCB6a/aeqDgK5odXh6aozF8gTvvB3OMoDP6lbGdARB2TLu5bw z2l3Bn//4hU/gNT2Wq28LcGTdDQtvnpPWu4SzZV8fzHVpCFY942/qGZE9yWjvR9WWPXr xKJ3SRKKqy4IY6EmuIlQdonWPysWzGojFSfNWJ5vuIMvT32eTtiFM9JOlL5FNy95HHyr 3Hcg== X-Gm-Message-State: AO0yUKXo7qgGmSZ9Ja8MmSGIzJBiSIH8mJg+W70jC+d8LRF5ikQts4LT OWke4fZx/Xs4zjT0RMxzfVYBEnaQL73hvlhXgOA= X-Google-Smtp-Source: AK7set9dKc2GjLZcBjIzabDjcJDyhqapS5wfQJJRL3j3AZKy0mBUDOtr2fmDvHHlO/XHuHkyfCCimg== X-Received: by 2002:a4a:3347:0:b0:51a:2ba5:4356 with SMTP id q68-20020a4a3347000000b0051a2ba54356mr866061ooq.7.1675747712780; Mon, 06 Feb 2023 21:28:32 -0800 (PST) Received: from localhost (23-118-233-243.lightspeed.snantx.sbcglobal.net. [23.118.233.243]) by smtp.gmail.com with ESMTPSA id 1-20020a4a0901000000b004fb9a65daf1sm5531339ooa.43.2023.02.06.21.28.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Feb 2023 21:28:32 -0800 (PST) From: Steev Klimaszewski To: Steev Klimaszewski Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Andy Gross , Bjorn Andersson , Konrad Dybcio , Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , Sven Peter , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-bluetooth@vger.kernel.org, Mark Pearson Subject: [PATCH v4 1/4] dt-bindings: net: Add WCN6855 Bluetooth Date: Mon, 6 Feb 2023 23:28:26 -0600 Message-Id: <20230207052829.3996-2-steev@kali.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230207052829.3996-1-steev@kali.org> References: <20230207052829.3996-1-steev@kali.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add bindings for the QTI WCN6855 chipset. Signed-off-by: Steev Klimaszewski --- Changes since v3: * Separate 6855 enum because we don't need 9 regulators like 6750 * Drop Ack because of changes Changes since v2: * No changes from v2 Changes since v1: * drop second binding in subject line --- .../net/bluetooth/qualcomm-bluetooth.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Documentation/devicetree/bindings/net/bluetooth/qualcomm-bluetooth.yaml b/Documentation/devicetree/bindings/net/bluetooth/qualcomm-bluetooth.yaml index a6a6b0e4df7a..68f78b90d23a 100644 --- a/Documentation/devicetree/bindings/net/bluetooth/qualcomm-bluetooth.yaml +++ b/Documentation/devicetree/bindings/net/bluetooth/qualcomm-bluetooth.yaml @@ -23,6 +23,7 @@ properties: - qcom,wcn3998-bt - qcom,qca6390-bt - qcom,wcn6750-bt + - qcom,wcn6855-bt enable-gpios: maxItems: 1 @@ -133,6 +134,22 @@ allOf: - vddrfa1p7-supply - vddrfa1p2-supply - vddasd-supply + - if: + properties: + compatible: + contains: + enum: + - qcom,wcn6855-bt + then: + required: + - enable-gpios + - swctrl-gpios + - vddio-supply + - vddbtcxmx-supply + - vddrfacmn-supply + - vddrfa0p8-supply + - vddrfa1p2-supply + - vddrfa1p7-supply examples: - | From patchwork Tue Feb 7 05:28:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steev Klimaszewski X-Patchwork-Id: 651469 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 19635C636D4 for ; Tue, 7 Feb 2023 05:28:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230180AbjBGF2m (ORCPT ); Tue, 7 Feb 2023 00:28:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229895AbjBGF2i (ORCPT ); Tue, 7 Feb 2023 00:28:38 -0500 Received: from mail-oa1-x32.google.com (mail-oa1-x32.google.com [IPv6:2001:4860:4864:20::32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 739B923C5B for ; Mon, 6 Feb 2023 21:28:36 -0800 (PST) Received: by mail-oa1-x32.google.com with SMTP id 586e51a60fabf-16a10138faeso11454549fac.11 for ; Mon, 06 Feb 2023 21:28:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kali.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NcCUn+etXz5tPhMNSYc+y9NM2vCskMw7VjiaJS4weeI=; b=LUTiiL4iomfCVnsJCmzAa2Mofa4V6ITWuOo/6UO8X5XH3nBWjAv62OMx0/qaTZQH3+ iznsT2qrzWqzyn8dGbC9FZMi72RRBI5yYqDcTU84NwU6u8Bs+qiNJQudl5KJRcxxeWid lD4isn9/QfPI1EAgA+CVXSex5fZElRUrjpfPc0Dq/h+0ElRjbA1lVNsfvG7Qa7ahhavY HdsAwsKa4fpitiGjWIOdG8FCxNLEXFu64y5I6Xg1o4XiP8tQmIjP8cKZqNBi4DwpqZV9 X9L3vtfXA4hhBllNs+x4OBtulHjGVCRMeHLgiPR24MTHyqONYrFb5LR9oxiSs0jT34S/ PSLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NcCUn+etXz5tPhMNSYc+y9NM2vCskMw7VjiaJS4weeI=; b=LVHa5fEzFmc0gJJULPZBFDA1ZtijWk4jcXrTpsjO4Pr/ntURxIbVGkm5S0KdmBPFHJ Pl8RAW8nKYim0LcKi8dITOHGGoakNPOJVcGjJDKgsIr2vPF1VnXgNLGLCCNTjmPZaJAn KXuLha0HlhwQ+XYSUJUH6jyncU6/ZYM1uw3eZrWbtttYbr3e/RQO/6Z/jh6zQTpRf52A O/fKRxMD/EwuH5g/VRkMgssTYWUHT4+OtGGCWrkUQcxAVLFAxuYFrdrdKMWRuUO3+L3W ry0inQ2lCzdSkq1Jzz+ZQFfCy7S7yc9xGN9EYgKGi3+WaY5UkkyLD0pJDCVqadHkbNtW NMOQ== X-Gm-Message-State: AO0yUKXB7S1M3/22JJ1bGOc33RmqGWgTq61aRdSTlSnpD7IM9RTiDpPY wDkoU+8dILvQrB2M1r3uRotBtQ== X-Google-Smtp-Source: AK7set9VoAqoLINKRBGa+auyEDsHYEwlxdqCNO/c9Z9DL2c/HY3k474RVB6tJmJq0e49Y6SXuyINKw== X-Received: by 2002:a05:6871:8a:b0:16a:180a:b348 with SMTP id u10-20020a056871008a00b0016a180ab348mr659665oaa.16.1675747715722; Mon, 06 Feb 2023 21:28:35 -0800 (PST) Received: from localhost (23-118-233-243.lightspeed.snantx.sbcglobal.net. [23.118.233.243]) by smtp.gmail.com with ESMTPSA id v21-20020a056870e49500b00163b85ef1bfsm4966734oag.35.2023.02.06.21.28.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Feb 2023 21:28:35 -0800 (PST) From: Steev Klimaszewski To: Steev Klimaszewski Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Andy Gross , Bjorn Andersson , Konrad Dybcio , Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , Sven Peter , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-bluetooth@vger.kernel.org, Mark Pearson Subject: [PATCH v4 2/4] Bluetooth: hci_qca: Add support for QTI Bluetooth chip wcn6855 Date: Mon, 6 Feb 2023 23:28:27 -0600 Message-Id: <20230207052829.3996-3-steev@kali.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230207052829.3996-1-steev@kali.org> References: <20230207052829.3996-1-steev@kali.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Added regulators,GPIOs and changes required to power on/off wcn6855. Added support for firmware download for wcn6855. Signed-off-by: Steev Klimaszewski --- Changes since v3: * drop unused regulators Changes since v2: * drop unnecessary commit info Changes since v1: * None --- drivers/bluetooth/btqca.c | 24 ++++++++++++++-- drivers/bluetooth/btqca.h | 10 +++++++ drivers/bluetooth/hci_qca.c | 56 ++++++++++++++++++++++++++++--------- 3 files changed, 75 insertions(+), 15 deletions(-) diff --git a/drivers/bluetooth/btqca.c b/drivers/bluetooth/btqca.c index c9064d34d830..456b961b9554 100644 --- a/drivers/bluetooth/btqca.c +++ b/drivers/bluetooth/btqca.c @@ -472,6 +472,19 @@ static int qca_download_firmware(struct hci_dev *hdev, config->fwname, ret); return ret; } + } else if (soc_type == QCA_WCN6855 && config->type == ELF_TYPE_PATCH) { + bt_dev_dbg(hdev, "QCA Failed to request file: %s (%d)", + config->fwname, ret); + config->type = TLV_TYPE_PATCH; + snprintf(config->fwname, sizeof(config->fwname), + "qca/hpbtfw%02x.tlv", rom_ver); + bt_dev_info(hdev, "QCA Downloading %s", config->fwname); + ret = request_firmware(&fw, config->fwname, &hdev->dev); + if (ret) { + bt_dev_err(hdev, "QCA Failed to request file: %s (%d)", + config->fwname, ret); + return ret; + } } else { bt_dev_err(hdev, "QCA Failed to request file: %s (%d)", config->fwname, ret); @@ -596,7 +609,7 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate, */ rom_ver = ((soc_ver & 0x00000f00) >> 0x04) | (soc_ver & 0x0000000f); - if (soc_type == QCA_WCN6750) + if (soc_type == QCA_WCN6750 || soc_type == QCA_WCN6855) qca_send_patch_config_cmd(hdev); /* Download rampatch file */ @@ -614,6 +627,9 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate, config.type = ELF_TYPE_PATCH; snprintf(config.fwname, sizeof(config.fwname), "qca/msbtfw%02x.mbn", rom_ver); + } else if (soc_type == QCA_WCN6855) { + snprintf(config.fwname, sizeof(config.fwname), + "qca/hpbtfw%02x.tlv", rom_ver); } else { snprintf(config.fwname, sizeof(config.fwname), "qca/rampatch_%08x.bin", soc_ver); @@ -648,6 +664,9 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate, else if (soc_type == QCA_WCN6750) snprintf(config.fwname, sizeof(config.fwname), "qca/msnv%02x.bin", rom_ver); + else if (soc_type == QCA_WCN6855) + snprintf(config.fwname, sizeof(config.fwname), + "qca/hpnv%02x.bin", rom_ver); else snprintf(config.fwname, sizeof(config.fwname), "qca/nvm_%08x.bin", soc_ver); @@ -672,6 +691,7 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate, case QCA_WCN3991: case QCA_WCN3998: case QCA_WCN6750: + case QCA_WCN6855: hci_set_msft_opcode(hdev, 0xFD70); break; default: @@ -685,7 +705,7 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate, return err; } - if (soc_type == QCA_WCN3991 || soc_type == QCA_WCN6750) { + if (soc_type == QCA_WCN3991 || soc_type == QCA_WCN6750 || soc_type == QCA_WCN6855) { /* get fw build info */ err = qca_read_fw_build_info(hdev); if (err < 0) diff --git a/drivers/bluetooth/btqca.h b/drivers/bluetooth/btqca.h index 61e9a50e66ae..b884095bcd9d 100644 --- a/drivers/bluetooth/btqca.h +++ b/drivers/bluetooth/btqca.h @@ -147,6 +147,7 @@ enum qca_btsoc_type { QCA_WCN3991, QCA_QCA6390, QCA_WCN6750, + QCA_WCN6855, }; #if IS_ENABLED(CONFIG_BT_QCA) @@ -168,6 +169,10 @@ static inline bool qca_is_wcn6750(enum qca_btsoc_type soc_type) { return soc_type == QCA_WCN6750; } +static inline bool qca_is_wcn6855(enum qca_btsoc_type soc_type) +{ + return soc_type == QCA_WCN6855; +} #else @@ -206,6 +211,11 @@ static inline bool qca_is_wcn6750(enum qca_btsoc_type soc_type) return false; } +static inline bool qca_is_wcn6855(enum qca_btsoc_type soc_type) +{ + return false; +} + static inline int qca_send_pre_shutdown_cmd(struct hci_dev *hdev) { return -EOPNOTSUPP; diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c index 3df8c3606e93..a35612ba23b2 100644 --- a/drivers/bluetooth/hci_qca.c +++ b/drivers/bluetooth/hci_qca.c @@ -606,7 +606,8 @@ static int qca_open(struct hci_uart *hu) qcadev = serdev_device_get_drvdata(hu->serdev); if (qca_is_wcn399x(qcadev->btsoc_type) || - qca_is_wcn6750(qcadev->btsoc_type)) + qca_is_wcn6750(qcadev->btsoc_type) || + qca_is_wcn6855(qcadev->btsoc_type)) hu->init_speed = qcadev->init_speed; if (qcadev->oper_speed) @@ -1317,7 +1318,8 @@ static int qca_set_baudrate(struct hci_dev *hdev, uint8_t baudrate) /* Give the controller time to process the request */ if (qca_is_wcn399x(qca_soc_type(hu)) || - qca_is_wcn6750(qca_soc_type(hu))) + qca_is_wcn6750(qca_soc_type(hu)) || + qca_is_wcn6855(qca_soc_type(hu))) usleep_range(1000, 10000); else msleep(300); @@ -1394,7 +1396,8 @@ static unsigned int qca_get_speed(struct hci_uart *hu, static int qca_check_speeds(struct hci_uart *hu) { if (qca_is_wcn399x(qca_soc_type(hu)) || - qca_is_wcn6750(qca_soc_type(hu))) { + qca_is_wcn6750(qca_soc_type(hu)) || + qca_is_wcn6855(qca_soc_type(hu))) { if (!qca_get_speed(hu, QCA_INIT_SPEED) && !qca_get_speed(hu, QCA_OPER_SPEED)) return -EINVAL; @@ -1428,7 +1431,8 @@ static int qca_set_speed(struct hci_uart *hu, enum qca_speed_type speed_type) * changing the baudrate of chip and host. */ if (qca_is_wcn399x(soc_type) || - qca_is_wcn6750(soc_type)) + qca_is_wcn6750(soc_type) || + qca_is_wcn6855(soc_type)) hci_uart_set_flow_control(hu, true); if (soc_type == QCA_WCN3990) { @@ -1446,7 +1450,8 @@ static int qca_set_speed(struct hci_uart *hu, enum qca_speed_type speed_type) error: if (qca_is_wcn399x(soc_type) || - qca_is_wcn6750(soc_type)) + qca_is_wcn6750(soc_type) || + qca_is_wcn6855(soc_type)) hci_uart_set_flow_control(hu, false); if (soc_type == QCA_WCN3990) { @@ -1682,7 +1687,8 @@ static int qca_power_on(struct hci_dev *hdev) return 0; if (qca_is_wcn399x(soc_type) || - qca_is_wcn6750(soc_type)) { + qca_is_wcn6750(soc_type) || + qca_is_wcn6855(soc_type)) { ret = qca_regulator_init(hu); } else { qcadev = serdev_device_get_drvdata(hu->serdev); @@ -1723,7 +1729,8 @@ static int qca_setup(struct hci_uart *hu) bt_dev_info(hdev, "setting up %s", qca_is_wcn399x(soc_type) ? "wcn399x" : - (soc_type == QCA_WCN6750) ? "wcn6750" : "ROME/QCA6390"); + (soc_type == QCA_WCN6750) ? "wcn6750" : + (soc_type == QCA_WCN6855) ? "wcn6855" : "ROME/QCA6390"); qca->memdump_state = QCA_MEMDUMP_IDLE; @@ -1735,7 +1742,8 @@ static int qca_setup(struct hci_uart *hu) clear_bit(QCA_SSR_TRIGGERED, &qca->flags); if (qca_is_wcn399x(soc_type) || - qca_is_wcn6750(soc_type)) { + qca_is_wcn6750(soc_type) || + qca_is_wcn6855(soc_type)) { set_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks); hci_set_aosp_capable(hdev); @@ -1757,7 +1765,8 @@ static int qca_setup(struct hci_uart *hu) } if (!(qca_is_wcn399x(soc_type) || - qca_is_wcn6750(soc_type))) { + qca_is_wcn6750(soc_type) || + qca_is_wcn6855(soc_type))) { /* Get QCA version information */ ret = qca_read_soc_version(hdev, &ver, soc_type); if (ret) @@ -1883,6 +1892,20 @@ static const struct qca_device_data qca_soc_data_wcn6750 = { .capabilities = QCA_CAP_WIDEBAND_SPEECH | QCA_CAP_VALID_LE_STATES, }; +static const struct qca_device_data qca_soc_data_wcn6855 = { + .soc_type = QCA_WCN6855, + .vregs = (struct qca_vreg []) { + { "vddio", 5000 }, + { "vddbtcxmx", 126000 }, + { "vddrfacmn", 12500 }, + { "vddrfa0p8", 102000 }, + { "vddrfa1p7", 302000 }, + { "vddrfa1p2", 257000 }, + }, + .num_vregs = 6, + .capabilities = QCA_CAP_WIDEBAND_SPEECH | QCA_CAP_VALID_LE_STATES, +}; + static void qca_power_shutdown(struct hci_uart *hu) { struct qca_serdev *qcadev; @@ -2047,7 +2070,8 @@ static int qca_serdev_probe(struct serdev_device *serdev) if (data && (qca_is_wcn399x(data->soc_type) || - qca_is_wcn6750(data->soc_type))) { + qca_is_wcn6750(data->soc_type) || + qca_is_wcn6855(data->soc_type))) { qcadev->btsoc_type = data->soc_type; qcadev->bt_power = devm_kzalloc(&serdev->dev, sizeof(struct qca_power), @@ -2067,14 +2091,18 @@ static int qca_serdev_probe(struct serdev_device *serdev) qcadev->bt_en = devm_gpiod_get_optional(&serdev->dev, "enable", GPIOD_OUT_LOW); - if (IS_ERR_OR_NULL(qcadev->bt_en) && data->soc_type == QCA_WCN6750) { + if (IS_ERR_OR_NULL(qcadev->bt_en) + && (data->soc_type == QCA_WCN6750 || + data->soc_type == QCA_WCN6855)) { dev_err(&serdev->dev, "failed to acquire BT_EN gpio\n"); power_ctrl_enabled = false; } qcadev->sw_ctrl = devm_gpiod_get_optional(&serdev->dev, "swctrl", GPIOD_IN); - if (IS_ERR_OR_NULL(qcadev->sw_ctrl) && data->soc_type == QCA_WCN6750) + if (IS_ERR_OR_NULL(qcadev->sw_ctrl) + && (data->soc_type == QCA_WCN6750 || + data->soc_type == QCA_WCN6855)) dev_warn(&serdev->dev, "failed to acquire SW_CTRL gpio\n"); qcadev->susclk = devm_clk_get_optional(&serdev->dev, NULL); @@ -2150,7 +2178,8 @@ static void qca_serdev_remove(struct serdev_device *serdev) struct qca_power *power = qcadev->bt_power; if ((qca_is_wcn399x(qcadev->btsoc_type) || - qca_is_wcn6750(qcadev->btsoc_type)) && + qca_is_wcn6750(qcadev->btsoc_type) || + qca_is_wcn6855(qcadev->btsoc_type)) && power->vregs_on) qca_power_shutdown(&qcadev->serdev_hu); else if (qcadev->susclk) @@ -2335,6 +2364,7 @@ static const struct of_device_id qca_bluetooth_of_match[] = { { .compatible = "qcom,wcn3991-bt", .data = &qca_soc_data_wcn3991}, { .compatible = "qcom,wcn3998-bt", .data = &qca_soc_data_wcn3998}, { .compatible = "qcom,wcn6750-bt", .data = &qca_soc_data_wcn6750}, + { .compatible = "qcom,wcn6855-bt", .data = &qca_soc_data_wcn6855}, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, qca_bluetooth_of_match); From patchwork Tue Feb 7 05:28:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steev Klimaszewski X-Patchwork-Id: 651468 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DBC92C636CD for ; Tue, 7 Feb 2023 05:29:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230369AbjBGF3K (ORCPT ); Tue, 7 Feb 2023 00:29:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230236AbjBGF2z (ORCPT ); Tue, 7 Feb 2023 00:28:55 -0500 Received: from mail-oo1-xc2a.google.com (mail-oo1-xc2a.google.com [IPv6:2607:f8b0:4864:20::c2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96B302BF29 for ; Mon, 6 Feb 2023 21:28:40 -0800 (PST) Received: by mail-oo1-xc2a.google.com with SMTP id z25-20020a4ad1b9000000b00517affa07c0so1325218oor.7 for ; Mon, 06 Feb 2023 21:28:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kali.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Gd4sYDNe6UVOrg+q9jpwoTsY9NpzBuVI5nXxucyMsZw=; b=EDW35YE/XRTMMUEDQNybDT4BzNWrzrsr6SEz8tih38Ww92U1TfwKe9dIJCgF5AsHNI yYOeV9usgnONpu2u8IDgVQaTstSn2T8OFHFGWT7O4PzdWe7xtbLaKznmXfywTOZJL7P8 N6ezM9J47wm/eLLMb2+V5BzFArqzpN5nHU6t+Vw/JvyZ8D15v7Bl/65Q2ZBG+PC2mEfS 8I6Okf+ly3oPRxnIQxYiasmtk1BTthtmWAyomqLON1LCh3YPCVa+3zZRdUO/sqnTz0eE taMpP3Yd/WRtUcW14zTV69y15MLbvSK+zfnsr+NWfoiBtQTnxyrBlG1lFvpI+r7/8SrN Z5CQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Gd4sYDNe6UVOrg+q9jpwoTsY9NpzBuVI5nXxucyMsZw=; b=nKloQNlfPMrpHl/8w68ULxyUUloyj6jZaXeXgjHPqLBKj/5cmit83oqVuqh5uwOWjW 6iKQxEgQqoE8s4N0E9s+s5uEimCKJ4AI915f0/FZbiGyXbrb5zf4Pdw0YyyXau01JgYA a5xIefj/aXIm1o2k5KC6kCRqHJPzM0Ifs3Vdzr/FxKNaU1cpGiVD02/RVP2hB+wd6L3X g6tkuvd4omy9hilZ2zfrdFajS4gWOHST6ys2Wae2FYoUqD1ifBgeToYvIf9duKVq70Iv XYiohpybJbnGNlbwf6bP8dTk1RYV2U6b7zUuRDP6avskwpr04fhWLARhQlw6phetl2ss 6c2w== X-Gm-Message-State: AO0yUKVz0t6959ekh/1+2RlmLhQFa7avgxTIDEvoL4gg5KueOHSKAv1V tpjlPkG4kmNtF4V5fjz+SKC3Lg== X-Google-Smtp-Source: AK7set9Uy3D004ifBj8bxCumSdcCXKbgivSVVGaqxQArAm5s+JDPXWj34hs2WLgu1SHb2En8zit28g== X-Received: by 2002:a4a:88c5:0:b0:51a:be3:bcff with SMTP id q5-20020a4a88c5000000b0051a0be3bcffmr955384ooh.7.1675747719599; Mon, 06 Feb 2023 21:28:39 -0800 (PST) Received: from localhost (23-118-233-243.lightspeed.snantx.sbcglobal.net. [23.118.233.243]) by smtp.gmail.com with ESMTPSA id l14-20020a4ae38e000000b004a0ad937ccdsm581478oov.1.2023.02.06.21.28.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Feb 2023 21:28:39 -0800 (PST) From: Steev Klimaszewski To: Steev Klimaszewski Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Andy Gross , Bjorn Andersson , Konrad Dybcio , Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , Sven Peter , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-bluetooth@vger.kernel.org, Mark Pearson Subject: [PATCH v4 4/4] arm64: dts: qcom: thinkpad-x13s: Add bluetooth Date: Mon, 6 Feb 2023 23:28:29 -0600 Message-Id: <20230207052829.3996-5-steev@kali.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230207052829.3996-1-steev@kali.org> References: <20230207052829.3996-1-steev@kali.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The Lenovo Thinkpad X13s has a WCN6855 Bluetooth controller on uart2, add this. Signed-off-by: Steev Klimaszewski --- Changes since v3: * Add vreg_s1c * Add regulators and not dead code * Fix commit message changelog Changes since v2: * Remove dead code and add TODO comment * Make dtbs_check happy with the pin definitions --- .../qcom/sc8280xp-lenovo-thinkpad-x13s.dts | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts index f936b020a71d..8e3c6524e7c6 100644 --- a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts +++ b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts @@ -24,6 +24,8 @@ / { aliases { i2c4 = &i2c4; i2c21 = &i2c21; + serial0 = &uart17; + serial1 = &uart2; }; wcd938x: audio-codec { @@ -297,6 +299,14 @@ pmc8280c-rpmh-regulators { qcom,pmic-id = "c"; vdd-bob-supply = <&vreg_vph_pwr>; + vreg_s1c: smps1 { + regulator-name = "vreg_s1c"; + regulator-min-microvolt = <1880000>; + regulator-max-microvolt = <1900000>; + regulator-allowed-modes = ; + regulator-allow-set-load; + }; + vreg_l1c: ldo1 { regulator-name = "vreg_l1c"; regulator-min-microvolt = <1800000>; @@ -712,6 +722,32 @@ &qup0 { status = "okay"; }; +&uart2 { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&uart2_state>; + + bluetooth { + compatible = "qcom,wcn6855-bt"; + + vddio-supply = <&vreg_s10b>; + vddbtcxmx-supply = <&vreg_s12b>; + vddrfacmn-supply = <&vreg_s12b>; + vddrfa0p8-supply = <&vreg_s12b>; + vddrfa1p2-supply = <&vreg_s11b>; + vddrfa1p7-supply = <&vreg_s1c>; + + max-speed = <3200000>; + + enable-gpios = <&tlmm 133 GPIO_ACTIVE_HIGH>; + swctrl-gpios = <&tlmm 132 GPIO_ACTIVE_HIGH>; + + pinctrl-names = "default"; + pinctrl-0 = <&bt_en>; + }; +}; + &qup1 { status = "okay"; }; @@ -720,6 +756,12 @@ &qup2 { status = "okay"; }; +&uart17 { + compatible = "qcom,geni-debug-uart"; + + status = "okay"; +}; + &remoteproc_adsp { firmware-name = "qcom/sc8280xp/LENOVO/21BX/qcadsp8280.mbn"; @@ -980,6 +1022,19 @@ hastings_reg_en: hastings-reg-en-state { &tlmm { gpio-reserved-ranges = <70 2>, <74 6>, <83 4>, <125 2>, <128 2>, <154 7>; + bt_en: bt-en-state { + hstp-sw-ctrl-pins { + pins = "gpio132"; + function = "gpio"; + }; + + hstp-bt-en-pins { + pins = "gpio133"; + function = "gpio"; + drive-strength = <16>; + }; + }; + edp_reg_en: edp-reg-en-state { pins = "gpio25"; function = "gpio"; @@ -1001,6 +1056,27 @@ i2c4_default: i2c4-default-state { bias-disable; }; + uart2_state: uart2-state { + cts-pins { + pins = "gpio122"; + function = "qup2"; + bias-disable; + }; + + rts-tx-pins { + pins = "gpio122", "gpio123"; + function = "qup2"; + drive-strength = <2>; + bias-disable; + }; + + rx-pins { + pins = "gpio124"; + function = "qup2"; + bias-pull-up; + }; + }; + i2c21_default: i2c21-default-state { pins = "gpio81", "gpio82"; function = "qup21";