aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/ibm_acpi.c43
1 files changed, 24 insertions, 19 deletions
diff --git a/drivers/acpi/ibm_acpi.c b/drivers/acpi/ibm_acpi.c
index 60aaed92eef9..41c46b00511b 100644
--- a/drivers/acpi/ibm_acpi.c
+++ b/drivers/acpi/ibm_acpi.c
@@ -506,7 +506,7 @@ static int ibm_acpi_driver_init(void)
506 return 0; 506 return 0;
507} 507}
508 508
509static int driver_read(char *p) 509static int ibm_acpi_driver_read(char *p)
510{ 510{
511 int len = 0; 511 int len = 0;
512 512
@@ -1310,9 +1310,9 @@ static const int led_exp_hlbl[] = { 0, 0, 1 }; /* led# * */
1310static const int led_exp_hlcl[] = { 0, 1, 1 }; /* led# * */ 1310static const int led_exp_hlcl[] = { 0, 1, 1 }; /* led# * */
1311static const int led_led_arg1[] = { 0, 0x80, 0xc0 }; 1311static const int led_led_arg1[] = { 0, 0x80, 0xc0 };
1312 1312
1313#define EC_HLCL 0x0c 1313#define IBMACPI_LED_EC_HLCL 0x0c
1314#define EC_HLBL 0x0d 1314#define IBMACPI_LED_EC_HLBL 0x0d
1315#define EC_HLMS 0x0e 1315#define IBMACPI_LED_EC_HLMS 0x0e
1316 1316
1317static int led_write(char *buf) 1317static int led_write(char *buf)
1318{ 1318{
@@ -1344,13 +1344,15 @@ static int led_write(char *buf)
1344 } else if (led_supported == IBMACPI_LED_OLD) { 1344 } else if (led_supported == IBMACPI_LED_OLD) {
1345 /* 600e/x, 770e, 770x, A21e, A2xm/p, T20-22, X20 */ 1345 /* 600e/x, 770e, 770x, A21e, A2xm/p, T20-22, X20 */
1346 led = 1 << led; 1346 led = 1 << led;
1347 ret = ec_write(EC_HLMS, led); 1347 ret = ec_write(IBMACPI_LED_EC_HLMS, led);
1348 if (ret >= 0) 1348 if (ret >= 0)
1349 ret = 1349 ret =
1350 ec_write(EC_HLBL, led * led_exp_hlbl[ind]); 1350 ec_write(IBMACPI_LED_EC_HLBL,
1351 led * led_exp_hlbl[ind]);
1351 if (ret >= 0) 1352 if (ret >= 0)
1352 ret = 1353 ret =
1353 ec_write(EC_HLCL, led * led_exp_hlcl[ind]); 1354 ec_write(IBMACPI_LED_EC_HLCL,
1355 led * led_exp_hlcl[ind]);
1354 if (ret < 0) 1356 if (ret < 0)
1355 return ret; 1357 return ret;
1356 } else { 1358 } else {
@@ -1657,8 +1659,8 @@ static int brightness_read(char *p)
1657 return len; 1659 return len;
1658} 1660}
1659 1661
1660#define BRIGHTNESS_UP 4 1662#define TP_CMOS_BRIGHTNESS_UP 4
1661#define BRIGHTNESS_DOWN 5 1663#define TP_CMOS_BRIGHTNESS_DOWN 5
1662 1664
1663static int brightness_set(int value) 1665static int brightness_set(int value)
1664{ 1666{
@@ -1667,7 +1669,8 @@ static int brightness_set(int value)
1667 1669
1668 value &= 7; 1670 value &= 7;
1669 1671
1670 cmos_cmd = value > current_value ? BRIGHTNESS_UP : BRIGHTNESS_DOWN; 1672 cmos_cmd = value > current_value ?
1673 TP_CMOS_BRIGHTNESS_UP : TP_CMOS_BRIGHTNESS_DOWN;
1671 inc = value > current_value ? 1 : -1; 1674 inc = value > current_value ? 1 : -1;
1672 for (i = current_value; i != value; i += inc) { 1675 for (i = current_value; i != value; i += inc) {
1673 if (!cmos_eval(cmos_cmd)) 1676 if (!cmos_eval(cmos_cmd))
@@ -1769,9 +1772,9 @@ static int volume_read(char *p)
1769 return len; 1772 return len;
1770} 1773}
1771 1774
1772#define VOLUME_DOWN 0 1775#define TP_CMOS_VOLUME_DOWN 0
1773#define VOLUME_UP 1 1776#define TP_CMOS_VOLUME_UP 1
1774#define VOLUME_MUTE 2 1777#define TP_CMOS_VOLUME_MUTE 2
1775 1778
1776static int volume_write(char *buf) 1779static int volume_write(char *buf)
1777{ 1780{
@@ -1805,7 +1808,8 @@ static int volume_write(char *buf)
1805 return -EINVAL; 1808 return -EINVAL;
1806 1809
1807 if (new_level != level) { /* mute doesn't change */ 1810 if (new_level != level) { /* mute doesn't change */
1808 cmos_cmd = new_level > level ? VOLUME_UP : VOLUME_DOWN; 1811 cmos_cmd = new_level > level ?
1812 TP_CMOS_VOLUME_UP : TP_CMOS_VOLUME_DOWN;
1809 inc = new_level > level ? 1 : -1; 1813 inc = new_level > level ? 1 : -1;
1810 1814
1811 if (mute && (!cmos_eval(cmos_cmd) || 1815 if (mute && (!cmos_eval(cmos_cmd) ||
@@ -1817,14 +1821,15 @@ static int volume_write(char *buf)
1817 !acpi_ec_write(volume_offset, i + inc)) 1821 !acpi_ec_write(volume_offset, i + inc))
1818 return -EIO; 1822 return -EIO;
1819 1823
1820 if (mute && (!cmos_eval(VOLUME_MUTE) || 1824 if (mute && (!cmos_eval(TP_CMOS_VOLUME_MUTE) ||
1821 !acpi_ec_write(volume_offset, 1825 !acpi_ec_write(volume_offset,
1822 new_level + mute))) 1826 new_level + mute)))
1823 return -EIO; 1827 return -EIO;
1824 } 1828 }
1825 1829
1826 if (new_mute != mute) { /* level doesn't change */ 1830 if (new_mute != mute) { /* level doesn't change */
1827 cmos_cmd = new_mute ? VOLUME_MUTE : VOLUME_UP; 1831 cmos_cmd = new_mute ?
1832 TP_CMOS_VOLUME_MUTE : TP_CMOS_VOLUME_UP;
1828 1833
1829 if (!cmos_eval(cmos_cmd) || 1834 if (!cmos_eval(cmos_cmd) ||
1830 !acpi_ec_write(volume_offset, level + new_mute)) 1835 !acpi_ec_write(volume_offset, level + new_mute))
@@ -2315,7 +2320,7 @@ static struct ibm_struct ibms[] = {
2315 { 2320 {
2316 .name = "driver", 2321 .name = "driver",
2317 .init = ibm_acpi_driver_init, 2322 .init = ibm_acpi_driver_init,
2318 .read = driver_read, 2323 .read = ibm_acpi_driver_read,
2319 }, 2324 },
2320 { 2325 {
2321 .name = "hotkey", 2326 .name = "hotkey",
@@ -2534,7 +2539,7 @@ static int __init ibm_device_add(struct acpi_device *device)
2534 return 0; 2539 return 0;
2535} 2540}
2536 2541
2537static int __init register_driver(struct ibm_struct *ibm) 2542static int __init register_ibmacpi_subdriver(struct ibm_struct *ibm)
2538{ 2543{
2539 int ret; 2544 int ret;
2540 2545
@@ -2569,7 +2574,7 @@ static int __init ibm_init(struct ibm_struct *ibm)
2569 return 0; 2574 return 0;
2570 2575
2571 if (ibm->hid) { 2576 if (ibm->hid) {
2572 ret = register_driver(ibm); 2577 ret = register_ibmacpi_subdriver(ibm);
2573 if (ret < 0) 2578 if (ret < 0)
2574 return ret; 2579 return ret;
2575 ibm->driver_registered = 1; 2580 ibm->driver_registered = 1;