|
@@ -167,7 +167,7 @@ struct qca_serdev {
|
|
|
};
|
|
|
|
|
|
static int qca_power_setup(struct hci_uart *hu, bool on);
|
|
|
-static void qca_power_shutdown(struct hci_dev *hdev);
|
|
|
+static void qca_power_shutdown(struct hci_uart *hu);
|
|
|
|
|
|
static void __serial_clock_on(struct tty_struct *tty)
|
|
|
{
|
|
@@ -608,7 +608,7 @@ static int qca_close(struct hci_uart *hu)
|
|
|
if (hu->serdev) {
|
|
|
qcadev = serdev_device_get_drvdata(hu->serdev);
|
|
|
if (qcadev->btsoc_type == QCA_WCN3990)
|
|
|
- qca_power_shutdown(hu->hdev);
|
|
|
+ qca_power_shutdown(hu);
|
|
|
else
|
|
|
gpiod_set_value_cansleep(qcadev->bt_en, 0);
|
|
|
|
|
@@ -1230,12 +1230,15 @@ static const struct qca_vreg_data qca_soc_data = {
|
|
|
.num_vregs = 4,
|
|
|
};
|
|
|
|
|
|
-static void qca_power_shutdown(struct hci_dev *hdev)
|
|
|
+static void qca_power_shutdown(struct hci_uart *hu)
|
|
|
{
|
|
|
- struct hci_uart *hu = hci_get_drvdata(hdev);
|
|
|
+ struct serdev_device *serdev = hu->serdev;
|
|
|
+ unsigned char cmd = QCA_WCN3990_POWEROFF_PULSE;
|
|
|
|
|
|
host_set_baudrate(hu, 2400);
|
|
|
- qca_send_power_pulse(hdev, QCA_WCN3990_POWEROFF_PULSE);
|
|
|
+ hci_uart_set_flow_control(hu, true);
|
|
|
+ serdev_device_write_buf(serdev, &cmd, sizeof(cmd));
|
|
|
+ hci_uart_set_flow_control(hu, false);
|
|
|
qca_power_setup(hu, false);
|
|
|
}
|
|
|
|
|
@@ -1411,7 +1414,7 @@ static void qca_serdev_remove(struct serdev_device *serdev)
|
|
|
struct qca_serdev *qcadev = serdev_device_get_drvdata(serdev);
|
|
|
|
|
|
if (qcadev->btsoc_type == QCA_WCN3990)
|
|
|
- qca_power_shutdown(qcadev->serdev_hu.hdev);
|
|
|
+ qca_power_shutdown(&qcadev->serdev_hu);
|
|
|
else
|
|
|
clk_disable_unprepare(qcadev->susclk);
|
|
|
|