Some Bluetooth controllers require initialization before being
used (vendor config, firmware download). Add possibility for a
HCI UART proto to implement this early init via the setup callback.
Signed-off-by: Loic Poulain <loic.poulain@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
        return 0;
 }
 
+static int hci_uart_setup(struct hci_dev *hdev)
+{
+       struct hci_uart *hu = hci_get_drvdata(hdev);
+
+       if (hu->proto->setup)
+               return hu->proto->setup(hu);
+
+       return 0;
+}
+
 /* ------ LDISC part ------ */
 /* hci_uart_tty_open
  *
        hdev->close = hci_uart_close;
        hdev->flush = hci_uart_flush;
        hdev->send  = hci_uart_send_frame;
+       hdev->setup = hci_uart_setup;
        SET_HCIDEV_DEV(hdev, hu->tty->dev);
 
        if (test_bit(HCI_UART_RAW_DEVICE, &hu->hdev_flags))
 
        int (*flush)(struct hci_uart *hu);
        int (*recv)(struct hci_uart *hu, void *data, int len);
        int (*enqueue)(struct hci_uart *hu, struct sk_buff *skb);
+       int (*setup)(struct hci_uart *hu);
        struct sk_buff *(*dequeue)(struct hci_uart *hu);
 };