Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp10337069rwr; Fri, 12 May 2023 07:00:36 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6qaeCLh3QHl/q+t3vIDQ8Wpzkkjy/otvHIf6nW1jqSsiRnSFCLBBuBgACBce92YRRFHRp0 X-Received: by 2002:a05:6a20:9148:b0:103:bad9:1254 with SMTP id x8-20020a056a20914800b00103bad91254mr8552633pzc.6.1683900036147; Fri, 12 May 2023 07:00:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683900036; cv=none; d=google.com; s=arc-20160816; b=FtbTh+EPIHMwrp78ak3EkXOtVg2UHPTH9HbYoKkAFSN5mqgXvomV6YEpJvDwM+v+W0 pe2pKFATVxMyUENIPYywV2Py2JD0CpKn6NODeCJZuJNpuZUj/xAiTYi8anlzFlkqXCvG rApJTxLCXRSMWY2FVilrkwP4TG+O97QPltD1qgEbCbXNjK7lP8wSYgBEk38XCiQ/F8j6 8FbJ9UGcYVpEOReKYgGeLTG0KEMi+buFkibnOP0FACp7+TzkgQkoa34bFf20PzeJenj4 jW96QpFrdtwIHaUqD22BwUYp9IRdqDpdjkh8zT51iRIcs+S8/t1aaEPwuYnjv7k/1wEl 3c0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=uD3Ipvt0NExfmILEv8OKGxIPIOoFOtued5pY1YUMvaA=; b=baURUs783O4ijsYvnNxuny9dhfv53l6pU7+moSdzbsDCX4oIF0PJToEFm/tRQt04OM opcgsjJRX1SXhmr7C9xG2t76kPHUDp71Z+6Pfk5rQ6KPg3zA6M/30A7b6OQzdbQxvQS8 kg2KD67awY1a9JVykdZoeJCAsZfcN+W+6itIK6x6EaRdmxbTAkCVtji050W8hpOpLeHn RKVygaTMDvr1EhzcNx+NEqDUvTyWkLbbjPDZrEcR+6caG1kj9jG9UKA4XIoNQwJQkMDr W7GNivL73a+9AASivq0Hj+sguGzEKgISarUjnSYSBeasU4mQ/9lguF2h763eOOAY0Fy6 58dA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fairphone.com header.s=fair header.b=ZPbUlqd5; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fairphone.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h23-20020a633857000000b00513b4eb72a5si9669540pgn.731.2023.05.12.07.00.12; Fri, 12 May 2023 07:00:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@fairphone.com header.s=fair header.b=ZPbUlqd5; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fairphone.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241409AbjELN7L (ORCPT + 99 others); Fri, 12 May 2023 09:59:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241374AbjELN7F (ORCPT ); Fri, 12 May 2023 09:59:05 -0400 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20FC013C2E for ; Fri, 12 May 2023 06:58:58 -0700 (PDT) Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-96598a7c5e0so1607999566b.3 for ; Fri, 12 May 2023 06:58:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fairphone.com; s=fair; t=1683899936; x=1686491936; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=uD3Ipvt0NExfmILEv8OKGxIPIOoFOtued5pY1YUMvaA=; b=ZPbUlqd510c1ym+w8AeWysEGsU8WE4AvhtiRwFFFnqVDALOh+khbiSvxLg23oSyqZb m23j7QATGuiB4u5f77wUiSITvARRigOD9JS+B/tkoTq68F3Xv8HSx5C+8gufqCGb2jjJ vfVjzyKT6UxdFfWKSp5p+ftUI4XHKVG3wf6dHJVycvhQkMEdGfMDVCKE6Q9hO5a7wwr4 faAyGH3z4UyfAob0fREEEbsUpcUmp5EOxCWdfKQsqY0Pp9kfi8jdZs0uKlY7pUej7IV6 GEgNxH+Bh2Ib7LWsorTTtcuvaEnZz+D04+udrmhsU1TW+sJBVVAmAn82d6dQyBoArZ56 biYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683899936; x=1686491936; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uD3Ipvt0NExfmILEv8OKGxIPIOoFOtued5pY1YUMvaA=; b=lW2p6Hi9m+8pKzPEcteYoM6OHbbfZG2268u33k3J93M29iflkD5Ubs9nYjLrqUgg+R YWlW8qkszrwoSR9WeDp3BRTgKw7GCAWDHkdQ4JJN4vmsO+xX1sXE9/RBGKZBE7D20RZA uO3lAs2pyKzf3L1g36hZ4okvhyR0AmSbAECjCpD0rIKHLhBao67uwcdG0D1P4ZUbAy+q IJPjejyoyE2Ez38t/uqXY4n1+pyHgMMAtjgHNn7FDNSCLpkcuQ2We8ANhvbtOJp4T2Vs R22cM/k7fC4VsmXsMPY2ZtvyKOAQexdXqE8iaVUU4zxKzI7epDPjmyJEaEsm+8QO2WBO vcnw== X-Gm-Message-State: AC+VfDxD1dIHV9Kx69DFCNRBKbY8cs1+PjNb670I1z451SrQqsS0AJsO kyGFa5BSjbSnCZhRPpUkdw8plQ== X-Received: by 2002:a17:907:9347:b0:933:3814:e0f4 with SMTP id bv7-20020a170907934700b009333814e0f4mr23139917ejc.16.1683899936411; Fri, 12 May 2023 06:58:56 -0700 (PDT) Received: from [172.16.240.113] (144-178-202-138.static.ef-service.nl. [144.178.202.138]) by smtp.gmail.com with ESMTPSA id mc27-20020a170906eb5b00b00966330021e9sm5399061ejb.47.2023.05.12.06.58.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 May 2023 06:58:55 -0700 (PDT) From: Luca Weiss Date: Fri, 12 May 2023 15:58:26 +0200 Subject: [PATCH v2 4/4] arm64: dts: qcom: sm7225-fairphone-fp4: Add Bluetooth MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230421-fp4-bluetooth-v2-4-3de840d5483e@fairphone.com> References: <20230421-fp4-bluetooth-v2-0-3de840d5483e@fairphone.com> In-Reply-To: <20230421-fp4-bluetooth-v2-0-3de840d5483e@fairphone.com> To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , Andy Gross , Bjorn Andersson , Konrad Dybcio , Conor Dooley Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-bluetooth@vger.kernel.org, linux-arm-msm@vger.kernel.org, Luca Weiss X-Mailer: b4 0.12.2 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org The device has a WCN3988 chip for WiFi and Bluetooth. Configure the Bluetooth node and enable the UART it is connected to, plus the necessary pinctrl that has been borrowed with comments from sc7280-idp.dtsi. Signed-off-by: Luca Weiss --- arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts | 103 ++++++++++++++++++++++ 1 file changed, 103 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts b/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts index 7ae6aba5d2ec..e3dc49951523 100644 --- a/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts +++ b/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts @@ -31,6 +31,7 @@ / { aliases { serial0 = &uart9; + serial1 = &uart1; }; chosen { @@ -524,6 +525,39 @@ adc-chan@644 { }; }; +&qup_uart1_cts { + /* + * Configure a bias-bus-hold on CTS to lower power + * usage when Bluetooth is turned off. Bus hold will + * maintain a low power state regardless of whether + * the Bluetooth module drives the pin in either + * direction or leaves the pin fully unpowered. + */ + bias-bus-hold; +}; + +&qup_uart1_rts { + /* We'll drive RTS, so no pull */ + drive-strength = <2>; + bias-disable; +}; + +&qup_uart1_rx { + /* + * Configure a pull-up on RX. This is needed to avoid + * garbage data when the TX pin of the Bluetooth module is + * in tri-state (module powered off or not driving the + * signal yet). + */ + bias-pull-up; +}; + +&qup_uart1_tx { + /* We'll drive TX, so no pull */ + drive-strength = <2>; + bias-disable; +}; + &qupv3_id_0 { status = "okay"; }; @@ -561,6 +595,75 @@ &sdhc_2 { &tlmm { gpio-reserved-ranges = <13 4>, <56 2>; + + qup_uart1_sleep_cts: qup-uart1-sleep-cts-state { + pins = "gpio61"; + function = "gpio"; + /* + * Configure a bias-bus-hold on CTS to lower power + * usage when Bluetooth is turned off. Bus hold will + * maintain a low power state regardless of whether + * the Bluetooth module drives the pin in either + * direction or leaves the pin fully unpowered. + */ + bias-bus-hold; + }; + + qup_uart1_sleep_rts: qup-uart1-sleep-rts-state { + pins = "gpio62"; + function = "gpio"; + /* + * Configure pull-down on RTS. As RTS is active low + * signal, pull it low to indicate the BT SoC that it + * can wakeup the system anytime from suspend state by + * pulling RX low (by sending wakeup bytes). + */ + bias-pull-down; + }; + + qup_uart1_sleep_rx: qup-uart1-sleep-rx-state { + pins = "gpio64"; + function = "gpio"; + /* + * Configure a pull-up on RX. This is needed to avoid + * garbage data when the TX pin of the Bluetooth module + * is floating which may cause spurious wakeups. + */ + bias-pull-up; + }; + + qup_uart1_sleep_tx: qup-uart1-sleep-tx-state { + pins = "gpio63"; + function = "gpio"; + /* + * Configure pull-up on TX when it isn't actively driven + * to prevent BT SoC from receiving garbage during sleep. + */ + bias-pull-up; + }; +}; + +&uart1 { + /delete-property/ interrupts; + interrupts-extended = <&intc GIC_SPI 602 IRQ_TYPE_LEVEL_HIGH>, + <&tlmm 64 IRQ_TYPE_EDGE_FALLING>; + + pinctrl-names = "default", "sleep"; + pinctrl-1 = <&qup_uart1_sleep_cts>, <&qup_uart1_sleep_rts>, <&qup_uart1_sleep_tx>, <&qup_uart1_sleep_rx>; + + status = "okay"; + + bluetooth { + compatible = "qcom,wcn3988-bt"; + + vddio-supply = <&vreg_l11a>; + vddxo-supply = <&vreg_l7a>; + vddrf-supply = <&vreg_l2e>; + vddch0-supply = <&vreg_l10e>; + swctrl-gpios = <&tlmm 69 GPIO_ACTIVE_HIGH>; + + max-speed = <3200000>; + }; }; &uart9 { -- 2.40.1