All of lore.kernel.org
 help / color / mirror / Atom feed
From: Len Brown <len.brown@intel.com>
To: linux-acpi@vger.kernel.org
Cc: Henrique de Moraes Holschuh <hmh@hmh.eng.br>,
	Len Brown <len.brown@intel.com>
Subject: [PATCH 025/105] ACPI: ibm-acpi: rename some identifiers
Date: Sun, 29 Apr 2007 00:50:25 -0400	[thread overview]
Message-ID: <11778223273782-git-send-email-len.brown@intel.com> (raw)
Message-ID: <e062e0343871a41e8ec408f1c1e8ac3b0310da9d.1177822058.git.len.brown@intel.com> (raw)
In-Reply-To: <1177822326583-git-send-email-len.brown@intel.com>
In-Reply-To: <ac122bb64b0d51f0512185d3522a75f3f3a80bc9.1177822058.git.len.brown@intel.com>

From: Henrique de Moraes Holschuh <hmh@hmh.eng.br>

Rename some identifiers so that they are more in tune with the rest of the
driver code, or less generic.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/ibm_acpi.c |   43 ++++++++++++++++++++++++-------------------
 1 files changed, 24 insertions(+), 19 deletions(-)

diff --git a/drivers/acpi/ibm_acpi.c b/drivers/acpi/ibm_acpi.c
index 60aaed9..41c46b0 100644
--- a/drivers/acpi/ibm_acpi.c
+++ b/drivers/acpi/ibm_acpi.c
@@ -506,7 +506,7 @@ static int ibm_acpi_driver_init(void)
 	return 0;
 }
 
-static int driver_read(char *p)
+static int ibm_acpi_driver_read(char *p)
 {
 	int len = 0;
 
@@ -1310,9 +1310,9 @@ static const int led_exp_hlbl[] = { 0, 0, 1 };	/* led# * */
 static const int led_exp_hlcl[] = { 0, 1, 1 };	/* led# * */
 static const int led_led_arg1[] = { 0, 0x80, 0xc0 };
 
-#define EC_HLCL 0x0c
-#define EC_HLBL 0x0d
-#define EC_HLMS 0x0e
+#define IBMACPI_LED_EC_HLCL 0x0c
+#define IBMACPI_LED_EC_HLBL 0x0d
+#define IBMACPI_LED_EC_HLMS 0x0e
 
 static int led_write(char *buf)
 {
@@ -1344,13 +1344,15 @@ static int led_write(char *buf)
 		} else if (led_supported == IBMACPI_LED_OLD) {
 			/* 600e/x, 770e, 770x, A21e, A2xm/p, T20-22, X20 */
 			led = 1 << led;
-			ret = ec_write(EC_HLMS, led);
+			ret = ec_write(IBMACPI_LED_EC_HLMS, led);
 			if (ret >= 0)
 				ret =
-				    ec_write(EC_HLBL, led * led_exp_hlbl[ind]);
+				    ec_write(IBMACPI_LED_EC_HLBL,
+				    	     led * led_exp_hlbl[ind]);
 			if (ret >= 0)
 				ret =
-				    ec_write(EC_HLCL, led * led_exp_hlcl[ind]);
+				    ec_write(IBMACPI_LED_EC_HLCL,
+				    	     led * led_exp_hlcl[ind]);
 			if (ret < 0)
 				return ret;
 		} else {
@@ -1657,8 +1659,8 @@ static int brightness_read(char *p)
 	return len;
 }
 
-#define BRIGHTNESS_UP	4
-#define BRIGHTNESS_DOWN	5
+#define TP_CMOS_BRIGHTNESS_UP	4
+#define TP_CMOS_BRIGHTNESS_DOWN	5
 
 static int brightness_set(int value)
 {
@@ -1667,7 +1669,8 @@ static int brightness_set(int value)
 
 	value &= 7;
 
-	cmos_cmd = value > current_value ? BRIGHTNESS_UP : BRIGHTNESS_DOWN;
+	cmos_cmd = value > current_value ?
+		   TP_CMOS_BRIGHTNESS_UP : TP_CMOS_BRIGHTNESS_DOWN;
 	inc = value > current_value ? 1 : -1;
 	for (i = current_value; i != value; i += inc) {
 		if (!cmos_eval(cmos_cmd))
@@ -1769,9 +1772,9 @@ static int volume_read(char *p)
 	return len;
 }
 
-#define VOLUME_DOWN	0
-#define VOLUME_UP	1
-#define VOLUME_MUTE	2
+#define TP_CMOS_VOLUME_DOWN	0
+#define TP_CMOS_VOLUME_UP	1
+#define TP_CMOS_VOLUME_MUTE	2
 
 static int volume_write(char *buf)
 {
@@ -1805,7 +1808,8 @@ static int volume_write(char *buf)
 			return -EINVAL;
 
 		if (new_level != level) {	/* mute doesn't change */
-			cmos_cmd = new_level > level ? VOLUME_UP : VOLUME_DOWN;
+			cmos_cmd = new_level > level ?
+					TP_CMOS_VOLUME_UP : TP_CMOS_VOLUME_DOWN;
 			inc = new_level > level ? 1 : -1;
 
 			if (mute && (!cmos_eval(cmos_cmd) ||
@@ -1817,14 +1821,15 @@ static int volume_write(char *buf)
 				    !acpi_ec_write(volume_offset, i + inc))
 					return -EIO;
 
-			if (mute && (!cmos_eval(VOLUME_MUTE) ||
+			if (mute && (!cmos_eval(TP_CMOS_VOLUME_MUTE) ||
 				     !acpi_ec_write(volume_offset,
 						    new_level + mute)))
 				return -EIO;
 		}
 
 		if (new_mute != mute) {	/* level doesn't change */
-			cmos_cmd = new_mute ? VOLUME_MUTE : VOLUME_UP;
+			cmos_cmd = new_mute ?
+				   TP_CMOS_VOLUME_MUTE : TP_CMOS_VOLUME_UP;
 
 			if (!cmos_eval(cmos_cmd) ||
 			    !acpi_ec_write(volume_offset, level + new_mute))
@@ -2315,7 +2320,7 @@ static struct ibm_struct ibms[] = {
 	{
 	 .name = "driver",
 	 .init = ibm_acpi_driver_init,
-	 .read = driver_read,
+	 .read = ibm_acpi_driver_read,
 	 },
 	{
 	 .name = "hotkey",
@@ -2534,7 +2539,7 @@ static int __init ibm_device_add(struct acpi_device *device)
 	return 0;
 }
 
-static int __init register_driver(struct ibm_struct *ibm)
+static int __init register_ibmacpi_subdriver(struct ibm_struct *ibm)
 {
 	int ret;
 
@@ -2569,7 +2574,7 @@ static int __init ibm_init(struct ibm_struct *ibm)
 		return 0;
 
 	if (ibm->hid) {
-		ret = register_driver(ibm);
+		ret = register_ibmacpi_subdriver(ibm);
 		if (ret < 0)
 			return ret;
 		ibm->driver_registered = 1;
-- 
1.5.2.rc0.34.gda94

  parent reply	other threads:[~2007-04-29  4:52 UTC|newest]

Thread overview: 89+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-29  4:50 ACPI patches for 2.6.22 merge window Len Brown
     [not found] ` <11778223068-git-send-email-len.brown@intel.com>
     [not found]   ` <ac122bb64b0d51f0512185d3522a75f3f3a80bc9.1177822058.git.len.brown@intel.com>
2007-04-29  4:50     ` [PATCH 002/105] ACPI: EC: Don't use Global Lock if not asked to do so Len Brown
2007-04-29  4:50       ` Len Brown
2007-04-29  4:50     ` [PATCH 003/105] ACPI: EC: Make EC to initialize first in ACPI Len Brown
2007-04-29  4:50       ` Len Brown
2007-04-29  4:50     ` [PATCH 004/105] ACPI: EC: "Fake ECDT" workaround is not needed any longer Len Brown
2007-04-29  4:50       ` Len Brown
2007-04-29  4:50     ` [PATCH 005/105] ACPI: EC: enable burst functionality in EC Len Brown
2007-04-29  4:50       ` Len Brown
2007-04-29  4:50     ` [PATCH 006/105] ACPI: EC: Remove casts to/from void* from ec.c Len Brown
2007-04-29  4:50       ` Len Brown
2007-04-29  4:50     ` [PATCH 007/105] ACPI: EC: Put install handlers into separate function Len Brown
2007-04-29  4:50       ` Len Brown
2007-04-29  4:50     ` [PATCH 008/105] ACPI: EC: Clean ECDT and namespace parsing Len Brown
2007-04-29  4:50       ` Len Brown
2007-04-29  4:50     ` [PATCH 009/105] ACPI: EC: Rename ec_ecdt to more informative boot_ec Len Brown
2007-04-29  4:50       ` Len Brown
2007-04-29  4:50     ` [PATCH 010/105] ACPI: EC: first_ec is better to be acpi_ec than acpi_device Len Brown
2007-04-29  4:50       ` Len Brown
2007-04-29  4:50     ` [PATCH 011/105] ACPI: EC: Cleanup of EC initialization Len Brown
2007-04-29  4:50       ` Len Brown
2007-04-29  4:50     ` [PATCH 012/105] ACPI: EC: Block queries until EC is fully initialized Len Brown
2007-04-29  4:50       ` Len Brown
2007-04-29  4:50     ` [PATCH 013/105] asus-laptop: use acpi_evaluate_integer instead of read_acpi_int Len Brown
2007-04-29  4:50       ` Len Brown
2007-04-29  4:50     ` [PATCH 014/105] asus-laptop: clean write_status Len Brown
2007-04-29  4:50       ` Len Brown
2007-04-29  4:50     ` [PATCH 015/105] asus-laptop: add GLED Len Brown
2007-04-29  4:50       ` Len Brown
2007-04-29  4:50     ` [PATCH 016/105] asus-laptop: add wapf param Len Brown
2007-04-29  4:50       ` Len Brown
2007-04-29  4:50     ` [PATCH 017/105] asus-laptop: version bump Len Brown
2007-04-29  4:50       ` Len Brown
2007-04-29  4:50     ` [PATCH 018/105] ACPI: sbs: use EC rather than I2C Len Brown
2007-04-29  4:50       ` Len Brown
2007-04-29  4:50     ` [PATCH 019/105] ACPI: sbs: remove I2C Kconfig dependency Len Brown
2007-04-29  4:50       ` Len Brown
2007-04-29  4:50     ` [PATCH 020/105] ACPI: sbs: remove I2C Makefile hooks Len Brown
2007-04-29  4:50       ` Len Brown
2007-04-29  4:50     ` [PATCH 021/105] ACPI: sbs: Debug messages correction/improvement Len Brown
2007-04-29  4:50       ` Len Brown
2007-04-29  4:50     ` [PATCH 022/105] ACPI: sbs: Common interface with CM battery Len Brown
2007-04-29  4:50       ` Len Brown
2007-04-29  4:50     ` [PATCH 023/105] ACPI: sbs: remove i2c_ec.[ch] Len Brown
2007-04-29  4:50       ` Len Brown
2007-04-29  4:50     ` [PATCH 024/105] ACPI: ibm-acpi: kill trailing whitespace Len Brown
2007-04-29  4:50       ` Len Brown
2007-04-29  4:50     ` Len Brown [this message]
2007-04-29  4:50       ` [PATCH 025/105] ACPI: ibm-acpi: rename some identifiers Len Brown
2007-04-29  4:50     ` [PATCH 026/105] ACPI: ibm-acpi: add header file Len Brown
2007-04-29  4:50       ` Len Brown
2007-04-29  4:50     ` [PATCH 027/105] ACPI: ibm-acpi: organize code Len Brown
2007-04-29  4:50       ` Len Brown
2007-04-29  4:50     ` [PATCH 028/105] ACPI: ibm-acpi: update copyright notice Len Brown
2007-04-29  4:50       ` Len Brown
2007-04-29  4:50     ` [PATCH 029/105] ACPI: ibm-acpi: update documentation Len Brown
2007-04-29  4:50       ` Len Brown
2007-04-29  4:50     ` [PATCH 031/105] ACPI: dock: use NULL for pointer Len Brown
2007-04-29  4:50       ` Len Brown
2007-04-29  4:50     ` [PATCH 033/105] ACPI: thinkpad-acpi: cleanup Kconfig for thinkpad-acpi Len Brown
2007-04-29  4:50       ` Len Brown
2007-04-29  4:50     ` [PATCH 034/105] ACPI: thinkpad-acpi: add compatibility MODULE_ALIAS entry Len Brown
2007-04-29  4:50       ` Len Brown
2007-04-29  4:50     ` [PATCH 035/105] ACPI: thinkpad-acpi: cleanup after rename Len Brown
2007-04-29  4:50       ` Len Brown
2007-04-29  4:50     ` [PATCH 036/105] ACPI: thinkpad-acpi: update MAINTAINERS Len Brown
2007-04-29  4:50       ` Len Brown
     [not found]         ` <11778223411658-git-send-email-len.brown@intel.com>
     [not found]           ` <11778223412672-git-send-email-len.brown@intel.com>
     [not found]             ` <11778223423-git-send-email-len.brown@intel.com>
     [not found]               ` <1177822343712-git-send-email-len.brown@intel.com>
     [not found]                 ` <11778223442065-git-send-email-len.brown@intel.com>
     [not found]                   ` <11778223452843-git-send-email-len.brown@intel.com>
     [not found]                     ` <11778223461282-git-send-email-len.brown@intel.com>
     [not found]                       ` <11778223472316-git-send-email-len.brown@intel.com>
2007-04-29  4:50     ` [PATCH 046/105] ACPI: thinkpad-acpi: rename register_ibmacpi_subdriver Len Brown
2007-04-29  4:50       ` Len Brown
2007-04-29  4:50     ` [PATCH 047/105] ACPI: thinkpad-acpi: rename one stray use of ibm-acpi in a comment Len Brown
2007-04-29  4:50       ` Len Brown
2007-04-29  4:50     ` [PATCH 048/105] ACPI: thinkpad-acpi: rename module glue Len Brown
2007-04-29  4:50       ` Len Brown
2007-04-29  4:50     ` [PATCH 049/105] ACPI: thinkpad-acpi: rename thinkpad constants Len Brown
2007-04-29  4:50       ` Len Brown
2007-04-29  4:50     ` [PATCH 050/105] ACPI: thinkpad-acpi: update fan firmware documentation Len Brown
2007-04-29  4:50       ` Len Brown
2007-04-29  4:50     ` [PATCH 051/105] ACPI: thinkpad-acpi: add debug mode Len Brown
2007-04-29  4:50       ` Len Brown
2007-04-29  4:50     ` [PATCH 052/105] ACPI: thinkpad-acpi: clean up probing and move init to subdrivers Len Brown
2007-04-29  4:50       ` Len Brown
2007-04-29  4:50     ` [PATCH 053/105] ACPI: thinkpad-acpi: add subdriver debug statements Len Brown
2007-04-29  4:50       ` Len Brown
2007-04-29  4:50     ` [PATCH 054/105] ACPI: thinkpad-acpi: uncouple subdriver init from ibms struct Len Brown
2007-04-29  4:50       ` Len Brown
2007-04-29  4:50     ` [PATCH 055/105] ACPI: thinkpad-acpi: improve thinkpad detection Len Brown
2007-04-29  4:50       ` Len Brown
2007-04-29  4:50     ` [PATCH 056/105] ACPI: thinkpad-acpi: use bitfields to hold subdriver flags Len Brown
2007-04-29  4:50       ` Len Brown
2007-04-29  4:50     ` [PATCH 057/105] ACPI: thinkpad-acpi: use bitfields for module flags Len Brown
2007-04-29  4:50       ` Len Brown
2007-04-29  4:50     ` [PATCH 058/105] ACPI: thinkpad-acpi: prepare for device model conversion Len Brown
2007-04-29  4:50       ` Len Brown
2007-04-29  4:50     ` [PATCH 059/105] ACPI: thinkpad-acpi: mark acpi helper functions __must_check Len Brown
2007-04-29  4:50       ` Len Brown
2007-04-29  4:51     ` [PATCH 060/105] ACPI: thinkpad-acpi: clean up hotkey subdriver Len Brown
2007-04-29  4:51       ` Len Brown
2007-04-29  4:51     ` [PATCH 061/105] ACPI: thinkpad-acpi: cleanup bluetooth and wan for sysfs conversion Len Brown
2007-04-29  4:51       ` Len Brown
2007-04-29  4:51     ` [PATCH 062/105] ACPI: thinkpad-acpi: cleanup video subdriver Len Brown
2007-04-29  4:51       ` Len Brown
2007-04-29  4:51     ` [PATCH 063/105] ACPI: thinkpad-acpi: clean up CMOS commands subdriver Len Brown
2007-04-29  4:51       ` Len Brown
2007-04-29  4:51     ` [PATCH 064/105] ACPI: thinkpad-acpi: cleanup thermal subdriver for sysfs conversion Len Brown
2007-04-29  4:51       ` Len Brown
2007-04-29  4:51     ` [PATCH 065/105] ACPI: thinkpad-acpi: improve fan watchdog messages Len Brown
2007-04-29  4:51       ` Len Brown
2007-04-29  4:51     ` [PATCH 066/105] ACPI: Disable MSI on request of FADT Len Brown
2007-04-29  4:51       ` Len Brown
2007-04-29  4:51     ` [PATCH 067/105] ACPI: Improve acpi debug documentation Len Brown
2007-04-29  4:51       ` Len Brown
2007-04-29  4:51     ` [PATCH 068/105] ACPI: thinkpad-acpi: register with the device model Len Brown
2007-04-29  4:51       ` Len Brown
2007-04-29  4:51     ` [PATCH 069/105] ACPI: thinkpad-acpi: driver sysfs conversion Len Brown
2007-04-29  4:51       ` Len Brown
2007-04-29  4:51     ` [PATCH 070/105] ACPI: thinkpad-acpi: add infrastructure for the sysfs device attributes Len Brown
2007-04-29  4:51       ` Len Brown
2007-04-29  4:51     ` [PATCH 071/105] ACPI: thinkpad-acpi: protect fan and hotkey data structures Len Brown
2007-04-29  4:51       ` Len Brown
2007-04-29  4:51     ` [PATCH 072/105] ACPI: thinkpad-acpi: add sysfs support to the thermal subdriver Len Brown
2007-04-29  4:51       ` Len Brown
2007-04-29  4:51     ` [PATCH 073/105] ACPI: thinkpad-acpi: add sysfs support to fan subdriver Len Brown
2007-04-29  4:51       ` Len Brown
2007-04-29  4:51     ` [PATCH 074/105] ACPI: thinkpad-acpi: add a safety net for TPEC fan control mode Len Brown
2007-04-29  4:51       ` Len Brown
2007-04-29  4:51     ` [PATCH 075/105] ACPI: thinkpad-acpi: add sysfs support to the cmos command subdriver Len Brown
2007-04-29  4:51       ` Len Brown
2007-04-29  4:51     ` [PATCH 076/105] ACPI: thinkpad-acpi: update brightness sysfs interface support Len Brown
2007-04-29  4:51       ` Len Brown
2007-04-29  4:51     ` [PATCH 077/105] ACPI: remove duplicate include Len Brown
2007-04-29  4:51       ` Len Brown
2007-04-29  4:51     ` [PATCH 078/105] ACPI: Remove duplicate definitions for _STA bits Len Brown
2007-04-29  4:51       ` Len Brown
2007-04-29  4:51     ` [PATCH 079/105] ACPI: use _STA bit names rather than 0x0F Len Brown
2007-04-29  4:51       ` Len Brown
2007-04-29  4:51     ` [PATCH 080/105] ACPI: correct pathname in comment Len Brown
2007-04-29  4:51       ` Len Brown
2007-04-29  4:51     ` [PATCH 081/105] ACPI: word-smith kconfig help Len Brown
2007-04-29  4:51       ` Len Brown
2007-04-29  4:51     ` [PATCH 082/105] ACPI: make /proc/acpi/wakeup more useful Len Brown
2007-04-29  4:51       ` Len Brown
2007-04-29  4:51     ` [PATCH 083/105] ACPI: prevent ACPI quirk warning mass spamming in logs Len Brown
2007-04-29  4:51       ` Len Brown
2007-04-29  9:58         ` Andi Kleen
2007-04-29  4:51     ` [PATCH 084/105] ACPI: Remove a warning about unused variable in !CONFIG_ACPI compilation Len Brown
2007-04-29  4:51       ` Len Brown
2007-04-29  9:59         ` Andi Kleen
2007-04-29  4:51     ` [PATCH 085/105] ACPICA: clear fields reserved before FADT r3 Len Brown
2007-04-29  4:51       ` Len Brown
2007-04-29  4:51     ` [PATCH 086/105] ACPI: thinkpad-acpi: add a fan-control feature master toggle Len Brown
2007-04-29  4:51       ` Len Brown
2007-04-29  4:51     ` [PATCH 087/105] ACPI: thinkpad-acpi: do not arm fan watchdog if it would not work Len Brown
2007-04-29  4:51       ` Len Brown
2007-04-29  4:51     ` [PATCH 088/105] ACPI: thinkpad-acpi: fix a fan watchdog invocation Len Brown
2007-04-29  4:51       ` Len Brown
2007-04-29  4:51     ` [PATCH 089/105] ACPI: thinkpad-acpi: map ENXIO to EINVAL for fan sysfs Len Brown
2007-04-29  4:51       ` Len Brown
2007-04-29  4:51     ` [PATCH 090/105] ACPI: thinkpad-acpi: improve fan control documentation Len Brown
2007-04-29  4:51       ` Len Brown
2007-04-29  4:51     ` [PATCH 091/105] ACPI: thinkpad-acpi: improve debugging for acpi helpers Len Brown
2007-04-29  4:51       ` Len Brown
2007-04-29  4:51     ` [PATCH 092/105] ACPI: thinkpad-acpi: improve dock subdriver initialization Len Brown
2007-04-29  4:51       ` Len Brown
2007-04-29  4:51     ` [PATCH 093/105] ACPI: thinkpad-acpi: add sysfs support to hotkey subdriver Len Brown
2007-04-29  4:51       ` Len Brown
2007-04-29  4:51     ` [PATCH 094/105] ACPI: thinkpad-acpi: add sysfs support to wan and bluetooth subdrivers Len Brown
2007-04-29  4:51       ` Len Brown
2007-04-29  4:51     ` [PATCH 095/105] thinkpad-acpi: make drivers/misc/thinkpad_acpi:fan_mutex static Len Brown
2007-04-29  4:51       ` Len Brown
     [not found]         ` <11778223931192-git-send-email-len.brown@intel.com>
     [not found]           ` <11778223942367-git-send-email-len.brown@intel.com>
     [not found]             ` <11778223942377-git-send-email-len.brown@intel.com>
     [not found]               ` <1177822395384-git-send-email-len.brown@intel.com>
     [not found]                 ` <11778223963095-git-send-email-len.brown@intel.com>
     [not found]                   ` <11778223972558-git-send-email-len.brown@intel.com>
     [not found]                     ` <11778223981263-git-send-email-len.brown@intel.com>
     [not found]                       ` <117782239917-git-send-email-len.brown@intel.com>
2007-04-29  4:51     ` [PATCH 105/105] sonypi: use mutex instead of semaphore Len Brown
2007-04-29  4:51       ` Len Brown
2007-05-01  2:19 ` ACPI patches for 2.6.22 merge window Mattia Dongili
2007-05-10  6:44   ` 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=11778223273782-git-send-email-len.brown@intel.com \
    --to=len.brown@intel.com \
    --cc=hmh@hmh.eng.br \
    --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.