All of lore.kernel.org
 help / color / mirror / Atom feed
From: Len Brown <lenb@kernel.org>
To: linux-acpi@vger.kernel.org
Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>, Len Brown <len.brown@intel.com>
Subject: [PATCH 06/29] ACPI: button: remove control method/fixed hardware distinctions
Date: Thu, 23 Apr 2009 02:23:28 -0400	[thread overview]
Message-ID: <d68b597c883cf863c7216564cae08a4730d56cc1.1240467664.git.len.brown@intel.com> (raw)
In-Reply-To: <1240467831-32613-1-git-send-email-lenb@kernel.org>
In-Reply-To: <50a4da890102a455e5cd3dd358c38650d07178d3.1240467664.git.len.brown@intel.com>

From: Bjorn Helgaas <bjorn.helgaas@hp.com>

This patch removes the driver distinction between control method (CM)
and fixed hardware (FF) buttons.  We previously needed that so we
could install either a fixed event handler or a notify handler, but
the Linux/ACPI code now handles that for us, so we don't need to
worry about it.

Note that this removes the FF/CM annotation from the "info" files
in /proc.  For example,

    /proc/acpi/button/PWRF/info:
    -type:		Power Button (FF)
    +type:		Power Button

I don't think there's anything meaningful user-space can do by
knowing whether a button is a control method or a fixed hardware
button, so nobody should be looking at the FF/CM.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/button.c |   32 ++++++--------------------------
 1 files changed, 6 insertions(+), 26 deletions(-)

diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c
index c844162..9195deb 100644
--- a/drivers/acpi/button.c
+++ b/drivers/acpi/button.c
@@ -41,17 +41,13 @@
 
 #define ACPI_BUTTON_SUBCLASS_POWER	"power"
 #define ACPI_BUTTON_HID_POWER		"PNP0C0C"
-#define ACPI_BUTTON_DEVICE_NAME_POWER	"Power Button (CM)"
-#define ACPI_BUTTON_DEVICE_NAME_POWERF	"Power Button (FF)"
+#define ACPI_BUTTON_DEVICE_NAME_POWER	"Power Button"
 #define ACPI_BUTTON_TYPE_POWER		0x01
-#define ACPI_BUTTON_TYPE_POWERF		0x02
 
 #define ACPI_BUTTON_SUBCLASS_SLEEP	"sleep"
 #define ACPI_BUTTON_HID_SLEEP		"PNP0C0E"
-#define ACPI_BUTTON_DEVICE_NAME_SLEEP	"Sleep Button (CM)"
-#define ACPI_BUTTON_DEVICE_NAME_SLEEPF	"Sleep Button (FF)"
+#define ACPI_BUTTON_DEVICE_NAME_SLEEP	"Sleep Button"
 #define ACPI_BUTTON_TYPE_SLEEP		0x03
-#define ACPI_BUTTON_TYPE_SLEEPF		0x04
 
 #define ACPI_BUTTON_SUBCLASS_LID	"lid"
 #define ACPI_BUTTON_HID_LID		"PNP0C0D"
@@ -166,14 +162,12 @@ static int acpi_button_add_fs(struct acpi_device *device)
 
 	switch (button->type) {
 	case ACPI_BUTTON_TYPE_POWER:
-	case ACPI_BUTTON_TYPE_POWERF:
 		if (!acpi_power_dir)
 			acpi_power_dir = proc_mkdir(ACPI_BUTTON_SUBCLASS_POWER,
 						    acpi_button_dir);
 		entry = acpi_power_dir;
 		break;
 	case ACPI_BUTTON_TYPE_SLEEP:
-	case ACPI_BUTTON_TYPE_SLEEPF:
 		if (!acpi_sleep_dir)
 			acpi_sleep_dir = proc_mkdir(ACPI_BUTTON_SUBCLASS_SLEEP,
 						    acpi_button_dir);
@@ -315,30 +309,18 @@ static int acpi_button_add(struct acpi_device *device)
 	name = acpi_device_name(device);
 	class = acpi_device_class(device);
 
-	/*
-	 * Determine the button type (via hid), as fixed-feature buttons
-	 * need to be handled a bit differently than generic-space.
-	 */
-	if (!strcmp(hid, ACPI_BUTTON_HID_POWER)) {
+	if (!strcmp(hid, ACPI_BUTTON_HID_POWER) ||
+	    !strcmp(hid, ACPI_BUTTON_HID_POWERF)) {
 		button->type = ACPI_BUTTON_TYPE_POWER;
 		strcpy(name, ACPI_BUTTON_DEVICE_NAME_POWER);
 		sprintf(class, "%s/%s",
 			ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_POWER);
-	} else if (!strcmp(hid, ACPI_BUTTON_HID_POWERF)) {
-		button->type = ACPI_BUTTON_TYPE_POWERF;
-		strcpy(name, ACPI_BUTTON_DEVICE_NAME_POWERF);
-		sprintf(class, "%s/%s",
-			ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_POWER);
-	} else if (!strcmp(hid, ACPI_BUTTON_HID_SLEEP)) {
+	} else if (!strcmp(hid, ACPI_BUTTON_HID_SLEEP) ||
+		   !strcmp(hid, ACPI_BUTTON_HID_SLEEPF)) {
 		button->type = ACPI_BUTTON_TYPE_SLEEP;
 		strcpy(name, ACPI_BUTTON_DEVICE_NAME_SLEEP);
 		sprintf(class, "%s/%s",
 			ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_SLEEP);
-	} else if (!strcmp(hid, ACPI_BUTTON_HID_SLEEPF)) {
-		button->type = ACPI_BUTTON_TYPE_SLEEPF;
-		strcpy(name, ACPI_BUTTON_DEVICE_NAME_SLEEPF);
-		sprintf(class, "%s/%s",
-			ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_SLEEP);
 	} else if (!strcmp(hid, ACPI_BUTTON_HID_LID)) {
 		button->type = ACPI_BUTTON_TYPE_LID;
 		strcpy(name, ACPI_BUTTON_DEVICE_NAME_LID);
@@ -364,13 +346,11 @@ static int acpi_button_add(struct acpi_device *device)
 
 	switch (button->type) {
 	case ACPI_BUTTON_TYPE_POWER:
-	case ACPI_BUTTON_TYPE_POWERF:
 		input->evbit[0] = BIT_MASK(EV_KEY);
 		set_bit(KEY_POWER, input->keybit);
 		break;
 
 	case ACPI_BUTTON_TYPE_SLEEP:
-	case ACPI_BUTTON_TYPE_SLEEPF:
 		input->evbit[0] = BIT_MASK(EV_KEY);
 		set_bit(KEY_SLEEP, input->keybit);
 		break;
-- 
1.6.0.6


  parent reply	other threads:[~2009-04-23  6:23 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-23  6:23 ACPI patches queued for 2.6.30-rc3 Len Brown
2009-04-23  6:23 ` [PATCH 01/29] ACPI: button: whitespace changes Len Brown
2009-04-23  6:23   ` [PATCH 02/29] ACPI: button: remove unnecessary null pointer checks Len Brown
2009-04-23  6:23   ` [PATCH 03/29] ACPI: button: use Linux style for getting driver_data Len Brown
2009-04-23  6:23   ` [PATCH 04/29] ACPI: button: cache hid/name/class pointers Len Brown
2009-04-23  6:23   ` [PATCH 05/29] ACPI: button: remove button->device pointer Len Brown
2009-04-23  6:23   ` Len Brown [this message]
2009-04-23  6:23   ` [PATCH 07/29] ACPI: Revert conflicting workaround for BIOS w/ mangled PRT entries Len Brown
2009-04-23  6:23   ` [PATCH 08/29] ACPI video: handle indexed _BQC correctly Len Brown
2009-04-23  6:23   ` [PATCH 09/29] ACPI: Disable _GTS and _BFS support by default Len Brown
2009-04-23  6:23   ` [PATCH 10/29] thermal: Fix polling frequency for systems without passive cooling Len Brown
2009-04-23  6:23   ` [PATCH 11/29] sony-laptop: Duplicate SNC 127 Event Fix Len Brown
2009-04-23  6:23   ` [PATCH 12/29] sony-laptop: SNC 127 Initialization Fix Len Brown
2009-04-23  6:23   ` [PATCH 13/29] sony-laptop: SNC input event 38 fix Len Brown
2009-04-23  6:23   ` [PATCH 14/29] ec.c: Fix ACPI EC resume non-query interrupt message Len Brown
2009-04-23  6:23   ` [PATCH 15/29] sony-laptop: fix bogus error message display on resume Len Brown
2009-04-23  6:23   ` [PATCH 16/29] sony-laptop: always try to unblock rfkill on load Len Brown
2009-04-23  6:23   ` [PATCH 17/29] thinkpad-acpi: silence hotkey enable warning for module parameter Len Brown
2009-04-23  6:23   ` [PATCH 18/29] thinkpad-acpi: fix LED blinking through timer trigger Len Brown
2009-04-23  6:23   ` [PATCH 19/29] thinkpad-acpi: fix use of MODULE_AUTHOR Len Brown
2009-04-23  6:23   ` [PATCH 20/29] thinkpad-acpi: simplify module autoloading Len Brown
2009-04-23  6:23   ` [PATCH 21/29] thinkpad-acpi: bump up version to 0.23 Len Brown
2009-04-23  6:23   ` [PATCH 22/29] x86, acpi_cpufreq: Fix the NULL pointer dereference in get_measured_perf Len Brown
2009-04-23  6:23   ` [PATCH 23/29] acpi-cpufreq: Cleanup: Use printk_once Len Brown
2009-04-23  6:23   ` [PATCH 24/29] acpi-cpufreq: style-only: add parens to math expression Len Brown
2009-04-23  6:23   ` [PATCH 25/29] acpi-cpufreq: Do not let get_measured perf depend on internal variable Len Brown
2009-04-23  6:23   ` [PATCH 26/29] ACPI video: fix an error when the brightness levels on AC and on Battery are same Len Brown
2009-04-23  6:23   ` [PATCH 27/29] ACPI: add /sys/firmware/acpi/interrupts/sci_not counter Len Brown
2009-04-23  6:23   ` [PATCH 28/29] ACPI: idle: mark_tsc_unstable() at init-time, not run-time Len Brown
2009-04-23  6:23   ` [PATCH 29/29] ACPI: delete obsolete "bus master activity" proc field Len Brown

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=d68b597c883cf863c7216564cae08a4730d56cc1.1240467664.git.len.brown@intel.com \
    --to=lenb@kernel.org \
    --cc=bjorn.helgaas@hp.com \
    --cc=len.brown@intel.com \
    --cc=linux-acpi@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.