drivers/bluetooth/hci_bcm.c
Source file repositories/reference/linux-study-clean/drivers/bluetooth/hci_bcm.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/bluetooth/hci_bcm.c- Extension
.c- Size
- 40105 bytes
- Lines
- 1631
- Domain
- Driver Families
- Bucket
- drivers/bluetooth
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/errno.hlinux/skbuff.hlinux/firmware.hlinux/module.hlinux/acpi.hlinux/of.hlinux/of_irq.hlinux/property.hlinux/platform_data/x86/apple.hlinux/platform_device.hlinux/regulator/consumer.hlinux/clk.hlinux/gpio/consumer.hlinux/gpio/machine.hlinux/tty.hlinux/interrupt.hlinux/dmi.hlinux/pm_runtime.hlinux/serdev.hnet/bluetooth/bluetooth.hnet/bluetooth/hci_core.hbtbcm.hhci_uart.h
Detected Declarations
struct bcm_device_datastruct bcm_devicestruct bcm_datafunction host_set_baudratefunction bcm_set_baudratefunction bcm_device_existsfunction list_for_eachfunction bcm_gpio_set_powerfunction bcm_host_wakefunction bcm_request_irqfunction bcm_setup_sleepfunction bcm_request_irqfunction bcm_setup_sleepfunction bcm_set_diagfunction bcm_openfunction list_for_eachfunction devicefunction bcm_closefunction bcm_flushfunction bcm_setupfunction bcm_recvfunction bcm_enqueuefunction bcm_suspend_devicefunction bcm_resume_devicefunction bcm_suspendfunction bcm_resumefunction bcm_resourcefunction bcm_apple_set_device_wakeupfunction bcm_apple_set_shutdownfunction bcm_apple_get_resourcesfunction bcm_apple_get_resourcesfunction bcm_gpio_set_device_wakeupfunction bcm_gpio_set_shutdownfunction bcm_get_resourcesfunction bcm_acpi_probefunction resource_list_for_each_entryfunction bcm_acpi_probefunction bcm_of_probefunction bcm_probefunction bcm_removefunction bcm_serdev_probefunction bcm_serdev_removefunction bcm_initfunction bcm_deinit
Annotated Snippet
struct bcm_device_data {
bool no_early_set_baudrate;
bool drive_rts_on_open;
bool no_uart_clock_set;
u32 max_autobaud_speed;
u32 max_speed;
};
/**
* struct bcm_device - device driver resources
* @serdev_hu: HCI UART controller struct
* @list: bcm_device_list node
* @dev: physical UART slave
* @name: device name logged by bt_dev_*() functions
* @device_wakeup: BT_WAKE pin,
* assert = Bluetooth device must wake up or remain awake,
* deassert = Bluetooth device may sleep when sleep criteria are met
* @shutdown: BT_REG_ON pin,
* power up or power down Bluetooth device internal regulators
* @reset: BT_RST_N pin,
* active low resets the Bluetooth logic core
* @set_device_wakeup: callback to toggle BT_WAKE pin
* either by accessing @device_wakeup or by calling @btlp
* @set_shutdown: callback to toggle BT_REG_ON pin
* either by accessing @shutdown or by calling @btpu/@btpd
* @btlp: Apple ACPI method to toggle BT_WAKE pin ("Bluetooth Low Power")
* @btpu: Apple ACPI method to drive BT_REG_ON pin high ("Bluetooth Power Up")
* @btpd: Apple ACPI method to drive BT_REG_ON pin low ("Bluetooth Power Down")
* @gpio_count: internal counter for GPIO resources associated with ACPI device
* @gpio_int_idx: index in _CRS for GpioInt() resource
* @txco_clk: external reference frequency clock used by Bluetooth device
* @lpo_clk: external LPO clock used by Bluetooth device
* @supplies: VBAT and VDDIO supplies used by Bluetooth device
* @res_enabled: whether clocks and supplies are prepared and enabled
* @init_speed: default baudrate of Bluetooth device;
* the host UART is initially set to this baudrate so that
* it can configure the Bluetooth device for @oper_speed
* @oper_speed: preferred baudrate of Bluetooth device;
* set to 0 if @init_speed is already the preferred baudrate
* @irq: interrupt triggered by HOST_WAKE_BT pin
* @irq_active_low: whether @irq is active low
* @irq_acquired: flag to show if IRQ handler has been assigned
* @hu: pointer to HCI UART controller struct,
* used to disable flow control during runtime suspend and system sleep
* @is_suspended: whether flow control is currently disabled
* @no_early_set_baudrate: don't set_baudrate before setup()
* @drive_rts_on_open: drive RTS signal on ->open() when platform requires it
* @no_uart_clock_set: UART clock set command for >3Mbps mode is unavailable
* @pcm_int_params: keep the initial PCM configuration
* @use_autobaud_mode: start Bluetooth device in autobaud mode
* @max_autobaud_speed: max baudrate supported by device in autobaud mode
*/
struct bcm_device {
/* Must be the first member, hci_serdev.c expects this. */
struct hci_uart serdev_hu;
struct list_head list;
struct device *dev;
const char *name;
struct gpio_desc *device_wakeup;
struct gpio_desc *shutdown;
struct gpio_desc *reset;
int (*set_device_wakeup)(struct bcm_device *, bool);
int (*set_shutdown)(struct bcm_device *, bool);
#ifdef CONFIG_ACPI
acpi_handle btlp, btpu, btpd;
int gpio_count;
int gpio_int_idx;
#endif
struct clk *txco_clk;
struct clk *lpo_clk;
struct regulator_bulk_data supplies[BCM_NUM_SUPPLIES];
bool res_enabled;
u32 init_speed;
u32 oper_speed;
int irq;
bool irq_active_low;
bool irq_acquired;
#ifdef CONFIG_PM
struct hci_uart *hu;
bool is_suspended;
#endif
bool no_early_set_baudrate;
bool drive_rts_on_open;
bool no_uart_clock_set;
bool use_autobaud_mode;
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/errno.h`, `linux/skbuff.h`, `linux/firmware.h`, `linux/module.h`, `linux/acpi.h`, `linux/of.h`, `linux/of_irq.h`.
- Detected declarations: `struct bcm_device_data`, `struct bcm_device`, `struct bcm_data`, `function host_set_baudrate`, `function bcm_set_baudrate`, `function bcm_device_exists`, `function list_for_each`, `function bcm_gpio_set_power`, `function bcm_host_wake`, `function bcm_request_irq`.
- Atlas domain: Driver Families / drivers/bluetooth.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.