#include <linux/kernel.h>
#include <linux/clk.h>
#include <linux/completion.h>
#include <linux/debugfs.h>
#include <linux/delay.h>
#include <linux/devcoredump.h>
#include <linux/device.h>
#include <linux/gpio/consumer.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/acpi.h>
#include <linux/platform_device.h>
#include <linux/pwrseq/consumer.h>
#include <linux/regulator/consumer.h>
#include <linux/serdev.h>
#include <linux/mutex.h>
#include <linux/unaligned.h>
#include <net/bluetooth/bluetooth.h>
#include <net/bluetooth/hci_core.h>
#include "hci_uart.h"
#include "btqca.h"
#define HCI_IBS_SLEEP_IND …
#define HCI_IBS_WAKE_IND …
#define HCI_IBS_WAKE_ACK …
#define HCI_MAX_IBS_SIZE …
#define IBS_WAKE_RETRANS_TIMEOUT_MS …
#define IBS_BTSOC_TX_IDLE_TIMEOUT_MS …
#define IBS_HOST_TX_IDLE_TIMEOUT_MS …
#define CMD_TRANS_TIMEOUT_MS …
#define MEMDUMP_TIMEOUT_MS …
#define IBS_DISABLE_SSR_TIMEOUT_MS …
#define FW_DOWNLOAD_TIMEOUT_MS …
#define SUSCLK_RATE_32KHZ …
#define QCA_DEBUG_HANDLE …
#define MAX_INIT_RETRIES …
#define QCA_SSR_DUMP_HANDLE …
#define QCA_DUMP_PACKET_SIZE …
#define QCA_LAST_SEQUENCE_NUM …
#define QCA_CRASHBYTE_PACKET_LEN …
#define QCA_MEMDUMP_BYTE …
enum qca_flags { … };
enum qca_capabilities { … };
enum tx_ibs_states { … };
enum rx_states { … };
enum hci_ibs_clock_state_vote { … };
enum qca_memdump_states { … };
struct qca_memdump_info { … };
struct qca_memdump_event_hdr { … } __packed;
struct qca_dump_size { … } __packed;
struct qca_data { … };
enum qca_speed_type { … };
struct qca_vreg { … };
struct qca_device_data { … };
struct qca_power { … };
struct qca_serdev { … };
static int qca_regulator_enable(struct qca_serdev *qcadev);
static void qca_regulator_disable(struct qca_serdev *qcadev);
static void qca_power_shutdown(struct hci_uart *hu);
static int qca_power_off(struct hci_dev *hdev);
static void qca_controller_memdump(struct work_struct *work);
static void qca_dmp_hdr(struct hci_dev *hdev, struct sk_buff *skb);
static enum qca_btsoc_type qca_soc_type(struct hci_uart *hu)
{ … }
static const char *qca_get_firmware_name(struct hci_uart *hu)
{ … }
static void __serial_clock_on(struct tty_struct *tty)
{ … }
static void __serial_clock_off(struct tty_struct *tty)
{ … }
static void serial_clock_vote(unsigned long vote, struct hci_uart *hu)
{ … }
static int send_hci_ibs_cmd(u8 cmd, struct hci_uart *hu)
{ … }
static void qca_wq_awake_device(struct work_struct *work)
{ … }
static void qca_wq_awake_rx(struct work_struct *work)
{ … }
static void qca_wq_serial_rx_clock_vote_off(struct work_struct *work)
{ … }
static void qca_wq_serial_tx_clock_vote_off(struct work_struct *work)
{ … }
static void hci_ibs_tx_idle_timeout(struct timer_list *t)
{ … }
static void hci_ibs_wake_retrans_timeout(struct timer_list *t)
{ … }
static void qca_controller_memdump_timeout(struct work_struct *work)
{ … }
static int qca_open(struct hci_uart *hu)
{ … }
static void qca_debugfs_init(struct hci_dev *hdev)
{ … }
static int qca_flush(struct hci_uart *hu)
{ … }
static int qca_close(struct hci_uart *hu)
{ … }
static void device_want_to_wakeup(struct hci_uart *hu)
{ … }
static void device_want_to_sleep(struct hci_uart *hu)
{ … }
static void device_woke_up(struct hci_uart *hu)
{ … }
static int qca_enqueue(struct hci_uart *hu, struct sk_buff *skb)
{ … }
static int qca_ibs_sleep_ind(struct hci_dev *hdev, struct sk_buff *skb)
{ … }
static int qca_ibs_wake_ind(struct hci_dev *hdev, struct sk_buff *skb)
{ … }
static int qca_ibs_wake_ack(struct hci_dev *hdev, struct sk_buff *skb)
{ … }
static int qca_recv_acl_data(struct hci_dev *hdev, struct sk_buff *skb)
{ … }
static void qca_dmp_hdr(struct hci_dev *hdev, struct sk_buff *skb)
{ … }
static void qca_controller_memdump(struct work_struct *work)
{ … }
static int qca_controller_memdump_event(struct hci_dev *hdev,
struct sk_buff *skb)
{ … }
static int qca_recv_event(struct hci_dev *hdev, struct sk_buff *skb)
{ … }
#define QCA_IBS_SLEEP_IND_EVENT …
#define QCA_IBS_WAKE_IND_EVENT …
#define QCA_IBS_WAKE_ACK_EVENT …
static const struct h4_recv_pkt qca_recv_pkts[] = …;
static int qca_recv(struct hci_uart *hu, const void *data, int count)
{ … }
static struct sk_buff *qca_dequeue(struct hci_uart *hu)
{ … }
static uint8_t qca_get_baudrate_value(int speed)
{ … }
static int qca_set_baudrate(struct hci_dev *hdev, uint8_t baudrate)
{ … }
static inline void host_set_baudrate(struct hci_uart *hu, unsigned int speed)
{ … }
static int qca_send_power_pulse(struct hci_uart *hu, bool on)
{ … }
static unsigned int qca_get_speed(struct hci_uart *hu,
enum qca_speed_type speed_type)
{ … }
static int qca_check_speeds(struct hci_uart *hu)
{ … }
static int qca_set_speed(struct hci_uart *hu, enum qca_speed_type speed_type)
{ … }
static int qca_send_crashbuffer(struct hci_uart *hu)
{ … }
static void qca_wait_for_dump_collection(struct hci_dev *hdev)
{ … }
static void qca_hw_error(struct hci_dev *hdev, u8 code)
{ … }
static void qca_cmd_timeout(struct hci_dev *hdev)
{ … }
static bool qca_wakeup(struct hci_dev *hdev)
{ … }
static int qca_port_reopen(struct hci_uart *hu)
{ … }
static int qca_regulator_init(struct hci_uart *hu)
{ … }
static int qca_power_on(struct hci_dev *hdev)
{ … }
static void hci_coredump_qca(struct hci_dev *hdev)
{ … }
static int qca_get_data_path_id(struct hci_dev *hdev, __u8 *data_path_id)
{ … }
static int qca_configure_hfp_offload(struct hci_dev *hdev)
{ … }
static int qca_setup(struct hci_uart *hu)
{ … }
static const struct hci_uart_proto qca_proto = …;
static const struct qca_device_data qca_soc_data_wcn3988 __maybe_unused = …;
static const struct qca_device_data qca_soc_data_wcn3990 __maybe_unused = …;
static const struct qca_device_data qca_soc_data_wcn3991 __maybe_unused = …;
static const struct qca_device_data qca_soc_data_wcn3998 __maybe_unused = …;
static const struct qca_device_data qca_soc_data_qca2066 __maybe_unused = …;
static const struct qca_device_data qca_soc_data_qca6390 __maybe_unused = …;
static const struct qca_device_data qca_soc_data_wcn6750 __maybe_unused = …;
static const struct qca_device_data qca_soc_data_wcn6855 __maybe_unused = …;
static const struct qca_device_data qca_soc_data_wcn7850 __maybe_unused = …;
static void qca_power_shutdown(struct hci_uart *hu)
{ … }
static int qca_power_off(struct hci_dev *hdev)
{ … }
static int qca_regulator_enable(struct qca_serdev *qcadev)
{ … }
static void qca_regulator_disable(struct qca_serdev *qcadev)
{ … }
static int qca_init_regulators(struct qca_power *qca,
const struct qca_vreg *vregs, size_t num_vregs)
{ … }
static void qca_clk_disable_unprepare(void *data)
{ … }
static int qca_serdev_probe(struct serdev_device *serdev)
{ … }
static void qca_serdev_remove(struct serdev_device *serdev)
{ … }
static void qca_serdev_shutdown(struct device *dev)
{ … }
static int __maybe_unused qca_suspend(struct device *dev)
{ … }
static int __maybe_unused qca_resume(struct device *dev)
{ … }
static SIMPLE_DEV_PM_OPS(qca_pm_ops, qca_suspend, qca_resume);
#ifdef CONFIG_OF
static const struct of_device_id qca_bluetooth_of_match[] = …;
MODULE_DEVICE_TABLE(of, qca_bluetooth_of_match);
#endif
#ifdef CONFIG_ACPI
static const struct acpi_device_id qca_bluetooth_acpi_match[] = …;
MODULE_DEVICE_TABLE(acpi, qca_bluetooth_acpi_match);
#endif
#ifdef CONFIG_DEV_COREDUMP
static void hciqca_coredump(struct device *dev)
{ … }
#endif
static struct serdev_device_driver qca_serdev_driver = …;
int __init qca_init(void)
{ … }
int __exit qca_deinit(void)
{ … }