From patchwork Fri Jul 5 20:26:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 13725522 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5D13D16DEA4 for ; Fri, 5 Jul 2024 20:27:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720211233; cv=none; b=DPH7Ao4j/6jYa6VV6pRYQH8osg6X6cR4qvSuY2ztRVseAsIhdbfhosL+XBjPVrhcvqRppGswlZ4P+8/nABPmapMM4cHjbpzrHDuFx00GkIApvnJLKGlCkH+oNh6iItEB7OPeaPI8Nu7I87TvGaJicfC30wcxMfYfhuBWcD37gzU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720211233; c=relaxed/simple; bh=lnpdHivpa0ZtGALVGMDdo0DO3IUBtoV7QZSuwbPAAcw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=pBuY8yhB3cKkUXqDmubJ4NboeqWIt7lurvLmKRJ5dNJ56oJX/57OQ8aIv6SFeUJz6DKgOFqAUBBvsHPUXMtJoz00ygl3e5KpwtRcBIXcVrB616ch2awzlsaKEK44HLS9YQWQ2HUfYZ7DHsXdWc67JgzoNagl+B1e2z7MC9FgQ6A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=iPvbFzUq; arc=none smtp.client-ip=209.85.221.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="iPvbFzUq" Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-367963ea053so1523560f8f.2 for ; Fri, 05 Jul 2024 13:27:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1720211229; x=1720816029; darn=vger.kernel.org; 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=ECapj6dpkD5GtOAKeD+vFFeZbzC5454tZ0kmlaK792w=; b=iPvbFzUqPFgIY6pI9vVzKNRsqcTkbyFqCPiEf3wXDEtOPi3iayG3jQgD7SP75uW61m iBUbsCIVKz5jb2O8JCpkNRe/TKlLhIGMLjkO3mJu5s/n2UBvNkAWB04V02omEicri1Ya XSR2+auZYAmoAWSZwR4MHpmxH4SMHkfMIkGFjNAneUpk4LjuJ29a1MFTSQ3RdctUM5rx 77UiADP7Oa/X04HSiTlxuig91MjFEkKzrYRb0x/okQxRMo1QAJ+h3t6rHDi7kfFfNdgg NFzuSl0DYGrVlCpMK5jqTSVL6TQXZpWzGKSwUl46vqn46b6Ryj/TiwObmZXL8sFS5Ykm K+1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720211229; x=1720816029; 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=ECapj6dpkD5GtOAKeD+vFFeZbzC5454tZ0kmlaK792w=; b=wOVXoQr9dtf54s6o4bAC2Xj/MMFj6oo01gECDAs79PDP8ybWjy9V/cw747e6zCdPIh jzSV0JzbFisFpLUtu02fneJZuMGu1R9P6ZgzyRZ9tkPpiJqXuKyGnMq4/d2Bv3yUhu8b 3bkE0F/KCE4MT6Z/UvaYTgdKtEv+/PhjIZjN9i9qPc2N97AbNkXOwuMdEWcO1tSHKqPk obUwENnopjqItbOaZWCWnF8ebUQCROUnLsQOeQDbmgVz0PhvBWVMVL5/PF6HdhZnM9vJ YmEqlRcN25/7xg6fj3ZLGOWM6Rql1i9MGGST/MhUXjEVCpPmCCDFOtG2hJ+tXUasTmHa onLQ== X-Forwarded-Encrypted: i=1; AJvYcCUHxGgoSNHjVelgA1pe9mdKZV7vKELUzMcIdPBVfkqu0ATZSZqqhG0rNejd+thy7Tu+GmiJm3bZU3Xk0CI9EgergbmmuiEM X-Gm-Message-State: AOJu0YyFb/lcqPnY3Pzsc3EKiswiZcpCA/2pJNIucYSh8pxlo3tJ/u6w 0CwsOZMZICbIamw9p+/KbX4fDOQCaTdjJxAXDj3szNh4puXCximN8IfgX9Thwgw= X-Google-Smtp-Source: AGHT+IFJ3z0LfuSofPTxLtIs/z2uSbJf7YDA+LoJh9YBeLMf7b7CW5PSUvb5I70Ar3/fSCgWLJQAow== X-Received: by 2002:adf:f744:0:b0:367:94b8:1dfd with SMTP id ffacd0b85a97d-3679dd65886mr4729145f8f.46.1720211228580; Fri, 05 Jul 2024 13:27:08 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:c688:2842:8675:211]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4264a1d5116sm74397625e9.10.2024.07.05.13.27.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jul 2024 13:27:08 -0700 (PDT) From: Bartosz Golaszewski Date: Fri, 05 Jul 2024 22:26:35 +0200 Subject: [PATCH 1/6] dt-bindings: bluetooth: qualcomm: describe the inputs from PMU for wcn7850 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240705-hci_qca_refactor-v1-1-e2442121c13e@linaro.org> References: <20240705-hci_qca_refactor-v1-0-e2442121c13e@linaro.org> In-Reply-To: <20240705-hci_qca_refactor-v1-0-e2442121c13e@linaro.org> To: Marcel Holtmann , Luiz Augusto von Dentz , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Balakrishna Godavarthi , Rocky Liao , Bjorn Andersson , Konrad Dybcio Cc: linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Bartosz Golaszewski X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1853; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=MP5aeVc3EiqpKpqEdBQnkaD+MInTgWkpRAZc9/j+Em8=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBmiFcYPicO2avBQqbsKBvcUzBp3IboimO9QKK4n PfdrPaQ1KaJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCZohXGAAKCRARpy6gFHHX cgMXEACBb+mwnPffAiFMf1EDNWktjlMyh/let7+4PFla3S+RPhIzl/mRAgIwn+AoD8W5XcJ99R+ IRsasX68VpmJN0/6b+o9rQzeIdWkz0UtGUOya5uz5vECxHGfexnGUtTeAqmG7F0FvGollePDeX4 sOwWF/165hzVfupIwHY8ZP2kmQyxl4gtQ6o7Uz/3zRSL7KeOqsXuVKQ/r1dZ+LYr5/l+QC1Ezvq pa4A9QnweO6w6ryFRuG0bcQpCIrEL4So2qm8QdjJAh05aVuKI0bU7/uTI9s/csIw01wVhN8mFYb dVIwC4FJieuSO8UBvszYTXniVPPyKl7zebul4agHDWM200jQyCngqtbj/05YrrJ2RhMT8cCnGKZ TLxGsnwYhOXP6ZAstmHplcAYqJB3js9piRPqTO5izudP5Mk5+EIwgC5mti7GEfzRV1nPGPAgp8T 5sn2CPTftAhJq1l2xQ35hX37yetxvvPP/cVJsk7p+9snmH1frXkXh6VxFkMme4Myw1MGSbsBski 6qasn4zhnRX8M4u1Ul+CTFeZP9A5ExFw0hE1LnKX/nJr65GtEi6ygh+ZPfweMHO7+rxr1Q64FF4 EoJCY6uCnUVGJO0qzlauLPpGC9FMKv6uEzw+XvYhZbwD2fkIlq/Z0iScehBja6WNhPdnkflil37 qOXMzVciG2sqIag== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 X-Patchwork-Delegate: kuba@kernel.org From: Bartosz Golaszewski Drop the inputs from the host and instead expect the Bluetooth node to consume the outputs of the internal PMU. This model is closer to reality than how we represent it now. Signed-off-by: Bartosz Golaszewski --- .../bindings/net/bluetooth/qualcomm-bluetooth.yaml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/Documentation/devicetree/bindings/net/bluetooth/qualcomm-bluetooth.yaml b/Documentation/devicetree/bindings/net/bluetooth/qualcomm-bluetooth.yaml index 48ac9f10ef05..68c5ed111417 100644 --- a/Documentation/devicetree/bindings/net/bluetooth/qualcomm-bluetooth.yaml +++ b/Documentation/devicetree/bindings/net/bluetooth/qualcomm-bluetooth.yaml @@ -77,6 +77,9 @@ properties: vddrfa1p7-supply: description: VDD_RFA_1P7 supply regulator handle + vddrfa1p8-supply: + description: VDD_RFA_1P8 supply regulator handle + vddrfa1p2-supply: description: VDD_RFA_1P2 supply regulator handle @@ -89,6 +92,12 @@ properties: vddasd-supply: description: VDD_ASD supply regulator handle + vddwlcx-supply: + description: VDD_WLCX supply regulator handle + + vddwlmx-supply: + description: VDD_WLMX supply regulator handle + max-speed: description: see Documentation/devicetree/bindings/serial/serial.yaml @@ -179,14 +188,13 @@ allOf: - qcom,wcn7850-bt then: required: - - enable-gpios - - swctrl-gpios - - vddio-supply + - vddrfacmn-supply - vddaon-supply - - vdddig-supply + - vddwlcx-supply + - vddwlmx-supply - vddrfa0p8-supply - vddrfa1p2-supply - - vddrfa1p9-supply + - vddrfa1p8-supply - if: properties: compatible: From patchwork Fri Jul 5 20:26:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 13725523 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8A089176AA2 for ; Fri, 5 Jul 2024 20:27:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720211234; cv=none; b=oKtRMruZE4lPt4YcLCTXs3NPnQl5xtjkKX8IZehhWsygmlYT2ABgTXmu7Hhyh3dPZsooG5SHyT87wVGBkpHHQh7Yf731HHD9dRVlzVpwR68HcUStGiBzASoghyFsyNm6v8npMuNVpcXOBUZ41LTNftdgZkC7oRew6h9lsRsSFes= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720211234; c=relaxed/simple; bh=BHZpwUurXz6EHmSePeAstBj5C3my+ISMfUE7d9hT6nU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=GGeXcuzBFN5GQrjebJGVQcaaxPgkhxf6RTpIATTfblWtekD8/W99nRnmw9FCAjgUC7EgH3uzZZ75Lparceoe1rqzVXSOFKgrYDFwLLNCHWyf5tIbvwfPC/y9XeGbDYtxcO+Zm5TIFyaTLMmkmX+ZaNdj8seK1wFX3fFQxY0QI14= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=ghqX7XYU; arc=none smtp.client-ip=209.85.128.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="ghqX7XYU" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-42122ac2f38so12575475e9.1 for ; Fri, 05 Jul 2024 13:27:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1720211230; x=1720816030; darn=vger.kernel.org; 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=RhxeWNbsehkvTYXadehkR5iqHrP46Gy95tZ+1/cyqoQ=; b=ghqX7XYU0OeltDmllXgwh3jERx7z9YusVk/KrllXGMjss19RAA26jgumpLdJSK9UV3 upcND/mU6qucHhM4nFBTVx2HZjtP2FuwRju7pNzSqKlGvqSOd7rHoG69aTvgWR9LB+vW goB/hy3WBHbHyRZxXawVPyHvBIl+ioX1CB1Y4TppOLHK3goG0jG+5k+UG3frrZf2xFfX UJ2gq/IgVfB7QNmQnUGv6FXHDsiYll3VJmgMVEnceSV7SzSDvchwSqMN/K1sQbhzEhkm mc9ERRzRHr5jNhSoNGBGax7E7UPFxbgCPuud3cN6K9ykH6nf4JlVl/1K6n1YsJTNgoO8 mYuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720211230; x=1720816030; 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=RhxeWNbsehkvTYXadehkR5iqHrP46Gy95tZ+1/cyqoQ=; b=Yj8PzuoihbBZWVLFFsxv3ffQ+amFvqzdIJqP6Vwa9+tjmaUZKp9H/XkuANHWR8Chl3 Cs523vw05Yl3ghXfp3P2Rqo4CmdOE/aGudHVjZlJcXwFyKdGEQApelzAjP2AKUijsieu U2i3vYH5vUVhOlNbxw95WWq7KfxZ0SOuAT9vZux3j+J9maldCLOeuGevj4bvSXPOBjmA JAfz8MvzHPHkHAZdGjMNpN3WCuli1Kqw6RsIv34daFnD/2rzsEfSosz9tyYN9SeySCdx NkcKrh3tPjfnVbsTUAVHOU1KW0btpafcZtJ43gsTrpuiUOImxte0aF0Vb03kbyTR9zxC ldNw== X-Forwarded-Encrypted: i=1; AJvYcCVHhiEke6bcQrr0un5tZ+V0lMQFI4AUDjflRt0jzXk17plnMJLzFSUIzmrLCNX7vksW3sS0QBHLa0LCmsksTRwZvFU/xnXH X-Gm-Message-State: AOJu0YxaKIRwJDG9lyE7yDJZqbHqYtWIYL0et5sVBXuug1mTmdUGlRRV Dp07x8awiWIoAnoxiJFqnH8860xCGi5O0PNB/NKP/A2I5AAOlj5ylJJAa9imKto= X-Google-Smtp-Source: AGHT+IEhEdRIa0FfJfC3c9Ak5qO6SfMmWAfIVvgBak2MobkC2CRcPCUQJyJZWnWfde4yEeCXAFECFA== X-Received: by 2002:a05:600c:3547:b0:425:7aa7:e490 with SMTP id 5b1f17b1804b1-4264b0c50ecmr48207955e9.3.1720211230038; Fri, 05 Jul 2024 13:27:10 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:c688:2842:8675:211]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4264a1d5116sm74397625e9.10.2024.07.05.13.27.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jul 2024 13:27:09 -0700 (PDT) From: Bartosz Golaszewski Date: Fri, 05 Jul 2024 22:26:36 +0200 Subject: [PATCH 2/6] Bluetooth: hci_qca: schedule a devm action for disabling the clock Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240705-hci_qca_refactor-v1-2-e2442121c13e@linaro.org> References: <20240705-hci_qca_refactor-v1-0-e2442121c13e@linaro.org> In-Reply-To: <20240705-hci_qca_refactor-v1-0-e2442121c13e@linaro.org> To: Marcel Holtmann , Luiz Augusto von Dentz , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Balakrishna Godavarthi , Rocky Liao , Bjorn Andersson , Konrad Dybcio Cc: linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Bartosz Golaszewski X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1835; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=ioulty3Koez8d+kC3c/wVdy/glxCtXawrHUZeGjPJfg=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBmiFcYktlTUSh5+2R72g8hp1y+NQBm5mc2IAjPl 60MEldV/RCJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCZohXGAAKCRARpy6gFHHX cqkUEACTILPVYt3HW639Sz4v+7V7oRX/iHEZ9svUqZt8Dgv12PpnpGQqJ3BnagDOTwEU2de+/jN iOO6/tmwAda1LUxNpUIFx6xSLZhiICcdPGd46xkjEl/XDyfPZSpSIQYOCkQ30gItLhlYvXMnuCk LH4FXCuA2S38ZpiTOWLmVbQODeUz9AK1HRbMjm6vp68zH3A72MXj2pM70HJzy/oIsjLWgEDBbqd t4assCUa3wIYL+KlMqwPZ8dvjnDYkRw4/uNLeGIMQlqZ5uyIiNEJrxDTozXwKqOnxkwPq0U8ABS heqLpiKLWxhDbNERciw3yR64CPYAR7aQaD++oWQ7WVTgrKbzL4cBMza9o4WIYif3htIRobQe1+w G16IydvNtwKDmvY5fhvoxlHCOKq7nzvJYRZDMn38V6aCVl37d88CTqBsfSXhvuzPD/hle2YwWiC OxRDwjRVcG1ZmomC46SWNh+CjuynLT/JlfaWFDU6VBK8tNDyCmEasPTRQOE6nOXl2j6gucwpTO0 tN6rLUgHztZ/Li/NI12Vw04C4DfZR80afUJYXMKMX4b5OYfZXIxnC1/RkYQaYqy+RpNG5ibT6Jf xX/1gF49OK+/84lQVT7WTZ4dMUbT3vmiTK0PGmXNyZbL4Cjrh7oQF5dXAIwGl9gjRfDd2MxjtTp sdXDacC+Zt4szhw== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski In preparation for unduplicating the hci_uart registration code, schedule a devres action for disabling the SUSCLK rather than doing it manually. We cannot really use devm_clk_get_enabled() as we also set the rate before enabling the clock. While this should in theory work, I don't want to risk breaking existing users. One solution for the future is to add devm_clk_get_enabled_with_rate() to the clock framework. Signed-off-by: Bartosz Golaszewski --- drivers/bluetooth/hci_qca.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c index bc6a49ba26f9..895ce8e11da8 100644 --- a/drivers/bluetooth/hci_qca.c +++ b/drivers/bluetooth/hci_qca.c @@ -2295,6 +2295,13 @@ static int qca_init_regulators(struct qca_power *qca, return 0; } +static void qca_clk_disable_unprepare(void *data) +{ + struct clk *clk = data; + + clk_disable_unprepare(clk); +} + static int qca_serdev_probe(struct serdev_device *serdev) { struct qca_serdev *qcadev; @@ -2434,10 +2441,15 @@ static int qca_serdev_probe(struct serdev_device *serdev) if (err) return err; + err = devm_add_action_or_reset(&serdev->dev, + qca_clk_disable_unprepare, + qcadev->susclk); + if (err) + return err; + err = hci_uart_register_device(&qcadev->serdev_hu, &qca_proto); if (err) { BT_ERR("Rome serdev registration failed"); - clk_disable_unprepare(qcadev->susclk); return err; } } @@ -2484,8 +2496,6 @@ static void qca_serdev_remove(struct serdev_device *serdev) fallthrough; default: - if (qcadev->susclk) - clk_disable_unprepare(qcadev->susclk); } hci_uart_unregister_device(&qcadev->serdev_hu); From patchwork Fri Jul 5 20:26:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 13725524 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8FD25176AC6 for ; Fri, 5 Jul 2024 20:27:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720211234; cv=none; b=Ppz2NGQZvLHu20yROS1y65A3Pt+UdZ9vGTymPrHzjijw9EUorhVsSQsY/IhcQJEnQqqKkYTRJgZ/mk/cFQzQB1oULApXNT+daIOoQ4TAZeNTX9HKRsX772yFoRVLkgP0MmYbTQk5u562FZYjn7aBWlsPbgLa2kdFC8oGhLzTYkE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720211234; c=relaxed/simple; bh=3JJpQ+oo3xGyTKVTn2HDGtuueCXPZ8B1Bep/el2fYlA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=m8NEKmrYauvWJV/fe9sGkyxBm1ujzD5hlrHG1VixhJkd5AMactDSP3D1DFRGyF6H6vR7bXY6yGB/q6AyC/O43D/tyRnILzlX9BYTSE/GEOVR8wdKJIVvW6Ap+iit1LxI5Qu1HvnUYXNbFZzYhu37yT3lseXkKIoQltS9C5Onu5w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=jyBAdPJ8; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="jyBAdPJ8" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-42567ddf099so13731485e9.3 for ; Fri, 05 Jul 2024 13:27:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1720211231; x=1720816031; darn=vger.kernel.org; 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=ek4Qbx2Gvl17zeQGl5E0Vo1b4PWxuZXdNVZczTqRXn4=; b=jyBAdPJ8emeD3SMosM+kmFgRdBvnPO/Mmu5Y/9HZ4vVFwCn/paTULOJDt1Eg6Im+J5 Xcn27poi/Xj4rcv6YPT19mPUxFsChDY52VydsfIv4povwyCdcPh48zQ5cYgIcday827O whiIZLKKYsRJSO73nJgzRQuNZqMvLT07th5YSgtvHB/vTLjSUnnOeftA/YrhwTLwi7Cw IBkl32h5DSVXXRyxm1gyuMsjb0+2kxS9XsuTlA+j443sXb8j6yTen++i4SHRJhXmNXUI peEV79O2T8qId0BEag/p+kDO0mtWJbR3yZ9eDhYyANNG8XR6mExulElXxaWaqtBQEOy7 Jk2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720211231; x=1720816031; 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=ek4Qbx2Gvl17zeQGl5E0Vo1b4PWxuZXdNVZczTqRXn4=; b=N4ZvFS12XJOD54eEZQQbihzNW4UYowBuMkNvxmZMESpRBzwo6/2qJvyynQaTrKK0Uo UZUhuDolJW/UcU/b9e3/yFPiV4FSlS32DDgSYj2DdV3gOSYoCsfQg0U/dCxPNtwAoYXY +/IUl01sMX+79u6uo9y1TNtcOt3PlUv1fJ9S8Qo6CduROTPzZVF7NmCRI78BTU1mK9+G sAzJ+2mADiy4dkBlStGjPko0Pnm7vugYViG1gYBuBp0PufOUkdQYjXgXOYAzM1IYxMSc DKlq/TUbc2pMIsgYhXoDf2uaovvAiJ7wjeI6yo2QNo2hB0RdyTJ3HEHRzSw1YvycMBk2 7gFQ== X-Forwarded-Encrypted: i=1; AJvYcCWZrFwZuNiQl2SdHj3EWL5gYDCgsVsPfiN0kxk1xM7nirTkvXQpFCTognbPya57Dj2SbwM6XLu8KwalzpUYDZ6xV/jkc95H X-Gm-Message-State: AOJu0YxovnhwAVMczDrEhRFQpWVenxTawwIPwGfbZtOx0HvN4ycUJn/0 PoFfmBi+lsawGGA2sIoMWdMyyRSU19geQpC32cthW36cd8/kxQ9C/9oOmVGouo0= X-Google-Smtp-Source: AGHT+IFrg9DRIHULVIyH1hCiF8TSXKC2iWRZWcbSi5KPaPVXlXlOFP2zwMp64pZpDq9d2F7Ank8eyA== X-Received: by 2002:a05:600c:54e6:b0:426:5cdf:266c with SMTP id 5b1f17b1804b1-4265cdf28d7mr7174305e9.7.1720211231157; Fri, 05 Jul 2024 13:27:11 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:c688:2842:8675:211]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4264a1d5116sm74397625e9.10.2024.07.05.13.27.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jul 2024 13:27:10 -0700 (PDT) From: Bartosz Golaszewski Date: Fri, 05 Jul 2024 22:26:37 +0200 Subject: [PATCH 3/6] Bluetooth: hci_qca: unduplicate calls to hci_uart_register_device() Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240705-hci_qca_refactor-v1-3-e2442121c13e@linaro.org> References: <20240705-hci_qca_refactor-v1-0-e2442121c13e@linaro.org> In-Reply-To: <20240705-hci_qca_refactor-v1-0-e2442121c13e@linaro.org> To: Marcel Holtmann , Luiz Augusto von Dentz , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Balakrishna Godavarthi , Rocky Liao , Bjorn Andersson , Konrad Dybcio Cc: linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Bartosz Golaszewski X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1766; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=SiXd2qnQF7139UYHDKSEmoyHNzAxnCurvumJqhFNm/g=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBmiFcZM99X+s1yRAHziWgjQ+T9Z7+lxTuiH8TFI Y9DUUb3PoeJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCZohXGQAKCRARpy6gFHHX cpZOEACjEByW+4Ok5NsnJdvArQDiDIsxDAQ0+VtTkRxFb9wk0QrNkjpf01aFZBGeZbIAWQ5EB3I l+Z3roz4oHtWiolhFEvpYiNJKkuqzJhTM3lm47sUXJmu/7POleEewFpM7/Rm7oskz682tJdYIBK sgMzq3Rj6WRFlx4I2FQUNn/eQwHT+0mFEym0vsrZ/HSMteOrZdokU9O7a39gLmhTHjvMFHXFY/s HLHnVLlG8krBU2jfLTHb3auKwFIYRn2wwwP8QlRjEa2R8wE9C1Bg/Gv85WG3C2SNv6qn8j/3Df4 zqiuTc/J4ZfU9kMXq7AfJpuHv6K4ZZH8T2cIqhKGEuR9M+R8Ll0Es0XjWDa2mhuX6I9uvz+0P+f MAyIHJ5SutrMgrkWzNL+wfNGOciSuKHg/xiQoj6RqZxNzfhF+5ZWR/keG14QdoQlwPfQadtlR+c C9dF09LU5lmz8+hzDKjMOPvfKxQVQk80EhSxLe3mGk10XDK0UUJidsxbQWYxujR5JBMdXbCJA6M g+5na7izEDt+wg6JTGlZx4EXBnwQemzXvOq8ryvp5Aq3qQXV4HR9TZ4aZfgf0Ak/o6P8c2TUAMr ooccqP48SzYBUTapimUfG/FqpmqzMgoYKNK83Jzp/lKh/4cgxczgZbrnF9omxn4PT/5fswrDroW 0VDrtijwsbJWGHw== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski Now that all three branches of the switch end up doing the same thing, we can move the call to hci_uart_register_device() past it and unify the error message. Signed-off-by: Bartosz Golaszewski --- drivers/bluetooth/hci_qca.c | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c index 895ce8e11da8..c4546f6b6a19 100644 --- a/drivers/bluetooth/hci_qca.c +++ b/drivers/bluetooth/hci_qca.c @@ -2396,12 +2396,6 @@ static int qca_serdev_probe(struct serdev_device *serdev) dev_err(&serdev->dev, "failed to acquire clk\n"); return PTR_ERR(qcadev->susclk); } - - err = hci_uart_register_device(&qcadev->serdev_hu, &qca_proto); - if (err) { - BT_ERR("wcn3990 serdev registration failed"); - return err; - } break; case QCA_QCA6390: @@ -2409,12 +2403,6 @@ static int qca_serdev_probe(struct serdev_device *serdev) "bluetooth"); if (IS_ERR(qcadev->bt_power->pwrseq)) return PTR_ERR(qcadev->bt_power->pwrseq); - - err = hci_uart_register_device(&qcadev->serdev_hu, &qca_proto); - if (err) { - BT_ERR("qca6390 serdev registration failed"); - return err; - } break; default: @@ -2447,11 +2435,12 @@ static int qca_serdev_probe(struct serdev_device *serdev) if (err) return err; - err = hci_uart_register_device(&qcadev->serdev_hu, &qca_proto); - if (err) { - BT_ERR("Rome serdev registration failed"); - return err; - } + } + + err = hci_uart_register_device(&qcadev->serdev_hu, &qca_proto); + if (err) { + BT_ERR("serdev registration failed"); + return err; } hdev = qcadev->serdev_hu.hdev; From patchwork Fri Jul 5 20:26:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 13725525 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 98AD8176FDB for ; Fri, 5 Jul 2024 20:27:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720211236; cv=none; b=t/l1jVWzPwGAG64+zeDsaA6piAOpwckvQXUzComZQuDEbnjwgRWce2QWGG+oMck5x3LfvASpi2RpqAYmH3hk9AhXMzdnZwePCSERFhmUZJQ+TbNeHGRX3/9lt8bDjWCh9UJPw4GPeo+9uIpJNZ0JNAPfmAOYcc7hAG2h0nxuVSU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720211236; c=relaxed/simple; bh=vZbYLkT7sc39H69a0omh1DqJUGzm0SozpFlhFopuBE8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ZS/NEhsjZSIGP05pQWZLxxQSyjLgh3sLOZQBT09Zd5VNbOpgz0aWvQpCQiHVzMnZY9mIeDbPdoa+cX9VUuB5jhSKEJCb2fh70XwEj7+YSGc1saZOFaqobXdLHKbhiMt58ZYCwF59XqC1sd9o9lp77tov32GKnyMlh8Zs53CkvOA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=V8oiVvwV; arc=none smtp.client-ip=209.85.128.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="V8oiVvwV" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-4257d5fc9b7so17430655e9.2 for ; Fri, 05 Jul 2024 13:27:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1720211232; x=1720816032; darn=vger.kernel.org; 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=6poXA8vtF9YhtBJpFyw5H5N1WqhPbFnwYiqesDZxMKA=; b=V8oiVvwV30/t7CWztGUBRFu73dfpH86oVEdYC67REBs0dauMW7B+Pz9TRjzKENTaqM kapAAx3gKkBgmbuQmnr3n68QqUQsJd791yOFpgusVTs1Jcf7DyZFSJ/obSCsfXxsYaFI 01cBXKK3paRTNb68IGFz6BvA6J3ftvDt/Bzb6NMV7J8VK7rz2sco+rdvZFKVOoYSaxKZ Ddy3DF90g9gp4jMXkB6WninXL9Iu+W8nkCra06vXBXePrSE0nCSTfpMcoahTsl4h+ODB /5oFeELBfXpXcWBM7+AoqUWYAHiR/qVKVKtZ1hGQ4J/CHOl0b3ePQ51wjODQ28Uy0Q1m mecQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720211232; x=1720816032; 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=6poXA8vtF9YhtBJpFyw5H5N1WqhPbFnwYiqesDZxMKA=; b=VpxUji9/vLLjzwNNIBuuLRlD4xMIj3XsK/0TEA6R+lBI6Xhvf2KqZuMBJBCWpuMUI7 ski7jlkdDwo4mLpin2TIbDiEhsETMA5hbxemm4UsrZQEinuBh9foHn52dj6pBDc3Lkc0 6/4Qnws0BwmZGPApHQ4jsBkhRPGVUBWK0+zJQS1Hq1mx/lyKtJ7VIJPGNI0EDXboqR+J ewZ5fCQ2NB9F8/7FDNvGO8f6nsV9tmPdWIYnT10vlK2VPMyR08Dxmss4KGx0s7vlZ97d aFGxRRUlgMBIPc8l5nkHn1f+Y11beG1g4PIGVCZu8E4hX8sPrzt4DoUPKaliYvaBLRq0 l2Ag== X-Forwarded-Encrypted: i=1; AJvYcCV+GHLYLzmQn7jVJcR7m6Cy5f+hK6UhkPofC2G1S7qzyKsLplR7AyqBV5pWV36rnUzUK58JgEDzJe7hvPXO1c2ZGEzfnvDB X-Gm-Message-State: AOJu0Yy/KtJ7+l4okskrT3voNQAF6IQj/HEmeIw76W2ujhWfcsEPD17m bYjtjVUSuCo3T126gN+4BByzTOQ2QZesGkOZCfR+0bI0SyWRWJ8FuLZTKR6GKrU= X-Google-Smtp-Source: AGHT+IEsJGhws+ipXp+0gVAmOwuUyWO7G5ZOakq+4XRgX1PO5fvzeU35nkYtV2nT+c7CWK7eTKK0pQ== X-Received: by 2002:a05:600c:1790:b0:424:784c:b134 with SMTP id 5b1f17b1804b1-4264a3bc345mr49401935e9.6.1720211232143; Fri, 05 Jul 2024 13:27:12 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:c688:2842:8675:211]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4264a1d5116sm74397625e9.10.2024.07.05.13.27.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jul 2024 13:27:11 -0700 (PDT) From: Bartosz Golaszewski Date: Fri, 05 Jul 2024 22:26:38 +0200 Subject: [PATCH 4/6] Bluetooth: hci_qca: make pwrseq calls the default if available Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240705-hci_qca_refactor-v1-4-e2442121c13e@linaro.org> References: <20240705-hci_qca_refactor-v1-0-e2442121c13e@linaro.org> In-Reply-To: <20240705-hci_qca_refactor-v1-0-e2442121c13e@linaro.org> To: Marcel Holtmann , Luiz Augusto von Dentz , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Balakrishna Godavarthi , Rocky Liao , Bjorn Andersson , Konrad Dybcio Cc: linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Bartosz Golaszewski X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2211; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=ZpmEwvey3NWw9NR2sGz0nekucDSBfXs9XCKX9XuYIUw=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBmiFcZuYqZq1MSlsn+OQ/IpMG7OxTxDwudgIdL5 sNr/Qr50K2JAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCZohXGQAKCRARpy6gFHHX cu9cD/0c1tzgFobG3RdRL0G+fTJSG222aEjj11NL97yelwleF2EU+h5oDzZZWeU9wzEef/+BLwN 6pi2ix/fGuvfkfilTAXIXcskJ/OvMmfHPSxP/8C9PzHb6bvC7Axv3TSSMOWwvO0AVYmD6ebK7KI Gk9FPWnXh7bzpUShQMwqSj8V0FGSZ9TRAsoqcUOHcm2VZqgwPT2oFiMg5qSsi63GhdxHw7YjhGw dpy96QnxtHkktk7KXXmaT8u8GTF1pkXRhvaE2P0w1j3I8NwFkSfK9Daog4NDLenRmZwW5DfbW1e QKqxoRQv20ojGLdeFiAOjUKeg0LwF5ag8GoUQZor6IrPm5Jx/twF3F5wdZMJGxFYG+UPLBvBwxK UPFqRHJWRf9DpKMVUz4+rdoM2Wgbf+O3JydGrMsY1+kv5e6rExHXZ2WyV6/lKwVGlKwX9L/w9Xh acP8mZ6ArgCgSPW/NTQ34eRk6GDcQ5Edr/cA7gsgGaTIC/tdRtXgFqdOKOf+XFgmjaBHh3sXm5L 4w5dWEtbz0HUu5UaRRdoLTmPNGybKd/83ZrD81YcllG7HmwSEuxoKQSfhmaMUDhhpr+UTJCIuiB nJjWhr7TbITnO4gO+UaQyWrtW9la0imSC7xMvLQ5zO1Az7KVgwjRloYFyFCWKCQUFCbUD10mxh6 Ffy/+Z2sUsuqVSw== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski If the device has a power sequencing handle, use it first. Otherwise fall back to whatever code already exists. Signed-off-by: Bartosz Golaszewski --- drivers/bluetooth/hci_qca.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c index c4546f6b6a19..f2dd37d01189 100644 --- a/drivers/bluetooth/hci_qca.c +++ b/drivers/bluetooth/hci_qca.c @@ -1718,6 +1718,7 @@ static int qca_regulator_init(struct hci_uart *hu) * off the voltage regulator. */ qcadev = serdev_device_get_drvdata(hu->serdev); + if (!qcadev->bt_power->vregs_on) { serdev_device_close(hu->serdev); ret = qca_regulator_enable(qcadev); @@ -1800,18 +1801,8 @@ static int qca_power_on(struct hci_dev *hdev) case QCA_WCN6750: case QCA_WCN6855: case QCA_WCN7850: - ret = qca_regulator_init(hu); - break; - case QCA_QCA6390: - qcadev = serdev_device_get_drvdata(hu->serdev); - ret = pwrseq_power_on(qcadev->bt_power->pwrseq); - if (ret) - return ret; - - ret = qca_port_reopen(hu); - if (ret) - return ret; + ret = qca_regulator_init(hu); break; default: @@ -2149,6 +2140,7 @@ static void qca_power_shutdown(struct hci_uart *hu) unsigned long flags; enum qca_btsoc_type soc_type = qca_soc_type(hu); bool sw_ctrl_state; + struct qca_power *power; /* From this point we go into power off state. But serial port is * still open, stop queueing the IBS data and flush all the buffered @@ -2166,6 +2158,13 @@ static void qca_power_shutdown(struct hci_uart *hu) return; qcadev = serdev_device_get_drvdata(hu->serdev); + power = qcadev->bt_power; + + if (power->pwrseq) { + pwrseq_power_off(power->pwrseq); + set_bit(QCA_BT_OFF, &qca->flags); + return; + } switch (soc_type) { case QCA_WCN3988: @@ -2227,6 +2226,9 @@ static int qca_regulator_enable(struct qca_serdev *qcadev) struct qca_power *power = qcadev->bt_power; int ret; + if (power->pwrseq) + return pwrseq_power_on(power->pwrseq); + /* Already enabled */ if (power->vregs_on) return 0; From patchwork Fri Jul 5 20:26:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 13725526 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BF9B81791EB for ; Fri, 5 Jul 2024 20:27:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720211236; cv=none; b=YdMH0OhtH3m5sKYQUCP4apLx/BMu0BnM9cO8wK8jWxLImGcfvzjVK5wlij8yrEZz+MJJ19VrAurV7Lhk7Y+Zesq8gsLI6rQu13xdgZDAFVqv1R9w+ZYvpPhSemmLa25Uod6zMHnSZ68Vlg+OpT0x/sA/9ZFqTImNlV5IoPwfIpk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720211236; c=relaxed/simple; bh=MfyFPRwbvLBOBealo7DEoGG4CJC2dVdGpjWbW5vZ97I=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=VmbZ9PueZw9EQnaVK2FeaObXfuygrrdq2FUHpgDRufFNATUJ0ZzE8JYmwVi3G1PEtefU9ol9IBMd4R7QAAiDtrvtkxRRMxWLpjMd60DZpJFaLyjG+6bno5QZO6OJiKt8ziRAoH2Bl4FGOrEDxX0WRA6L/gKSNI+yxAczauC6W9Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=U6LU0pze; arc=none smtp.client-ip=209.85.128.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="U6LU0pze" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-425814992aeso13443215e9.1 for ; Fri, 05 Jul 2024 13:27:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1720211233; x=1720816033; darn=vger.kernel.org; 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=1hK4ceHZT7jTrfqEpMWg4p0dQ8CFa9mi8p0ES3UVrDg=; b=U6LU0pzez/hDYUF8+1mhu2uua0m5Q4LMsbqn678jBczJzUYk4yIXyJA4QVNKH7wxOL XaM1ANN+IvZ033WCFzrgtCh5SVFl3Hn3qi738htaED4r9S+y0lcR+BgfdJ9NW1TFLibH tKdSCefouTHRh0kuy7eotCvIJXBdH9W0kOUNfcwtFNh+MX7DyiteErOABH3trdtX3TF7 FqXff3obeQchsC35dHd/lGaUTgQXjLmXXalZqEXHLDrvYBf/7ty9KTk/3GJd/JQTGnv4 PbC58XrL8vobgyiVZdJrTtgbW9DUdqRYxr7Yzima7Rv6KmYH4wLbpBXT2dLTyTZ91Nnm kf9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720211233; x=1720816033; 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=1hK4ceHZT7jTrfqEpMWg4p0dQ8CFa9mi8p0ES3UVrDg=; b=dwB1VSediqbIRapgMjhNSISQtGaIxYazeXr1zAjXmtDOl0QqP93yngANIRDu5UyigK kESXWhitAf99UkWIBaDbuz6lPBU2EG2nRXxQhTNvud+lW2FGzhntY4+MZP4xx2NC2TYi fOddPFtKXWPIDAtWf+QlPb2f0CpX+FP8XXGn35jj20W9J82JXfe53NalmYEuJVxteTb/ gLaA1GLtsxJ/T/NIXwIrRSiCir2/4clxuxXtn93mhu7Xd+PwNSc5HrKxzPV4A1N9EJMz 7MT2HgwrlnPP4tWbVU0fk3+5sEpU+ADM+4yfe4unMoohCfPzgU/Mkyfuze46otBxpcc+ R8gg== X-Forwarded-Encrypted: i=1; AJvYcCWSyfwzQpkGkwdf6uno0D1oDLH2oTx39r98y7J7A8fSlyt8WLhi+TnOzr4s7y5O9k6iUXmmVz9C8bWHa+dEXtmdp+NIC6Ph X-Gm-Message-State: AOJu0YxLykr1tb/lgfadZ9UVP0jP3hxhULmeUJPh0ZRq4IgH/ZMMGZ3G ueX4wzWJuOtrA5m4/McsyK0+Vga38otmWf1MYvg2JyuYeI9ZMGOrSWzffAAteO4= X-Google-Smtp-Source: AGHT+IEmZUyDPxiUiyglOFkHsmmvEyicgf9qzylCXGKW0OhVjN1/4hSXrDznx2x2xtSDMNLEjUOlBA== X-Received: by 2002:a05:600c:6d4f:b0:421:7aa1:435 with SMTP id 5b1f17b1804b1-4264a3f60c7mr41730995e9.25.1720211233283; Fri, 05 Jul 2024 13:27:13 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:c688:2842:8675:211]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4264a1d5116sm74397625e9.10.2024.07.05.13.27.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jul 2024 13:27:12 -0700 (PDT) From: Bartosz Golaszewski Date: Fri, 05 Jul 2024 22:26:39 +0200 Subject: [PATCH 5/6] Bluetooth: hci_qca: use the power sequencer for wcn7850 and wcn6855 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240705-hci_qca_refactor-v1-5-e2442121c13e@linaro.org> References: <20240705-hci_qca_refactor-v1-0-e2442121c13e@linaro.org> In-Reply-To: <20240705-hci_qca_refactor-v1-0-e2442121c13e@linaro.org> To: Marcel Holtmann , Luiz Augusto von Dentz , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Balakrishna Godavarthi , Rocky Liao , Bjorn Andersson , Konrad Dybcio Cc: linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Bartosz Golaszewski X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1940; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=ErJpORb/JKYC9WuXTmP94HnvACooMp37CDxDnihdy5I=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBmiFcZRByP3tZueEfeEIQigZZPW17xKzHC6FKJd 5DTzFPUM+mJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCZohXGQAKCRARpy6gFHHX cmhjD/sEv7MnVR/G8TCh6kRHAZaNwE1g4gv+ovb1GPRwxXoKFTXULXRUUS0kWqpTSUiheXHRrnZ SCaLOUtFlVBkR3AtbI/HhXbF8jaGmHIsORD+Q9X163BGPhzNUMlHtO+Fb1JS0JOeO7qy/kjEDZB nY1PvlqismbKQxAVA3Mbpsv3eGU4CCnyAOhT9UQMvtoa7YXd0YJwfCvROZjCUr24nbmnnFLipuO Dbf8NVM8G7BldDlbxemtnzRezfzaOpTPTeLtkCCp1nd9s3RtPmJgwCM4lWudhRJmGZpz+WdXhMF byBfu7CRmvncraEFiw/zj5yqPTzJkOvNnE91wEPKX+K8x8LK3401Vdnv7oMrMI2PQWlWQtc2Wl9 8AAJEXaG8PlDy4HX8Wm3rftaE4qiyvzN0d6nH0u5VgdaSvDpl1KxabAwXojfJZEnKIni4aFoQlI Ig6J2FsvQ9e4aAFemXWQ1MuOlkP8d1SuglPmBDWK8FNME7wk05Lmh1M7pes6DZefPOPwlrEOrPg 7hBiA1XwiEIu5NzFsD1A1vZxU05tMLsDTTQfQzF/0vfJqzX33dvFJccB+B5XyyBDeMujDXxzs+h BllFfUCx60j0MsY34Asx2x3tmaa/3Js6gjS761d2Z6V9YydW+zOzxalSIjNF9ZCrHZp02H+l5iN GuZLOuTRBcDFZQQ== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski In preparation for using the power sequencing subsystem on sm8650 boards and X13s laptop let's make pwrseq the default for wcn7850 and wcn6855. Both these models require an enable GPIO so we can safely assume that if the property is not there, then we should try to get the power sequencer. Due to how the pwrseq lookup works - checking the provider at run-time - we cannot really do it the other way around as we'd get stuck forever on -EPROBE_DEFER. If the relevant OF node does have the 'enable-gpios' property, we fallback to the existing code for backward compatibility with older DTs. Signed-off-by: Bartosz Golaszewski --- drivers/bluetooth/hci_qca.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c index f2dd37d01189..bcc6483074ff 100644 --- a/drivers/bluetooth/hci_qca.c +++ b/drivers/bluetooth/hci_qca.c @@ -2354,13 +2354,28 @@ static int qca_serdev_probe(struct serdev_device *serdev) } switch (qcadev->btsoc_type) { + case QCA_WCN6855: + case QCA_WCN7850: + if (!device_property_present(&serdev->dev, "enable-gpios")) { + /* + * Backward compatibility with old DT sources. If the + * node doesn't have the 'enable-gpios' property then + * let's use the power sequencer. Otherwise, let's + * drive everything outselves. + */ + qcadev->bt_power->pwrseq = devm_pwrseq_get(&serdev->dev, + "bluetooth"); + if (IS_ERR(qcadev->bt_power->pwrseq)) + return PTR_ERR(qcadev->bt_power->pwrseq); + + break; + } + fallthrough; case QCA_WCN3988: case QCA_WCN3990: case QCA_WCN3991: case QCA_WCN3998: case QCA_WCN6750: - case QCA_WCN6855: - case QCA_WCN7850: qcadev->bt_power->dev = &serdev->dev; err = qca_init_regulators(qcadev->bt_power, data->vregs, data->num_vregs); From patchwork Fri Jul 5 20:26:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 13725527 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D25AD17B42F for ; Fri, 5 Jul 2024 20:27:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720211237; cv=none; b=Yo0L2Hl/CO2TncTmxXGtkROJFRtk2gpqVa86PoEiqRPYWIUgrjgJtDI5W2kNiCLg4FOkPiO4Kj5FZw5IwVvShlnHsd3Obp3X7ASi4TQvTNfrQGSgAdcp2L5dC4VY6imaKgH6+By22Ilho9S31ojK9LfbzmrO06eCMlUjCnghcBg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720211237; c=relaxed/simple; bh=x+REoia1SPVixROvzFdazwCRh5mhW9XzZbQzMlPar2M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XwEAEN+kniLy+8vT5LSj7CVdFOCcvC9HDct/QC6PDbXDa/XvQh1GjYwLoooxiZzaCWOamPzweIoa7aI2tXJNCJUabqRig7gf1I7Yj5qXbCa7oDhSn94wXhF5uoKKe/PlyINbsQ77g9bDafB3sJD9Qex7URurMjBOBQ9U4tOXgOs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=kqhNYSGu; arc=none smtp.client-ip=209.85.128.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="kqhNYSGu" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-426526d31a3so5572175e9.1 for ; Fri, 05 Jul 2024 13:27:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1720211234; x=1720816034; darn=vger.kernel.org; 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=Xo8BvOJHNg5KkElAnqbJxKoNs4vF5XqhPo69/tFmIJc=; b=kqhNYSGu6VaYR1mjSrfrMzijCLnGY2zRDZeZ1Ou0s5wrwyX97PAr8ANVsCUP0d3hbh abf9pxBH3fDbinDMG9nLyJ80e8qXjXfbbBSwyL84yVJqu9Ql5AAiz4GgGOthaFHYlxIK j8L5XkrjM2t+OeGiZKASTZ9I37T3SdpBuf3NlVrxpMn3y3gj1U4I/Ff2CnHBPCJ0UucC NIoulD+QBaMhuGMNfJFlAhZ/pSJyz0/gFN6sxUMQJw/Pl371y1p04A2iQV+Mg3atFxz8 dPQLvqiECX0qj8jbTYNH69jwPmqc5X2QtUa3Cop9y6T7xZuZUfXU4qLloxIYmfbycqrQ oFsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720211234; x=1720816034; 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=Xo8BvOJHNg5KkElAnqbJxKoNs4vF5XqhPo69/tFmIJc=; b=jijFf/zXhH1h+SoGqnalnfTaAko45yBUlNx9+TZlELwnjIdVwJAckkvTZE9QSr7jNe JJBn7YI/XmoKeXClvelWQviWtwTbWTvwNyRxKxGLIoH4XDNCwqSKlKWtqE6q2N4ZyAYO 7DwhO/JN+W2NEMFrLpJmSJcUz54cvCJbyuo/vlUIcodQiedZ+h/Ol1zrIsnImfg+DA69 wXUJVK28fo5rji+L4LwhcVZk1xtbSktM2cvMH+v4AVXvfCf0+8LFgAcx2BX9JKKjqRZJ 0aMNkc/wgAWB9rlC0yrmmkHdf3rjNOBpVzlOPu6F4d8aMxPh9QmoG05EdaY/Vpl6MLIS Zj1A== X-Forwarded-Encrypted: i=1; AJvYcCXcPxdXnTvOImQaPn/nzYaT0uNHijMtuAVS6WodMgfVdgDuQYw478YjXAkivd2ixq3RwcJtUgG5vhnd2BUy89OaPGUj55Sb X-Gm-Message-State: AOJu0YzktNVG68cyu1J9ouJ+xRuJnw5XTxCtk8Auq8PGPtDW/QSoZp9E q6XCPDCc2Iq3LYvisIk0txyEvBWdpNdKezZuS0N17iHMUWkDebY3VQ81D/u0pbM= X-Google-Smtp-Source: AGHT+IHk45VodLs4hfZ4bMqYhA8JhJaClHg8mzt3znbrPWdgMMhSoHE2jkLb2VW+d//JgbWdYJaYpA== X-Received: by 2002:a05:600c:4993:b0:426:54c9:dfe5 with SMTP id 5b1f17b1804b1-42654c9e20emr18480915e9.10.1720211234305; Fri, 05 Jul 2024 13:27:14 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:c688:2842:8675:211]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4264a1d5116sm74397625e9.10.2024.07.05.13.27.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jul 2024 13:27:14 -0700 (PDT) From: Bartosz Golaszewski Date: Fri, 05 Jul 2024 22:26:40 +0200 Subject: [PATCH 6/6] arm64: dts: qcom: sm8650-qrd: use the PMU to power up bluetooth Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240705-hci_qca_refactor-v1-6-e2442121c13e@linaro.org> References: <20240705-hci_qca_refactor-v1-0-e2442121c13e@linaro.org> In-Reply-To: <20240705-hci_qca_refactor-v1-0-e2442121c13e@linaro.org> To: Marcel Holtmann , Luiz Augusto von Dentz , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Balakrishna Godavarthi , Rocky Liao , Bjorn Andersson , Konrad Dybcio Cc: linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Bartosz Golaszewski X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1973; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=kdQldVCRGhnIPxVPu3DpUjVdb4CujtCOUfjhf5GMlEY=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBmiFcaeCfsaInBBJIIlhG+1f/h4DrpvPHua2tpg s7T2ZuAaUqJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCZohXGgAKCRARpy6gFHHX cvPIEACF7n3xgUaa9Am60rAm+YiQrXmvaiDReuJWuKZ2mJCC0pglCJK5K9XEpSalxPOhUGbaIpH nu93vvC0ZL9kH1Ow8Oxpi8Cd0sqjcKWgLQHVfuXw3fTPO+vX7OC+wTN9OoyTtc68Gp08HUV402W ZA64XN/frf4gLo8MynFzddhlYz+oScisQx1zlRYkgY0m4HCdoRK22ATDh4fvaVESUIqDyoWkHJ8 4HzwpZvKHop1HGHRk+3uaC+uxhaXUAITTZ14vD5X9h7QZYSD0pMELSgTEWH9LMGmX8z81KHjhF0 np9v5kI8M7IRISCndFEThWWnIkC/HjJW+tnTwIRQad9FmhempXux2cxDNkF8lq91sHJl38y3mN8 SNwRhM5gGTu8/2HLyX6+eER3PEy8/fp47TtRz3uU9DXwJ6AGnjK+YyEtpHRpvxkjDR6xl0Dyn9t nQjczoH92VdohNbX48KtbynSTQ97wfspJG3WNF3fY5imsJDz+HBTCBXZq08BnWFrsZnqu2C/EVJ Fev/KcrZP+j4qa+UtjdWs9JEHBzmGjibFQSMwoDMRh00jnrafkD2NeCPBjL+iWYEFBzneAWTW7/ LFy+wz6TZA8iQ2bJHJTA0/vtIp2+ZKpPjGGCKSGfpkRU5NiKkgS26M+YSlyCrMokhlIOwKmiGYd c40Ymd6+uyULcrQ== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski Change the HW model in sm8650-qrd.dts to a one closer to reality - where the WLAN and Bluetooth modules of the WCN7850 are powered by the PMU inside the package. Signed-off-by: Bartosz Golaszewski --- arch/arm64/boot/dts/qcom/sm8650-qrd.dts | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/sm8650-qrd.dts b/arch/arm64/boot/dts/qcom/sm8650-qrd.dts index b0d7927b708f..8ca0d28eba9b 100644 --- a/arch/arm64/boot/dts/qcom/sm8650-qrd.dts +++ b/arch/arm64/boot/dts/qcom/sm8650-qrd.dts @@ -208,13 +208,10 @@ wcn7850-pmu { compatible = "qcom,wcn7850-pmu"; pinctrl-names = "default"; - pinctrl-0 = <&wlan_en>; + pinctrl-0 = <&wlan_en>, <&bt_default>; wlan-enable-gpios = <&tlmm 16 GPIO_ACTIVE_HIGH>; - /* - * TODO Add bt-enable-gpios once the Bluetooth driver is - * converted to using the power sequencer. - */ + bt-enable-gpios = <&tlmm 17 GPIO_ACTIVE_HIGH>; vdd-supply = <&vreg_s4i_0p85>; vddio-supply = <&vreg_l15b_1p8>; @@ -1255,22 +1252,15 @@ &uart14 { bluetooth { compatible = "qcom,wcn7850-bt"; - clocks = <&rpmhcc RPMH_RF_CLK1>; - - vddio-supply = <&vreg_l3c_1p2>; - vddaon-supply = <&vreg_l15b_1p8>; - vdddig-supply = <&vreg_s3c_0p9>; - vddrfa0p8-supply = <&vreg_s3c_0p9>; - vddrfa1p2-supply = <&vreg_s1c_1p2>; - vddrfa1p9-supply = <&vreg_s6c_1p8>; + vddrfacmn-supply = <&vreg_pmu_rfa_cmn>; + vddaon-supply = <&vreg_pmu_aon_0p59>; + vddwlcx-supply = <&vreg_pmu_wlcx_0p8>; + vddwlmx-supply = <&vreg_pmu_wlmx_0p85>; + vddrfa0p8-supply = <&vreg_pmu_rfa_0p8>; + vddrfa1p2-supply = <&vreg_pmu_rfa_1p2>; + vddrfa1p8-supply = <&vreg_pmu_rfa_1p8>; max-speed = <3200000>; - - enable-gpios = <&tlmm 17 GPIO_ACTIVE_HIGH>; - swctrl-gpios = <&tlmm 18 GPIO_ACTIVE_HIGH>; - - pinctrl-0 = <&bt_default>; - pinctrl-names = "default"; }; };