/* Toshiba ACPI method paths */
#define METHOD_VIDEO_OUT "\\_SB_.VALX.DSSX"
-/* The Toshiba configuration interface is composed of the HCI and the SCI,
+/*
+ * The Toshiba configuration interface is composed of the HCI and the SCI,
* which are defined as follows:
*
* HCI is Toshiba's "Hardware Control Interface" which is supposed to
{ KE_END, 0 },
};
-/* utility
+/*
+ * Utility
*/
static inline void _set_bit(u32 *word, u32 mask, int value)
*word = (*word & ~mask) | (mask * value);
}
-/* acpi interface wrappers
+/*
+ * ACPI interface wrappers
*/
static int write_acpi_int(const char *methodName, int val)
return (status == AE_OK) ? 0 : -EIO;
}
-/* Perform a raw configuration call. Here we don't care about input or output
+/*
+ * Perform a raw configuration call. Here we don't care about input or output
* buffer format.
*/
static acpi_status tci_raw(struct toshiba_acpi_dev *dev,
return status;
}
-/* common hci tasks (get or set one or two value)
+/*
+ * Common hci tasks (get or set one or two value)
*
* In addition to the ACPI status, the HCI system returns a result which
* may be useful (such as "not supported").
return out[0];
}
-/* common sci tasks
+/*
+ * Common sci tasks
*/
static int sci_open(struct toshiba_acpi_dev *dev)
pr_info("Toshiba SCI already opened\n");
return 1;
} else if (out[0] == TOS_NOT_SUPPORTED) {
- /* Some BIOSes do not have the SCI open/close functions
+ /*
+ * Some BIOSes do not have the SCI open/close functions
* implemented and return 0x8000 (Not Supported), failing to
* register some supported features.
*
return 0;
}
- /* Check for keyboard backlight timeout max value,
+ /*
+ * Check for keyboard backlight timeout max value,
* previous kbd backlight implementation set this to
* 0x3c0003, and now the new implementation set this
- * to 0x3c001a, use this to distinguish between them
+ * to 0x3c001a, use this to distinguish between them.
*/
if (out[3] == SCI_KBD_TIME_MAX)
dev->kbd_type = 2;
} else if (out[0] == TOS_NOT_INSTALLED) {
pr_info("ECO led not installed");
} else if (out[0] == TOS_INPUT_DATA_ERROR) {
- /* If we receive 0x8300 (Input Data Error), it means that the
+ /*
+ * If we receive 0x8300 (Input Data Error), it means that the
* LED device is present, but that we just screwed the input
* parameters.
*
u32 out[TCI_WORDS];
acpi_status status;
- /* Check if the accelerometer call exists,
+ /*
+ * Check if the accelerometer call exists,
* this call also serves as initialization
*/
status = tci_raw(dev, in, out);
buffer = cmd;
- /* scan expression. Multiple expressions may be delimited with ;
- *
- * NOTE: to keep scanning simple, invalid fields are ignored
+ /*
+ * Scan expression. Multiple expressions may be delimited with ;
+ * NOTE: To keep scanning simple, invalid fields are ignored.
*/
while (remain) {
if (sscanf(buffer, " lcd_out : %i", &value) == 1)
crt_out = value & 1;
else if (sscanf(buffer, " tv_out : %i", &value) == 1)
tv_out = value & 1;
- /* advance to one character past the next ; */
+ /* Advance to one character past the next ; */
do {
++buffer;
--remain;
_set_bit(&new_video_out, HCI_VIDEO_OUT_CRT, crt_out);
if (tv_out != -1)
_set_bit(&new_video_out, HCI_VIDEO_OUT_TV, tv_out);
- /* To avoid unnecessary video disruption, only write the new
+ /*
+ * To avoid unnecessary video disruption, only write the new
* video setting if something changed. */
if (new_video_out != video_out)
ret = write_acpi_int(METHOD_VIDEO_OUT, new_video_out);
dev->key_event_valid = 1;
dev->last_key_event = value;
} else if (hci_result == TOS_FIFO_EMPTY) {
- /* better luck next time */
+ /* Better luck next time */
} else if (hci_result == TOS_NOT_SUPPORTED) {
- /* This is a workaround for an unresolved issue on
+ /*
+ * This is a workaround for an unresolved issue on
* some machines where system events sporadically
- * become disabled. */
+ * become disabled.
+ */
hci_result = hci_write1(dev, HCI_SYSTEM_EVENT, 1);
pr_notice("Re-enabled hotkeys\n");
} else {
.release = single_release,
};
-/* proc and module init
+/*
+ * Proc and module init
*/
#define PROC_TOSHIBA "toshiba"
return -EINVAL;
}
- /* Set the Keyboard Backlight Mode where:
+ /*
+ * Set the Keyboard Backlight Mode where:
* Auto - KBD backlight turns off automatically in given time
* FN-Z - KBD backlight "toggles" when hotkey pressed
* ON - KBD backlight is always on
ret = kstrtoint(buf, 0, &state);
if (ret)
return ret;
- /* Check for supported values, where:
+ /*
+ * Check for supported values, where:
* 0 - Disabled
* 1 - Alternate (Non USB conformant devices that require more power)
* 2 - Auto (USB conformant devices)
if (ret)
return ret;
- /* Set the status of the function:
+ /*
+ * Set the status of the function:
* 0 - Disabled
* 1-100 - Enabled
*/
ret = kstrtoint(buf, 0, &mode);
if (ret)
return ret;
- /* Check for the function keys mode where:
+ /*
+ * Check for the function keys mode where:
* 0 - Normal operation (F{1-12} as usual and hotkeys via FN-F{1-12})
* 1 - Special functions (Opposite of the above setting)
*/
ret = kstrtoint(buf, 0, &state);
if (ret)
return ret;
- /* Check for USB 3 mode where:
+ /*
+ * Check for USB 3 mode where:
* 0 - Disabled (Acts like a USB 2 port, saving power)
* 1 - Enabled
*/
if (scancode == 0x100)
return;
- /* act on key press; ignore key release */
+ /* Act on key press; ignore key release */
if (scancode & 0x80)
return;
hci_result =
hci_write1(dev, HCI_SYSTEM_EVENT, 1);
pr_notice("Re-enabled hotkeys\n");
- /* fall through */
+ /* Fall through */
default:
retries--;
break;
props.type = BACKLIGHT_PLATFORM;
props.max_brightness = HCI_LCD_BRIGHTNESS_LEVELS - 1;
- /* adding an extra level and having 0 change to transflective mode */
+ /* Adding an extra level and having 0 change to transflective mode */
if (dev->tr_backlight_supported)
props.max_brightness++;