summaryrefslogtreecommitdiff
path: root/drivers/platform/x86/sony-laptop.c
AgeCommit message (Collapse)AuthorFilesLines
2013-11-21sony-laptop: warn on multiple KBD backlight handlesMattia Dongili1-4/+12
Some BIOS versions/Vaio models apparently ship with two nearly identical functions to handle backlight related controls. The only difference seems to be: If (LEqual (BUF1, 0x40)) { Store (0x40, P80H) Store (BUF2, Local0) - And (Local0, One, Local0) + And (Local0, 0x03, Local0) Store (Local0, ^^H_EC.KLPC) } Avoid erroring out on initialization and messing things up on cleanup for now since we never call into these methods with anything different than 1 or 0. This issue was found on a Sony VPCSE1V9E/BIOS R2087H4. Cc: Marco Krüger <krgsch@gmail.com> Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-10-28Merge branch 'acpi-cleanup'Rafael J. Wysocki1-19/+9
* acpi-cleanup: (34 commits) ACPI / proc: Remove alarm proc file ACPI: Remove CONFIG_ACPI_PROCFS_POWER and cm_sbsc.c ACPI / SBS: Remove SBS's proc directory ACPI / Battery: Remove battery's proc directory ACP / fan: trivial style cleanup ACPI / processor: remove superfluous pr == NULL checks ACPI / mm: use NUMA_NO_NODE toshiba_acpi: convert acpi_evaluate_object() to acpi_evaluate_integer() intel-smartconnect: convert acpi_evaluate_object() to acpi_evaluate_integer() intel-rst: convert acpi_evaluate_object() to acpi_evaluate_integer() fujitsu-laptop: convert acpi_evaluate_object() to acpi_evaluate_integer() i2c-hid: convert acpi_evaluate_object() to acpi_evaluate_integer() ACPI: dock: convert acpi_evaluate_object() to acpi_evaluate_integer() acpi_processor: convert acpi_evaluate_object() to acpi_evaluate_integer() pnpacpi: convert acpi_get_handle() to acpi_has_method() wmi: convert acpi_get_handle() to acpi_has_method() toshiba_acpi: convert acpi_get_handle() to acpi_has_method() sony-laptop: convert acpi_get_handle() to acpi_has_method() intel_menlow: convert acpi_get_handle() to acpi_has_method() fujitsu-laptop: convert acpi_get_handle() to acpi_has_method() ...
2013-10-22sony-laptop: don't change keyboard backlight settingsMattia Dongili1-17/+9
Do not touch keyboard backlight unless explicitly passed a module parameter. In this way we won't make wrong assumptions about what are good default values since they actually are different from model to model. The only side effect is that we won't know what is the current value until set via the sysfs attributes. Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-09-24sony-laptop: convert acpi_get_handle() to acpi_has_method()Zhang Rui1-19/+9
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/sony-laptop.c in this patch. Signed-off-by: Zhang Rui <rui.zhang@intel.com> CC: Matthew Garrett <matthew.garrett@nebula.com> CC: Mattia Dongili <malattia@linux.it> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2013-08-27Merge branch 'acpi-assorted'Rafael J. Wysocki1-4/+0
* acpi-assorted: ACPI / osl: Kill macro INVALID_TABLE(). earlycpio.c: Fix the confusing comment of find_cpio_data(). ACPI / x86: Print Hot-Pluggable Field in SRAT. ACPI / thermal: Use THERMAL_TRIPS_NONE macro to replace number ACPI / thermal: Remove unused macros in the driver/acpi/thermal.c ACPI / thermal: Remove the unused lock of struct acpi_thermal ACPI / osl: Fix osi_setup_entries[] __initdata attribute location ACPI / numa: Fix __init attribute location in slit_valid() ACPI / dock: Fix __init attribute location in find_dock_and_bay() ACPI / Sleep: Fix incorrect placement of __initdata ACPI / processor: Fix incorrect placement of __initdata ACPI / EC: Fix incorrect placement of __initdata ACPI / scan: Drop unnecessary label from acpi_create_platform_device() ACPI: Move acpi_bus_get_device() from bus.c to scan.c ACPI / scan: Allow platform device creation without any IO resources ACPI: Cleanup sparse warning on acpi_os_initialize1() platform / thinkpad: Remove deprecated hotkey_report_mode parameter ACPI: Remove the old /proc/acpi/event interface
2013-08-18sony-laptop: Fix reporting of gfx_switch_statusDaniel Serpell1-1/+4
Signed-off-by: Daniel Serpell <daniel.serpell@gmail.com> Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-08-18sony-laptop: return a negative error code in sonypi_compat_init()Wei Yongjun1-1/+2
Return -1 in the error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-07-15ACPI: Remove the old /proc/acpi/event interfaceThomas Renninger1-4/+0
It is quite some time that this one has been deprecated. Get rid of it. Should some really important user be overseen, it may be reverted and the userspace program worked on first, but it is time to do something to get rid of this old stuff... Signed-off-by: Thomas Renninger <trenn@suse.de> Acked-by: Matthew Garrett <matthew.garrett@nebula.com> Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2013-05-09sony-laptop: SVS151290S kbd backlight and gfx switch supportArthur Wirski1-1/+19
SVS151290S series uses handle 0x0163 for keyboard backlight and 0x015B for the graphics switch. Signed-off-by: Arthur Wirski <awirski@gmail.com> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-03-24ACPI: Set length even for TYPE_END_TAG acpi resourceYinghai Lu1-1/+2
Found with a network device in QEMU/KVM guest not working anymore. Bisected to commit c13085e5 ACPICA: Resource Mgr: Prevent infinite loops in resource walks That commit will check acpi_resource length strictly which causes acpi_set_current_resources to return failure and IRQ for PCI devices is not set properly. Set length for all those TYPE_END_TAG acpi_resources. [rjw: Changelog] Bisected-by: Yinghai Lu <yinghai@kernel.org> Signed-off-by: Yinghai Lu <yinghai@kernel.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2013-03-03Merge branch 'for_linus' of git://cavan.codon.org.uk/platform-drivers-x86Linus Torvalds1-11/+134
Pull x86 platform driver updates from Matthew Garrett: "Mostly relatively small updates, along with some hardware enablement for Sony hardware and a pile of updates to Google's Chromebook driver" * 'for_linus' of git://cavan.codon.org.uk/platform-drivers-x86: (49 commits) ideapad-laptop: Depend on BACKLIGHT_CLASS_DEVICE instead of selecting it ideapad: depends on backlight subsystem and update comment Platform: x86: chromeos_laptop - add i915 gmbuses to adapter names Platform: x86: chromeos_laptop - Add isl light sensor for Pixel Platform: x86: chromeos_laptop - Add a more general add_i2c_device Platform: x86: chromeos_laptop - Add Pixel Touchscreen Platform: x86: chromeos_laptop - Add support for probing devices Platform: x86: chromeos_laptop - Add Pixel Trackpad hp-wmi: fix handling of platform device sony-laptop: leak in error handling sony_nc_lid_resume_setup() hp-wmi: Add support for SMBus hotkeys asus-wmi: Fix unused function build warning acer-wmi: avoid the warning of 'devices' may be used uninitialized drivers/platform/x86/thinkpad_acpi.c: Handle HKEY event 0x6040 Platform: x86: chromeos_laptop - Add HP Pavilion 14 Platform: x86: chromeos_laptop - Add Taos tsl2583 device Platform: x86: chromeos_laptop - Add Taos tsl2563 device Platform: x86: chromeos_laptop - Add Acer C7 trackpad Platform: x86: chromeos_laptop - Rename setup_lumpy_tp to setup_cyapa_smbus_tp asus-laptop: always report brightness key events ...
2013-02-27sony-laptop: leak in error handling sony_nc_lid_resume_setup()Dan Carpenter1-1/+1
We need to decrement "i" first because the current "i" was not allocated succesfully. Also we should go free the way down to zero to avoid a leak. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-27sony-laptop: support basic functions for handle 0x14B and 0x14CMattia Dongili1-0/+20
Z series and other recent models have 0x14? for lid and keyboard backlight. Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-27sony-laptop: allow reading the status of gfx switchMattia Dongili1-9/+112
Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-02-27sony-laptop: fully enable SNY controlled modemsMattia Dongili1-1/+1
The call to handlers 0x124 and 0x135 (rfkill control) seems to take a bitmask to control various states of the device. For our rfkill we need a fully on/off. SVZ1311Z9R/X's LTE modem needs more bits up. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=47751 Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com> Cc: stable@kernel.org
2013-02-27Merge branch 'for-linus' of ↵Linus Torvalds1-1/+1
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-1/+1
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-07sony-laptop: fix SNC buffer calls when SN06 returns IntegersMattia Dongili1-7/+8
SN06 in some cases returns an Integer instead of a buffer. While the code handling the return value was trying to cope with the difference, the memcpy call was not making any difference between the two types of acpi_object union. This regression was introduced in 3.5. While there also rework the return value logic to improve readability. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=48671 Cc: <stable@vger.kernel.org> Cc: Fabrizio Narni <shibotto@gmail.com> Cc: <mus.svz@gmail.com> Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2012-08-10platform / x86 / PM: Fix unused function warnings for CONFIG_PM_SLEEPRafael J. Wysocki1-1/+11
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-23Merge tag 'pm-for-3.6-rc1' of ↵Linus Torvalds1-8/+12
git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull power management updates from Rafael Wysocki: - ACPI conversion to PM handling based on struct dev_pm_ops. - Conversion of a number of platform drivers to PM handling based on struct dev_pm_ops and removal of empty legacy PM callbacks from a couple of PCI drivers. - Suspend-to-both for in-kernel hibernation from Bojan Smojver. - cpuidle fixes and cleanups from ShuoX Liu, Daniel Lezcano and Preeti Murthy. - cpufreq bug fixes from Jonghwa Lee and Stephen Boyd. - Suspend and hibernate fixes from Srivatsa Bhat and Colin Cross. - Generic PM domains framework updates. - RTC CMOS wakeup signaling update from Paul Fox. - sparse warnings fixes from Sachin Kamat. - Build warnings fixes for the generic PM domains framework and PM sysfs code. - sysfs switch for printing device suspend times from Sameer Nanda. - Documentation fix from Oskar Schirmer. * tag 'pm-for-3.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (70 commits) cpufreq: Fix sysfs deadlock with concurrent hotplug/frequency switch EXYNOS: bugfix on retrieving old_index from freqs.old PM / Sleep: call early resume handlers when suspend_noirq fails PM / QoS: Use NULL pointer instead of plain integer in qos.c PM / QoS: Use NULL pointer instead of plain integer in pm_qos.h PM / Sleep: Require CAP_BLOCK_SUSPEND to use wake_lock/wake_unlock PM / Sleep: Add missing static storage class specifiers in main.c cpuilde / ACPI: remove time from acpi_processor_cx structure cpuidle / ACPI: remove usage from acpi_processor_cx structure cpuidle / ACPI : remove latency_ticks from acpi_processor_cx structure rtc-cmos: report wakeups from interrupt handler PM / Sleep: Fix build warning in sysfs.c for CONFIG_PM_SLEEP unset PM / Domains: Fix build warning for CONFIG_PM_RUNTIME unset olpc-xo15-sci: Use struct dev_pm_ops for power management PM / Domains: Replace plain integer with NULL pointer in domain.c file PM / Domains: Add missing static storage class specifier in domain.c file PM / crypto / ux500: Use struct dev_pm_ops for power management PM / IPMI: Remove empty legacy PCI PM callbacks tpm_nsc: Use struct dev_pm_ops for power management tpm_tis: Use struct dev_pm_ops for power management ...
2012-07-01sony-laptop: Use struct dev_pm_ops for power managementRafael J. Wysocki1-8/+12
Make the sony-laptop 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-1/+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-26sony-laptop: correct find_snc_handle failure checksMattia Dongili1-3/+3
Since bab7084c745bf4d75b760728387f375fd34dc683, find_snc_handle returns -EINVAL, not -1. Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-06-26sony-laptop: fix a couple signedness bugsDan Carpenter1-3/+1
This needs to be signed to handle negative error codes. Remove a redundant check, read_limits is always called with a valid handle. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-06-26sony-laptop: fix sony_nc_sysfs_store()Dan Carpenter1-3/+3
We made this an unsigned long and it causes a bug on 64 bit big endian systems when we try to pass the value to sony_nc_int_call(). Also value has to be signed because validate() returns negative error codes. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-06-26sony-laptop: input initialization should be done before SNCMattia Dongili1-13/+12
SNC needs input devices so better have those ready before starting handle events. Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-06-26sony-laptop: add lid backlight support for handle 0x143Mattia Dongili1-3/+24
Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-06-26sony-laptop: store battery care limits on batteriesMattia Dongili1-20/+21
Some models offer the option to store the limits on the battery (firmware?). Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-06-26sony-laptop: notify userspace of GFX switch position changesMarco Chiappero1-1/+20
Some Vaios come with both integrated and discrete graphics, plus a switch for choosing one of the two. When the switch position is changed, a notification is generated. Signed-off-by: Marco Chiappero <marco@absence.it> Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-06-26sony-laptop: use an enum for SNC event typesMattia Dongili1-3/+7
Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-05-31sony-laptop: add touchpad enable/disable functionMarco Chiappero1-0/+91
This setting is stored in the EC and available across reboots. [malattia@linux.it: group function specific variables in a struct, use kstrtoul] Signed-off-by: Marco Chiappero <marco@absence.it> Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-05-31sony-laptop: add missing Fn key combos for 0x100 handlersMarco Chiappero1-0/+4
Signed-off-by: Marco Chiappero <marco@absence.it> Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-05-31sony-laptop: add support for more WWAN modemsMarco Chiappero1-19/+34
Also make the initialization function return a value for consistency with all the other setup functions. Signed-off-by: Marco Chiappero <marco@absence.it> Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-05-31sony-laptop: new keyboard backlight handleMarco Chiappero1-62/+87
Add support for handle 0x0143 (Vaio SA/SB/SC, CA/CB) and rework the code to be hable to support different handles for the keyboard backlight function. [malattia@linux.it: group function specific variables in a struct] Signed-off-by: Marco Chiappero <marco@absence.it> Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-05-31sony-laptop: add high speed battery charging functionMarco Chiappero1-0/+86
Signed-off-by: Marco Chiappero <marco@absence.it> Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-05-31sony-laptop: support automatic resume on lid openMarco Chiappero1-0/+140
A few models offer the chance to set whether to resume from S3 and/or S4 when opening the lid. [malattia@linux.it: create three sysfs files for S3/4/5 rather than using a single one accepting a bitmask. Support S5 since the DSDT exports it. Use a struct to hold all the related values, caching of the current status value rather than re-reading all the time in the sysfs show function.] Signed-off-by: Marco Chiappero <marco@absence.it> Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-05-31sony-laptop: adjust error handling in finding SNC handlesMattia Dongili1-4/+4
All handles must be greater than 0, also return more meaningful error codes on invalid conditions. Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-05-31sony-laptop: add thermal profiles supportMarco Chiappero1-0/+183
[malattia@linux.it: support string based profiles names] Signed-off-by: Marco Chiappero <marco@absence.it> Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-05-31sony-laptop: support battery care functionsMarco Chiappero1-0/+178
Allows limiting the maximum battery charge level to a selectable value (100%, 80% and 50%). [malattia@linux.it: group function specific variables in a struct, use kstrtoul. Allow 0 to 100 values into sysfs files rounding to the actual limit.] Signed-off-by: Marco Chiappero <marco@absence.it> Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-05-31sony-laptop: additional debug statementsMattia Dongili1-1/+6
Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-05-31sony-laptop: improve SNC initialization and acpi notify callback codeMarco Chiappero1-86/+233
Loop through the list of SNC handles and run the proper initialization function for each of the known handles. Also return void in function where we are not checking the return value anyway. For notifications we also know which handle is linked to the event and the code becomes simpler to read with a switch rather than using convoluted ifs. [malattia@linux.it: Code reworked to merge the initialization code improvements and the notify callback changes. Modified the code paths to allow easier error exit paths. Also fixed some missing break statements and spelling mistakes.] Signed-off-by: Marco Chiappero <marco@absence.it> Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-05-31sony-laptop: use kstrtoul to parse sysfs valuesMattia Dongili1-9/+17
This avoids surprises like echoing "enable" into a sysfs file and finding that the feature was actually disabled. Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-05-31sony-laptop: generalise ACPI calls into SNC functionsMattia Dongili1-142/+133
All calls into the SNC device methods have zero or one arguments and return an integer or a buffer (some functions go as far as returning an integer _or_ a buffer depending on the input parameter...). This allows simplifying a couple of code paths and prepares the field for other users of functions returning buffers. Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-05-31sony-laptop: fix return path when no ACPI buffer is allocatedMattia Dongili1-2/+2
The goto target location would still try to free a buffer that was never allocated. Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-05-31sony-laptop: use soft rfkill status stored in hwMarco Chiappero1-4/+17
The SNC device on recent Vaio laptops also stores the soft status and leaves it available after reboot. Use it and always set the last soft and hard status on module load. [malattia@linux.it: patch taken from a largely modified sony-laptop.c, smaller modifications to the original code to simplify it] Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-03-20to fix scancodes returned by sony-laptop driverJohn Hughes1-5/+8
Fix scancodes returned by driver to match scancodes used to remap keys. (Before the patch FN/E returned scancode 0x1B, but to remap scancode 0x14 had to be used). The scancodes returned by the sony-laptop driver for function keys did not match the scancodes used to remap keys. Also, since the scancode was sent to the input subsystem after the mapped keysym the /lib/udev/keymap utility was confused about which scancode to report for which keysym. This patch fixes the driver so the correct scancode is shown for each key. It also adds to the documentation a description of where to find the scancodes. Signed-off-by: John Hughes <john@calva.com> Acked-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-03-20sony-laptop: Enable keyboard backlight by defaultJosh Boyer1-1/+1
When the keyboard backlight support was originally added, the commit said to default it to on with a 10 second timeout. That actually wasn't the case, as the default value is commented out for the kbd_backlight parameter. Because it is a static variable, it gets set to 0 by default without some other form of initialization. However, it seems the function to set the value wasn't actually called immediately, so whatever state the keyboard was in initially would remain. Then commit df410d522410e67660 was introduced during the 2.6.39 timeframe to immediately set whatever value was present (as well as attempt to restore/reset the state on module removal or resume). That seems to have now forced the light off immediately when the module is loaded unless the option kbd_backlight=1 is specified. Let's enable it by default again (for the first time). This should solve https://bugzilla.redhat.com/show_bug.cgi?id=728478 Signed-off-by: Josh Boyer <jwboyer@redhat.com> Acked-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24sony-laptop:irq: Remove IRQF_DISABLEDYong Zhang1-1/+1
Since commit [e58aa3d2: genirq: Run irq handlers with interrupts disabled], We run all interrupt handlers with interrupts disabled and we even check and yell when an interrupt handler returns with interrupts enabled (see commit [b738a50a: genirq: Warn when handler enables interrupts]). So now this flag is a NOOP and can be removed. Signed-off-by: Yong Zhang <yong.zhang0@gmail.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-05-27platform/x86:delete two unused variablesWeiping Pan1-2/+0
variable handle is not used in these two functions, just delete them. Signed-off-by: Weiping Pan <panweiping3@gmail.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>