All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zijun Hu <quic_zijuhu@quicinc.com>
To: <luiz.dentz@gmail.com>, <wt@penguintechs.org>
Cc: <linux-bluetooth@vger.kernel.org>, Zijun Hu <quic_zijuhu@quicinc.com>
Subject: [PATCH v1 1/2] Bluetooth: qca: Dump more config info for debugging
Date: Sun, 14 Apr 2024 19:57:04 +0800	[thread overview]
Message-ID: <1713095825-4954-2-git-send-email-quic_zijuhu@quicinc.com> (raw)
In-Reply-To: <1713095825-4954-1-git-send-email-quic_zijuhu@quicinc.com>

Dump more config info for debugging.

Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
---
 drivers/bluetooth/hci_qca.c | 67 +++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 64 insertions(+), 3 deletions(-)

diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
index ecbc52eaf101..b61ca9828284 100644
--- a/drivers/bluetooth/hci_qca.c
+++ b/drivers/bluetooth/hci_qca.c
@@ -1883,8 +1883,12 @@ static int qca_setup(struct hci_uart *hu)
 		soc_name = "wcn7850";
 		break;
 
+	case QCA_QCA6390:
+		soc_name = "QCA6390";
+		break;
+
 	default:
-		soc_name = "ROME/QCA6390";
+		soc_name = "ROME";
 	}
 	bt_dev_info(hdev, "setting up %s", soc_name);
 
@@ -2281,18 +2285,33 @@ static int qca_serdev_probe(struct serdev_device *serdev)
 	if (!qcadev)
 		return -ENOMEM;
 
+#ifdef CONFIG_GPIOLIB
+	BT_INFO("%s: CONFIG_GPIOLIB is defined", __func__);
+#else
+	BT_INFO("%s: CONFIG_GPIOLIB is Undefined", __func__);
+#endif
+
 	qcadev->serdev_hu.serdev = serdev;
 	data = device_get_match_data(&serdev->dev);
 	serdev_device_set_drvdata(serdev, qcadev);
 	device_property_read_string(&serdev->dev, "firmware-name",
 					 &qcadev->firmware_name);
+	if (qcadev->firmware_name)
+		BT_INFO("%s: firmware-name is \"%s\"", __func__, qcadev->firmware_name);
+
 	device_property_read_u32(&serdev->dev, "max-speed",
 				 &qcadev->oper_speed);
+	BT_INFO("%s: max-speed(%d)", __func__, qcadev->oper_speed);
 	if (!qcadev->oper_speed)
 		BT_DBG("UART will pick default operating speed");
 
 	qcadev->bdaddr_property_broken = device_property_read_bool(&serdev->dev,
 			"qcom,local-bd-address-broken");
+	BT_INFO("%s: bdaddr_property_broken(%d)", __func__, (int)qcadev->bdaddr_property_broken);
+	if (data) {
+		BT_INFO("%s: soc_type(%d)", __func__, (int)data->soc_type);
+		BT_INFO("%s: capabilities(%#x)", __func__, data->capabilities);
+	}
 
 	if (data)
 		qcadev->btsoc_type = data->soc_type;
@@ -2320,11 +2339,29 @@ static int qca_serdev_probe(struct serdev_device *serdev)
 			BT_ERR("Failed to init regulators:%d", err);
 			return err;
 		}
+		{
+			int i;
+
+			BT_INFO("%s: num_vregs(%d)", __func__, (int)data->num_vregs);
+			for (i = 0; i < data->num_vregs; i++)
+				BT_INFO("%s: %d regulator %s I(%duA) is %p",
+					__func__, i,
+					qcadev->bt_power->vreg_bulk[i].supply,
+					data->vregs[i].load_uA,
+					qcadev->bt_power->vreg_bulk[i].consumer);
+		}
+
 
 		qcadev->bt_power->vregs_on = false;
 
 		qcadev->bt_en = devm_gpiod_get_optional(&serdev->dev, "enable",
 					       GPIOD_OUT_LOW);
+		if (IS_ERR(qcadev->bt_en))
+			BT_ERR("%s: Get enable gpio ERROR", __func__);
+		else if (qcadev->bt_en)
+			BT_INFO("%s: Got enable gpio(%d) ", __func__, desc_to_gpio(qcadev->bt_en));
+		else
+			BT_INFO("%s: qcadev->bt_en(nullptr)", __func__);
 		if (IS_ERR(qcadev->bt_en) &&
 		    (data->soc_type == QCA_WCN6750 ||
 		     data->soc_type == QCA_WCN6855)) {
@@ -2333,7 +2370,14 @@ static int qca_serdev_probe(struct serdev_device *serdev)
 		}
 
 		qcadev->sw_ctrl = devm_gpiod_get_optional(&serdev->dev, "swctrl",
-					       GPIOD_IN);
+							  GPIOD_IN);
+		if (IS_ERR(qcadev->sw_ctrl))
+			BT_ERR("%s: Get sw_ctrl gpio ERROR", __func__);
+		else if (qcadev->sw_ctrl)
+			BT_INFO("%s: Got sw_ctrl gpio(%d) ", __func__,
+				desc_to_gpio(qcadev->sw_ctrl));
+		else
+			BT_INFO("%s: qcadev->sw_ctrl(nullptr)", __func__);
 		if (IS_ERR(qcadev->sw_ctrl) &&
 		    (data->soc_type == QCA_WCN6750 ||
 		     data->soc_type == QCA_WCN6855 ||
@@ -2341,6 +2385,10 @@ static int qca_serdev_probe(struct serdev_device *serdev)
 			dev_warn(&serdev->dev, "failed to acquire SW_CTRL gpio\n");
 
 		qcadev->susclk = devm_clk_get_optional(&serdev->dev, NULL);
+		if (IS_ERR(qcadev->susclk))
+			BT_ERR("%s: Get clock ERROR", __func__);
+		else
+			BT_INFO("%s: susclk(%p)", __func__, qcadev->susclk);
 		if (IS_ERR(qcadev->susclk)) {
 			dev_err(&serdev->dev, "failed to acquire clk\n");
 			return PTR_ERR(qcadev->susclk);
@@ -2355,13 +2403,24 @@ static int qca_serdev_probe(struct serdev_device *serdev)
 
 	default:
 		qcadev->bt_en = devm_gpiod_get_optional(&serdev->dev, "enable",
-					       GPIOD_OUT_LOW);
+							GPIOD_OUT_LOW);
+		if (IS_ERR(qcadev->bt_en))
+			BT_ERR("%s: default Get enable gpio ERROR", __func__);
+		else if (qcadev->bt_en)
+			BT_INFO("%s: default Got enable gpio(%d) ",
+				__func__, desc_to_gpio(qcadev->bt_en));
+		else
+			BT_INFO("%s: default qcadev->bt_en(nullptr)", __func__);
 		if (IS_ERR(qcadev->bt_en)) {
 			dev_warn(&serdev->dev, "failed to acquire enable gpio\n");
 			power_ctrl_enabled = false;
 		}
 
 		qcadev->susclk = devm_clk_get_optional(&serdev->dev, NULL);
+		if (IS_ERR(qcadev->susclk))
+			BT_ERR("%s: default Get clock ERROR", __func__);
+		else
+			BT_INFO("%s: default susclk(%p)", __func__, qcadev->susclk);
 		if (IS_ERR(qcadev->susclk)) {
 			dev_warn(&serdev->dev, "failed to acquire clk\n");
 			return PTR_ERR(qcadev->susclk);
@@ -2384,6 +2443,7 @@ static int qca_serdev_probe(struct serdev_device *serdev)
 
 	hdev = qcadev->serdev_hu.hdev;
 
+	BT_INFO("%s: power_ctrl_enabled(%d)", __func__, (int)power_ctrl_enabled);
 	if (power_ctrl_enabled) {
 		set_bit(HCI_QUIRK_NON_PERSISTENT_SETUP, &hdev->quirks);
 		hdev->shutdown = qca_power_off;
@@ -2448,6 +2508,7 @@ static void qca_serdev_shutdown(struct device *dev)
 		    !test_bit(HCI_RUNNING, &hdev->flags))
 			return;
 
+		BT_INFO("%s: Start to send EDL_RESET_REQ", __func__);
 		serdev_device_write_flush(serdev);
 		ret = serdev_device_write_buf(serdev, ibs_wake_cmd,
 					      sizeof(ibs_wake_cmd));
-- 
2.7.4


  reply	other threads:[~2024-04-14 11:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-14 11:57 [PATCH v1 0/2] QCA6390 enable failure debugging changes Zijun Hu
2024-04-14 11:57 ` Zijun Hu [this message]
2024-04-14 14:48   ` bluez.test.bot
2024-04-14 11:57 ` [PATCH v1 2/2] Bluetooth: qca: Fix QCA6390 enable failure after reboot or disable Zijun Hu
2024-04-15 10:12   ` [PATCH v2] " Zijun Hu
2024-04-15 10:36     ` [v2] " bluez.test.bot
2024-04-17 15:04     ` [PATCH v3] " Zijun Hu
2024-04-17 15:14       ` [v3] " bluez.test.bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1713095825-4954-2-git-send-email-quic_zijuhu@quicinc.com \
    --to=quic_zijuhu@quicinc.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=wt@penguintechs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.