Skip to content

RFC ACPI: ACPI 5.0 device enumeration proposal

Zhang Rui linux-acpi linux-i2c linux-pm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest6 patches 16 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6Introduce acpi_match_device_id().drivers/acpi/scan.c include/acpi/acpi_bus.h+28 -05 replies
2/6Introduce ACPI style match in platform_matchdrivers/base/platform.c+8 -02 replies
3/6ACPI: introduce acpi_get_generic_resourcesdrivers/acpi/Makefile drivers/acpi/resource.c include/acpi/acpi_bus.h+167 -01 reply
4/6Change i2c_register_board_info from __init to __devinitdrivers/i2c/i2c-boardinfo.c+1 -10 replies
5/6ACPI: Introduce ACPI I2C controller enumeration driverdrivers/acpi/Makefile drivers/acpi/i2c_root.c drivers/acpi/sysfs.c +1 more+232 -05 replies
6/6Introduce INT33B1 I2C controller driverdrivers/i2c/busses/Kconfig drivers/i2c/busses/Makefile drivers/i2c/busses/i2c-33b1.c+126 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/6] ACPI: ACPI 5.0 device enumeration proposal

Hi, all,

I'm working on ACPI device enumeration support recently, and here is the proposal I made to enumerate devices via ACPI namespace.

the main idea is that, for Serial Buses like I2C and SPI, we enumerate the controller as a platform device, and then enumerate the slaves via i2c/spi_register_board_info. And then, when the controller is really probed and enabled in the platform driver, the SPI/I2C bus code will enumerate I2C/SPI slaves automatically.
And for the other devices, we will enumerate all of them as platform devices, which is not covered in this patch set yet.

Patch 1 & 2 Introduce ACPI style device match method in platform_match. this is because an ACPI device may have multiple hardware ID (_HID) and Compatible IDs, aka, _CID, but in platform device code, only pdev->name is used to match the driver id_table currently.
Patch 3 introduces a new API acpi_get_generic_resources(). this API is used to convert ACPI style resources to the generic struct resource.
Patch 4 changes i2c_register_board_info from __init to __devinit. This is needed because I want to enumerate the slave devices in ACPI I2C control Driver, which supports hotplug in theory.
Patch 5 introduces the ACPI I2C controller enumeration drive. it enumerate the ACPI I2C controller to a platform device and then enumerate the I2C slaves as I2C_board_info.
Patch 6 is an example driver for an ACPI enuemrated I2C controller.

Note that this is just prototype patch set, which just passes build test. Because I'd like to get your ideas about this before going on. any comments are welcome.

thanks,
rui