platform/surface: surfacepro3_button: Convert to a platform driver
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 4 Mar 2026 18:55:28 +0000 (19:55 +0100)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Mon, 9 Mar 2026 14:10:37 +0000 (16:10 +0200)
commitd913a5a12b4036e4219b02777d0a9c70e37a6620
treeae8bb6f046bc3a537931928815c14844356edc2f
parent639d8c601c7a9aab44803245a22f6e3c365b08be
platform/surface: surfacepro3_button: Convert to a platform driver

In all cases in which a struct acpi_driver is used for binding a driver
to an ACPI device object, a corresponding platform device is created by
the ACPI core and that device is regarded as a proper representation of
underlying hardware.  Accordingly, a struct platform_driver should be
used by driver code to bind to that device.  There are multiple reasons
why drivers should not bind directly to ACPI device objects [1].

Overall, it is better to bind drivers to platform devices than to their
ACPI companions, so convert the Surface Pro 3 button ACPI driver to a
platform one.

After this change, the subordinate input device and wakeup source class
device will be registered under the platform device used for driver
binding instead of its ACPI companion.

While this is not expected to alter functionality, it changes sysfs
layout and so it will be visible to user space.

Link: https://lore.kernel.org/all/2396510.ElGaqSPkdT@rafael.j.wysocki/
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/3207406.CbtlEUcBR6@rafael.j.wysocki
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
drivers/platform/surface/surfacepro3_button.c