From: Henrique de Moraes Holschuh <hmh-N3TV7GIv+o9fyO9Q7EP/yw@public.gmane.org>
To: 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 2/6] ACPI: ibm-acpi: rename some identifiers
Date: Sun, 11 Mar 2007 21:20:45 -0300 [thread overview]
Message-ID: <11736588491476-git-send-email-hmh@hmh.eng.br> (raw)
In-Reply-To: <11736588493322-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 a889dc5..3363eda 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",
@@ -2529,7 +2534,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;
@@ -2562,7 +2567,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.3
-------------------------------------------------------------------------
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
next prev parent reply other threads:[~2007-03-12 0:20 UTC|newest]
Thread overview: 60+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-12 0:20 [GIT PULL] ibm-acpi changes acpi-test/2.6.22 Henrique de Moraes Holschuh
2007-03-12 0:20 ` [PATCH 1/6] ACPI: ibm-acpi: kill trailing whitespace Henrique de Moraes Holschuh
[not found] ` <11736588493322-git-send-email-hmh-N3TV7GIv+o9fyO9Q7EP/yw@public.gmane.org>
2007-03-12 0:20 ` Henrique de Moraes Holschuh [this message]
[not found] ` <11736588491476-git-send-email-hmh-N3TV7GIv+o9fyO9Q7EP/yw@public.gmane.org>
2007-03-12 0:20 ` [PATCH 3/6] ACPI: ibm-acpi: add header file Henrique de Moraes Holschuh
[not found] ` <11736588493502-git-send-email-hmh-N3TV7GIv+o9fyO9Q7EP/yw@public.gmane.org>
2007-03-12 0:20 ` [PATCH 4/6] ACPI: ibm-acpi: organize code Henrique de Moraes Holschuh
2007-03-12 0:20 ` [PATCH 5/6] ACPI: ibm-acpi: update copyright notice Henrique de Moraes Holschuh
2007-03-12 0:20 ` [PATCH 6/6] ACPI: ibm-acpi: update documentation Henrique de Moraes Holschuh
2007-03-12 0:54 ` [GIT PULL] ibm-acpi changes acpi-test/2.6.22 Len Brown
2007-03-12 1:27 ` Henrique de Moraes Holschuh
2007-03-15 3:10 ` [GIT PULL] ibm-acpi move to drivers/misc Henrique de Moraes Holschuh
2007-03-15 3:12 ` [PATCH] ACPI: ibm-acpi: move driver to drivers/misc hierarchy Henrique de Moraes Holschuh
2007-03-15 6:06 ` CONFIG_IBM_BAY Len Brown
2007-03-15 13:39 ` CONFIG_IBM_BAY Henrique de Moraes Holschuh
2007-03-15 15:06 ` CONFIG_IBM_BAY Kristen Carlson Accardi
2007-03-15 17:55 ` CONFIG_IBM_BAY Henrique de Moraes Holschuh
2007-03-15 18:01 ` CONFIG_IBM_BAY Kristen Carlson Accardi
[not found] ` <20070315110156.09e80b99.kristen.c.accardi-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2007-03-15 19:31 ` CONFIG_IBM_BAY Henrique de Moraes Holschuh
2007-03-15 19:50 ` CONFIG_IBM_BAY Kristen Carlson Accardi
2007-03-18 5:38 ` CONFIG_IBM_BAY Tejun Heo
2007-03-18 8:27 ` CONFIG_IBM_BAY Holger Macht
2007-03-18 18:36 ` CONFIG_IBM_BAY Henrique de Moraes Holschuh
2007-03-18 18:55 ` CONFIG_IBM_BAY Holger Macht
2007-03-18 19:00 ` CONFIG_IBM_BAY Henrique de Moraes Holschuh
2007-03-19 18:04 ` CONFIG_IBM_BAY Kristen Carlson Accardi
2007-03-20 15:53 ` CONFIG_IBM_BAY Holger Macht
2007-03-20 16:19 ` CONFIG_IBM_BAY Kristen Carlson Accardi
[not found] ` <20070320091932.f61bbdcc.kristen.c.accardi-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2007-03-20 16:34 ` CONFIG_IBM_BAY Holger Macht
2007-03-19 18:17 ` CONFIG_IBM_BAY Kristen Carlson Accardi
2007-03-20 0:07 ` CONFIG_IBM_BAY Henrique de Moraes Holschuh
[not found] ` <20070320000706.GE5932-ZGHd14iZgfaRjzvQDGKj+xxZW9W5cXbT@public.gmane.org>
2007-03-20 16:14 ` CONFIG_IBM_BAY Kristen Carlson Accardi
2007-03-19 13:22 ` CONFIG_IBM_BAY Matthew Garrett
[not found] ` <20070319132243.GA2869-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org>
2007-03-19 13:48 ` CONFIG_IBM_BAY Holger Macht
2007-03-19 14:04 ` CONFIG_IBM_BAY Matthew Garrett
2007-03-19 14:37 ` CONFIG_IBM_BAY Holger Macht
[not found] ` <20070319143746.GC4885-tB0uoaAy/Z1bpigZmTR7Iw@public.gmane.org>
2007-03-19 18:11 ` CONFIG_IBM_BAY Kristen Carlson Accardi
2007-03-19 23:11 ` [ibm-acpi-devel] CONFIG_IBM_BAY Henrique de Moraes Holschuh
2007-03-19 23:56 ` Kristen Carlson Accardi
2007-03-20 0:12 ` Henrique de Moraes Holschuh
2007-03-20 16:11 ` Kristen Carlson Accardi
2007-03-20 16:07 ` CONFIG_IBM_BAY Holger Macht
[not found] ` <20070320160707.GB6079-tB0uoaAy/Z1bpigZmTR7Iw@public.gmane.org>
2007-03-20 16:16 ` CONFIG_IBM_BAY Holger Macht
[not found] ` <20070319140403.GA3697-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org>
2007-03-19 15:36 ` CONFIG_IBM_BAY Henrique de Moraes Holschuh
2007-03-19 15:47 ` CONFIG_IBM_BAY Holger Macht
[not found] ` <20070319153659.GB15942-ZGHd14iZgfaRjzvQDGKj+xxZW9W5cXbT@public.gmane.org>
2007-03-19 16:41 ` CONFIG_IBM_BAY Shem Multinymous
[not found] ` <41840b750703190941p77fc4a64k49361b678dd6aa90-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2007-03-19 23:04 ` CONFIG_IBM_BAY Henrique de Moraes Holschuh
2007-03-20 14:18 ` [ibm-acpi-devel] CONFIG_IBM_BAY Shem Multinymous
2007-03-20 15:12 ` Henrique de Moraes Holschuh
2007-03-19 18:00 ` CONFIG_IBM_BAY Kristen Carlson Accardi
[not found] ` <45FCD062.3050001-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2007-03-18 18:26 ` CONFIG_IBM_BAY Henrique de Moraes Holschuh
2007-03-15 20:31 ` [ibm-acpi-devel] CONFIG_IBM_BAY Shem Multinymous
2007-03-15 20:49 ` Henrique de Moraes Holschuh
2007-03-19 12:04 ` Theodore Tso
2007-03-19 23:24 ` Henrique de Moraes Holschuh
2007-03-20 14:57 ` Theodore Tso
2007-03-20 15:14 ` Henrique de Moraes Holschuh
2007-03-20 18:45 ` Theodore Tso
2007-03-20 20:25 ` Shem Multinymous
[not found] ` <20070320184541.GB29493-AKGzg7BKzIDYtjvyW6yDsg@public.gmane.org>
2007-03-20 20:44 ` CONFIG_IBM_BAY Henrique de Moraes Holschuh
2007-03-15 18:22 ` CONFIG_IBM_BAY Kristen Carlson Accardi
2007-03-15 19:33 ` CONFIG_IBM_BAY 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=11736588491476-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