STRUCT BCM_DEVICE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 β€” the bcm_device_list node. it's how this device links up with its friends πŸ’–
  • dev β€” the physical UART slave.
  • name β€” the device name that gets logged by the bt_dev_*() functions. it's giving name tag at a party.
  • device_wakeup β€” the BT_WAKE pin. 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 β€” the BT_REG_ON pin, which powers the Bluetooth device's internal regulators up or down. iconic power move.
  • reset β€” the BT_RST_N pin. active low, resets the Bluetooth logic core. the factory-reset button of pins πŸ’…
  • set_device_wakeup β€” callback to toggle the BT_WAKE pin, either by poking at device_wakeup directly or by calling btlp.
  • set_shutdown β€” callback to toggle the BT_REG_ON pin, either by poking at shutdown directly or by calling btpu/btpd.
  • btlp β€” the Apple ACPI method that toggles the BT_WAKE pin ("Bluetooth Low Power"). so fancy ✨
  • btpu β€” the Apple ACPI method that drives the BT_REG_ON pin high ("Bluetooth Power Up"). up up up 🎈
  • btpd β€” the Apple ACPI method that drives the BT_REG_ON pin 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 _CRS for 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 β€” the VBAT and VDDIO supplies 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 for oper_speed. it's giving starter speed.
  • oper_speed β€” the preferred baudrate of the Bluetooth device. set to 0 if init_speed is already the preferred baudrate. no point glamming twice πŸ’„
  • irq β€” the interrupt triggered by the HOST_WAKE_BT pin.
  • irq_active_low β€” whether irq is 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 when CONFIG_PM is on, iykyk 🧚)
  • is_suspended β€” whether flow control is currently disabled.
  • no_early_set_baudrate β€” don't set_baudrate before setup. literally just don't 🚫
  • drive_rts_on_open β€” drive the RTS signal on ->open when the platform requires it.
  • no_uart_clock_set β€” the UART clock set command for >3Mbps mode 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