STRUCT BCM_DEVICE(9)
π struct bcm_device β device driver resources π
okay so this is a page from the Kernel API Manual, section 9, and it's literally all about struct bcm_device bestie β one big gorgeous bundle of every resource a Bluetooth-over-UART driver could ever need. grab a snack, we're going member by member π
β¨ NAME β¨
struct bcm_device β device driver resources. that's it, that's the whole vibe. it's the resource container, the little suitcase the driver carries around π
π¦ SYNOPSIS π¦
here's the whole struct, no cap, copied exactly:
struct bcm_device {
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;
u8 pcm_int_params[5];
u32 max_autobaud_speed;
};
notice the #ifdef blocks? those fields only show up when CONFIG_ACPI or CONFIG_PM are on β conditional queen behavior π
πΈ Members πΈ
this is the part where each field gets its moment. every single one, in order, no skipping. let's go π«Ά
serdev_huβ the HCI UART controller struct. main character energy fr.listβ thebcm_device_listnode. it's how this device links up with its friends πdevβ the physical UART slave.nameβ the device name that gets logged by thebt_dev_*()functions. it's giving name tag at a party.device_wakeupβ theBT_WAKEpin. assert = the Bluetooth device must wake up or remain awake; deassert = it may sleep when the sleep criteria are met. so basically a "u up?" pin πshutdownβ theBT_REG_ONpin, which powers the Bluetooth device's internal regulators up or down. iconic power move.resetβ theBT_RST_Npin. active low, resets the Bluetooth logic core. the factory-reset button of pins πset_device_wakeupβ callback to toggle theBT_WAKEpin, either by poking atdevice_wakeupdirectly or by callingbtlp.set_shutdownβ callback to toggle theBT_REG_ONpin, either by poking atshutdowndirectly or by callingbtpu/btpd.btlpβ the Apple ACPI method that toggles theBT_WAKEpin ("Bluetooth Low Power"). so fancy β¨btpuβ the Apple ACPI method that drives theBT_REG_ONpin high ("Bluetooth Power Up"). up up up πbtpdβ the Apple ACPI method that drives theBT_REG_ONpin low ("Bluetooth Power Down"). nap time π΄gpio_countβ internal counter for the GPIO resources tied to the ACPI device.gpio_int_idxβ the index in_CRSfor the GpioInt resource. lowkey niche but we respect it.txco_clkβ the external reference frequency clock the Bluetooth device uses.lpo_clkβ the external LPO clock the Bluetooth device uses. two clocks, double the slay π°οΈsuppliesβ theVBATandVDDIOsupplies the Bluetooth device uses. yes bestie, it eats.res_enabledβ whether the clocks and supplies are prepared and enabled. both. not one, both π₯init_speedβ the default baudrate of the Bluetooth device. the host UART starts out at this baudrate so it can configure the Bluetooth device foroper_speed. it's giving starter speed.oper_speedβ the preferred baudrate of the Bluetooth device. set to0ifinit_speedis already the preferred baudrate. no point glamming twice πirqβ the interrupt triggered by theHOST_WAKE_BTpin.irq_active_lowβ whetherirqis active low.irq_acquiredβ a flag showing whether the IRQ handler has been assigned. like a little "taken β " sticker.huβ pointer to the HCI UART controller struct, used to disable flow control during runtime suspend and system sleep. (only around whenCONFIG_PMis on, iykyk π§)is_suspendedβ whether flow control is currently disabled.no_early_set_baudrateβ don'tset_baudratebefore setup. literally just don't π«drive_rts_on_openβ drive the RTS signal on->openwhen the platform requires it.no_uart_clock_setβ the UART clock set command for>3Mbpsmode is unavailable. sad but true πuse_autobaud_modeβ start the Bluetooth device in autobaud mode.pcm_int_paramsβ keep the initial PCM configuration. preserve the lore πmax_autobaud_speedβ the max baudrate the device supports in autobaud mode. fastest girlie in the room β
ngl this struct is long but every single field pulls its weight. no filler, no dead weight, just resource management excellence π
π SEE ALSO π
- Kernel file
./drivers/bluetooth/hci_bcm.c struct bcm_device_data(9)
go read hci_bcm.c bestie, it's where all this actually lives π
that's the whole page!! this one lives under ./drivers/bluetooth and it's dated October 2026 β so yes, we're reading the future, and it's giving kernel API excellence π periodt.
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms