aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
authorMark Brown <broonie@kernel.org>2026-05-29 23:00:12 +0100
committerMark Brown <broonie@kernel.org>2026-05-29 23:00:14 +0100
commit166f6eabaab65d0625b28dfafe72b76d44027977 (patch)
tree214d0cacd490fa1c3f1f2c474533ab1e886cae31 /arch
parente8b79e654b43e511a9ff0af1963f86718564c7d6 (diff)
parent5fdac9983681f743cfaa89414ea154a2c5fd39c4 (diff)
downloadlinux-next-history-166f6eabaab65d0625b28dfafe72b76d44027977.tar.gz
Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/platform/olpc/olpc-xo15-sci.c33
1 files changed, 19 insertions, 14 deletions
diff --git a/arch/x86/platform/olpc/olpc-xo15-sci.c b/arch/x86/platform/olpc/olpc-xo15-sci.c
index 82c51b6ec5288..e486109e88c87 100644
--- a/arch/x86/platform/olpc/olpc-xo15-sci.c
+++ b/arch/x86/platform/olpc/olpc-xo15-sci.c
@@ -9,6 +9,7 @@
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/workqueue.h>
+#include <linux/platform_device.h>
#include <linux/power_supply.h>
#include <linux/olpc-ec.h>
@@ -136,14 +137,16 @@ static u32 xo15_sci_gpe_handler(acpi_handle gpe_device, u32 gpe, void *context)
return ACPI_INTERRUPT_HANDLED | ACPI_REENABLE_GPE;
}
-static int xo15_sci_add(struct acpi_device *device)
+static int xo15_sci_probe(struct platform_device *pdev)
{
+ struct acpi_device *device;
unsigned long long tmp;
acpi_status status;
int r;
+ device = ACPI_COMPANION(&pdev->dev);
if (!device)
- return -EINVAL;
+ return -ENODEV;
strscpy(acpi_device_name(device), XO15_SCI_DEVICE_NAME);
strscpy(acpi_device_class(device), XO15_SCI_CLASS);
@@ -160,7 +163,7 @@ static int xo15_sci_add(struct acpi_device *device)
if (ACPI_FAILURE(status))
return -ENODEV;
- dev_info(&device->dev, "Initialized, GPE = 0x%lx\n", xo15_sci_gpe);
+ dev_info(&pdev->dev, "Initialized, GPE = 0x%lx\n", xo15_sci_gpe);
r = sysfs_create_file(&device->dev.kobj, &lid_wake_on_close_attr.attr);
if (r)
@@ -174,7 +177,7 @@ static int xo15_sci_add(struct acpi_device *device)
/* Enable wake-on-EC */
if (device->wakeup.flags.valid)
- device_init_wakeup(&device->dev, true);
+ device_init_wakeup(&pdev->dev, true);
return 0;
@@ -184,8 +187,11 @@ err_sysfs:
return r;
}
-static void xo15_sci_remove(struct acpi_device *device)
+static void xo15_sci_remove(struct platform_device *pdev)
{
+ struct acpi_device *device = ACPI_COMPANION(&pdev->dev);
+
+ device_init_wakeup(&pdev->dev, false);
acpi_disable_gpe(NULL, xo15_sci_gpe);
acpi_remove_gpe_handler(NULL, xo15_sci_gpe, xo15_sci_gpe_handler);
cancel_work_sync(&sci_work);
@@ -213,19 +219,18 @@ static const struct acpi_device_id xo15_sci_device_ids[] = {
{"", 0},
};
-static struct acpi_driver xo15_sci_drv = {
- .name = DRV_NAME,
- .class = XO15_SCI_CLASS,
- .ids = xo15_sci_device_ids,
- .ops = {
- .add = xo15_sci_add,
- .remove = xo15_sci_remove,
+static struct platform_driver xo15_sci_drv = {
+ .probe = xo15_sci_probe,
+ .remove = xo15_sci_remove,
+ .driver = {
+ .name = DRV_NAME,
+ .acpi_match_table = xo15_sci_device_ids,
+ .pm = &xo15_sci_pm,
},
- .drv.pm = &xo15_sci_pm,
};
static int __init xo15_sci_init(void)
{
- return acpi_bus_register_driver(&xo15_sci_drv);
+ return platform_driver_register(&xo15_sci_drv);
}
device_initcall(xo15_sci_init);