summaryrefslogtreecommitdiff
path: root/drivers/platform/x86/toshiba_acpi.c
AgeCommit message (Collapse)AuthorFilesLines
2014-10-07toshiba_acpi: Adapt kbd_bl_timeout_store to the new kbd typeAzael Avalos1-9/+29
With the introduction of the new keyboard backlight implementation, the *_timeout_store function is broken, as it only supports the first kbd_type. This patch adapts such function for the new kbd_type, as well as converts from using sscanf to kstrtoint. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2014-10-01toshiba_acpi: Change HCI/SCI functions return code typeAzael Avalos1-67/+62
Currently the HCI/SCI read/write functions are returning the status of the ACPI call and also assigning the returned value of the HCI/SCI function, however, only the HCI/SCI status is being checked. This patch changes such functions, returning the value of the HCI/SCI function instead of the ACPI call status, eliminating one parameter, and returning something useful that indeed is being checked. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2014-10-01toshiba_acpi: Unify return codes prefix from HCI/SCI to TOSAzael Avalos1-71/+72
The return codes are split in between HCI/SCI prefixes, but they are shared (used) by both interfaces, mixing hci_read/write calls with SCI_* return codes, and sci_read/write calls with HCI_* ones. This patch changes the prefix of the return codes definitions, dropping the HCI/SCI naming and instead replacing it with TOS (for TOShiba). Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2014-10-01toshiba_acpi: Rename hci_raw to tci_rawAzael Avalos1-59/+60
The function name hci_raw was used before to reflect a raw (read/write) call to Toshiba's Hardware Configuration Interface (HCI), however, since the introduction of the System Configuration Interface (SCI), that "name" no longer applies. This patch changes the name of that function to tci_raw (for Toshiba Configuration Interface), and change the comments about it. Also, the HCI_WORDS definition was changed to TCI_RAW, to better reflect that we're no longer using pure HCI calls, but a combination of HCI and SCI, which form part of the Toshiba Configuration Interface. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2014-09-18toshiba_acpi: Support new keyboard backlight typeAzael Avalos1-32/+156
Newer Toshiba models now come with a new (and different) keyboard backlight implementation with three modes of operation: TIMER, ON and OFF, and the LED is now controlled internally by the firmware. This patch adds support for that type of backlight, changing the existing code to accomodate the new implementation. The timeout value range is now 1-60 seconds, and the accepted modes are now: 1 (FN-Z), 2 (AUTO or TIMER), 8 (ON) and 10 (OFF), this adds two new entries kbd_type and available_kbd_modes, the first shows the keyboard type and the latter shows the supported modes depending on the keyboard type. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2014-09-18toshiba_acpi: Change touchpad store to check for invalid valuesAzael Avalos1-4/+10
The function toshiba_touchpad_store is not checking for invalid values and simply returns silently. This patch checks for invalid values and returns accordingly. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2014-09-18toshiba_acpi: Fix illumination not available on certain modelsAzael Avalos1-1/+1
Some Toshiba models with illumination support set a different value on the returned codes, thus not allowing the illumination LED to be registered, where it should be. This patch removes a check from toshiba_illumination_available function to allow such models to register the illumination LED. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2014-09-18toshiba_acpi: Additional hotkey scancodesAzael Avalos1-1/+6
Appart from reporting hotkeys, the INFO method is used as a system wide event notifier for hardware or software changes. This patch adds additional "events" to the keymap list, ignored by now, until we find them a good use. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2014-09-03toshiba_acpi: fix and cleanup toshiba_kbd_bl_mode_store()Dan Carpenter1-6/+12
The current code just returns -EINVAL because mode can't be equal to both 1 and 2. Also this function is messy so I have cleaned it up: 1) Remove initializers like "int time = -1". Initializing variables to garbage values turns off GCC's uninitialized variable warnings so it can lead to bugs. 2) Use kstrtoint() instead of sscanf(). 3) Use SCI_KBD_MODE_FNZ and SCI_KBD_MODE_AUTO instead of magic numbers 1 and 2. 4) Don't check for "mode == -1" because that can't happen. 5) Preserve the error code from toshiba_kbd_illum_status_set(). Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2014-09-03platform/x86: toshiba: re-enable acpi hotkeys after suspend to diskBenjamin Tissoires1-1/+8
On the Toshiba Tecra Z40, after a suspend-to-disk, some FN hotkeys driven by toshiba_acpi are not functional. Calling the ACPI object ENAB on resume makes them back alive. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Acked-by: Matthew Garrett <matthew.garrett@nebula.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2014-08-20Revert "platform/x86/toshiba-apci.c possible bad if test?"Matthew Garrett1-1/+1
This reverts commit bdc3ae7221213963f438faeaa69c8b4a2195f491. Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2014-08-16toshiba_acpi: Add Qosmio X75-A to the alt keymap dmi listAzael Avalos1-0/+7
The Toshiba Qosmio X75-A series models also come with the new keymap layout. This patch adds this model to the alt_keymap_dmi list, along with an extra key found on these models. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2014-08-16toshiba_acpi: Add extra check to backlight codeAzael Avalos1-4/+17
Some Toshiba models (most notably Qosmios) come with an incomplete backlight method where the AML code doesn't check for write or read commands and always returns HCI_SUCCESS and the actual brightness (and in some cases the max brightness), thus allowing the backlight interface to be registered without write support. This patch changes the set_lcd_brightness function, checking the returned values for values greater than zero to avoid registering a broken backlight interface. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2014-08-16platform/x86/toshiba-apci.c possible bad if test?Nick1-1/+1
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2014-06-10toshiba_acpi: Add alternative keymap support for Satellite M840Takashi Iwai1-1/+29
Toshiba Satellite M840 laptop has a complete different keymap although it's bound with the same ACPI ID "TOS1900". This patch provides an alternative keymap specific to this machine by identifying via DMI matching. The keymap table doesn't fill all entries that were used before since some keys aren't found on this machine at all. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=69761 Bugzilla: https://bugzilla.novell.com/show_bug.cgi?id=812209 Reported-and-tested-by: Federico Vecchiarelli <fedev@gmx.net> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2014-04-06toshiba_acpi: Fix whitespaceMatthew Garrett1-14/+14
Tidy up whitespace introduced by the previous patchset Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2014-04-06toshiba_acpi: Update version and copyright infoAzael Avalos1-1/+2
Given that some new features were added to the driver, bump its version to 0.20 and add myself to the copyright list for these new features that were added. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2014-04-06toshiba_acpi: Add accelerometer supportAzael Avalos1-0/+80
Recent Toshiba laptops now come equiped with a built in accelerometer (TOS620A) device, but such device does not expose the axes information, however, HCI calls 0x006d and 0x00a6 can be used to query such info. This patch adds support to read the axes values by exposing them through the _position_ sysfs file. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2014-04-06toshiba_acpi: Add ECO mode led supportAzael Avalos1-0/+66
Newer Toshiba laptops now come with a feature called ECO Mode, where the system is put in low power consupmtion state and a green (world shaped with leaves) icon illuminates indicating that the system is in such power state. This patch adds support to turn on/off the ECO led by creating and registering the toshiba::eco_mode led. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2014-04-06toshiba_acpi: Add touchpad enable/disable support-Azael Avalos1-0/+81
Toshiba laptops have two ways of letting userspace know the touchpad has changed state, one with a button on top of the touchpad that simply emmits scancodes whenever enabled/disabled, and another one by pressing Fn-F9 (touchpad toggle) hotkey. This patch adds support to enable/disable the touchpad by exposing the _touchpad_ file in sysfs that simply makes a call to a SCI register, imitating what Toshiba provided software does on Windows. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2014-04-06toshiba_acpi: Add keyboard backlight supportAzael Avalos1-0/+240
Toshiba laptops equiped with an illuminated keyboard can operate in two different modes: Auto and FN-Z. The Auto mode turns on the led on keystrokes and automatically turns it off after some (configurable) time the last key was pressed. The FN-Z mode is used to toggle the keyboard led on/off by userspace. This patch adds support to set the desired KBD mode and timeout via sysfs, creates and registers toshiba::kbd_backlight led device whenever the mode is set to FN-Z. The acceptable values for mode are: 1 (Auto) and 2 (Fn-Z) The time values range are: 1-60 seconds Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2014-04-06toshiba_acpi: Adapt Illumination code to use SCIAzael Avalos1-60/+34
Change the toshiba_illumination_* code to use the newly introduced SCI functions, making the code more robust in detecting Illumination capabilities properly, since it was only opening the SCI and the return value was never checked for errors or actual Illumination support. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2014-04-06toshiba_acpi: Add System Configuration InterfaceAzael Avalos1-0/+79
SCI stands for System Configuration Interface, which aim is to conceal differences in hardware between different models. This patch introduces four new calls: sci_open, sci_close, sci_read and sci_write, along with its definitions and return codes which will be used by later patches. More information about the SCI can be found at Jonathan Buzzard's website [1]. [1] http://www.buzzard.me.uk/toshiba/docs.html Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2014-01-30Merge branch 'for_linus' of git://cavan.codon.org.uk/platform-drivers-x86Linus Torvalds1-0/+1
Pull x86 platform drivers update from Matthew Garrett: "Nothing amazingly special here. Some cleanups, a new driver to support a single button on some new HPs, a tiny amount of hardware enablement" * 'for_linus' of git://cavan.codon.org.uk/platform-drivers-x86: ipc: add intel-mid's pci id macros hp-wireless: new driver for hp wireless button for Windows 8 toshiba_acpi: Support RFKILL hotkey scancode hp_accel: Add a new PnP ID HPQ6007 for new HP laptops sony-laptop: remove unnecessary assigment of len fujitsu-laptop: fix error return code dell-laptop: Only install the i8042 filter when rfkill is active X86 platform: New BayTrail IOSF-SB MBI driver drivers: platform: Include appropriate header file in mxm-wmi.c drivers: platform: Mark functions as static in hp_accel.c dell-laptop: rkill whitelist Precision models ipc: simplify platform data approach asus-wmi: Convert to use devm_hwmon_device_register_with_groups compal-laptop: Use devm_hwmon_device_register_with_groups compal-laptop: Replace SENSOR_DEVICE_ATTR with DEVICE_ATTR eeepc-laptop: Convert to use devm_hwmon_device_register_with_groups compal-laptop: Use devm_kzalloc to allocate local data structure dell-laptop: fix to return error code in dell_send_intensity()
2014-01-21toshiba_acpi: Support RFKILL hotkey scancodeUnai Uribarri1-0/+1
This scancode is used in new 2013 models like Satellite P75-A7200. Signed-off-by: Unai Uribarri <unaiur@gmail.com> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2014-01-13Merge branch 'acpi-cleanup'Rafael J. Wysocki1-3/+1
* acpi-cleanup: (22 commits) ACPI / tables: Return proper error codes from acpi_table_parse() and fix comment. ACPI / tables: Check if id is NULL in acpi_table_parse() ACPI / proc: Include appropriate header file in proc.c ACPI / EC: Remove unused functions and add prototype declaration in internal.h ACPI / dock: Include appropriate header file in dock.c ACPI / PCI: Include appropriate header file in pci_link.c ACPI / PCI: Include appropriate header file in pci_slot.c ACPI / EC: Mark the function acpi_ec_add_debugfs() as static in ec_sys.c ACPI / NVS: Include appropriate header file in nvs.c ACPI / OSL: Mark the function acpi_table_checksum() as static ACPI / processor: initialize a variable to silence compiler warning ACPI / processor: use ACPI_COMPANION() to get ACPI device ACPI: correct minor typos ACPI / sleep: Drop redundant acpi_disabled check ACPI / dock: Drop redundant acpi_disabled check ACPI / table: Replace '1' with specific error return values ACPI: remove trailing whitespace ACPI / IBFT: Fix incorrect <acpi/acpi.h> inclusion in iSCSI boot firmware module ACPI / i915: Fix incorrect <acpi/acpi.h> inclusions via <linux/acpi_io.h> SFI / ACPI: Fix warnings reported during builds with W=1 ... Conflicts: drivers/acpi/nvs.c drivers/hwmon/asus_atk0110.c
2013-12-07ACPI: Clean up inclusions of ACPI header filesLv Zheng1-3/+1
Replace direct inclusions of <acpi/acpi.h>, <acpi/acpi_bus.h> and <acpi/acpi_drivers.h>, which are incorrect, with <linux/acpi.h> inclusions and remove some inclusions of those files that aren't necessary. First of all, <acpi/acpi.h>, <acpi/acpi_bus.h> and <acpi/acpi_drivers.h> should not be included directly from any files that are built for CONFIG_ACPI unset, because that generally leads to build warnings about undefined symbols in !CONFIG_ACPI builds. For CONFIG_ACPI set, <linux/acpi.h> includes those files and for CONFIG_ACPI unset it provides stub ACPI symbols to be used in that case. Second, there are ordering dependencies between those files that always have to be met. Namely, it is required that <acpi/acpi_bus.h> be included prior to <acpi/acpi_drivers.h> so that the acpi_pci_root declarations the latter depends on are always there. And <acpi/acpi.h> which provides basic ACPICA type declarations should always be included prior to any other ACPI headers in CONFIG_ACPI builds. That also is taken care of including <linux/acpi.h> as appropriate. Signed-off-by: Lv Zheng <lv.zheng@intel.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Matthew Garrett <mjg59@srcf.ucam.org> Cc: Tony Luck <tony.luck@intel.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Acked-by: Bjorn Helgaas <bhelgaas@google.com> (drivers/pci stuff) Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> (Xen stuff) Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2013-11-21platform:x86: Remove OOM message after input_allocate_deviceJoe Perches1-3/+1
Emitting an OOM message isn't necessary after input_allocate_device as there's a generic OOM and a dump_stack already done. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-09-24toshiba_acpi: convert acpi_evaluate_object() to acpi_evaluate_integer()Zhang Rui1-9/+5
acpi_evaluate_integer() is an ACPI API introduced to evaluate an ACPI control method that is known to have an integer return value. This API can simplify the code because the calling function does not need to use the specified acpi_buffer structure required by acpi_evaluate_object(); Convert acpi_evaluate_object() to acpi_evaluate_integer() in drivers/platform/x86/toshiba_acpi.c in this patch. Signed-off-by: Zhang Rui <rui.zhang@intel.com> CC: Matthew Garrett <matthew.garrett@nebula.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2013-09-24toshiba_acpi: convert acpi_get_handle() to acpi_has_method()Zhang Rui1-15/+6
acpi_has_method() is a new ACPI API introduced to check the existence of an ACPI control method. It can be used to replace acpi_get_handle() in the case that 1. the calling function doesn't need the ACPI handle of the control method. and 2. the calling function doesn't care the reason why the method is unavailable. Convert acpi_get_handle() to acpi_has_method() in drivers/platform/x86/toshiba_acpi.c in this patch. Signed-off-by: Zhang Rui <rui.zhang@intel.com> CC: Matthew Garrett <matthew.garrett@nebula.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2013-09-24toshiba_acpi: convert acpi_evaluate_object() to acpi_execute_simple_method()Zhang Rui1-8/+1
acpi_execute_simple_method() is a new ACPI API introduced to invoke an ACPI control method that has single integer parameter and no return value. Convert acpi_evaluate_object() to acpi_execute_simple_method() in drivers/platform/x86/toshiba_acpi.c Signed-off-by: Zhang Rui <rui.zhang@intel.com> CC: Matthew Garrett <matthew.garrett@nebula.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2013-04-09procfs: new helper - PDE_DATA(inode)Al Viro1-9/+9
The only part of proc_dir_entry the code outside of fs/proc really cares about is PDE(inode)->data. Provide a helper for that; static inline for now, eventually will be moved to fs/proc, along with the knowledge of struct proc_dir_entry layout. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-02-27Merge branch 'for-linus' of ↵Linus Torvalds1-4/+4
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull vfs pile (part one) from Al Viro: "Assorted stuff - cleaning namei.c up a bit, fixing ->d_name/->d_parent locking violations, etc. The most visible changes here are death of FS_REVAL_DOT (replaced with "has ->d_weak_revalidate()") and a new helper getting from struct file to inode. Some bits of preparation to xattr method interface changes. Misc patches by various people sent this cycle *and* ocfs2 fixes from several cycles ago that should've been upstream right then. PS: the next vfs pile will be xattr stuff." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (46 commits) saner proc_get_inode() calling conventions proc: avoid extra pde_put() in proc_fill_super() fs: change return values from -EACCES to -EPERM fs/exec.c: make bprm_mm_init() static ocfs2/dlm: use GFP_ATOMIC inside a spin_lock ocfs2: fix possible use-after-free with AIO ocfs2: Fix oops in ocfs2_fast_symlink_readpage() code path get_empty_filp()/alloc_file() leave both ->f_pos and ->f_version zero target: writev() on single-element vector is pointless export kernel_write(), convert open-coded instances fs: encode_fh: return FILEID_INVALID if invalid fid_type kill f_vfsmnt vfs: kill FS_REVAL_DOT by adding a d_weak_revalidate dentry op nfsd: handle vfs_getattr errors in acl protocol switch vfs_getattr() to struct path default SET_PERSONALITY() in linux/elf.h ceph: prepopulate inodes only when request is aborted d_hash_and_lookup(): export, switch open-coded instances 9p: switch v9fs_set_create_acl() to inode+fid, do it before d_instantiate() 9p: split dropping the acls from v9fs_set_create_acl() ...
2013-02-23new helper: file_inode(file)Al Viro1-4/+4
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-01-26ACPI: Remove useless type argument of driver .remove() operationRafael J. Wysocki1-2/+2
The second argument of ACPI driver .remove() operation is only used by the ACPI processor driver and the value passed to that driver through it is always available from the given struct acpi_device object's removal_type field. For this reason, the second ACPI driver .remove() argument is in fact useless, so drop it. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Jiang Liu <jiang.liu@huawei.com> Acked-by: Toshi Kani <toshi.kani@hp.com> Acked-by: Yinghai Lu <yinghai@kernel.org>
2013-01-04Drivers: platform: x86: remove __dev* attributes.Greg Kroah-Hartman1-7/+6
CONFIG_HOTPLUG is going away as an option. As a result, the __dev* markings need to be removed. This change removes the use of __devinit, __devexit_p, __devinitdata, __devinitconst, and __devexit from these drivers. Based on patches originally written by Bill Pemberton, but redone by me in order to handle some of the coding style issues better, by hand. Cc: Bill Pemberton <wfp5p@virginia.edu> Cc: Joey Lee <jlee@novell.com> Cc: Matthew Garrett <mjg@redhat.com> Cc: Peter Feuerer <peter@piie.net> Cc: Corentin Chary <corentin.chary@gmail.com> Cc: Cezary Jackiewicz <cezary.jackiewicz@gmail.com> Cc: Robert Gerlach <khnz@gmx.de> Cc: Ike Panhc <ike.pan@canonical.com> Cc: Henrique de Moraes Holschuh <ibm-acpi@hmh.eng.br> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-08-10platform / x86 / PM: Fix unused function warnings for CONFIG_PM_SLEEPRafael J. Wysocki1-0/+2
According to compiler warnings, quite some suspend/resume functions in platform x86 drivers are not used for CONFIG_PM_SLEEP unset, so add #ifdefs to prevent them from being built in that case. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2012-07-01toshiba_acpi: Use struct dev_pm_ops for power managementRafael J. Wysocki1-6/+8
Make the toshiba_acpi driver define its PM callbacks through a struct dev_pm_ops object rather than by using legacy PM hooks in struct acpi_device_ops. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2012-07-01ACPI / PM: Drop pm_message_t argument from device suspend callbackRafael J. Wysocki1-2/+1
None of the drivers implementing the ACPI device suspend callback uses the pm_message_t argument of it, so this argument may be dropped entirely from that callback. This will simplify switching the ACPI bus type to PM handling based on struct dev_pm_ops. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2012-06-01toshiba_acpi: Fix mis-mergeMatthew Garrett1-1/+1
I managed to screw up the various backlight changes and ended up memsetting the props structure after it had already been populated. This should fix it. Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-05-31toshiba_acpi: Add support for transflective LCDAkio Idehara1-4/+57
Some Toshiba laptops have the transflective LCD and toshset can control its backlight state. I brought this feature to the mainline. To support transflective LCD, it's implemented by adding an extra level to the backlight and having 0 change to transflective mode. It was tested on a Toshiba Portege R500. Signed-off-by: Akio Idehara <zbe64533@gmail.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-05-31toshiba_acpi: Only register backlight device when interface is read/writeSeth Forshee1-24/+56
Currently the backlight device is registered unconditionally, but many (probably most) Toshibas either don't support HCI_LCD_BRIGHTNESS or only support reading from it. This patch adds a test of HCI_LCD_BRIGHTNESS during initialization and only registers the backlight device if this interface supports both reads and writes. Cc: Akio Idehara <zbe64533@gmail.com> Signed-off-by: Seth Forshee <seth.forshee@canonical.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-05-30backlight: initialize struct backlight_properties properlyCorentin Chary1-0/+1
In all these files, the .power field was never correctly initialized. Signed-off-by: Corentin Chary <corentin.chary@gmail.com> Cc: Jingoo Han <jg1.han@samsung.com> Cc: Dave Airlie <airlied@gmail.com> Cc: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-03-22toshiba_acpi: Refuse to load on machines with buggy INFO implementationsSeth Forshee1-0/+10
Several Satellite models have a buggy implementation of the INFO method that causes ACPI exceptions when executed: ACPI Error: Result stack is empty! State=ffff88012d70f800 (20110413/dswstate-98) ACPI Exception: AE_AML_NO_RETURN_VALUE, Missing or null operand (20110413/dsutils-646) ACPI Exception: AE_AML_NO_RETURN_VALUE, While creating Arg 0 (20110413/dsutils-763) ACPI Error: Method parse/execution failed [\_SB_.VALZ.GETE] (Node ffff880131175eb0), AE_AML_NO_RETURN_VALUE (20110413/psparse-536) ACPI Error: Method parse/execution failed [\_SB_.VALZ.INFO] (Node ffff880131175ed8), AE_AML_NO_RETURN_VALUE (20110413/psparse-536) toshiba_acpi: ACPI INFO method execution failed toshiba_acpi: Failed to query hotkey event All known machines with this implementation also have a WMI interface with event GUID 59142400-C6A3-40FA-BADB-8A2652834100 which is not seen on any other models. Refuse to load toshiba_acpi on machines with this guid. Signed-off-by: Seth Forshee <seth.forshee@canonical.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-03-22toshiba_acpi: Support additional hotkey scancodesAzael Avalos1-1/+4
These scancodes are used by many of the models now supported with the addition of TOS1900 device support. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Seth Forshee <seth.forshee@canonical.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-03-22toshiba_acpi: Support alternate hotkey interfacesSeth Forshee1-36/+195
There are two types of problems that prevent hotkeys from working on many of the machines supported by toshiba_acpi. The first of these is the lack of a functioning SCI for hotkey events. For these machines it is possible to filter the Fn keypresses from the keyboard and generate a notification by executing the ACPI NTFY method. The second problem is a lack of support for HCI_SYSTEM_EVENT, which is used for reading the hotkey scancodes. On these machines the scancodes can be read by executing the ACPI NTFY method. This patch fixes both problems by installing an i8042 filter when the NTFY method is present to generate notifications and by detecting which of INFO or HCI_SYSTEM_EVENT is supported for reading scancodes. If neither method of reading scancodes is supported, the hotkey input device is not registered. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Seth Forshee <seth.forshee@canonical.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-03-20toshiba_acpi: make one-bit bitfields unsignedDan Carpenter1-4/+4
This doesn't change how the code works, but it silences a Sparse complaint: drivers/platform/x86/toshiba_acpi.c:121:37: error: dubious one-bit signed bitfield Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-12-05toshiba_acpi: Fix machines that don't support HCI_SYSTEM_EVENTSeth Forshee1-5/+16
The Satellite C670-10V generates notifications for hotkeys but does not support HCI_SYSTEM_EVENT. As a result when a hotkey is pressed it gets stuck in an infinite loop in toshiba_acpi_notify. To fix this, detect whether or not HCI_SYSTEM_EVENT is supported up-front and don't try to read system events if it isn't supported. In addition, limit the number of retries when reading HCI_SYSTEM_EVENT fails so that this loop cannot run unbounded. Signed-off-by: Seth Forshee <seth.forshee@canonical.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24toshiba_acpi: Initialize brightness in backlight deviceSeth Forshee1-0/+1
Signed-off-by: Seth Forshee <seth.forshee@canonical.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24toshiba_acpi: Don't add devices for unsupported featuresSeth Forshee1-35/+67
Test for features up-front to determine whether or not they are supported, and avoid creating devices and proc files for unsupported features. Signed-off-by: Seth Forshee <seth.forshee@canonical.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>