#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/skbuff.h>
#include <linux/firmware.h>
#include <linux/module.h>
#include <linux/acpi.h>
#include <linux/of.h>
#include <linux/of_irq.h>
#include <linux/property.h>
#include <linux/platform_data/x86/apple.h>
#include <linux/platform_device.h>
#include <linux/regulator/consumer.h>
#include <linux/clk.h>
#include <linux/gpio/consumer.h>
#include <linux/gpio/machine.h>
#include <linux/tty.h>
#include <linux/interrupt.h>
#include <linux/dmi.h>
#include <linux/pm_runtime.h>
#include <linux/serdev.h>
#include <net/bluetooth/bluetooth.h>
#include <net/bluetooth/hci_core.h>
#include "btbcm.h"
#include "hci_uart.h"
#define BCM_NULL_PKT …
#define BCM_NULL_SIZE …
#define BCM_LM_DIAG_PKT …
#define BCM_LM_DIAG_SIZE …
#define BCM_TYPE49_PKT …
#define BCM_TYPE49_SIZE …
#define BCM_TYPE52_PKT …
#define BCM_TYPE52_SIZE …
#define BCM_AUTOSUSPEND_DELAY …
#define BCM_NUM_SUPPLIES …
struct bcm_device_data { … };
struct bcm_device { … };
struct bcm_data { … };
static DEFINE_MUTEX(bcm_device_lock);
static LIST_HEAD(bcm_device_list);
static int irq_polarity = …;
module_param(irq_polarity, int, 0444);
MODULE_PARM_DESC(…) …;
static inline void host_set_baudrate(struct hci_uart *hu, unsigned int speed)
{ … }
static int bcm_set_baudrate(struct hci_uart *hu, unsigned int speed)
{ … }
static bool bcm_device_exists(struct bcm_device *device)
{ … }
static int bcm_gpio_set_power(struct bcm_device *dev, bool powered)
{ … }
#ifdef CONFIG_PM
static irqreturn_t bcm_host_wake(int irq, void *data)
{ … }
static int bcm_request_irq(struct bcm_data *bcm)
{ … }
static const struct bcm_set_sleep_mode default_sleep_params = …;
static int bcm_setup_sleep(struct hci_uart *hu)
{ … }
#else
static inline int bcm_request_irq(struct bcm_data *bcm) { return 0; }
static inline int bcm_setup_sleep(struct hci_uart *hu) { return 0; }
#endif
static int bcm_set_diag(struct hci_dev *hdev, bool enable)
{ … }
static int bcm_open(struct hci_uart *hu)
{ … }
static int bcm_close(struct hci_uart *hu)
{ … }
static int bcm_flush(struct hci_uart *hu)
{ … }
static int bcm_setup(struct hci_uart *hu)
{ … }
#define BCM_RECV_LM_DIAG …
#define BCM_RECV_NULL …
#define BCM_RECV_TYPE49 …
#define BCM_RECV_TYPE52 …
static const struct h4_recv_pkt bcm_recv_pkts[] = …;
static int bcm_recv(struct hci_uart *hu, const void *data, int count)
{ … }
static int bcm_enqueue(struct hci_uart *hu, struct sk_buff *skb)
{ … }
static struct sk_buff *bcm_dequeue(struct hci_uart *hu)
{ … }
#ifdef CONFIG_PM
static int bcm_suspend_device(struct device *dev)
{ … }
static int bcm_resume_device(struct device *dev)
{ … }
#endif
#ifdef CONFIG_PM_SLEEP
static int bcm_suspend(struct device *dev)
{ … }
static int bcm_resume(struct device *dev)
{ … }
#endif
static struct gpiod_lookup_table irq_on_int33fc02_pin17_gpios = …;
static const struct dmi_system_id bcm_broken_irq_dmi_table[] = …;
#ifdef CONFIG_ACPI
static const struct acpi_gpio_params first_gpio = …;
static const struct acpi_gpio_params second_gpio = …;
static const struct acpi_gpio_params third_gpio = …;
static const struct acpi_gpio_mapping acpi_bcm_int_last_gpios[] = …;
static const struct acpi_gpio_mapping acpi_bcm_int_first_gpios[] = …;
static int bcm_resource(struct acpi_resource *ares, void *data)
{ … }
static int bcm_apple_set_device_wakeup(struct bcm_device *dev, bool awake)
{ … }
static int bcm_apple_set_shutdown(struct bcm_device *dev, bool powered)
{ … }
static int bcm_apple_get_resources(struct bcm_device *dev)
{ … }
#else
static inline int bcm_apple_get_resources(struct bcm_device *dev)
{
return -EOPNOTSUPP;
}
#endif
static int bcm_gpio_set_device_wakeup(struct bcm_device *dev, bool awake)
{ … }
static int bcm_gpio_set_shutdown(struct bcm_device *dev, bool powered)
{ … }
static struct clk *bcm_get_txco(struct device *dev)
{ … }
static int bcm_get_resources(struct bcm_device *dev)
{ … }
#ifdef CONFIG_ACPI
static int bcm_acpi_probe(struct bcm_device *dev)
{ … }
#else
static int bcm_acpi_probe(struct bcm_device *dev)
{
return -EINVAL;
}
#endif
static int bcm_of_probe(struct bcm_device *bdev)
{ … }
static int bcm_probe(struct platform_device *pdev)
{ … }
static void bcm_remove(struct platform_device *pdev)
{ … }
static const struct hci_uart_proto bcm_proto = …;
#ifdef CONFIG_ACPI
static struct bcm_device_data bcm43430_device_data = …;
static const struct acpi_device_id bcm_acpi_match[] = …;
MODULE_DEVICE_TABLE(acpi, bcm_acpi_match);
#endif
static const struct dev_pm_ops bcm_pm_ops = …;
static struct platform_driver bcm_driver = …;
static int bcm_serdev_probe(struct serdev_device *serdev)
{ … }
static void bcm_serdev_remove(struct serdev_device *serdev)
{ … }
#ifdef CONFIG_OF
static struct bcm_device_data bcm4354_device_data = …;
static struct bcm_device_data bcm43438_device_data = …;
static struct bcm_device_data cyw4373a0_device_data = …;
static struct bcm_device_data cyw55572_device_data = …;
static const struct of_device_id bcm_bluetooth_of_match[] = …;
MODULE_DEVICE_TABLE(of, bcm_bluetooth_of_match);
#endif
static struct serdev_device_driver bcm_serdev_driver = …;
int __init bcm_init(void)
{ … }
int __exit bcm_deinit(void)
{ … }