Message ID | 20250219091512.290231-1-loic.poulain@linaro.org (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [v2,1/2] bluetooth: btnxpuart: Support for controller wakeup gpio config | expand |
Context | Check | Description |
---|---|---|
tedd_an/pre-ci_am | success | Success |
tedd_an/SubjectPrefix | fail | "Bluetooth: " prefix is not specified in the subject |
tedd_an/BuildKernel | success | BuildKernel PASS |
tedd_an/CheckAllWarning | success | CheckAllWarning PASS |
tedd_an/CheckSparse | success | CheckSparse PASS |
tedd_an/BuildKernel32 | success | BuildKernel32 PASS |
tedd_an/TestRunnerSetup | success | TestRunnerSetup PASS |
tedd_an/TestRunner_l2cap-tester | success | TestRunner PASS |
tedd_an/TestRunner_iso-tester | success | TestRunner PASS |
tedd_an/TestRunner_bnep-tester | success | TestRunner PASS |
tedd_an/TestRunner_mgmt-tester | fail | TestRunner_mgmt-tester: Total: 490, Passed: 484 (98.8%), Failed: 2, Not Run: 4 |
tedd_an/TestRunner_rfcomm-tester | success | TestRunner PASS |
tedd_an/TestRunner_sco-tester | success | TestRunner PASS |
tedd_an/TestRunner_ioctl-tester | success | TestRunner PASS |
tedd_an/TestRunner_mesh-tester | success | TestRunner PASS |
tedd_an/TestRunner_smp-tester | success | TestRunner PASS |
tedd_an/TestRunner_userchan-tester | success | TestRunner PASS |
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=935490 ---Test result--- Test Summary: CheckPatch PENDING 0.23 seconds GitLint PENDING 0.21 seconds SubjectPrefix FAIL 0.51 seconds BuildKernel PASS 24.73 seconds CheckAllWarning PASS 27.25 seconds CheckSparse PASS 32.32 seconds BuildKernel32 PASS 24.62 seconds TestRunnerSetup PASS 446.05 seconds TestRunner_l2cap-tester PASS 21.27 seconds TestRunner_iso-tester PASS 39.86 seconds TestRunner_bnep-tester PASS 5.01 seconds TestRunner_mgmt-tester FAIL 121.96 seconds TestRunner_rfcomm-tester PASS 8.03 seconds TestRunner_sco-tester PASS 9.73 seconds TestRunner_ioctl-tester PASS 8.62 seconds TestRunner_mesh-tester PASS 6.23 seconds TestRunner_smp-tester PASS 7.46 seconds TestRunner_userchan-tester PASS 5.24 seconds IncrementalBuild PENDING 0.41 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 "Bluetooth: " prefix is not specified in the subject ############################## Test: TestRunner_mgmt-tester - FAIL Desc: Run mgmt-tester with test-runner Output: Total: 490, Passed: 484 (98.8%), Failed: 2, Not Run: 4 Failed Test Cases LL Privacy - Add Device 3 (AL is full) Failed 0.210 seconds LL Privacy - Set Flags 3 (2 Devices to RL) Failed 0.182 seconds ############################## Test: IncrementalBuild - PENDING Desc: Incremental build with the patches in the series Output: --- Regards, Linux Bluetooth
Hi Loic, This looks good to me. Reviewed-by: Neeraj Sanjay Kale <neeraj.sanjaykale@nxp.com> Thanks, Neeraj > When using the out-of-band WAKE_IN and WAKE_OUT pins, we have to tell > the firmware which pins to use (from controller point of view). This allows to > report remote wakeup support when WAKE_OUT(c2h) is configured. > > Signed-off-by: Loic Poulain <loic.poulain@linaro.org> > --- > v2: - Move pin properties read in ps_setup > - Display warning in case of wakein prop without related gpio > > drivers/bluetooth/btnxpuart.c | 32 ++++++++++++++++++++++++++++---- > 1 file changed, 28 insertions(+), 4 deletions(-) > > diff --git a/drivers/bluetooth/btnxpuart.c b/drivers/bluetooth/btnxpuart.c > index aa5ec1d444a9..4f2f429c9800 100644 > --- a/drivers/bluetooth/btnxpuart.c > +++ b/drivers/bluetooth/btnxpuart.c > @@ -447,8 +447,14 @@ static int ps_setup(struct hci_dev *hdev) > return PTR_ERR(psdata->h2c_ps_gpio); > } > > - if (!psdata->h2c_ps_gpio) > + if (device_property_read_u8(&serdev->dev, "nxp,wakein-pin", &psdata- > >h2c_wakeup_gpio)) { > + psdata->h2c_wakeup_gpio = 0xff; /* 0xff: use default pin/gpio */ > + } else if (!psdata->h2c_ps_gpio) { > + bt_dev_warn(hdev, "nxp,wakein-pin property without > + device-wakeup GPIO"); > psdata->h2c_wakeup_gpio = 0xff; > + } > + > + device_property_read_u8(&serdev->dev, "nxp,wakeout-pin", > + &psdata->c2h_wakeup_gpio); > > psdata->hdev = hdev; > INIT_WORK(&psdata->work, ps_work_func); @@ -540,9 +546,11 @@ > static int send_wakeup_method_cmd(struct hci_dev *hdev, void *data) > > pcmd.c2h_wakeupmode = psdata->c2h_wakeupmode; > pcmd.c2h_wakeup_gpio = psdata->c2h_wakeup_gpio; > + pcmd.h2c_wakeup_gpio = 0xff; > switch (psdata->h2c_wakeupmode) { > case WAKEUP_METHOD_GPIO: > pcmd.h2c_wakeupmode = BT_CTRL_WAKEUP_METHOD_GPIO; > + pcmd.h2c_wakeup_gpio = psdata->h2c_wakeup_gpio; > break; > case WAKEUP_METHOD_DTR: > pcmd.h2c_wakeupmode = BT_CTRL_WAKEUP_METHOD_DSR; @@ - > 552,7 +560,6 @@ static int send_wakeup_method_cmd(struct hci_dev *hdev, > void *data) > pcmd.h2c_wakeupmode = BT_CTRL_WAKEUP_METHOD_BREAK; > break; > } > - pcmd.h2c_wakeup_gpio = 0xff; > > skb = nxp_drv_send_cmd(hdev, HCI_NXP_WAKEUP_METHOD, > sizeof(pcmd), &pcmd); > if (IS_ERR(skb)) { > @@ -586,8 +593,13 @@ static void ps_init(struct hci_dev *hdev) > usleep_range(5000, 10000); > > psdata->ps_state = PS_STATE_AWAKE; > - psdata->c2h_wakeupmode = BT_HOST_WAKEUP_METHOD_NONE; > - psdata->c2h_wakeup_gpio = 0xff; > + > + if (psdata->c2h_wakeup_gpio) { > + psdata->c2h_wakeupmode = BT_HOST_WAKEUP_METHOD_GPIO; > + } else { > + psdata->c2h_wakeupmode = BT_HOST_WAKEUP_METHOD_NONE; > + psdata->c2h_wakeup_gpio = 0xff; > + } > > psdata->cur_h2c_wakeupmode = WAKEUP_METHOD_INVALID; > if (psdata->h2c_ps_gpio) > @@ -1266,6 +1278,17 @@ static int nxp_shutdown(struct hci_dev *hdev) > return 0; > } > > +static bool nxp_wakeup(struct hci_dev *hdev) { > + struct btnxpuart_dev *nxpdev = hci_get_drvdata(hdev); > + struct ps_data *psdata = &nxpdev->psdata; > + > + if (psdata->c2h_wakeupmode != BT_HOST_WAKEUP_METHOD_NONE) > + return true; > + > + return false; > +} > + > static int btnxpuart_queue_skb(struct hci_dev *hdev, struct sk_buff *skb) { > struct btnxpuart_dev *nxpdev = hci_get_drvdata(hdev); @@ -1546,6 > +1569,7 @@ static int nxp_serdev_probe(struct serdev_device *serdev) > hdev->send = nxp_enqueue; > hdev->hw_error = nxp_hw_err; > hdev->shutdown = nxp_shutdown; > + hdev->wakeup = nxp_wakeup; > SET_HCIDEV_DEV(hdev, &serdev->dev); > > if (hci_register_dev(hdev) < 0) { > -- > 2.34.1
diff --git a/drivers/bluetooth/btnxpuart.c b/drivers/bluetooth/btnxpuart.c index aa5ec1d444a9..4f2f429c9800 100644 --- a/drivers/bluetooth/btnxpuart.c +++ b/drivers/bluetooth/btnxpuart.c @@ -447,8 +447,14 @@ static int ps_setup(struct hci_dev *hdev) return PTR_ERR(psdata->h2c_ps_gpio); } - if (!psdata->h2c_ps_gpio) + if (device_property_read_u8(&serdev->dev, "nxp,wakein-pin", &psdata->h2c_wakeup_gpio)) { + psdata->h2c_wakeup_gpio = 0xff; /* 0xff: use default pin/gpio */ + } else if (!psdata->h2c_ps_gpio) { + bt_dev_warn(hdev, "nxp,wakein-pin property without device-wakeup GPIO"); psdata->h2c_wakeup_gpio = 0xff; + } + + device_property_read_u8(&serdev->dev, "nxp,wakeout-pin", &psdata->c2h_wakeup_gpio); psdata->hdev = hdev; INIT_WORK(&psdata->work, ps_work_func); @@ -540,9 +546,11 @@ static int send_wakeup_method_cmd(struct hci_dev *hdev, void *data) pcmd.c2h_wakeupmode = psdata->c2h_wakeupmode; pcmd.c2h_wakeup_gpio = psdata->c2h_wakeup_gpio; + pcmd.h2c_wakeup_gpio = 0xff; switch (psdata->h2c_wakeupmode) { case WAKEUP_METHOD_GPIO: pcmd.h2c_wakeupmode = BT_CTRL_WAKEUP_METHOD_GPIO; + pcmd.h2c_wakeup_gpio = psdata->h2c_wakeup_gpio; break; case WAKEUP_METHOD_DTR: pcmd.h2c_wakeupmode = BT_CTRL_WAKEUP_METHOD_DSR; @@ -552,7 +560,6 @@ static int send_wakeup_method_cmd(struct hci_dev *hdev, void *data) pcmd.h2c_wakeupmode = BT_CTRL_WAKEUP_METHOD_BREAK; break; } - pcmd.h2c_wakeup_gpio = 0xff; skb = nxp_drv_send_cmd(hdev, HCI_NXP_WAKEUP_METHOD, sizeof(pcmd), &pcmd); if (IS_ERR(skb)) { @@ -586,8 +593,13 @@ static void ps_init(struct hci_dev *hdev) usleep_range(5000, 10000); psdata->ps_state = PS_STATE_AWAKE; - psdata->c2h_wakeupmode = BT_HOST_WAKEUP_METHOD_NONE; - psdata->c2h_wakeup_gpio = 0xff; + + if (psdata->c2h_wakeup_gpio) { + psdata->c2h_wakeupmode = BT_HOST_WAKEUP_METHOD_GPIO; + } else { + psdata->c2h_wakeupmode = BT_HOST_WAKEUP_METHOD_NONE; + psdata->c2h_wakeup_gpio = 0xff; + } psdata->cur_h2c_wakeupmode = WAKEUP_METHOD_INVALID; if (psdata->h2c_ps_gpio) @@ -1266,6 +1278,17 @@ static int nxp_shutdown(struct hci_dev *hdev) return 0; } +static bool nxp_wakeup(struct hci_dev *hdev) +{ + struct btnxpuart_dev *nxpdev = hci_get_drvdata(hdev); + struct ps_data *psdata = &nxpdev->psdata; + + if (psdata->c2h_wakeupmode != BT_HOST_WAKEUP_METHOD_NONE) + return true; + + return false; +} + static int btnxpuart_queue_skb(struct hci_dev *hdev, struct sk_buff *skb) { struct btnxpuart_dev *nxpdev = hci_get_drvdata(hdev); @@ -1546,6 +1569,7 @@ static int nxp_serdev_probe(struct serdev_device *serdev) hdev->send = nxp_enqueue; hdev->hw_error = nxp_hw_err; hdev->shutdown = nxp_shutdown; + hdev->wakeup = nxp_wakeup; SET_HCIDEV_DEV(hdev, &serdev->dev); if (hci_register_dev(hdev) < 0) {
When using the out-of-band WAKE_IN and WAKE_OUT pins, we have to tell the firmware which pins to use (from controller point of view). This allows to report remote wakeup support when WAKE_OUT(c2h) is configured. Signed-off-by: Loic Poulain <loic.poulain@linaro.org> --- v2: - Move pin properties read in ps_setup - Display warning in case of wakein prop without related gpio drivers/bluetooth/btnxpuart.c | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-)