Skip to contentSkip to conversation

Meaning / use of acpi_driver.class and acpi_device_class() fields ?

DISCUSSION Hans de Goede 2 participants 3 messages Mar 4, 2021 ACPI

lore
Share & tools
lore
#0 lore raw

Hi Rafael,

While reviewing a new acpi-driver:
https://patchwork.kernel.org/project/platform-driver-x86/patch/CAFysUkSztjJpSjKA92a=3j3Nj7vfQy5TCsiJtNmfjegxLBvFSA@mail.gmail.com/

I was wondering what the meaning / use of the acpi_driver.class and acpi_device_class() fields is and if these should be set to anything specific ?

I did a quick grep and most drivers seem to set this to a string describing the driver / to the driver-name and they seem to set the 2 fields to the exact same value. But some drivers also use different values for acpi_driver.class and acpi_device_class() ?

Regards,

Hans

#1 lore raw

Hi Hans,

Quoted 9 lines · Hans de Goede

Hi Rafael,

While reviewing a new acpi-driver:
https://patchwork.kernel.org/project/platform-driver-x86/patch/CAFysUkSztjJpSjKA92a=3j3Nj7vfQy5TCsiJtNmfjegxLBvFSA@mail.gmail.com/

I was wondering what the meaning / use of the acpi_driver.class and acpi_device_class() fields is and if these should be set to anything specific ?

The latter is passed to acpi_bus_generate_netlink_event() in multiple places and that's the only use of it I'm aware of.

The former - I can't recall ATM.

Quoted 4 lines

I did a quick grep and most drivers seem to set this to a string describing the driver / to the driver-name and they seem to set the 2 fields to the exact same value. But some drivers also use different values for acpi_driver.class and acpi_device_class() ?

I don't generally want acpi_driver to be used at all, if that's possible.

#2 lore raw

Hi,

Quoted 16 lines · Rafael J. Wysocki

Hi Hans,

Quoted 9 lines · Hans de Goede

Hi Rafael,

While reviewing a new acpi-driver:
https://patchwork.kernel.org/project/platform-driver-x86/patch/CAFysUkSztjJpSjKA92a=3j3Nj7vfQy5TCsiJtNmfjegxLBvFSA@mail.gmail.com/

I was wondering what the meaning / use of the acpi_driver.class and acpi_device_class() fields is and if these should be set to anything specific ?

The latter is passed to acpi_bus_generate_netlink_event() in multiple places and that's the only use of it I'm aware of.

Quoted 8 lines

The former - I can't recall ATM.

Quoted 4 lines

I did a quick grep and most drivers seem to set this to a string describing the driver / to the driver-name and they seem to set the 2 fields to the exact same value. But some drivers also use different values for acpi_driver.class and acpi_device_class() ?

I don't generally want acpi_driver to be used at all, if that's possible.

Good point, I would expect the acpi subsys code to also instantiate a platform_dev for the HID which this driver binds to, so it should be able to just use that.

I'll ask the submitter of the patch to re-write the driver as a platform-driver.

Regards,

Hans