From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Nathan Chancellor <nathan@kernel.org>,
Nicolas Schier <nsc@kernel.org>, Arnd Bergmann <arnd@arndb.de>
Cc: Daniel Mack <daniel@zonque.org>,
Russell King <linux@armlinux.org.uk>,
Sasha Levin <sashal@kernel.org>,
linux-input@vger.kernel.org, linux-kbuild@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] Input: apm-power - remove driver
Date: Mon, 9 Nov 2026 00:09:44 -0800 [thread overview]
Message-ID: <20261109080944.3802916-1-dmitry.torokhov@gmail.com> (raw)
The apm-power input handler solely listens for EV_PWR KEY_SUSPEND
events to queue APM_USER_SUSPEND via legacy APM emulation. The only
in-tree platforms generating those events are legacy Sharp Zaurus ARM
machines (spitz/borzoi/akita and collie), none of which were converted
to Device Tree. Both mach-pxa board files and mach-sa1100 were marked
deprecated in v7.3 by commit cc7852314abd ("ARM: PXA: mark remaining
board files as deprecated") and commit 7d92e50ceacd ("ARM: mark
mach-sa1100 as deprecated"), and are queued for removal in v7.5. None
of the remaining ARM platforms or other APM_EMULATION targets
(MIPS_ALCHEMY, PMAC_APM_EMU, and SH_HP6XX) emit EV_PWR input events or
enable CONFIG_INPUT_APMPOWER, and arch/arm/configs/pxa_defconfig
already dropped CONFIG_PXA_SHARPSL at the same time, leaving its
CONFIG_INPUT_APMPOWER=m entry inert.
Normalizing dashes and underscores in scripts/modules-check.sh for v7.5
exposes a module name collision (apm_power) between
drivers/input/apm-power.ko and drivers/power/supply/apm_power.ko.
Remove this obsolete input bridge to resolve the collision rather than
renaming a module whose last target platforms are going away in the
same cycle.
Reported-by: Sasha Levin <sashal@kernel.org>
Closes: https://lore.kernel.org/r/20261108225808.1809266-1-sashal@kernel.org
Link: https://lore.kernel.org/r/20261109-apm-power-input-rename-v1-1-0609e7b91825@kernel.org
Link: https://lore.kernel.org/r/e4da2f9d-d3b9-4267-9b64-b0f2cb43402a@app.fastmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
arch/arm/configs/pxa_defconfig | 1 -
drivers/input/Kconfig | 12 ----
drivers/input/Makefile | 2 -
drivers/input/apm-power.c | 122 ---------------------------------
4 files changed, 137 deletions(-)
delete mode 100644 drivers/input/apm-power.c
diff --git a/arch/arm/configs/pxa_defconfig b/arch/arm/configs/pxa_defconfig
index e7a7ed2b7ef7..e70d2789d1f6 100644
--- a/arch/arm/configs/pxa_defconfig
+++ b/arch/arm/configs/pxa_defconfig
@@ -224,7 +224,6 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_X=640
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=480
CONFIG_INPUT_JOYDEV=m
CONFIG_INPUT_EVDEV=m
-CONFIG_INPUT_APMPOWER=m
CONFIG_KEYBOARD_ATKBD=m
CONFIG_KEYBOARD_QT1070=m
CONFIG_KEYBOARD_GPIO=m
diff --git a/drivers/input/Kconfig b/drivers/input/Kconfig
index 88ecdf5218ee..064beedf5558 100644
--- a/drivers/input/Kconfig
+++ b/drivers/input/Kconfig
@@ -162,18 +162,6 @@ config INPUT_KUNIT_TEST
If in doubt, say "N".
-config INPUT_APMPOWER
- tristate "Input Power Event -> APM Bridge" if EXPERT
- depends on INPUT && APM_EMULATION
- help
- Say Y here if you want suspend key events to trigger a user
- requested suspend through APM. This is useful on embedded
- systems where such behaviour is desired without userspace
- interaction. If unsure, say N.
-
- To compile this driver as a module, choose M here: the
- module will be called apm-power.
-
comment "Input Device Drivers"
source "drivers/input/keyboard/Kconfig"
diff --git a/drivers/input/Makefile b/drivers/input/Makefile
index 2cd6e1c9a778..7d2af8dfd17e 100644
--- a/drivers/input/Makefile
+++ b/drivers/input/Makefile
@@ -27,6 +27,4 @@ obj-$(CONFIG_INPUT_TOUCHSCREEN) += touchscreen/
obj-$(CONFIG_INPUT_MISC) += misc/
obj-$(CONFIG_INPUT_KUNIT_TEST) += tests/
-obj-$(CONFIG_INPUT_APMPOWER) += apm-power.o
-
obj-$(CONFIG_RMI4_CORE) += rmi4/
diff --git a/drivers/input/apm-power.c b/drivers/input/apm-power.c
deleted file mode 100644
index 028fcaf4c142..000000000000
--- a/drivers/input/apm-power.c
+++ /dev/null
@@ -1,122 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * Input Power Event -> APM Bridge
- *
- * Copyright (c) 2007 Richard Purdie
- */
-
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
-#include <linux/module.h>
-#include <linux/input.h>
-#include <linux/slab.h>
-#include <linux/init.h>
-#include <linux/tty.h>
-#include <linux/delay.h>
-#include <linux/pm.h>
-#include <linux/apm-emulation.h>
-
-static void system_power_event(unsigned int keycode)
-{
- switch (keycode) {
- case KEY_SUSPEND:
- apm_queue_event(APM_USER_SUSPEND);
- pr_info("Requesting system suspend...\n");
- break;
- default:
- break;
- }
-}
-
-static void apmpower_event(struct input_handle *handle, unsigned int type,
- unsigned int code, int value)
-{
- /* only react on key down events */
- if (value != 1)
- return;
-
- switch (type) {
- case EV_PWR:
- system_power_event(code);
- break;
-
- default:
- break;
- }
-}
-
-static int apmpower_connect(struct input_handler *handler,
- struct input_dev *dev,
- const struct input_device_id *id)
-{
- struct input_handle *handle;
- int error;
-
- handle = kzalloc_obj(struct input_handle);
- if (!handle)
- return -ENOMEM;
-
- handle->dev = dev;
- handle->handler = handler;
- handle->name = "apm-power";
-
- error = input_register_handle(handle);
- if (error) {
- pr_err("Failed to register input power handler, error %d\n",
- error);
- kfree(handle);
- return error;
- }
-
- error = input_open_device(handle);
- if (error) {
- pr_err("Failed to open input power device, error %d\n", error);
- input_unregister_handle(handle);
- kfree(handle);
- return error;
- }
-
- return 0;
-}
-
-static void apmpower_disconnect(struct input_handle *handle)
-{
- input_close_device(handle);
- input_unregister_handle(handle);
- kfree(handle);
-}
-
-static const struct input_device_id apmpower_ids[] = {
- {
- .flags = INPUT_DEVICE_ID_MATCH_EVBIT,
- .evbit = { BIT_MASK(EV_PWR) },
- },
- { },
-};
-
-MODULE_DEVICE_TABLE(input, apmpower_ids);
-
-static struct input_handler apmpower_handler = {
- .event = apmpower_event,
- .connect = apmpower_connect,
- .disconnect = apmpower_disconnect,
- .name = "apm-power",
- .id_table = apmpower_ids,
-};
-
-static int __init apmpower_init(void)
-{
- return input_register_handler(&apmpower_handler);
-}
-
-static void __exit apmpower_exit(void)
-{
- input_unregister_handler(&apmpower_handler);
-}
-
-module_init(apmpower_init);
-module_exit(apmpower_exit);
-
-MODULE_AUTHOR("Richard Purdie <rpurdie@rpsys.net>");
-MODULE_DESCRIPTION("Input Power Event -> APM Bridge");
-MODULE_LICENSE("GPL");
--
2.56.0.506.g506a7eabc5-goog
reply other threads:[~2026-11-09 8:09 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261109080944.3802916-1-dmitry.torokhov@gmail.com \
--to=dmitry.torokhov@gmail.com \
--cc=arnd@arndb.de \
--cc=daniel@zonque.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=nathan@kernel.org \
--cc=nsc@kernel.org \
--cc=sashal@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
all inboxes | Powered by JetHome®