i2c_acpi_get_i2c_resource(9)
π i2c_acpi_get_i2c_resource β so you wanna grab an I2cSerialBus resource? bestie, same
okay so real quick β this is a page from the Kernel API Manual (section 9, the kernel-API girlies know π), and it's all about i2c_acpi_get_i2c_resource, aka "gets I2cSerialBus resource if type matches". that's the whole NAME situation, no notes π
β¨ SYNOPSIS β¨
bool i2c_acpi_get_i2c_resource (struct acpi_resource *ares , struct
acpi_resource_i2c_serialbus **i2c );
not me obsessing over a function that returns a bool β she's giving "yes or no, no maybes" energy and honestly? iconic π
πΈ ARGUMENTS πΈ
aresβ the ACPI resource. that's the thing you're handing over for inspection, bestie π¦i2cβ a pointer to the I2cSerialBus resource, and this is where that pointer gets returned to you. like, you bring the bucket, the function fills the bucket πͺ£β¨
π DESCRIPTION π
so here's the vibe check π₯ this function checks if the given ACPI resource (ares) is of type I2cSerialBus. and if it is? slay. it returns a pointer to it right back to the caller.
and the return value, since you're gonna ask: it returns true if the resource type is of I2cSerialBus, otherwise false. simple as that, no cap π―
ngl this is the "are you the one or not" of kernel functions and she answers immediately π
π¦ SEE ALSO π¦
the kernel source file lives at ./drivers/i2c/i2c-core-acpi.c β yes, that's the one, go read her πβ¨
i2c_acpi_client_count(9)i2c_acpi_get_irq(9)i2c_acpi_register_devices(9)i2c_acpi_find_bus_speed(9)i2c_acpi_new_device_by_fwnode(9)
like, the whole friend group fr fr π«Ά
and that's the page, bestie π
she lives in ./drivers/i2c, dated October 2026, and this little group-chat study session was brought to you by the Kernel API Manual β mwah, 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