diff options
author | Azael Avalos <coproscefalo@gmail.com> | 2015-05-06 11:35:10 -0400 |
---|---|---|
committer | Darren Hart <dvhart@linux.intel.com> | 2015-05-11 13:38:19 -0400 |
commit | d37782bd7bc67af37cd415027e298d3d5c7d56ad (patch) | |
tree | 48ef5c88e21b44a86f10d4b591bbd4cdba5a5dd1 | |
parent | 3b8760009d41a861ebd048ab0c1a25e85f80b385 (diff) |
toshiba_acpi: Rename hci_{read, write}1 functions
This patch simply renames the hci_{read, write}1 functions to
hci_{read, write}.
Signed-off-by: Azael Avalos <coproscefalo@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
-rw-r--r-- | drivers/platform/x86/toshiba_acpi.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c index e59376220f00..19efb054317d 100644 --- a/drivers/platform/x86/toshiba_acpi.c +++ b/drivers/platform/x86/toshiba_acpi.c | |||
@@ -326,13 +326,13 @@ static acpi_status tci_raw(struct toshiba_acpi_dev *dev, | |||
326 | } | 326 | } |
327 | 327 | ||
328 | /* | 328 | /* |
329 | * Common hci tasks (get or set one or two value) | 329 | * Common hci tasks |
330 | * | 330 | * |
331 | * In addition to the ACPI status, the HCI system returns a result which | 331 | * In addition to the ACPI status, the HCI system returns a result which |
332 | * may be useful (such as "not supported"). | 332 | * may be useful (such as "not supported"). |
333 | */ | 333 | */ |
334 | 334 | ||
335 | static u32 hci_write1(struct toshiba_acpi_dev *dev, u32 reg, u32 in1) | 335 | static u32 hci_write(struct toshiba_acpi_dev *dev, u32 reg, u32 in1) |
336 | { | 336 | { |
337 | u32 in[TCI_WORDS] = { HCI_SET, reg, in1, 0, 0, 0 }; | 337 | u32 in[TCI_WORDS] = { HCI_SET, reg, in1, 0, 0, 0 }; |
338 | u32 out[TCI_WORDS]; | 338 | u32 out[TCI_WORDS]; |
@@ -341,7 +341,7 @@ static u32 hci_write1(struct toshiba_acpi_dev *dev, u32 reg, u32 in1) | |||
341 | return ACPI_SUCCESS(status) ? out[0] : TOS_FAILURE; | 341 | return ACPI_SUCCESS(status) ? out[0] : TOS_FAILURE; |
342 | } | 342 | } |
343 | 343 | ||
344 | static u32 hci_read1(struct toshiba_acpi_dev *dev, u32 reg, u32 *out1) | 344 | static u32 hci_read(struct toshiba_acpi_dev *dev, u32 reg, u32 *out1) |
345 | { | 345 | { |
346 | u32 in[TCI_WORDS] = { HCI_GET, reg, 0, 0, 0, 0 }; | 346 | u32 in[TCI_WORDS] = { HCI_GET, reg, 0, 0, 0, 0 }; |
347 | u32 out[TCI_WORDS]; | 347 | u32 out[TCI_WORDS]; |
@@ -596,7 +596,7 @@ static enum led_brightness toshiba_kbd_backlight_get(struct led_classdev *cdev) | |||
596 | u32 state, result; | 596 | u32 state, result; |
597 | 597 | ||
598 | /* Check the keyboard backlight state */ | 598 | /* Check the keyboard backlight state */ |
599 | result = hci_read1(dev, HCI_KBD_ILLUMINATION, &state); | 599 | result = hci_read(dev, HCI_KBD_ILLUMINATION, &state); |
600 | if (result == TOS_FAILURE || result == TOS_INPUT_DATA_ERROR) { | 600 | if (result == TOS_FAILURE || result == TOS_INPUT_DATA_ERROR) { |
601 | pr_err("ACPI call to get the keyboard backlight failed\n"); | 601 | pr_err("ACPI call to get the keyboard backlight failed\n"); |
602 | return LED_OFF; | 602 | return LED_OFF; |
@@ -617,7 +617,7 @@ static void toshiba_kbd_backlight_set(struct led_classdev *cdev, | |||
617 | 617 | ||
618 | /* Set the keyboard backlight state */ | 618 | /* Set the keyboard backlight state */ |
619 | state = brightness ? 1 : 0; | 619 | state = brightness ? 1 : 0; |
620 | result = hci_write1(dev, HCI_KBD_ILLUMINATION, state); | 620 | result = hci_write(dev, HCI_KBD_ILLUMINATION, state); |
621 | if (result == TOS_FAILURE || result == TOS_INPUT_DATA_ERROR) { | 621 | if (result == TOS_FAILURE || result == TOS_INPUT_DATA_ERROR) { |
622 | pr_err("ACPI call to set KBD Illumination mode failed\n"); | 622 | pr_err("ACPI call to set KBD Illumination mode failed\n"); |
623 | return; | 623 | return; |
@@ -1188,7 +1188,7 @@ static int get_tr_backlight_status(struct toshiba_acpi_dev *dev, bool *enabled) | |||
1188 | u32 hci_result; | 1188 | u32 hci_result; |
1189 | u32 status; | 1189 | u32 status; |
1190 | 1190 | ||
1191 | hci_result = hci_read1(dev, HCI_TR_BACKLIGHT, &status); | 1191 | hci_result = hci_read(dev, HCI_TR_BACKLIGHT, &status); |
1192 | *enabled = !status; | 1192 | *enabled = !status; |
1193 | return hci_result == TOS_SUCCESS ? 0 : -EIO; | 1193 | return hci_result == TOS_SUCCESS ? 0 : -EIO; |
1194 | } | 1194 | } |
@@ -1198,7 +1198,7 @@ static int set_tr_backlight_status(struct toshiba_acpi_dev *dev, bool enable) | |||
1198 | u32 hci_result; | 1198 | u32 hci_result; |
1199 | u32 value = !enable; | 1199 | u32 value = !enable; |
1200 | 1200 | ||
1201 | hci_result = hci_write1(dev, HCI_TR_BACKLIGHT, value); | 1201 | hci_result = hci_write(dev, HCI_TR_BACKLIGHT, value); |
1202 | return hci_result == TOS_SUCCESS ? 0 : -EIO; | 1202 | return hci_result == TOS_SUCCESS ? 0 : -EIO; |
1203 | } | 1203 | } |
1204 | 1204 | ||
@@ -1221,7 +1221,7 @@ static int __get_lcd_brightness(struct toshiba_acpi_dev *dev) | |||
1221 | brightness++; | 1221 | brightness++; |
1222 | } | 1222 | } |
1223 | 1223 | ||
1224 | hci_result = hci_read1(dev, HCI_LCD_BRIGHTNESS, &value); | 1224 | hci_result = hci_read(dev, HCI_LCD_BRIGHTNESS, &value); |
1225 | if (hci_result == TOS_SUCCESS) | 1225 | if (hci_result == TOS_SUCCESS) |
1226 | return brightness + (value >> HCI_LCD_BRIGHTNESS_SHIFT); | 1226 | return brightness + (value >> HCI_LCD_BRIGHTNESS_SHIFT); |
1227 | 1227 | ||
@@ -1276,7 +1276,7 @@ static int set_lcd_brightness(struct toshiba_acpi_dev *dev, int value) | |||
1276 | } | 1276 | } |
1277 | 1277 | ||
1278 | value = value << HCI_LCD_BRIGHTNESS_SHIFT; | 1278 | value = value << HCI_LCD_BRIGHTNESS_SHIFT; |
1279 | hci_result = hci_write1(dev, HCI_LCD_BRIGHTNESS, value); | 1279 | hci_result = hci_write(dev, HCI_LCD_BRIGHTNESS, value); |
1280 | return hci_result == TOS_SUCCESS ? 0 : -EIO; | 1280 | return hci_result == TOS_SUCCESS ? 0 : -EIO; |
1281 | } | 1281 | } |
1282 | 1282 | ||
@@ -1326,7 +1326,7 @@ static int get_video_status(struct toshiba_acpi_dev *dev, u32 *status) | |||
1326 | { | 1326 | { |
1327 | u32 hci_result; | 1327 | u32 hci_result; |
1328 | 1328 | ||
1329 | hci_result = hci_read1(dev, HCI_VIDEO_OUT, status); | 1329 | hci_result = hci_read(dev, HCI_VIDEO_OUT, status); |
1330 | return hci_result == TOS_SUCCESS ? 0 : -EIO; | 1330 | return hci_result == TOS_SUCCESS ? 0 : -EIO; |
1331 | } | 1331 | } |
1332 | 1332 | ||
@@ -1432,7 +1432,7 @@ static int get_fan_status(struct toshiba_acpi_dev *dev, u32 *status) | |||
1432 | { | 1432 | { |
1433 | u32 hci_result; | 1433 | u32 hci_result; |
1434 | 1434 | ||
1435 | hci_result = hci_read1(dev, HCI_FAN, status); | 1435 | hci_result = hci_read(dev, HCI_FAN, status); |
1436 | return hci_result == TOS_SUCCESS ? 0 : -EIO; | 1436 | return hci_result == TOS_SUCCESS ? 0 : -EIO; |
1437 | } | 1437 | } |
1438 | 1438 | ||
@@ -1472,7 +1472,7 @@ static ssize_t fan_proc_write(struct file *file, const char __user *buf, | |||
1472 | 1472 | ||
1473 | if (sscanf(cmd, " force_on : %i", &value) == 1 && | 1473 | if (sscanf(cmd, " force_on : %i", &value) == 1 && |
1474 | value >= 0 && value <= 1) { | 1474 | value >= 0 && value <= 1) { |
1475 | hci_result = hci_write1(dev, HCI_FAN, value); | 1475 | hci_result = hci_write(dev, HCI_FAN, value); |
1476 | if (hci_result == TOS_SUCCESS) | 1476 | if (hci_result == TOS_SUCCESS) |
1477 | dev->force_fan = value; | 1477 | dev->force_fan = value; |
1478 | else | 1478 | else |
@@ -1500,7 +1500,7 @@ static int keys_proc_show(struct seq_file *m, void *v) | |||
1500 | u32 value; | 1500 | u32 value; |
1501 | 1501 | ||
1502 | if (!dev->key_event_valid && dev->system_event_supported) { | 1502 | if (!dev->key_event_valid && dev->system_event_supported) { |
1503 | hci_result = hci_read1(dev, HCI_SYSTEM_EVENT, &value); | 1503 | hci_result = hci_read(dev, HCI_SYSTEM_EVENT, &value); |
1504 | if (hci_result == TOS_SUCCESS) { | 1504 | if (hci_result == TOS_SUCCESS) { |
1505 | dev->key_event_valid = 1; | 1505 | dev->key_event_valid = 1; |
1506 | dev->last_key_event = value; | 1506 | dev->last_key_event = value; |
@@ -1512,7 +1512,7 @@ static int keys_proc_show(struct seq_file *m, void *v) | |||
1512 | * some machines where system events sporadically | 1512 | * some machines where system events sporadically |
1513 | * become disabled. | 1513 | * become disabled. |
1514 | */ | 1514 | */ |
1515 | hci_result = hci_write1(dev, HCI_SYSTEM_EVENT, 1); | 1515 | hci_result = hci_write(dev, HCI_SYSTEM_EVENT, 1); |
1516 | pr_notice("Re-enabled hotkeys\n"); | 1516 | pr_notice("Re-enabled hotkeys\n"); |
1517 | } else { | 1517 | } else { |
1518 | pr_err("Error reading hotkey status\n"); | 1518 | pr_err("Error reading hotkey status\n"); |
@@ -1649,7 +1649,7 @@ static ssize_t fan_store(struct device *dev, | |||
1649 | if (state != 0 && state != 1) | 1649 | if (state != 0 && state != 1) |
1650 | return -EINVAL; | 1650 | return -EINVAL; |
1651 | 1651 | ||
1652 | result = hci_write1(toshiba, HCI_FAN, state); | 1652 | result = hci_write(toshiba, HCI_FAN, state); |
1653 | if (result == TOS_FAILURE) | 1653 | if (result == TOS_FAILURE) |
1654 | return -EIO; | 1654 | return -EIO; |
1655 | else if (result == TOS_NOT_SUPPORTED) | 1655 | else if (result == TOS_NOT_SUPPORTED) |
@@ -2271,7 +2271,7 @@ static int toshiba_acpi_enable_hotkeys(struct toshiba_acpi_dev *dev) | |||
2271 | if (ACPI_FAILURE(status)) | 2271 | if (ACPI_FAILURE(status)) |
2272 | return -ENODEV; | 2272 | return -ENODEV; |
2273 | 2273 | ||
2274 | result = hci_write1(dev, HCI_HOTKEY_EVENT, HCI_HOTKEY_ENABLE); | 2274 | result = hci_write(dev, HCI_HOTKEY_EVENT, HCI_HOTKEY_ENABLE); |
2275 | if (result == TOS_FAILURE) | 2275 | if (result == TOS_FAILURE) |
2276 | return -EIO; | 2276 | return -EIO; |
2277 | else if (result == TOS_NOT_SUPPORTED) | 2277 | else if (result == TOS_NOT_SUPPORTED) |
@@ -2288,8 +2288,8 @@ static void toshiba_acpi_enable_special_functions(struct toshiba_acpi_dev *dev) | |||
2288 | * Re-activate the hotkeys, but this time, we are using the | 2288 | * Re-activate the hotkeys, but this time, we are using the |
2289 | * "Special Functions" mode. | 2289 | * "Special Functions" mode. |
2290 | */ | 2290 | */ |
2291 | result = hci_write1(dev, HCI_HOTKEY_EVENT, | 2291 | result = hci_write(dev, HCI_HOTKEY_EVENT, |
2292 | HCI_HOTKEY_SPECIAL_FUNCTIONS); | 2292 | HCI_HOTKEY_SPECIAL_FUNCTIONS); |
2293 | if (result != TOS_SUCCESS) | 2293 | if (result != TOS_SUCCESS) |
2294 | pr_err("Could not enable the Special Function mode\n"); | 2294 | pr_err("Could not enable the Special Function mode\n"); |
2295 | } | 2295 | } |
@@ -2370,7 +2370,7 @@ static void toshiba_acpi_process_hotkeys(struct toshiba_acpi_dev *dev) | |||
2370 | toshiba_acpi_report_hotkey(dev, scancode); | 2370 | toshiba_acpi_report_hotkey(dev, scancode); |
2371 | } else if (dev->system_event_supported) { | 2371 | } else if (dev->system_event_supported) { |
2372 | do { | 2372 | do { |
2373 | hci_result = hci_read1(dev, HCI_SYSTEM_EVENT, &value); | 2373 | hci_result = hci_read(dev, HCI_SYSTEM_EVENT, &value); |
2374 | switch (hci_result) { | 2374 | switch (hci_result) { |
2375 | case TOS_SUCCESS: | 2375 | case TOS_SUCCESS: |
2376 | toshiba_acpi_report_hotkey(dev, (int)value); | 2376 | toshiba_acpi_report_hotkey(dev, (int)value); |
@@ -2382,7 +2382,7 @@ static void toshiba_acpi_process_hotkeys(struct toshiba_acpi_dev *dev) | |||
2382 | * sporadically become disabled. | 2382 | * sporadically become disabled. |
2383 | */ | 2383 | */ |
2384 | hci_result = | 2384 | hci_result = |
2385 | hci_write1(dev, HCI_SYSTEM_EVENT, 1); | 2385 | hci_write(dev, HCI_SYSTEM_EVENT, 1); |
2386 | pr_notice("Re-enabled hotkeys\n"); | 2386 | pr_notice("Re-enabled hotkeys\n"); |
2387 | /* Fall through */ | 2387 | /* Fall through */ |
2388 | default: | 2388 | default: |
@@ -2459,7 +2459,7 @@ static int toshiba_acpi_setup_keyboard(struct toshiba_acpi_dev *dev) | |||
2459 | if (acpi_has_method(dev->acpi_dev->handle, "INFO")) | 2459 | if (acpi_has_method(dev->acpi_dev->handle, "INFO")) |
2460 | dev->info_supported = 1; | 2460 | dev->info_supported = 1; |
2461 | else { | 2461 | else { |
2462 | hci_result = hci_write1(dev, HCI_SYSTEM_EVENT, 1); | 2462 | hci_result = hci_write(dev, HCI_SYSTEM_EVENT, 1); |
2463 | if (hci_result == TOS_SUCCESS) | 2463 | if (hci_result == TOS_SUCCESS) |
2464 | dev->system_event_supported = 1; | 2464 | dev->system_event_supported = 1; |
2465 | } | 2465 | } |
@@ -2784,7 +2784,7 @@ static int toshiba_acpi_suspend(struct device *device) | |||
2784 | u32 result; | 2784 | u32 result; |
2785 | 2785 | ||
2786 | if (dev->hotkey_dev) | 2786 | if (dev->hotkey_dev) |
2787 | result = hci_write1(dev, HCI_HOTKEY_EVENT, HCI_HOTKEY_DISABLE); | 2787 | result = hci_write(dev, HCI_HOTKEY_EVENT, HCI_HOTKEY_DISABLE); |
2788 | 2788 | ||
2789 | return 0; | 2789 | return 0; |
2790 | } | 2790 | } |