summaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorDarren Hart <dvhart@linux.intel.com>2015-02-11 23:50:08 -0500
committerDarren Hart <dvhart@linux.intel.com>2015-02-12 00:17:19 -0500
commite0769fe6f28b500868c2b1059f74ab1177ff41db (patch)
treee60bcb980abe2ff7d55d110f10b33fa19a8e4f0e /drivers/platform
parent0c3c0f10d4396a3d3dc9d7432102d5437b181487 (diff)
toshiba_acpi: Cleanup comment blocks and capitalization
Ensure multiline comments start with /* and */ each on its own line. Capitalize the first word of comments. Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/toshiba_acpi.c75
1 files changed, 47 insertions, 28 deletions
diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c
index 1cfc44324514..07be889011e1 100644
--- a/drivers/platform/x86/toshiba_acpi.c
+++ b/drivers/platform/x86/toshiba_acpi.c
@@ -71,7 +71,8 @@ MODULE_LICENSE("GPL");
71/* Toshiba ACPI method paths */ 71/* Toshiba ACPI method paths */
72#define METHOD_VIDEO_OUT "\\_SB_.VALX.DSSX" 72#define METHOD_VIDEO_OUT "\\_SB_.VALX.DSSX"
73 73
74/* The Toshiba configuration interface is composed of the HCI and the SCI, 74/*
75 * The Toshiba configuration interface is composed of the HCI and the SCI,
75 * which are defined as follows: 76 * which are defined as follows:
76 * 77 *
77 * HCI is Toshiba's "Hardware Control Interface" which is supposed to 78 * HCI is Toshiba's "Hardware Control Interface" which is supposed to
@@ -286,7 +287,8 @@ static const struct key_entry toshiba_acpi_alt_keymap[] = {
286 { KE_END, 0 }, 287 { KE_END, 0 },
287}; 288};
288 289
289/* utility 290/*
291 * Utility
290 */ 292 */
291 293
292static inline void _set_bit(u32 *word, u32 mask, int value) 294static inline void _set_bit(u32 *word, u32 mask, int value)
@@ -294,7 +296,8 @@ static inline void _set_bit(u32 *word, u32 mask, int value)
294 *word = (*word & ~mask) | (mask * value); 296 *word = (*word & ~mask) | (mask * value);
295} 297}
296 298
297/* acpi interface wrappers 299/*
300 * ACPI interface wrappers
298 */ 301 */
299 302
300static int write_acpi_int(const char *methodName, int val) 303static int write_acpi_int(const char *methodName, int val)
@@ -305,7 +308,8 @@ static int write_acpi_int(const char *methodName, int val)
305 return (status == AE_OK) ? 0 : -EIO; 308 return (status == AE_OK) ? 0 : -EIO;
306} 309}
307 310
308/* Perform a raw configuration call. Here we don't care about input or output 311/*
312 * Perform a raw configuration call. Here we don't care about input or output
309 * buffer format. 313 * buffer format.
310 */ 314 */
311static acpi_status tci_raw(struct toshiba_acpi_dev *dev, 315static acpi_status tci_raw(struct toshiba_acpi_dev *dev,
@@ -339,7 +343,8 @@ static acpi_status tci_raw(struct toshiba_acpi_dev *dev,
339 return status; 343 return status;
340} 344}
341 345
342/* common hci tasks (get or set one or two value) 346/*
347 * Common hci tasks (get or set one or two value)
343 * 348 *
344 * In addition to the ACPI status, the HCI system returns a result which 349 * In addition to the ACPI status, the HCI system returns a result which
345 * may be useful (such as "not supported"). 350 * may be useful (such as "not supported").
@@ -393,7 +398,8 @@ static u32 hci_read2(struct toshiba_acpi_dev *dev,
393 return out[0]; 398 return out[0];
394} 399}
395 400
396/* common sci tasks 401/*
402 * Common sci tasks
397 */ 403 */
398 404
399static int sci_open(struct toshiba_acpi_dev *dev) 405static int sci_open(struct toshiba_acpi_dev *dev)
@@ -414,7 +420,8 @@ static int sci_open(struct toshiba_acpi_dev *dev)
414 pr_info("Toshiba SCI already opened\n"); 420 pr_info("Toshiba SCI already opened\n");
415 return 1; 421 return 1;
416 } else if (out[0] == TOS_NOT_SUPPORTED) { 422 } else if (out[0] == TOS_NOT_SUPPORTED) {
417 /* Some BIOSes do not have the SCI open/close functions 423 /*
424 * Some BIOSes do not have the SCI open/close functions
418 * implemented and return 0x8000 (Not Supported), failing to 425 * implemented and return 0x8000 (Not Supported), failing to
419 * register some supported features. 426 * register some supported features.
420 * 427 *
@@ -567,10 +574,11 @@ static int toshiba_kbd_illum_available(struct toshiba_acpi_dev *dev)
567 return 0; 574 return 0;
568 } 575 }
569 576
570 /* Check for keyboard backlight timeout max value, 577 /*
578 * Check for keyboard backlight timeout max value,
571 * previous kbd backlight implementation set this to 579 * previous kbd backlight implementation set this to
572 * 0x3c0003, and now the new implementation set this 580 * 0x3c0003, and now the new implementation set this
573 * to 0x3c001a, use this to distinguish between them 581 * to 0x3c001a, use this to distinguish between them.
574 */ 582 */
575 if (out[3] == SCI_KBD_TIME_MAX) 583 if (out[3] == SCI_KBD_TIME_MAX)
576 dev->kbd_type = 2; 584 dev->kbd_type = 2;
@@ -714,7 +722,8 @@ static int toshiba_eco_mode_available(struct toshiba_acpi_dev *dev)
714 } else if (out[0] == TOS_NOT_INSTALLED) { 722 } else if (out[0] == TOS_NOT_INSTALLED) {
715 pr_info("ECO led not installed"); 723 pr_info("ECO led not installed");
716 } else if (out[0] == TOS_INPUT_DATA_ERROR) { 724 } else if (out[0] == TOS_INPUT_DATA_ERROR) {
717 /* If we receive 0x8300 (Input Data Error), it means that the 725 /*
726 * If we receive 0x8300 (Input Data Error), it means that the
718 * LED device is present, but that we just screwed the input 727 * LED device is present, but that we just screwed the input
719 * parameters. 728 * parameters.
720 * 729 *
@@ -776,7 +785,8 @@ static int toshiba_accelerometer_supported(struct toshiba_acpi_dev *dev)
776 u32 out[TCI_WORDS]; 785 u32 out[TCI_WORDS];
777 acpi_status status; 786 acpi_status status;
778 787
779 /* Check if the accelerometer call exists, 788 /*
789 * Check if the accelerometer call exists,
780 * this call also serves as initialization 790 * this call also serves as initialization
781 */ 791 */
782 status = tci_raw(dev, in, out); 792 status = tci_raw(dev, in, out);
@@ -1433,9 +1443,9 @@ static ssize_t video_proc_write(struct file *file, const char __user *buf,
1433 1443
1434 buffer = cmd; 1444 buffer = cmd;
1435 1445
1436 /* scan expression. Multiple expressions may be delimited with ; 1446 /*
1437 * 1447 * Scan expression. Multiple expressions may be delimited with ;
1438 * NOTE: to keep scanning simple, invalid fields are ignored 1448 * NOTE: To keep scanning simple, invalid fields are ignored.
1439 */ 1449 */
1440 while (remain) { 1450 while (remain) {
1441 if (sscanf(buffer, " lcd_out : %i", &value) == 1) 1451 if (sscanf(buffer, " lcd_out : %i", &value) == 1)
@@ -1444,7 +1454,7 @@ static ssize_t video_proc_write(struct file *file, const char __user *buf,
1444 crt_out = value & 1; 1454 crt_out = value & 1;
1445 else if (sscanf(buffer, " tv_out : %i", &value) == 1) 1455 else if (sscanf(buffer, " tv_out : %i", &value) == 1)
1446 tv_out = value & 1; 1456 tv_out = value & 1;
1447 /* advance to one character past the next ; */ 1457 /* Advance to one character past the next ; */
1448 do { 1458 do {
1449 ++buffer; 1459 ++buffer;
1450 --remain; 1460 --remain;
@@ -1463,7 +1473,8 @@ static ssize_t video_proc_write(struct file *file, const char __user *buf,
1463 _set_bit(&new_video_out, HCI_VIDEO_OUT_CRT, crt_out); 1473 _set_bit(&new_video_out, HCI_VIDEO_OUT_CRT, crt_out);
1464 if (tv_out != -1) 1474 if (tv_out != -1)
1465 _set_bit(&new_video_out, HCI_VIDEO_OUT_TV, tv_out); 1475 _set_bit(&new_video_out, HCI_VIDEO_OUT_TV, tv_out);
1466 /* To avoid unnecessary video disruption, only write the new 1476 /*
1477 * To avoid unnecessary video disruption, only write the new
1467 * video setting if something changed. */ 1478 * video setting if something changed. */
1468 if (new_video_out != video_out) 1479 if (new_video_out != video_out)
1469 ret = write_acpi_int(METHOD_VIDEO_OUT, new_video_out); 1480 ret = write_acpi_int(METHOD_VIDEO_OUT, new_video_out);
@@ -1558,11 +1569,13 @@ static int keys_proc_show(struct seq_file *m, void *v)
1558 dev->key_event_valid = 1; 1569 dev->key_event_valid = 1;
1559 dev->last_key_event = value; 1570 dev->last_key_event = value;
1560 } else if (hci_result == TOS_FIFO_EMPTY) { 1571 } else if (hci_result == TOS_FIFO_EMPTY) {
1561 /* better luck next time */ 1572 /* Better luck next time */
1562 } else if (hci_result == TOS_NOT_SUPPORTED) { 1573 } else if (hci_result == TOS_NOT_SUPPORTED) {
1563 /* This is a workaround for an unresolved issue on 1574 /*
1575 * This is a workaround for an unresolved issue on
1564 * some machines where system events sporadically 1576 * some machines where system events sporadically
1565 * become disabled. */ 1577 * become disabled.
1578 */
1566 hci_result = hci_write1(dev, HCI_SYSTEM_EVENT, 1); 1579 hci_result = hci_write1(dev, HCI_SYSTEM_EVENT, 1);
1567 pr_notice("Re-enabled hotkeys\n"); 1580 pr_notice("Re-enabled hotkeys\n");
1568 } else { 1581 } else {
@@ -1631,7 +1644,8 @@ static const struct file_operations version_proc_fops = {
1631 .release = single_release, 1644 .release = single_release,
1632}; 1645};
1633 1646
1634/* proc and module init 1647/*
1648 * Proc and module init
1635 */ 1649 */
1636 1650
1637#define PROC_TOSHIBA "toshiba" 1651#define PROC_TOSHIBA "toshiba"
@@ -1749,7 +1763,8 @@ static ssize_t kbd_backlight_mode_store(struct device *dev,
1749 return -EINVAL; 1763 return -EINVAL;
1750 } 1764 }
1751 1765
1752 /* Set the Keyboard Backlight Mode where: 1766 /*
1767 * Set the Keyboard Backlight Mode where:
1753 * Auto - KBD backlight turns off automatically in given time 1768 * Auto - KBD backlight turns off automatically in given time
1754 * FN-Z - KBD backlight "toggles" when hotkey pressed 1769 * FN-Z - KBD backlight "toggles" when hotkey pressed
1755 * ON - KBD backlight is always on 1770 * ON - KBD backlight is always on
@@ -1960,7 +1975,8 @@ static ssize_t usb_sleep_charge_store(struct device *dev,
1960 ret = kstrtoint(buf, 0, &state); 1975 ret = kstrtoint(buf, 0, &state);
1961 if (ret) 1976 if (ret)
1962 return ret; 1977 return ret;
1963 /* Check for supported values, where: 1978 /*
1979 * Check for supported values, where:
1964 * 0 - Disabled 1980 * 0 - Disabled
1965 * 1 - Alternate (Non USB conformant devices that require more power) 1981 * 1 - Alternate (Non USB conformant devices that require more power)
1966 * 2 - Auto (USB conformant devices) 1982 * 2 - Auto (USB conformant devices)
@@ -2022,7 +2038,8 @@ static ssize_t sleep_functions_on_battery_store(struct device *dev,
2022 if (ret) 2038 if (ret)
2023 return ret; 2039 return ret;
2024 2040
2025 /* Set the status of the function: 2041 /*
2042 * Set the status of the function:
2026 * 0 - Disabled 2043 * 0 - Disabled
2027 * 1-100 - Enabled 2044 * 1-100 - Enabled
2028 */ 2045 */
@@ -2143,7 +2160,8 @@ static ssize_t kbd_function_keys_store(struct device *dev,
2143 ret = kstrtoint(buf, 0, &mode); 2160 ret = kstrtoint(buf, 0, &mode);
2144 if (ret) 2161 if (ret)
2145 return ret; 2162 return ret;
2146 /* Check for the function keys mode where: 2163 /*
2164 * Check for the function keys mode where:
2147 * 0 - Normal operation (F{1-12} as usual and hotkeys via FN-F{1-12}) 2165 * 0 - Normal operation (F{1-12} as usual and hotkeys via FN-F{1-12})
2148 * 1 - Special functions (Opposite of the above setting) 2166 * 1 - Special functions (Opposite of the above setting)
2149 */ 2167 */
@@ -2223,7 +2241,8 @@ static ssize_t usb_three_store(struct device *dev,
2223 ret = kstrtoint(buf, 0, &state); 2241 ret = kstrtoint(buf, 0, &state);
2224 if (ret) 2242 if (ret)
2225 return ret; 2243 return ret;
2226 /* Check for USB 3 mode where: 2244 /*
2245 * Check for USB 3 mode where:
2227 * 0 - Disabled (Acts like a USB 2 port, saving power) 2246 * 0 - Disabled (Acts like a USB 2 port, saving power)
2228 * 1 - Enabled 2247 * 1 - Enabled
2229 */ 2248 */
@@ -2375,7 +2394,7 @@ static void toshiba_acpi_report_hotkey(struct toshiba_acpi_dev *dev,
2375 if (scancode == 0x100) 2394 if (scancode == 0x100)
2376 return; 2395 return;
2377 2396
2378 /* act on key press; ignore key release */ 2397 /* Act on key press; ignore key release */
2379 if (scancode & 0x80) 2398 if (scancode & 0x80)
2380 return; 2399 return;
2381 2400
@@ -2411,7 +2430,7 @@ static void toshiba_acpi_process_hotkeys(struct toshiba_acpi_dev *dev)
2411 hci_result = 2430 hci_result =
2412 hci_write1(dev, HCI_SYSTEM_EVENT, 1); 2431 hci_write1(dev, HCI_SYSTEM_EVENT, 1);
2413 pr_notice("Re-enabled hotkeys\n"); 2432 pr_notice("Re-enabled hotkeys\n");
2414 /* fall through */ 2433 /* Fall through */
2415 default: 2434 default:
2416 retries--; 2435 retries--;
2417 break; 2436 break;
@@ -2533,7 +2552,7 @@ static int toshiba_acpi_setup_backlight(struct toshiba_acpi_dev *dev)
2533 props.type = BACKLIGHT_PLATFORM; 2552 props.type = BACKLIGHT_PLATFORM;
2534 props.max_brightness = HCI_LCD_BRIGHTNESS_LEVELS - 1; 2553 props.max_brightness = HCI_LCD_BRIGHTNESS_LEVELS - 1;
2535 2554
2536 /* adding an extra level and having 0 change to transflective mode */ 2555 /* Adding an extra level and having 0 change to transflective mode */
2537 if (dev->tr_backlight_supported) 2556 if (dev->tr_backlight_supported)
2538 props.max_brightness++; 2557 props.max_brightness++;
2539 2558