From: "Rafael J. Wysocki" <rafael@kernel.org>
To: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: Robert Gerlach <khnz@gmx.de>, Hans de Goede <hansg@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Linux ACPI <linux-acpi@vger.kernel.org>,
platform-driver-x86@vger.kernel.org,
Jonathan Woithe <jwoithe@just42.net>
Subject: [PATCH v2 1/5] platform/x86: fujitsu-tablet: Convert ACPI driver to a platform one
Date: Mon, 09 Mar 2026 18:04:15 +0100 [thread overview]
Message-ID: <6257931.lOV4Wx5bFT@rafael.j.wysocki> (raw)
In-Reply-To: <12863082.O9o76ZdvQC@rafael.j.wysocki>
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 fujitsu-tablet ACPI driver to a platform
one.
After this change, the subordinate input 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/ [1]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
v1 -> v2: No changes
---
drivers/platform/x86/fujitsu-tablet.c | 30 +++++++++++++--------------
1 file changed, 14 insertions(+), 16 deletions(-)
diff --git a/drivers/platform/x86/fujitsu-tablet.c b/drivers/platform/x86/fujitsu-tablet.c
index 17f08ce7552d..8319df28e9b8 100644
--- a/drivers/platform/x86/fujitsu-tablet.c
+++ b/drivers/platform/x86/fujitsu-tablet.c
@@ -18,6 +18,7 @@
#include <linux/input.h>
#include <linux/delay.h>
#include <linux/dmi.h>
+#include <linux/platform_device.h>
#define MODULENAME "fujitsu-tablet"
@@ -442,14 +443,12 @@ static acpi_status fujitsu_walk_resources(struct acpi_resource *res, void *data)
}
}
-static int acpi_fujitsu_add(struct acpi_device *adev)
+static int acpi_fujitsu_probe(struct platform_device *pdev)
{
+ struct acpi_device *adev = ACPI_COMPANION(&pdev->dev);
acpi_status status;
int error;
- if (!adev)
- return -EINVAL;
-
status = acpi_walk_resources(adev->handle, METHOD_NAME__CRS,
fujitsu_walk_resources, NULL);
if (ACPI_FAILURE(status) || !fujitsu.irq || !fujitsu.io_base)
@@ -461,7 +460,7 @@ static int acpi_fujitsu_add(struct acpi_device *adev)
snprintf(fujitsu.phys, sizeof(fujitsu.phys),
"%s/input0", acpi_device_hid(adev));
- error = input_fujitsu_setup(&adev->dev,
+ error = input_fujitsu_setup(&pdev->dev,
acpi_device_name(adev), fujitsu.phys);
if (error)
return error;
@@ -484,7 +483,7 @@ static int acpi_fujitsu_add(struct acpi_device *adev)
return 0;
}
-static void acpi_fujitsu_remove(struct acpi_device *adev)
+static void acpi_fujitsu_remove(struct platform_device *pdev)
{
free_irq(fujitsu.irq, fujitsu_interrupt);
release_region(fujitsu.io_base, fujitsu.io_length);
@@ -501,15 +500,14 @@ static int acpi_fujitsu_resume(struct device *dev)
static SIMPLE_DEV_PM_OPS(acpi_fujitsu_pm, NULL, acpi_fujitsu_resume);
-static struct acpi_driver acpi_fujitsu_driver = {
- .name = MODULENAME,
- .class = "hotkey",
- .ids = fujitsu_ids,
- .ops = {
- .add = acpi_fujitsu_add,
- .remove = acpi_fujitsu_remove,
+static struct platform_driver acpi_fujitsu_driver = {
+ .probe = acpi_fujitsu_probe,
+ .remove = acpi_fujitsu_remove,
+ .driver = {
+ .name = MODULENAME,
+ .acpi_match_table = fujitsu_ids,
+ .pm = &acpi_fujitsu_pm,
},
- .drv.pm = &acpi_fujitsu_pm,
};
static int __init fujitsu_module_init(void)
@@ -518,7 +516,7 @@ static int __init fujitsu_module_init(void)
dmi_check_system(dmi_ids);
- error = acpi_bus_register_driver(&acpi_fujitsu_driver);
+ error = platform_driver_register(&acpi_fujitsu_driver);
if (error)
return error;
@@ -527,7 +525,7 @@ static int __init fujitsu_module_init(void)
static void __exit fujitsu_module_exit(void)
{
- acpi_bus_unregister_driver(&acpi_fujitsu_driver);
+ platform_driver_unregister(&acpi_fujitsu_driver);
}
module_init(fujitsu_module_init);
--
2.51.0
next prev parent reply other threads:[~2026-03-09 17:11 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-09 17:03 [PATCH v2 0/5] platform/x86: fujitsu: Bind drivers to platform devices instead of ACPI ones Rafael J. Wysocki
2026-03-09 17:04 ` Rafael J. Wysocki [this message]
2026-03-09 17:05 ` [PATCH v2 2/5] platform/x86: fujitsu: Reorder code to avoid forward declarations Rafael J. Wysocki
2026-03-09 17:07 ` [PATCH v2 3/5] platform/x86: fujitsu: Register ACPI notify handlers directly Rafael J. Wysocki
2026-03-17 15:19 ` Ilpo Järvinen
2026-03-17 15:52 ` Rafael J. Wysocki
2026-03-17 15:56 ` Ilpo Järvinen
2026-03-09 17:09 ` [PATCH v2 5/5] platform/x86: fujitsu: Convert laptop driver to a platform one Rafael J. Wysocki
2026-03-09 17:10 ` [PATCH v2 4/5] platform/x86: fujitsu: Convert backlight " Rafael J. Wysocki
2026-03-10 0:36 ` [PATCH v2 0/5] platform/x86: fujitsu: Bind drivers to platform devices instead of ACPI ones Jonathan Woithe
2026-03-10 9:48 ` Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6257931.lOV4Wx5bFT@rafael.j.wysocki \
--to=rafael@kernel.org \
--cc=hansg@kernel.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=jwoithe@just42.net \
--cc=khnz@gmx.de \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox