mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v1 0/2] platform/x86: intel: Bind to platform devices instead of ACPI ones
@ 2026-02-28 15:26 Rafael J. Wysocki
  2026-02-28 15:27 ` [PATCH v1 1/2] platform/x86: intel/rst: Convert ACPI driver to a platform one Rafael J. Wysocki
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2026-02-28 15:26 UTC (permalink / raw)
  To: Ilpo Järvinen; +Cc: Hans de Goede, LKML, Linux ACPI, platform-driver-x86

Hi All,

This series is part of a larger effort to switch over all drivers using
the struct acpi_driver interface to the more common struct platform_driver
interface and eliminate the former.  The background is explained in
Documentation/driver-api/acpi/acpi-drivers.rst and in the changelog of
the patch that introduced the above document:

https://lore.kernel.org/all/2396510.ElGaqSPkdT@rafael.j.wysocki/

The bottom line is that the kernel would be better off without struct
acpi_driver and so it is better to get rid of it.

This series carries out driver conversion of two platform x86 Intel
drivers, intel-rst (patch [1/2] and intel-smartconnect (patch [2/2]).

Thanks!




^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v1 1/2] platform/x86: intel/rst: Convert ACPI driver to a platform one
  2026-02-28 15:26 [PATCH v1 0/2] platform/x86: intel: Bind to platform devices instead of ACPI ones Rafael J. Wysocki
@ 2026-02-28 15:27 ` Rafael J. Wysocki
  2026-02-28 15:28 ` [PATCH v1 2/2] platform/x86: intel/smartconnect: " Rafael J. Wysocki
  2026-03-09 14:58 ` [PATCH v1 0/2] platform/x86: intel: Bind to platform devices instead of ACPI ones Ilpo Järvinen
  2 siblings, 0 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2026-02-28 15:27 UTC (permalink / raw)
  To: Ilpo Järvinen; +Cc: Hans de Goede, LKML, Linux ACPI, platform-driver-x86

From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>

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 Intel Rapid Start Technology (rst) ACPI
driver to a platform one.

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/ [1]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/platform/x86/intel/rst.c | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/drivers/platform/x86/intel/rst.c b/drivers/platform/x86/intel/rst.c
index f3a60e14d4c1..4bd10927aad9 100644
--- a/drivers/platform/x86/intel/rst.c
+++ b/drivers/platform/x86/intel/rst.c
@@ -5,6 +5,7 @@
 
 #include <linux/acpi.h>
 #include <linux/module.h>
+#include <linux/platform_device.h>
 #include <linux/slab.h>
 
 MODULE_DESCRIPTION("Intel Rapid Start Technology Driver");
@@ -99,8 +100,9 @@ static struct device_attribute irst_timeout_attr = {
 	.store = irst_store_wakeup_time
 };
 
-static int irst_add(struct acpi_device *acpi)
+static int irst_probe(struct platform_device *pdev)
 {
+	struct acpi_device *acpi = ACPI_COMPANION(&pdev->dev);
 	int error;
 
 	error = device_create_file(&acpi->dev, &irst_timeout_attr);
@@ -114,8 +116,10 @@ static int irst_add(struct acpi_device *acpi)
 	return error;
 }
 
-static void irst_remove(struct acpi_device *acpi)
+static void irst_remove(struct platform_device *pdev)
 {
+	struct acpi_device *acpi = ACPI_COMPANION(&pdev->dev);
+
 	device_remove_file(&acpi->dev, &irst_wakeup_attr);
 	device_remove_file(&acpi->dev, &irst_timeout_attr);
 }
@@ -125,16 +129,15 @@ static const struct acpi_device_id irst_ids[] = {
 	{"", 0}
 };
 
-static struct acpi_driver irst_driver = {
-	.name = "intel_rapid_start",
-	.class = "intel_rapid_start",
-	.ids = irst_ids,
-	.ops = {
-		.add = irst_add,
-		.remove = irst_remove,
+static struct platform_driver irst_driver = {
+	.probe = irst_probe,
+	.remove = irst_remove,
+	.driver = {
+		.name = "intel_rapid_start",
+		.acpi_match_table = irst_ids,
 	},
 };
 
-module_acpi_driver(irst_driver);
+module_platform_driver(irst_driver);
 
 MODULE_DEVICE_TABLE(acpi, irst_ids);
-- 
2.51.0





^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v1 2/2] platform/x86: intel/smartconnect: Convert ACPI driver to a platform one
  2026-02-28 15:26 [PATCH v1 0/2] platform/x86: intel: Bind to platform devices instead of ACPI ones Rafael J. Wysocki
  2026-02-28 15:27 ` [PATCH v1 1/2] platform/x86: intel/rst: Convert ACPI driver to a platform one Rafael J. Wysocki
@ 2026-02-28 15:28 ` Rafael J. Wysocki
  2026-03-09 14:58 ` [PATCH v1 0/2] platform/x86: intel: Bind to platform devices instead of ACPI ones Ilpo Järvinen
  2 siblings, 0 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2026-02-28 15:28 UTC (permalink / raw)
  To: Ilpo Järvinen; +Cc: Hans de Goede, LKML, Linux ACPI, platform-driver-x86

From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>

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 Intel Smart Connect disabling ACPI
driver to a platform one.

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/ [1]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/platform/x86/intel/smartconnect.c | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/drivers/platform/x86/intel/smartconnect.c b/drivers/platform/x86/intel/smartconnect.c
index 31019a1a6d5e..4d866b6366d6 100644
--- a/drivers/platform/x86/intel/smartconnect.c
+++ b/drivers/platform/x86/intel/smartconnect.c
@@ -5,22 +5,24 @@
 
 #include <linux/acpi.h>
 #include <linux/module.h>
+#include <linux/platform_device.h>
 
 MODULE_DESCRIPTION("Intel Smart Connect disabling driver");
 MODULE_LICENSE("GPL");
 
-static int smartconnect_acpi_init(struct acpi_device *acpi)
+static int smartconnect_acpi_probe(struct platform_device *pdev)
 {
+	acpi_handle handle = ACPI_HANDLE(&pdev->dev);
 	unsigned long long value;
 	acpi_status status;
 
-	status = acpi_evaluate_integer(acpi->handle, "GAOS", NULL, &value);
+	status = acpi_evaluate_integer(handle, "GAOS", NULL, &value);
 	if (ACPI_FAILURE(status))
 		return -EINVAL;
 
 	if (value & 0x1) {
-		dev_info(&acpi->dev, "Disabling Intel Smart Connect\n");
-		status = acpi_execute_simple_method(acpi->handle, "SAOS", 0);
+		dev_info(&pdev->dev, "Disabling Intel Smart Connect\n");
+		status = acpi_execute_simple_method(handle, "SAOS", 0);
 	}
 
 	return 0;
@@ -32,13 +34,12 @@ static const struct acpi_device_id smartconnect_ids[] = {
 };
 MODULE_DEVICE_TABLE(acpi, smartconnect_ids);
 
-static struct acpi_driver smartconnect_driver = {
-	.name = "intel_smart_connect",
-	.class = "intel_smart_connect",
-	.ids = smartconnect_ids,
-	.ops = {
-		.add = smartconnect_acpi_init,
+static struct platform_driver smartconnect_driver = {
+	.probe = smartconnect_acpi_probe,
+	.driver = {
+		.name = "intel_smart_connect",
+		.acpi_match_table = smartconnect_ids,
 	},
 };
 
-module_acpi_driver(smartconnect_driver);
+module_platform_driver(smartconnect_driver);
-- 
2.51.0





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1 0/2] platform/x86: intel: Bind to platform devices instead of ACPI ones
  2026-02-28 15:26 [PATCH v1 0/2] platform/x86: intel: Bind to platform devices instead of ACPI ones Rafael J. Wysocki
  2026-02-28 15:27 ` [PATCH v1 1/2] platform/x86: intel/rst: Convert ACPI driver to a platform one Rafael J. Wysocki
  2026-02-28 15:28 ` [PATCH v1 2/2] platform/x86: intel/smartconnect: " Rafael J. Wysocki
@ 2026-03-09 14:58 ` Ilpo Järvinen
  2 siblings, 0 replies; 4+ messages in thread
From: Ilpo Järvinen @ 2026-03-09 14:58 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: Hans de Goede, LKML, Linux ACPI, platform-driver-x86

On Sat, 28 Feb 2026 16:26:44 +0100, Rafael J. Wysocki wrote:

> This series is part of a larger effort to switch over all drivers using
> the struct acpi_driver interface to the more common struct platform_driver
> interface and eliminate the former.  The background is explained in
> Documentation/driver-api/acpi/acpi-drivers.rst and in the changelog of
> the patch that introduced the above document:
> 
> https://lore.kernel.org/all/2396510.ElGaqSPkdT@rafael.j.wysocki/
> 
> [...]


Thank you for your contribution, it has been applied to my local
review-ilpo-next branch. Note it will show up in the public
platform-drivers-x86/review-ilpo-next branch only once I've pushed my
local branch there, which might take a while.

The list of commits applied:
[1/2] platform/x86: intel/rst: Convert ACPI driver to a platform one
      commit: 163a68a31f743c5a820f348322b9162bc89c720a
[2/2] platform/x86: intel/smartconnect: Convert ACPI driver to a platform one
      commit: 8a44bd3ffdb269c028236d9165ce06a46c091373

--
 i.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-03-09 14:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-28 15:26 [PATCH v1 0/2] platform/x86: intel: Bind to platform devices instead of ACPI ones Rafael J. Wysocki
2026-02-28 15:27 ` [PATCH v1 1/2] platform/x86: intel/rst: Convert ACPI driver to a platform one Rafael J. Wysocki
2026-02-28 15:28 ` [PATCH v1 2/2] platform/x86: intel/smartconnect: " Rafael J. Wysocki
2026-03-09 14:58 ` [PATCH v1 0/2] platform/x86: intel: Bind to platform devices instead of ACPI ones Ilpo Järvinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®