public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] Bluetooth: btnxpuart: Add VIN regulator support
@ 2025-02-26 15:05 Loic Poulain
  2025-02-26 15:05 ` [PATCH 2/2] dt-bindings: net: bluetooth: nxp: Add vin-supply property Loic Poulain
  2025-02-26 15:33 ` [1/2] Bluetooth: btnxpuart: Add VIN regulator support bluez.test.bot
  0 siblings, 2 replies; 5+ messages in thread
From: Loic Poulain @ 2025-02-26 15:05 UTC (permalink / raw)
  To: neeraj.sanjaykale, marcel, robh, krzk+dt
  Cc: amitkumar.karwar, conor+dt, linux-bluetooth, devicetree,
	Loic Poulain

As bluetooth controller is usually part of a WiFi/BT combo chip,
it is important that each driver references the common supply.
This prevents bluetooth to be powered down if WiFi driver is not
loaded or removed.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
---
 drivers/bluetooth/btnxpuart.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/bluetooth/btnxpuart.c b/drivers/bluetooth/btnxpuart.c
index 4f2f429c9800..fc313559c2aa 100644
--- a/drivers/bluetooth/btnxpuart.c
+++ b/drivers/bluetooth/btnxpuart.c
@@ -17,6 +17,7 @@
 #include <linux/crc32.h>
 #include <linux/string_helpers.h>
 #include <linux/gpio/consumer.h>
+#include <linux/regulator/consumer.h>
 
 #include <net/bluetooth/bluetooth.h>
 #include <net/bluetooth/hci_core.h>
@@ -1522,6 +1523,11 @@ static int nxp_serdev_probe(struct serdev_device *serdev)
 {
 	struct hci_dev *hdev;
 	struct btnxpuart_dev *nxpdev;
+	int ret;
+
+	ret = devm_regulator_get_enable(&serdev->dev, "vin");
+	if (ret)
+		return dev_err_probe(&serdev->dev, ret, "Failed to enable VIN\n");
 
 	nxpdev = devm_kzalloc(&serdev->dev, sizeof(*nxpdev), GFP_KERNEL);
 	if (!nxpdev)
-- 
2.34.1


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

end of thread, other threads:[~2025-02-27 10:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-26 15:05 [PATCH 1/2] Bluetooth: btnxpuart: Add VIN regulator support Loic Poulain
2025-02-26 15:05 ` [PATCH 2/2] dt-bindings: net: bluetooth: nxp: Add vin-supply property Loic Poulain
2025-02-26 17:55   ` Neeraj Sanjay Kale
2025-02-27 10:58     ` POPESCU Catalin
2025-02-26 15:33 ` [1/2] Bluetooth: btnxpuart: Add VIN regulator support bluez.test.bot

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