public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH next v4 1/2] dt-bindings: net: bluetooth: nxp: add support for supply and reset
@ 2025-07-02 11:41 Catalin Popescu
  2025-07-02 11:41 ` [PATCH next v4 2/2] Bluetooth: btnxpuart: implement powerup sequence Catalin Popescu
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Catalin Popescu @ 2025-07-02 11:41 UTC (permalink / raw)
  To: amitkumar.karwar, neeraj.sanjaykale, marcel, luiz.dentz, robh,
	krzk+dt, conor+dt, p.zabel
  Cc: linux-bluetooth, devicetree, linux-kernel, m.felsch,
	Catalin Popescu, Conor Dooley

Add support for chip power supply and chip reset/powerdown.

Signed-off-by: Catalin Popescu <catalin.popescu@leica-geosystems.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
---
v4:
- rebase on linux-next tag next-20250701
v3:
- rebase on linux-next tag next-20250409
v2:
- rebase on linux-next tag next-20250227
- add acked-by
---
 .../bindings/net/bluetooth/nxp,88w8987-bt.yaml         | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/bluetooth/nxp,88w8987-bt.yaml b/Documentation/devicetree/bindings/net/bluetooth/nxp,88w8987-bt.yaml
index bb9ab5dd3b4a..857c6234ba9b 100644
--- a/Documentation/devicetree/bindings/net/bluetooth/nxp,88w8987-bt.yaml
+++ b/Documentation/devicetree/bindings/net/bluetooth/nxp,88w8987-bt.yaml
@@ -72,6 +72,14 @@ properties:
     description:
       The GPIO number of the NXP chipset used for BT_WAKE_OUT.
 
+  vcc-supply:
+    description:
+      phandle of the regulator that provides the supply voltage.
+
+  reset-gpios:
+    description:
+      Chip powerdown/reset signal (PDn).
+
 required:
   - compatible
 
@@ -90,6 +98,8 @@ examples:
             device-wakeup-gpios = <&gpio 11 GPIO_ACTIVE_HIGH>;
             nxp,wakein-pin = /bits/ 8 <18>;
             nxp,wakeout-pin = /bits/ 8 <19>;
+            vcc-supply = <&nxp_iw612_supply>;
+            reset-gpios = <&gpioctrl 2 GPIO_ACTIVE_LOW>;
             local-bd-address = [66 55 44 33 22 11];
             interrupt-parent = <&gpio>;
             interrupts = <8 IRQ_TYPE_EDGE_FALLING>;

base-commit: 3f804361f3b9af33e00b90ec9cb5afcc96831e60
prerequisite-patch-id: 0000000000000000000000000000000000000000
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH next v4 2/2] Bluetooth: btnxpuart: implement powerup sequence
  2025-07-02 11:41 [PATCH next v4 1/2] dt-bindings: net: bluetooth: nxp: add support for supply and reset Catalin Popescu
@ 2025-07-02 11:41 ` Catalin Popescu
  2025-07-02 12:38 ` [next,v4,1/2] dt-bindings: net: bluetooth: nxp: add support for supply and reset bluez.test.bot
  2025-07-10 13:40 ` [PATCH next v4 1/2] " patchwork-bot+bluetooth
  2 siblings, 0 replies; 4+ messages in thread
From: Catalin Popescu @ 2025-07-02 11:41 UTC (permalink / raw)
  To: amitkumar.karwar, neeraj.sanjaykale, marcel, luiz.dentz, robh,
	krzk+dt, conor+dt, p.zabel
  Cc: linux-bluetooth, devicetree, linux-kernel, m.felsch,
	Catalin Popescu

NXP bluetooth chip shares power supply and reset gpio with a WLAN
chip. Add support for power supply and reset and enforce powerup
sequence:
- apply power supply
- deassert reset/powerdown

Signed-off-by: Catalin Popescu <catalin.popescu@leica-geosystems.com>
Reviewed-by: Neeraj Sanjay Kale <neeraj.sanjaykale@nxp.com>
---
v4:
- rebase on linux-next tag next-20250701
v3:
- rebase on linux-next tag next-20250409
- fix issue reported by CI regarding the subject
v2:
- rebase on linux-next tag next-20250227
- add reviewed-by
---
 drivers/bluetooth/btnxpuart.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/drivers/bluetooth/btnxpuart.c b/drivers/bluetooth/btnxpuart.c
index 25857919359e..b25096b8980b 100644
--- a/drivers/bluetooth/btnxpuart.c
+++ b/drivers/bluetooth/btnxpuart.c
@@ -18,6 +18,8 @@
 #include <linux/string_helpers.h>
 #include <linux/gpio/consumer.h>
 #include <linux/of_irq.h>
+#include <linux/regulator/consumer.h>
+#include <linux/reset.h>
 
 #include <net/bluetooth/bluetooth.h>
 #include <net/bluetooth/hci_core.h>
@@ -209,6 +211,7 @@ struct btnxpuart_dev {
 
 	struct ps_data psdata;
 	struct btnxpuart_data *nxp_data;
+	struct reset_control *pdn;
 };
 
 #define NXP_V1_FW_REQ_PKT	0xa5
@@ -1757,6 +1760,7 @@ static int nxp_serdev_probe(struct serdev_device *serdev)
 	struct hci_dev *hdev;
 	struct btnxpuart_dev *nxpdev;
 	bdaddr_t ba = {0};
+	int err;
 
 	nxpdev = devm_kzalloc(&serdev->dev, sizeof(*nxpdev), GFP_KERNEL);
 	if (!nxpdev)
@@ -1795,6 +1799,16 @@ static int nxp_serdev_probe(struct serdev_device *serdev)
 
 	crc8_populate_msb(crc8_table, POLYNOMIAL8);
 
+	nxpdev->pdn = devm_reset_control_get_optional_shared(&serdev->dev, NULL);
+	if (IS_ERR(nxpdev->pdn))
+		return PTR_ERR(nxpdev->pdn);
+
+	err = devm_regulator_get_enable(&serdev->dev, "vcc");
+	if (err) {
+		dev_err(&serdev->dev, "Failed to enable vcc regulator\n");
+		return err;
+	}
+
 	/* Initialize and register HCI device */
 	hdev = hci_alloc_dev();
 	if (!hdev) {
@@ -1802,6 +1816,8 @@ static int nxp_serdev_probe(struct serdev_device *serdev)
 		return -ENOMEM;
 	}
 
+	reset_control_deassert(nxpdev->pdn);
+
 	nxpdev->hdev = hdev;
 
 	hdev->bus = HCI_UART;
@@ -1840,6 +1856,7 @@ static int nxp_serdev_probe(struct serdev_device *serdev)
 	return 0;
 
 probe_fail:
+	reset_control_assert(nxpdev->pdn);
 	hci_free_dev(hdev);
 	return -ENODEV;
 }
@@ -1867,6 +1884,7 @@ static void nxp_serdev_remove(struct serdev_device *serdev)
 
 	ps_cleanup(nxpdev);
 	hci_unregister_dev(hdev);
+	reset_control_assert(nxpdev->pdn);
 	hci_free_dev(hdev);
 }
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* RE: [next,v4,1/2] dt-bindings: net: bluetooth: nxp: add support for supply and reset
  2025-07-02 11:41 [PATCH next v4 1/2] dt-bindings: net: bluetooth: nxp: add support for supply and reset Catalin Popescu
  2025-07-02 11:41 ` [PATCH next v4 2/2] Bluetooth: btnxpuart: implement powerup sequence Catalin Popescu
@ 2025-07-02 12:38 ` bluez.test.bot
  2025-07-10 13:40 ` [PATCH next v4 1/2] " patchwork-bot+bluetooth
  2 siblings, 0 replies; 4+ messages in thread
From: bluez.test.bot @ 2025-07-02 12:38 UTC (permalink / raw)
  To: linux-bluetooth, catalin.popescu

[-- Attachment #1: Type: text/plain, Size: 3786 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=978194

---Test result---

Test Summary:
CheckPatch                    PENDING   0.23 seconds
GitLint                       PENDING   0.19 seconds
SubjectPrefix                 FAIL      0.39 seconds
BuildKernel                   PASS      24.30 seconds
CheckAllWarning               PASS      26.98 seconds
CheckSparse                   PASS      30.01 seconds
BuildKernel32                 PASS      24.08 seconds
TestRunnerSetup               FAIL      100.13 seconds
TestRunner_l2cap-tester       FAIL      0.10 seconds
TestRunner_iso-tester         FAIL      0.10 seconds
TestRunner_bnep-tester        FAIL      0.09 seconds
TestRunner_mgmt-tester        FAIL      0.10 seconds
TestRunner_rfcomm-tester      FAIL      0.17 seconds
TestRunner_sco-tester         FAIL      0.10 seconds
TestRunner_ioctl-tester       FAIL      0.09 seconds
TestRunner_mesh-tester        FAIL      0.10 seconds
TestRunner_smp-tester         FAIL      0.09 seconds
TestRunner_userchan-tester    FAIL      0.10 seconds
IncrementalBuild              PENDING   0.91 seconds

Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:

##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:

##############################
Test: SubjectPrefix - FAIL
Desc: Check subject contains "Bluetooth" prefix
Output:
"Bluetooth: " prefix is not specified in the subject
##############################
Test: TestRunnerSetup - FAIL
Desc: Setup kernel and bluez for test-runner
Output:
Bluez: 
src/device.c: In function ‘connect_profiles’:
src/device.c:2689:6: error: ‘ERR_BREDR_CONN_PROFILE_UNAVAILABLE’ undeclared (first use in this function)
 2689 |      ERR_BREDR_CONN_PROFILE_UNAVAILABLE);
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/device.c:2689:6: note: each undeclared identifier is reported only once for each function it appears in
make[1]: *** [Makefile:11162: src/bluetoothd-device.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:4690: all] Error 2
##############################
Test: TestRunner_l2cap-tester - FAIL
Desc: Run l2cap-tester with test-runner
Output:
No tester found
##############################
Test: TestRunner_iso-tester - FAIL
Desc: Run iso-tester with test-runner
Output:
No tester found
##############################
Test: TestRunner_bnep-tester - FAIL
Desc: Run bnep-tester with test-runner
Output:
No tester found
##############################
Test: TestRunner_mgmt-tester - FAIL
Desc: Run mgmt-tester with test-runner
Output:
No tester found
##############################
Test: TestRunner_rfcomm-tester - FAIL
Desc: Run rfcomm-tester with test-runner
Output:
No tester found
##############################
Test: TestRunner_sco-tester - FAIL
Desc: Run sco-tester with test-runner
Output:
No tester found
##############################
Test: TestRunner_ioctl-tester - FAIL
Desc: Run ioctl-tester with test-runner
Output:
No tester found
##############################
Test: TestRunner_mesh-tester - FAIL
Desc: Run mesh-tester with test-runner
Output:
No tester found
##############################
Test: TestRunner_smp-tester - FAIL
Desc: Run smp-tester with test-runner
Output:
No tester found
##############################
Test: TestRunner_userchan-tester - FAIL
Desc: Run userchan-tester with test-runner
Output:
No tester found
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:



---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH next v4 1/2] dt-bindings: net: bluetooth: nxp: add support for supply and reset
  2025-07-02 11:41 [PATCH next v4 1/2] dt-bindings: net: bluetooth: nxp: add support for supply and reset Catalin Popescu
  2025-07-02 11:41 ` [PATCH next v4 2/2] Bluetooth: btnxpuart: implement powerup sequence Catalin Popescu
  2025-07-02 12:38 ` [next,v4,1/2] dt-bindings: net: bluetooth: nxp: add support for supply and reset bluez.test.bot
@ 2025-07-10 13:40 ` patchwork-bot+bluetooth
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+bluetooth @ 2025-07-10 13:40 UTC (permalink / raw)
  To: POPESCU Catalin
  Cc: amitkumar.karwar, neeraj.sanjaykale, marcel, luiz.dentz, robh,
	krzk+dt, conor+dt, p.zabel, linux-bluetooth, devicetree,
	linux-kernel, m.felsch, conor.dooley

Hello:

This series was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Wed,  2 Jul 2025 13:41:04 +0200 you wrote:
> Add support for chip power supply and chip reset/powerdown.
> 
> Signed-off-by: Catalin Popescu <catalin.popescu@leica-geosystems.com>
> Acked-by: Conor Dooley <conor.dooley@microchip.com>
> ---
> v4:
> - rebase on linux-next tag next-20250701
> v3:
> - rebase on linux-next tag next-20250409
> v2:
> - rebase on linux-next tag next-20250227
> - add acked-by
> 
> [...]

Here is the summary with links:
  - [next,v4,1/2] dt-bindings: net: bluetooth: nxp: add support for supply and reset
    https://git.kernel.org/bluetooth/bluetooth-next/c/92b12500ef1c
  - [next,v4,2/2] Bluetooth: btnxpuart: implement powerup sequence
    https://git.kernel.org/bluetooth/bluetooth-next/c/366116cab739

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-07-10 13:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-02 11:41 [PATCH next v4 1/2] dt-bindings: net: bluetooth: nxp: add support for supply and reset Catalin Popescu
2025-07-02 11:41 ` [PATCH next v4 2/2] Bluetooth: btnxpuart: implement powerup sequence Catalin Popescu
2025-07-02 12:38 ` [next,v4,1/2] dt-bindings: net: bluetooth: nxp: add support for supply and reset bluez.test.bot
2025-07-10 13:40 ` [PATCH next v4 1/2] " patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox