[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZBHvG9Nh1n+xp59X@corigine.com>
Date: Wed, 15 Mar 2023 17:15:23 +0100
From: Simon Horman <simon.horman@...igine.com>
To: Neeraj Sanjay Kale <neeraj.sanjaykale@....com>
Cc: davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com, robh+dt@...nel.org,
krzysztof.kozlowski+dt@...aro.org, marcel@...tmann.org,
johan.hedberg@...il.com, luiz.dentz@...il.com,
gregkh@...uxfoundation.org, jirislaby@...nel.org,
alok.a.tiwari@...cle.com, hdanton@...a.com,
ilpo.jarvinen@...ux.intel.com, leon@...nel.org,
netdev@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-bluetooth@...r.kernel.org,
linux-serial@...r.kernel.org, amitkumar.karwar@....com,
rohit.fule@....com, sherry.sun@....com
Subject: Re: [PATCH v12 4/4] Bluetooth: NXP: Add protocol support for NXP
Bluetooth chipsets
On Wed, Mar 15, 2023 at 05:33:26PM +0530, Neeraj Sanjay Kale wrote:
> This adds a driver based on serdev driver for the NXP BT serial protocol
> based on running H:4, which can enable the built-in Bluetooth device
> inside an NXP BT chip.
>
> This driver has Power Save feature that will put the chip into sleep state
> whenever there is no activity for 2000ms, and will be woken up when any
> activity is to be initiated over UART.
>
> This driver enables the power save feature by default by sending the vendor
> specific commands to the chip during setup.
>
> During setup, the driver checks if a FW is already running on the chip
> by waiting for the bootloader signature, and downloads device specific FW
> file into the chip over UART if bootloader signature is received..
>
> Signed-off-by: Neeraj Sanjay Kale <neeraj.sanjaykale@....com>
> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
...
> +static int nxp_set_ind_reset(struct hci_dev *hdev, void *data)
> +{
> + struct btnxpuart_dev *nxpdev = hci_get_drvdata(hdev);
> + struct sk_buff *skb;
> + u8 *status;
> + u8 pcmd = 0;
> + int err = 0;
> +
> + skb = nxp_drv_send_cmd(hdev, HCI_NXP_IND_RESET, 1, &pcmd);
> + if (IS_ERR(skb))
> + return PTR_ERR(skb);
> +
> + status = skb_pull_data(skb, 1);
> + if (status) {
> + if (*status == 0) {
> + set_bit(BTNXPUART_FW_DOWNLOADING, &nxpdev->tx_state);
nit: perhaps this can be written more idiomatically as:
if (!status || *status)
goto free_skb;
set_bit(BTNXPUART_FW_DOWNLOADING, &nxpdev->tx_state);
...
> + err = nxp_download_firmware(hdev);
> + if (err < 0)
> + goto free_skb;
> + serdev_device_set_baudrate(nxpdev->serdev, nxpdev->fw_init_baudrate);
> + nxpdev->current_baudrate = nxpdev->fw_init_baudrate;
> + hci_cmd_sync_queue(hdev, send_wakeup_method_cmd, NULL, NULL);
> + hci_cmd_sync_queue(hdev, send_ps_cmd, NULL, NULL);
> + }
> + }
> +
> +free_skb:
> + kfree_skb(skb);
> + return err;
> +}
...
Powered by blists - more mailing lists