summaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/toshiba_acpi.c
Commit message (Collapse)AuthorAgeFilesLines
...
* toshiba_acpi: Unify hotkey enabling functionsAzael Avalos2015-10-031-24/+12
| | | | | | | | | | | Currently the driver has two functions enabling hotkeys support, but these two functions can be merged into one. This patch merges these two functions, moving some checks to the *enable_hotkeys function, simplifying code in the process. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* toshiba_acpi: Fix hotkeys registration on some toshiba modelsAzael Avalos2015-09-101-5/+3
| | | | | | | | | | | | | | | | | | | | | Commit a2b3471b5b13 ("toshiba_acpi: Use the Hotkey Event Type function for keymap choosing") changed the *setup_keyboard function to query for the Hotkey Event Type to help choose the correct keymap, but turns out that here are certain Toshiba models out there not implementing this feature, and thus, failing to continue the input device registration and leaving such laptops without hotkey support. This patch changes such check, and instead of returning an error if the Hotkey Event Type is not present, we simply inform userspace about it, changing the message printed from err to notice, making the function responsible for registering the input device to continue. This issue was found on a Toshiba Portege Z30-B, but there might be some other models out there affected by this regression as well. Cc: <stable@vger.kernel.org> # 4.1+ Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* toshiba_acpi: Fix USB Sleep and Music always disabledAzael Avalos2015-09-101-1/+1
| | | | | | | | | | | | | Commit e1a949c1b988 ("toshiba_acpi: Refactor *{get, set} functions return value") made changes on the return type of the HCI/SCI functions, but a typo on the USB Sleep and Music code is always reporting non existent support for such feature. This patch corrects the typo, changing an assignment to a comparison, making the laptops with actual support for such feature to work again. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* toshiba_acpi: Bump driver version to 0.23Azael Avalos2015-08-051-1/+1
| | | | | | | | | Given that some features were added (/dev/toshiba_acpi device), some clean-ups and minor (cosmetic) changes all over the driver code, bump the driver version to 0.23 to reflect these overall changes. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* toshiba_acpi: Remove unnecessary checks and returns in HCI/SCI functionsAzael Avalos2015-08-051-125/+44
| | | | | | | | | | | | | A previous patch added explicit feature checks for support, *SUCCESS* and *FAILURE to the HCI/SCI *{get, set} functions. This patch removes some unnedded checks to the driver HCI/SCI functions given that the default error return value is now set to -EIO, there is no need to check for other error values other than the ones currently checking for. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* toshiba_acpi: Refactor *{get, set} functions return valueAzael Avalos2015-08-051-73/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch refactors the return value of the driver *{get, set} functions, since the driver default error value is -EIO. All the functions now check for TOS_FAILURE, TOS_NOT_SUPPORTED and TOS_SUCCESS. On TOS_FAILURE a pr_err message is printed informing the user of the error (no change was made to this, except the check was added to the functions not checking for this). On TOS_NOT_SUPPORTED we now return -ENODEV immediately (some functions were returning -EIO and some other were not checking) On TOS_SUCCESS* we now return 0 (as a side effect, a new success value was added, since some functions return one instead of zero to indicate success). As a special case, the LED functions now check for *FAILURE on *set, and check for TOS_FAILURE and TOS_SUCCESS on *get with their "default" return value set to LED_OFF. Also the {lcd, video}_proc* functions were adapted to reflect these changes to their parent HCI functions. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* toshiba_acpi: Remove "*not supported" feature printsAzael Avalos2015-08-051-26/+46
| | | | | | | | | | | | | Currently the driver prints "*not supported" if any of the features queried are in fact not supported, let us print the available features instead. This patch removes all instances pr_info printing "*not supported", and add a new function called "print_supported_features", which will print the available laptop features. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* toshiba_acpi: Change *available functions return typeAzael Avalos2015-08-051-67/+62
| | | | | | | | | | | | | | | | | | | This patch changes the *available functions return type from int to void. The checks for support of their respective features are done inside such functions and there was no need to return anything as we can flag the queried feature as supported inside these functions. The code was adapted accordingly to these changes and two new variables were created and another was changed from uint to bool. Also, the function toshiba_acceleremoter_supported was renamed to toshiba_accelerometer_available to maintain the naming consistency on the driver. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* toshiba_acpi: Add set_fan_status functionAzael Avalos2015-07-281-26/+40
| | | | | | | | | | | | | | | | | | This patch adds a new function named "set_fan_status" to complement its get* counterpart, as well as to avoid code duplication between "fan_proc_write" and "fan_store". Also, both functions (get*, set*) are now checking for TOS_FAILURE, TOS_NOT_SUPPORTED and TOS_SUCCESS (to be on par with the rest of the HCI/SCI functions), printing an error message, returning -ENODEV and zero respectively. The proc and sysfs functions were updated to reflect these changes as well, returning -EIO for proc, and propagating the error value on the sysfs functions. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* toshiba_acpi: Change some variables to avoid warnings from ninja-checkAzael Avalos2015-07-241-6/+9
| | | | | | | | | | | This patch changes some variables to avoid warnings from ninja-check. We are basically moving some variables inside the conditionals where such variables are being used, and we are checking the returned values of some others. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* toshiba_acpi: Reorder toshiba_acpi_alt_keymap entriesAzael Avalos2015-07-241-3/+3
| | | | | | | | | This patch simply reorders the entries found in the new keymap by ascending order, this is simply a cosmetic change, no functionality was modified. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* toshiba_acpi: Remove unused wireless definesAzael Avalos2015-07-241-5/+0
| | | | | | | | | | | | Commit 2b74103547b4 ("toshiba_acpi: Remove bluetooth rfkill code") removed bluetooth related code, however, the wireless defines were not removed and are unused. This patch simply removes those defines as there is no code using them. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* toshiba_acpi: Transflective backlight updatesAzael Avalos2015-07-241-19/+11
| | | | | | | | | | | | This patch changes the tr function second parameter from bool to u32, to be on par with the rest of the TCI functions of the driver, and the code was updated accordingly. Also, the check for translective support was moved to the *add function, as the {__get, set}_lcd_brightness functions make use of it. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* toshiba_acpi: Avoid registering input device on WMI event laptopsAzael Avalos2015-07-241-8/+13
| | | | | | | | | | | | | | | Commit f11f999e9890 ("toshiba_acpi: Refuse to load on machines with buggy INFO implementations") denied loading on laptops with a WMI Event GUID given that such laptops manage the hotkeys via that interface, however, such laptops have a working Toshiba Configuration Interface (TCI), and thus, such commit denied several supported features. This patch avoids registering the input device and ignores all hotkey events on laptops with such WMI Event GUID, making the supported features found in those laptops to work. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* toshiba_acpi: Add /dev/toshiba_acpi deviceAzael Avalos2015-07-241-0/+91
| | | | | | | | | | | | | | | | | | | | | | | | | There were previous attempts to "merge" the toshiba SMM module to the toshiba_acpi one, they were trying to imitate what the old toshiba module does, however, some models (TOS1900 devices) come with a "crippled" implementation and do not provide all the "features" a "genuine" Toshiba BIOS does. This patch adds a new device called toshiba_acpi, which aim is to enable userspace to access the SMM on Toshiba laptops via ACPI calls. Creating a new convenience _IOWR command to access the SCI functions by opening/closing the SCI internally to avoid buggy BIOS, while at the same time providing backwards compatibility. Older programs (and new) who wish to access the SMM on newer models can do it by pointing their path to /dev/toshiba_acpi (instead of /dev/toshiba) as the toshiba.h header was modified to reflect these changes as well as adds all the toshiba_acpi paths and command, however, it is strongly recommended to use the new IOCTL for any SCI command to avoid any buggy BIOS. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* toshiba_acpi: Adapt /proc/acpi/toshiba/keys to TOS1900 devicesAzael Avalos2015-07-241-36/+20
| | | | | | | | | | | | | Since the introduction of TOS1900 devices support to the driver, the "keys" entry under the proc directory was broken, given that it only handled TOS620X devices accordingly. This patch adapts the code to show the hotkey values of TOS1900 devices too, and in case some programs are still using that interface, hotkeys reporting should now work on these devices. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* Merge tag 'platform-drivers-x86-v4.2-1' of ↵Linus Torvalds2015-07-011-196/+50
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.infradead.org/users/dvhart/linux-platform-drivers-x86 Pull x86 platform driver updates from Darren Hart: "Fairly routine update for platform-drivers-x86. Mostly fixes and cleanups, with a significant refactoring of toshiba* drivers. Includes the addition of the dell-rbtn driver. Details: asus-wmi: - fan control dell*: - add Dell airplane mode switch driver ideapad-laptop: - platform rfkill fixes, and regression fix pvpanic: - handle missing _STA correctly toshiba*: - rafactor bluetooth support - haps documentation - driver cleanup other: - Use acpi_video_unregister_backlight instead of acpi_video_unregister in serveral drivers. - Orphan msi-wmi. * tag 'platform-drivers-x86-v4.2-1' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86: (24 commits) MAINTAINERS: Orphan x86 driver msi-wmi ideapad: fix software rfkill setting dell-laptop: Use dell-rbtn instead i8042 filter when possible dell-rbtn: Export notifier for other kernel modules dell-rbtn: Dell Airplane Mode Switch driver samsung-laptop: Use acpi_video_unregister_backlight instead of acpi_video_unregister asus-wmi: Use acpi_video_unregister_backlight instead of acpi_video_unregister apple_gmux: Use acpi_video_unregister_backlight instead of acpi_video_unregister pvpanic: handle missing _STA correctly ideapad_laptop: Lenovo G50-30 fix rfkill reports wireless blocked asus-wmi: add fan control Documentation/ABI: Add file describing the sysfs entries for toshiba_haps toshiba_haps: Make use of DEVICE_ATTR_{RW, WO} macros toshiba_haps: Replace sscanf with kstrtoint toshiba_acpi: Bump driver version to 0.22 toshiba_acpi: Remove TOS_FAILURE check from some functions toshiba_acpi: Comments cleanup toshiba_acpi: Rename hci_{read, write}1 functions toshiba_acpi: Remove no longer needed hci_{read, write}2 functions toshiba_bluetooth: Change BT status message to debug ...
| * toshiba_acpi: Bump driver version to 0.22Azael Avalos2015-05-111-1/+1
| | | | | | | | | | | | | | | | | | This patch simply bumps the driver version to 0.22, as significant changes were made to the driver, such as cleanups, updated events, keymap handling, fixes and the bluetooth rfkill code removal. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
| * toshiba_acpi: Remove TOS_FAILURE check from some functionsAzael Avalos2015-05-111-10/+10
| | | | | | | | | | | | | | | | | | | | This patch removes the check for TOS_FAILURE whenever we are using the tci_raw function call, as that code is only returned by the {hci, sci}_{read, write} functions and never by the tci_raw, and thus making that check irrelevant. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
| * toshiba_acpi: Comments cleanupAzael Avalos2015-05-111-7/+10
| | | | | | | | | | | | | | | | | | | | This patch simply does some misc cleanup to comments, mainly capitalizes some left over comments from a previous clean up and adds some comments at the beginning of some feature function calls, as well as some misc changes to some comments. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
| * toshiba_acpi: Rename hci_{read, write}1 functionsAzael Avalos2015-05-111-22/+22
| | | | | | | | | | | | | | | | 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>
| * toshiba_acpi: Remove no longer needed hci_{read, write}2 functionsAzael Avalos2015-05-111-32/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes the hci_{read, write}2 functions from the driver, and the toshiba_hotkey_event_type_get function was adapted to use the tci_raw function. The hci_write2 function was only used by the bluetooth rfkill code, but since its removal, it was causing build warnings, and the hci_read2 function was only used by the toshiba_hotkey_event_type_get function. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
| * toshiba_acpi: Remove bluetooth rfkill codeAzael Avalos2015-05-061-124/+0
| | | | | | | | | | | | | | | | | | | | | | This patch removes all bluetooth rfkill related code residing in the toshiba_acpi driver. Separate patches will add (and adapt) the code to toshiba_bluetooth (where it belongs). Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* | toshiba-acpi: Port to new backlight interface selection APIHans de Goede2015-06-191-5/+2
|/ | | | | | | | | | Port the backlight selection logic to the new backlight interface selection API. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Azael Avalos <coproscefalo@gmail.com> Acked-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* toshiba_acpi: Do not register vendor backlight when acpi_video bl is availableHans de Goede2015-04-241-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | commit a39f46df33c6 ("toshiba_acpi: Fix regression caused by backlight extra check code") causes the backlight to no longer work on the Toshiba Z30, reverting that commit fixes this but restores the original issue fixed by that commit. Looking at the toshiba_acpi backlight code for a fix for this I noticed that the toshiba code is the only code under platform/x86 which unconditionally registers a vendor acpi backlight interface, without checking for acpi_video backlight support first. This commit adds the necessary checks bringing toshiba_acpi in line with the other drivers, and fixing the Z30 regression without needing to revert the commit causing it. Chances are that there will be some Toshiba models which have a non working acpi-video implementation while the toshiba vendor backlight interface does work, this commit adds an empty dmi_id table where such systems can be added, this is identical to how other drivers handle such systems. BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1206036 BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=86521 Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-and-tested-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* toshiba_acpi: Fix pr_* messages from USB Sleep FunctionsAzael Avalos2015-04-071-8/+8
| | | | | | | | | This patch fixes the messages displayed by the USB Sleep Functions, they were printing wrong messages not associated to the feature currently queried. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* toshiba_acpi: Update and fix USB Sleep and Charge modesAzael Avalos2015-04-071-9/+62
| | | | | | | | | | | This patch fixes the USB Sleep and Charge mode on certain models where the value returned by the BIOS is different, and thus, making this feature not to work for those models. Also, the "Typical" charging mode was added as a supported mode. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* toshiba_acpi: Fix the enabling of the Special FunctionsAzael Avalos2015-03-251-1/+24
| | | | | | | | | | | | | | Some Toshiba laptops with the "Special Functions" feature enabled fail to properly enable such feature unless a specific value is used to enable the hotkey events. This patch adds a new function called "*_enable_special_functions", that simply makes a call to the HCI_HOTKEY_EVENT call, but this time we are using a different parameter to make the "Special Functions" mode work as expected. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* toshiba_acpi: Use the Hotkey Event Type function for keymap choosingAzael Avalos2015-03-251-38/+32
| | | | | | | | | | | | With the previous patch adding support to "Hotkey Event Type", we can now use the type to distinguish which keymap to use. This patch changes the toshiba_acpi_setup_keyboard function to make use of the hotkey event type to choose the correct keymap without the need to use the DMI matching list. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* toshiba_acpi: Add Hotkey Event Type function and definitionsAzael Avalos2015-03-251-0/+25
| | | | | | | | | | | | This patch adds support to query the "Hotkey Event Type" the system supports. There are two main event types (so far), 0x10 and 0x11, with the first being all those laptops that have the old keyboard layout, and the latter all those new laptops with the new keyboard layout. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* toshiba_acpi: Update events in toshiba_acpi_notifyAzael Avalos2015-03-141-6/+23
| | | | | | | | | | | | This patch adds a few more events sent to TOSXXXX devices, some of them are already identified, while some others simply print a message informing the type of event received. Also, a netlink event is generated so that userspace apps, daemons, etc. act accordingly to these events. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* toshiba_acpi: Cleanup GPL headerDarren Hart2015-02-111-9/+2
| | | | | | | | | Remove the Free Software Foundation street address paragraph and reference COPYING. Remove an empty TODO block. Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* toshiba_acpi: Cleanup comment blocks and capitalizationDarren Hart2015-02-111-28/+47
| | | | | | | 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>
* toshiba_acpi: Make use of DEVICE_ATTR_{RO, RW} macrosAzael Avalos2015-02-111-27/+15
| | | | | | | | This patch makes use of the DEVICE_ATTR_{RO, RW} macros to simplify sysfs attributes declarations. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* toshiba_acpi: Drop the toshiba_ prefix from sysfs function namesAzael Avalos2015-02-111-89/+75
| | | | | | | | | | | | This patch removes the toshiba_ prefix from all the sysfs function names and adapted the code according to coding style. Also a few functions were renamed to match the sysfs entry, as this patch is a preparation for the next patch to switch to DEVICE_ATTR_{RO, RW, WO} macros. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* toshiba_acpi: Move sysfs function and struct declarations further downAzael Avalos2015-02-111-138/+58
| | | | | | | | | | | | | | Commit 93f8c16d635e ("toshiba_acpi: Support new keyboard backlight type") moved all the sysfs structs and function declarations further up in order to make use of sysfs_update_group, however, commit 805469053ba9 ("toshiba_acpi: Add keyboard backlight mode change event") made use of that function unnecesary. This patch moves all the sysfs structs and function declarations further down, making the file shorther in lines and more readable. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* toshiba_acpi: Clean file according to coding styleAzael Avalos2015-02-111-15/+23
| | | | | | | | | This patch simply cleans the the driver out of 2 errors and 17 warnings according to "checkpatch -f", no functionality was changed, simply a cleanup. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* toshiba_acpi: Bump version number to 0.21Azael Avalos2015-02-111-2/+2
| | | | | | | | | | Several new features were added on previous patches, so lets bump up the driver version. And also, update the copyright year. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* toshiba_acpi: Add support to enable/disable USB 3Azael Avalos2015-02-111-0/+103
| | | | | | | | | | | | | | Toshiba laptops that come with USB 3 ports have a feature that lets them disable USB 3 functionality and act as a regular USB 2 port, and thus, saving power. This patch adds support to that feature, by creating a sysfs entry named "usb_three", acceptig only two parameters, 0 to disable the USB 3 (acting as a USB 2) and 1 to enable it, however, a reboot is needed everytime this is toggled. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* toshiba_acpi: Add support for Panel Power ONAzael Avalos2015-02-111-0/+100
| | | | | | | | | | | | | Toshiba laptops come with a feature called "Panel Open - Power ON", which makes the laptop turn on whenever the LID is opened. This patch adds support for such feature, by creating a sysfs entry named "panel_power_on", accepting only two values, 0 to disable and 1 to enable such feature, however, a reboot is needed on every mode change. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* toshiba_acpi: Add support for Keyboard functions modeAzael Avalos2015-02-111-0/+100
| | | | | | | | | | | | | | | | | | | | | | Recent Toshiba laptops that come with the new keyboard layout have the Special Functions (hotkeys) enabled by default, which, in order to access the F{1-12} keys, you need to press the FN-F{1-12} key to access such key. This patch adds support to toggle the Keyboard Functions operation mode by creating the sysfs entry "kbd_functions_keys", accepting only two parameters, 0 to set the "Normal Operation" mode and 1 to set the "Special Functions" mode, however, everytime the mode is toggled, a restart is needed. In the "Normal Operation" mode, the F{1-12} keys are as usual and the hotkeys are accessed via FN-F{1-12}. In the "Special Functions" mode, the F{1-12} keys trigger the hotkey and the F{1-12} keys are accessed via FN-F{1-12}. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* toshiba_acpi: Add fan entry to sysfsAzael Avalos2015-02-111-1/+50
| | | | | | | | This patch adds a fan entry to sysfs, enabling the user to get and set the fan status. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* toshiba_acpi: Add version entry to sysfsAzael Avalos2015-02-111-0/+10
| | | | | | | | This patch adds a new entry to the sysfs, showing the version of the driver. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* toshiba_acpi: Make toshiba_eco_mode_available more robustAzael Avalos2015-02-091-5/+22
| | | | | | | | | | | | | | | | | | | | | | Some Toshiba laptops do not come with the ECO led installed, however, the driver is registering support for it when it should not. This patch makes the toshiba_eco_mode_available function more robust in detecting ECO led capabilities, not registering the led on laptops that do not support it and registering the led when it really does. The ECO led function now returns 0x8e00 (Not Installed) by querying with in[3] = 0, whenever theres no physical LED installed, and returning 0x8300 (Input Data Error) when it is, however, there are some BIOSes that have stub function calls not returning anything and and the LED device was being registered too, hence the change of the default return value from 1 to 0. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Minor comment update, fixed a whitespace error, s/truly/actual/. Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* toshiba_acpi: Add a check for TOS_NOT_SUPPORTED in the sci_open functionAzael Avalos2015-01-281-0/+13
| | | | | | | | | | | | | | | | | | | This was "toshiba_acpi: Change sci_open function return value" Some Toshiba laptops have "poorly implemented" SCI calls on their BIOSes and are not checking for sci_{open, close} calls, therefore, the sci_open function is failing and making some of the supported features unavailable (kbd backlight, touchpad, illumination, etc.). This patch checks whether we receive TOS_NOT_SUPPORTED and returns 1, making the supported features work on such laptops. In the case that some laptops really do not support the SCI, all the SCI dependent functions check for TOS_NOT_SUPPORTED, and thus, not registering support for the queried feature. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* toshiba_acpi: Add support for USB Sleep and MusicAzael Avalos2015-01-231-0/+97
| | | | | | | | | | | | | | Newer Toshiba laptops now come with a feature called USB Sleep and Music, where the laptop speakers remain powered and the line-in jack is used to connect an external device to use the laptop speakers when the computer is asleep or turned off. This patchs adds support to such feature, by creating a sysfs entry named "usb_sleep_music", accepting only two values, 0 to disable and 1 to enable. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* toshiba_acpi: Add support for USB Rapid ChargeAzael Avalos2015-01-231-0/+107
| | | | | | | | | | | | | Newer Toshiba laptops equipped with USB 3.0 ports now have the functionality of rapid charging devices connected to their USB hubs. This patch adds support to use such feature by creating a sysfs entry named "usb_rapid_charge", accepting only two values, 0 to disable and 1 to enable, however, the machine needs a restart everytime the function is toggled. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* toshiba_acpi: Add support for USB Sleep functions under batteryAzael Avalos2015-01-231-0/+133
| | | | | | | | | | | | | | | | | Toshiba laptops supporting USB Sleep and Charge also come with a feature called "USB functions under battery", which what it does when enabled, is allows the USB Sleep functions when the computer is under battery power. This patch adds support to that function, creating a sysfs entry named "sleep_functions_on_battery", accepting values from 0-100, where zero disables the function and 1-100 sets the battery level at which point the USB Sleep functions will be disabled, and printing the current state of the functon and also the battery level currently set. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* toshiba_acpi: Add support for USB Sleep and Charge functionAzael Avalos2015-01-231-0/+118
| | | | | | | | | | | | | | | | | | | | Newer Toshiba models now come with a feature called Sleep and Charge, where the computer USB ports remain powered when the computer is asleep or turned off. This patch adds support to such feature, creating a sysfs entry called "usb_sleep_charge" to set the desired charging mode or to disable it. The sysfs entry accepts three parameters, 0, 1 and 2, beign disabled, alternate and auto respectively. The auto mode stands for USB conformant devices (which most are), and the alternate mode stands for those non USB conformant devices that require more power. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
* toshiba_acpi: Add keyboard backlight mode change eventAzael Avalos2014-12-031-6/+8
| | | | | | | | | | | | A previous patch added support to handle more events. This patch adds support to update the sysfs group whenever we receive a 0x92 event, which indicates a change in the keyboard backlight mode, removing the update group code from toshiba_kbd_bl_mode_store, as it is no longer needed there. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>