acpi_spi_device_alloc(9)
π acpi_spi_device_alloc π
okay so this is a page from the Kernel API Manual, and today's main character is acpi_spi_device_alloc(9) β the little function that hands you a fresh SPI device already dressed up in its ACPI info. slay.
β¨ NAME β¨
acpi_spi_device_alloc β allocate a spi device, and fill it in with ACPI information π
π¦ SYNOPSIS π¦
struct spi_device * acpi_spi_device_alloc (struct spi_controller *ctlr ,
struct acpi_device *adev , int index );
πΈ ARGUMENTS πΈ
ctlrβ the controller that this spi device belongs to. it's giving "who's your parent" energy πadevβ the ACPI Device for the spi device. the source of all the lore β¨indexβ the index of the spi resource inside the ACPI Node. like, which one bestie π«Ά
π DESCRIPTION π
okay so here's the vibe: you use this to allocate a new SPI device from and ACPI Device node. yes, "from and" β that's what the page says, we don't edit the original text's quirks, we respect them π
the caller is responsible for calling spi_add_device to register the SPI device. you, bestie. that's on you. no cap. π₯
if ctlr is set to NULL, the Controller for the SPI device will be looked up using the resource. it'll figure itself out, main character energy β
if index is set to -1, index is not used. it's just there vibing. π
β οΈ NOTE β οΈ
ifindexis-1, thenctlrmust be set. lowkey non-negotiable. don't come crying to me when it breaks π
π RETURN π
a pointer to the new device, or ERR_PTR on error. so like, check it. please. for me. π₯Ί
π SEE ALSO π
this list is long but every single one of them ate, so here we go, no skipping, hydrate first bestie π
- the kernel file
./drivers/spi/spi.c __spi_register_driver(9)spi_alloc_device(9)spi_add_device(9)spi_new_device(9)spi_unregister_device(9)spi_register_board_info(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)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)
iykyk π§
okay that's the whole page, we're done here π
this little number lives in ./drivers/spi, it's stamped October 2026, and it answers to the name acpi_spi_device_alloc(9). mwah, go read the source, bye bestie π«Άπβ¨
π¦ 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