Skip to content

Commit 9836b80

Browse files
Matthias Kaehlckeholtmann
authored andcommitted
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>
1 parent 5971752 commit 9836b80

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

drivers/bluetooth/hci_qca.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,10 +1004,11 @@ static inline void host_set_baudrate(struct hci_uart *hu, unsigned int speed)
10041004
hci_uart_set_baudrate(hu, speed);
10051005
}
10061006

1007-
static int qca_send_power_pulse(struct hci_uart *hu, u8 cmd)
1007+
static int qca_send_power_pulse(struct hci_uart *hu, bool on)
10081008
{
10091009
int ret;
10101010
int timeout = msecs_to_jiffies(POWER_PULSE_TRANS_TIMEOUT_MS);
1011+
u8 cmd = on ? QCA_WCN3990_POWERON_PULSE : QCA_WCN3990_POWEROFF_PULSE;
10111012

10121013
/* These power pulses are single byte command which are sent
10131014
* at required baudrate to wcn3990. On wcn3990, we have an external
@@ -1138,12 +1139,12 @@ static int qca_wcn3990_init(struct hci_uart *hu)
11381139

11391140
/* Forcefully enable wcn3990 to enter in to boot mode. */
11401141
host_set_baudrate(hu, 2400);
1141-
ret = qca_send_power_pulse(hu, QCA_WCN3990_POWEROFF_PULSE);
1142+
ret = qca_send_power_pulse(hu, false);
11421143
if (ret)
11431144
return ret;
11441145

11451146
qca_set_speed(hu, QCA_INIT_SPEED);
1146-
ret = qca_send_power_pulse(hu, QCA_WCN3990_POWERON_PULSE);
1147+
ret = qca_send_power_pulse(hu, true);
11471148
if (ret)
11481149
return ret;
11491150

@@ -1290,7 +1291,7 @@ static void qca_power_shutdown(struct hci_uart *hu)
12901291
spin_unlock_irqrestore(&qca->hci_ibs_lock, flags);
12911292

12921293
host_set_baudrate(hu, 2400);
1293-
qca_send_power_pulse(hu, QCA_WCN3990_POWEROFF_PULSE);
1294+
qca_send_power_pulse(hu, false);
12941295
qca_power_setup(hu, false);
12951296
}
12961297

0 commit comments

Comments
 (0)