public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Henrique de Moraes Holschuh <hmh-N3TV7GIv+o9fyO9Q7EP/yw@public.gmane.org>
To: Len Brown <lenb-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: linux-acpi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Henrique de Moraes Holschuh
	<hmh-N3TV7GIv+o9fyO9Q7EP/yw@public.gmane.org>,
	ibm-acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: [PATCH 1/5] ACPI: ibm-acpi: rename some identifiers
Date: Sat, 24 Feb 2007 13:01:18 -0200	[thread overview]
Message-ID: <1172329282220-git-send-email-hmh@hmh.eng.br> (raw)
Message-ID: <bde16e404cce89ebfe6d9b143d979f0c6fe5434b.1172327581.git.hmh-N3TV7GIv+o9fyO9Q7EP/yw@public.gmane.org> (raw)
In-Reply-To: <11723292823837-git-send-email-hmh-N3TV7GIv+o9fyO9Q7EP/yw@public.gmane.org>

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-N3TV7GIv+o9fyO9Q7EP/yw@public.gmane.org>
---
 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 e7309a6..0a22d46 100644
--- a/drivers/acpi/ibm_acpi.c
+++ b/drivers/acpi/ibm_acpi.c
@@ -505,7 +505,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;
 
@@ -1309,9 +1309,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)
 {
@@ -1343,13 +1343,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 {
@@ -1656,8 +1658,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)
 {
@@ -1666,7 +1668,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))
@@ -1765,9 +1768,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)
 {
@@ -1801,7 +1804,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) ||
@@ -1813,14 +1817,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))
@@ -2311,7 +2316,7 @@ static struct ibm_struct ibms[] = {
 	{
 	 .name = "driver",
 	 .init = ibm_acpi_driver_init,
-	 .read = driver_read,
+	 .read = ibm_acpi_driver_read,
 	 },
 	{
 	 .name = "hotkey",
@@ -2525,7 +2530,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;
 
@@ -2558,7 +2563,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.0.1


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

  parent reply	other threads:[~2007-02-24 15:01 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-24 15:01 [GIT PULL] ibm-acpi: more updates Henrique de Moraes Holschuh
     [not found] ` <11723292823837-git-send-email-hmh-N3TV7GIv+o9fyO9Q7EP/yw@public.gmane.org>
     [not found]   ` <bde16e404cce89ebfe6d9b143d979f0c6fe5434b.1172327581.git.hmh-N3TV7GIv+o9fyO9Q7EP/yw@public.gmane.org>
2007-02-24 15:01     ` Henrique de Moraes Holschuh [this message]
     [not found]     ` <b5817781c14e13765fe3e8565498182edcfd6c2f.1172327581.git.hmh-N3TV7GIv+o9fyO9Q7EP/yw@public.gmane.org>
2007-02-24 15:01       ` [PATCH 2/5] ACPI: ibm-acpi: add header file Henrique de Moraes Holschuh
     [not found]     ` <4787dcfed44cf6917db2ca185da606b4a0427d23.1172327581.git.hmh-N3TV7GIv+o9fyO9Q7EP/yw@public.gmane.org>
2007-02-24 15:01       ` [PATCH 3/5] ACPI: ibm-acpi: organize code Henrique de Moraes Holschuh
     [not found]     ` <1ae587639cc41f32d5652f15a650df14775925c3.1172327581.git.hmh-N3TV7GIv+o9fyO9Q7EP/yw@public.gmane.org>
2007-02-24 15:01       ` [PATCH 4/5] ACPI: ibm-acpi: update copyright notice Henrique de Moraes Holschuh
     [not found]     ` <d23ebd8421c3593ed659e16d6aa41a59dedc561c.1172327581.git.hmh-N3TV7GIv+o9fyO9Q7EP/yw@public.gmane.org>
2007-02-24 15:01       ` [PATCH 5/5] ACPI: ibm-acpi: update documentation Henrique de Moraes Holschuh
     [not found] ` <bde16e404cce89ebfe6d9b143d979f0c6fe5434b.1172327581.git.hmh@hmh.eng.br>
2007-02-24 15:01   ` [PATCH 1/5] ACPI: ibm-acpi: rename some identifiers Henrique de Moraes Holschuh
     [not found]   ` <b5817781c14e13765fe3e8565498182edcfd6c2f.1172327581.git.hmh@hmh.eng.br>
2007-02-24 15:01     ` [PATCH 2/5] ACPI: ibm-acpi: add header file Henrique de Moraes Holschuh
     [not found]   ` <4787dcfed44cf6917db2ca185da606b4a0427d23.1172327581.git.hmh@hmh.eng.br>
2007-02-24 15:01     ` [PATCH 3/5] ACPI: ibm-acpi: organize code Henrique de Moraes Holschuh
     [not found]   ` <1ae587639cc41f32d5652f15a650df14775925c3.1172327581.git.hmh@hmh.eng.br>
2007-02-24 15:01     ` [PATCH 4/5] ACPI: ibm-acpi: update copyright notice Henrique de Moraes Holschuh
     [not found]   ` <d23ebd8421c3593ed659e16d6aa41a59dedc561c.1172327581.git.hmh@hmh.eng.br>
2007-02-24 15:01     ` [PATCH 5/5] ACPI: ibm-acpi: update documentation Henrique de Moraes Holschuh
2007-03-09  3:59 ` [GIT PULL] ibm-acpi: more updates Len Brown
     [not found]   ` <200703082259.55832.lenb-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2007-03-10 17:16     ` Henrique de Moraes Holschuh
2007-03-11 19:34       ` Len Brown
2007-03-12  1:26         ` Henrique de Moraes Holschuh

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=1172329282220-git-send-email-hmh@hmh.eng.br \
    --to=hmh-n3tv7giv+o9fyo9q7ep/yw@public.gmane.org \
    --cc=ibm-acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=lenb-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=linux-acpi-u79uwXL29TY76Z2rM5mHXA@public.gmane.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