spi_register_board_info(9)
π spi_register_board_info(9) π
okay so this is a page from the Kernel API Manual bestie, and it's all about spi_register_board_info β register SPI devices for a given board. yes that's the whole NAME. slay. β¨
πΈ SYNOPSIS πΈ
int spi_register_board_info (struct spi_board_info const *info ,
unsigned n );
that's it. that's the signature. copy it exactly, don't @ me π
π ARGUMENTS π
infoβ an array of chip descriptors. like, the whole lineup of your little SPI babies π£nβ how many descriptors are provided. so how many of those babies you're actually handing over. count carefully fr fr
π CONTEXT π
can sleep π΄ β so don't call this from somewhere spicy where sleeping is illegal, okay? context matters, iykyk.
π₯ DESCRIPTION π₯
okay so here's the vibe. Board-specific early init code calls this β probably during arch_initcall β with segments of the SPI device table. that's the move. π«Ά
the way it works: any device nodes are created later, after the relevant parent SPI controller (bus_num) is defined. so you're not making devices yet, you're just putting the list on file. and bestie, we keep this table of devices forever β like, permanently, no take-backs β so that reloading a controller driver will not make Linux forget about these hard-wired devices. iconic behaviour honestly π
other code can also call this too, no gatekeeping! e.g. a particular add-on board might provide SPI devices through its expansion connector, so code initializing that board would naturally declare its SPI devices. makes sense, you'd want the board to introduce its own devices. π
β οΈ ok important warning time: the board info passed can safely be__initdata... but be careful of any embedded pointers (platform_data, etc) β they're copied as-is. so no funny business with those pointers, they're not deep-copied, they're just... pointed at. π don't let them dangle bestie.
β RETURN β
zero on success π else a negative error code π (which like, mood, but also: check it.)
π¦ SEE ALSO π¦
Kernel file ./drivers/spi/spi.c β plus this absolute list of friends, in order, no skips:
__spi_register_driver(9)spi_alloc_device(9)spi_add_device(9)spi_new_device(9)spi_unregister_device(9)spi_res_alloc(9)spi_res_free(9)spi_res_add(9)spi_res_release(9)spi_finalize_current_transfer(9)__spi_pump_messages(9)spi_pump_messages(9)spi_take_timestamp_pre(9)spi_take_timestamp_post(9)spi_set_thread_rt(9)spi_get_next_queued_message(9)spi_finalize_current_message(9)spi_queued_transfer(9)spi_flush_queue(9)of_register_spi_devices(9)spi_new_ancillary_device(9)devm_spi_new_ancillary_device(9)acpi_spi_count_resources(9)acpi_spi_device_alloc(9)spi_target_abort(9)__spi_alloc_controller(9)__devm_spi_alloc_controller(9)spi_get_gpio_descs(9)spi_register_controller(9)devm_spi_register_controller(9)spi_unregister_controller(9)spi_replace_transfers(9)spi_split_transfers_maxsize(9)spi_split_transfers_maxwords(9)spi_set_cs_timing(9)spi_setup(9)spi_optimize_message(9)spi_unoptimize_message(9)devm_spi_optimize_message(9)spi_async(9)spi_sync(9)spi_sync_locked(9)spi_bus_lock(9)spi_bus_unlock(9)spi_write_then_read(9)
and that's the page!! π§π
cute little sign-off: this one lives in ./drivers/spi, dated October 2026, and it's spi_register_board_info(9) for the Kernel API Manual. go be obsessed with your board info. 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