mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 06:10:56 +00:00
Bluetooth: hci_qca: Pass boolean 'on/off' to qca_send_power_pulse()
There are only two types of power pulses 'on' or 'off', pass a boolean instead of the power pulse 'command'. Signed-off-by: Matthias Kaehlcke <mka@chromium.org> Reviewed-by: Balakrishna Godavarthi <bgodavar@codeaurora.org> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
This commit is contained in:
parent
5971752de4
commit
9836b80208
1 changed files with 5 additions and 4 deletions
|
@ -1004,10 +1004,11 @@ static inline void host_set_baudrate(struct hci_uart *hu, unsigned int speed)
|
||||||
hci_uart_set_baudrate(hu, speed);
|
hci_uart_set_baudrate(hu, speed);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int qca_send_power_pulse(struct hci_uart *hu, u8 cmd)
|
static int qca_send_power_pulse(struct hci_uart *hu, bool on)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
int timeout = msecs_to_jiffies(POWER_PULSE_TRANS_TIMEOUT_MS);
|
int timeout = msecs_to_jiffies(POWER_PULSE_TRANS_TIMEOUT_MS);
|
||||||
|
u8 cmd = on ? QCA_WCN3990_POWERON_PULSE : QCA_WCN3990_POWEROFF_PULSE;
|
||||||
|
|
||||||
/* These power pulses are single byte command which are sent
|
/* These power pulses are single byte command which are sent
|
||||||
* at required baudrate to wcn3990. On wcn3990, we have an external
|
* at required baudrate to wcn3990. On wcn3990, we have an external
|
||||||
|
@ -1138,12 +1139,12 @@ static int qca_wcn3990_init(struct hci_uart *hu)
|
||||||
|
|
||||||
/* Forcefully enable wcn3990 to enter in to boot mode. */
|
/* Forcefully enable wcn3990 to enter in to boot mode. */
|
||||||
host_set_baudrate(hu, 2400);
|
host_set_baudrate(hu, 2400);
|
||||||
ret = qca_send_power_pulse(hu, QCA_WCN3990_POWEROFF_PULSE);
|
ret = qca_send_power_pulse(hu, false);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
qca_set_speed(hu, QCA_INIT_SPEED);
|
qca_set_speed(hu, QCA_INIT_SPEED);
|
||||||
ret = qca_send_power_pulse(hu, QCA_WCN3990_POWERON_PULSE);
|
ret = qca_send_power_pulse(hu, true);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
@ -1290,7 +1291,7 @@ static void qca_power_shutdown(struct hci_uart *hu)
|
||||||
spin_unlock_irqrestore(&qca->hci_ibs_lock, flags);
|
spin_unlock_irqrestore(&qca->hci_ibs_lock, flags);
|
||||||
|
|
||||||
host_set_baudrate(hu, 2400);
|
host_set_baudrate(hu, 2400);
|
||||||
qca_send_power_pulse(hu, QCA_WCN3990_POWEROFF_PULSE);
|
qca_send_power_pulse(hu, false);
|
||||||
qca_power_setup(hu, false);
|
qca_power_setup(hu, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue