when request_irq fails, we should release gpiochip
v2:
fix warning: ignoring return value of 'gpiochip_remove
Signed-off-by: Libo Chen <libo.chen@huawei.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Configuring this option as a module with ACPI_TOSHIBA built-in
results in the following errors:
drivers/built-in.o: In function `toshiba_acpi_remove':
>> toshiba_acpi.c:(.text+0x314bb0): undefined reference to `i8042_remove_filter'
drivers/built-in.o: In function `toshiba_acpi_add':
>> toshiba_acpi.c:(.devinit.text+0xb822): undefined reference to `i8042_install_filter'
>> toshiba_acpi.c:(.devinit.text+0xb98b): undefined reference to `i8042_remove_filter'
Add a dependency to prevent ACPI_TOSHIBA from being built-in when
SERIO_I8042=m.
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Cc: Azael Avalos <coproscefalo@gmail.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Need to set wapf to 4 for ASUSTeK COMPUTER INC. 1015E/U, so that
user can toggle wifi function through function key correctly.
Signed-off-by: AceLan Kao <acelan.kao@canonical.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Intel Smart Connect is an Intel-specific ACPI interface for configuring
devices to wake up at regular intervals so they can pull down mail or other
internet updates, and then go to sleep again. If a user enables this in
Windows and then reboots into Linux, the device may wake up if it's put to
sleep. Since there's no Linux userland support for any of this, the machine
will then remain awake until something else puts it back to sleep.
I haven't figured out all that much about how this works (there's a bunch
of different ACPI calls available on the device), but this seems to be
enough to turn it off. We can add more features to this driver if anyone
ever cares about figuring out what the rest of the calls do or writing some
Linux userspace to implement the rest of it.
Signed-off-by: Matthew Garrett <mjg59@srcf.ucam.org>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Intel Rapid Start Technology is a firmware-based suspend-to-disk
implementation. Once placed in S3, the device will wake once either a
timeout elapses or the battery reaches a critical level. It will then resume
to the firmware and copy the contents of RAM to a specialised partition, and
then power off the machine. If the user turns the machine back on the
firmware will copy the contents of the partition back to RAM and then resume
from S3 as normal.
This driver provides an interface for configuring the wakeup events and
timeout. It still requires firmware support and an appropriate suspend
partition.
Signed-off-by: Matthew Garrett <mjg59@srcf.ucam.org>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
HP laptops include a POST code error query 0x2A that reports
which point BIOS fails to boot at. The error code is kept in CMOS
until it is cleared.
Signed-off-by: Alex Hung <alex.hung@canonical.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Controlling the wlan led seems to have some side effects to the machines
with wapf value is not equal to 4. It will make the keyboard backlight
out of order.
So, the patch will enable the wlan led function only if the wapf == 4.
Bug: https://bugzilla.kernel.org/show_bug.cgi?id=46791
Reported-by: Mirto Silvio Busico <m.busico@ieee.org>
Tested-by: Karol Herbst <karolherbst@me.com>
Tested-by: drunkenbatman <drunkenbatman@gmail.com>
Signed-off-by: AceLan Kao <acelan.kao@canonical.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
use module_pci_driver instead of init/exit, make code clean.
Signed-off-by: Libo Chen <libo.chen@huawei.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
asus->name is null or point to const string,so it is not suitable to kfree it.
Signed-off-by: Libo Chen <libo.chen@huawei.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
1. fix two visible mistakes:
* when load_scm_model_init faild, we should call platform_device_del(msipf_device)
* msipf_attribute_group should be remove in err case
2. change some tags, give them real meaning.
Signed-off-by: Libo Chen <libo.chen@huawei.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
I forgot to add this when changing the driver to use the proper
i8042 functions.
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Fix to return -ENOMEM in the alloc_page() 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: Matthew Garrett <matthew.garrett@nebula.com>
Kyle Evans discovered that he needed to set some bits in an EC register in
order to receive hotkey events. Doing so blindly broke some otherwise
working HP laptops. It turns out that there's a WMI call that accesses
the same register, so let's try calling that instead.
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Cc: Kyle Evans <kvans32@gmail.com>
Calling dev_set_name with a single paramter causes it to be handled as a
format string. Many callers are passing potentially dynamic string
content, so use "%s" in those cases to avoid any potential accidents,
including wrappers like device_create*() and bdi_register().
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
The patch adds support for fan control button on Ideapad Z580. This is
the same button as on Z570, but it raises different bit in
VPCCMD_R_SPECIAL_BUTTONS. Also add message to dmesg when unknown button
press detected, it will help adding support for new special buttons.
Signed-off-by: Maxim Mikityanskiy <maxtram95@gmail.com>
Tested-by: Ivan Vojtko <nekroman.sk@gmail.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
pvpanic device is a qemu simulated device through which guest panic
event is sent to host.
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
BugLink: http://bugs.launchpad.net/bugs/1172151
Need to set wapf to 4 for ASUSTeK COMPUTER INC. X75A, so that
user can toggle wifi function through function key correctly.
Signed-off-by: AceLan Kao <acelan.kao@canonical.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Used PTR_RET function instead of IS_ERR and PTR_ERR.
Patch found using coccinelle.
Signed-off-by: Alexandru Gheorghiu <gheorghiuandru@gmail.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
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>
New HP laptops start generating new events, and hp-wmi prints unknown
event_ids for them. This patch also removes these messages
Signed-off-by: Alex Hung <alex.hung@canonical.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
If krealloc() returns NULL, it *doesn't* free the original. So any code
of the form 'foo = krealloc(foo, …);' is almost certainly a bug.
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
The error in lis3lv02_poweron() is harmless in the resume path, so
we should ignore it. It is inline with the other usages of lis3lv02_poweron()
and matches the 3.0 code for this routine. This patch is in suse git and
might have missed making it into the mainline.
opensuse - commit id: 66ccdac87c322cf7af12bddba8c805af640b1cff
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Shuah Khan <shuah.khan@hp.com>
CC: stable@vger.kernel.org 3.8, 3.4, 3.5, 3.2
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
There is a new DELL WMI spec. with new WMI event format.
I'm working on the AIO machines, but I think the new format will apply to
all the Dell's machines, not only for AIO, which will be released later
this year.
The new format of the WMI buffer is shown as below
word 0 - the number of words following in the WMI buffer(not including
this word.
word 1 - the event type
0x0000 - A hot key is pressed or an event occurred
0x000F - A sequence of hot keys are pressed
word 2 and on - the event data
Signed-off-by: AceLan Kao <acelan.kao@canonical.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Pull VFS updates from Al Viro,
Misc cleanups all over the place, mainly wrt /proc interfaces (switch
create_proc_entry to proc_create(), get rid of the deprecated
create_proc_read_entry() in favor of using proc_create_data() and
seq_file etc).
7kloc removed.
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (204 commits)
don't bother with deferred freeing of fdtables
proc: Move non-public stuff from linux/proc_fs.h to fs/proc/internal.h
proc: Make the PROC_I() and PDE() macros internal to procfs
proc: Supply a function to remove a proc entry by PDE
take cgroup_open() and cpuset_open() to fs/proc/base.c
ppc: Clean up scanlog
ppc: Clean up rtas_flash driver somewhat
hostap: proc: Use remove_proc_subtree()
drm: proc: Use remove_proc_subtree()
drm: proc: Use minor->index to label things, not PDE->name
drm: Constify drm_proc_list[]
zoran: Don't print proc_dir_entry data in debug
reiserfs: Don't access the proc_dir_entry in r_open(), r_start() r_show()
proc: Supply an accessor for getting the data from a PDE's parent
airo: Use remove_proc_subtree()
rtl8192u: Don't need to save device proc dir PDE
rtl8187se: Use a dir under /proc/net/r8180/
proc: Add proc_mkdir_data()
proc: Move some bits from linux/proc_fs.h to linux/{of.h,signal.h,tty.h}
proc: Move PDE_NET() to fs/proc/proc_net.c
...
* acpica: (33 commits)
ACPICA: Update version to 20130328
ACPICA: Add a lock to the internal object reference count mechanism
ACPICA: Fix a format string for 64-bit generation
ACPICA: Remove FORCE_DELETE option for global reference count mechanism
ACPICA: Improve error message for Index() operator
ACPICA: FADT: Remove extraneous warning for very large GPE registers
ACPICA: Fix a typo in a function header, no functional change
ACPICA: Fix a typo in an error message
ACPICA: Fix for some comments/headers
ACPICA: _OSI Support: handle any errors from acpi_os_acquire_mutex()
ACPICA: Predefine names: Add allowed argument types to master info table
ACPI: Set length even for TYPE_END_TAG acpi resource
ACPICA: Update version to 20130214
ACPICA: Object repair: Allow 0-length packages for variable-length packages
ACPICA: Disassembler: Add warnings for unresolved control methods
ACPICA: Return object repair: Add resource template repairs
ACPICA: Return object repair: Add string-to-unicode conversion
ACPICA: Split object conversion functions to a new file
ACPICA: Add mechanism for early object repairs on a per-name basis
ACPICA: Remove trailing comma in enum declarations
...
Pull x86 platform driver revert from Matthew Garrett:
"It turns out that one of the hp-wmi patches this cycle breaks some
other HP laptops. I think we have a good idea how to work on it for
3.10, but it's safer to just revert it for now."
* 'for_linus' of git://cavan.codon.org.uk/platform-drivers-x86:
Revert "hp-wmi: Add support for SMBus hotkeys"
This reverts commit fabf85e3ca which breaks
hotkey support on some other HP laptops. We'll try doing this differently
in 3.10.
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
hotkey_kthread() does try_to_freeze() under hotkey_thread_mutex.
We can simply kill this mutex, hotkey_poll_stop_sync() does not need to
serialize with hotkey_kthread(). When kthread_stop() returns the thread
is already dead, it called do_exit()->complete_vfork_done().
Reported-by: Artem Savkov <artem.savkov@gmail.com>
Reported-by: Maciej Rutecki <maciej.rutecki@gmail.com>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Matthew Garrett <matthew.garrett@nebula.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
Cc: Aaron Lu <aaron.lu@intel.com>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
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>
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>
Add basic platform data to get the current upstream driver working
with the 224s touchpad and 1664s touchscreen.
We will be using NULL config so we will use the settings from the
devices' NVRAMs.
Signed-off-by: Benson Leung <bleung@chromium.org>
Tested-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
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
...
Selecting BACKLIGHT_CLASS_DEVICE doesn't guarantee that any of its
dependencies are enabled, and these are complicated. Depending isn't ideal
for configuration UI purposes, but is probably more appropriate here.
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
I've got a report of build failure on ideapad-laptop, which shows
drivers/built-in.o: In function `ideapad_acpi_notify':
ideapad-laptop.c:(.text+0x63876a): undefined reference to `backlight_force_update'
drivers/built-in.o: In function `ideapad_acpi_remove':
ideapad-laptop.c:(.devexit.text+0x64a7): undefined reference to `backlight_device_unregister'
drivers/built-in.o: In function `ideapad_acpi_add':
ideapad-laptop.c:(.devinit.text+0x45e28): undefined reference to `backlight_device_register'
To select backlight subsystem can prevent this error from happening.
Also update comment for this driver.
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Add the two other i2c buses (vga and panel) from i915.
Chromebook Pixel has input and light sensor devices on these busses.
Signed-off-by: Benson Leung <bleung@chromium.org>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
The Chromebook Pixel uses an isl29023 ambient light sensor on the PANEL
GMBus.
Signed-off-by: Benson Leung <bleung@chromium.org>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
This will allow us to assign devices to buses by the type enum.
Signed-off-by: Benson Leung <bleung@chromium.org>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Instantiate the atmel mxt1664s touchscreen on this system.
The touchscreen may appear at two possible addresses:
0x4a in operational mode.
0x26 in bootloader mode.
Signed-off-by: Yufeng Shen <miletus@chromium.org>
Signed-off-by: Benson Leung <bleung@chromium.org>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
This will allow support for devices that may appear at more than
one i2c address at boot time. The specific example is the atmel_mxt touch
devices, which may appear at a different address if it comes up
in bootloader mode.
Signed-off-by: Benson Leung <bleung@chromium.org>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Instantiate the atmel mxt224s trackpad on this system.
The trackpad may appear at two possible addresses:
0x4b in operational mode.
0x25 in bootloader mode.
Signed-off-by: Benson Leung <bleung@chromium.org>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
The driver will not quite work if someone unbinds the platform device
from the platform driver via sysfs (moreover it will bomb is the driver
built into the kernel as hp_wmi_bios_remove is marked as __exit and will
not be present in the kernel).
To fix it let's use platform_driver_probe() instead of
platform_driver_register(), which disables binding/unbinding via sysfs.
This also allows us to mark hp_wmi_bios_setup as __init and discard it
once module is initialized.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
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>
Several models of HP laptops using the same DSDT have hotkey buttons
that do not work until the EC is configured to enable them.
Signed-off-by: Kyle Evans <kvans32@gmail.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Fix the following build warning
CC [M] drivers/platform/x86/asus-wmi.o
drivers/platform/x86/asus-wmi.c:1356:13: warning: ‘do_nothing’ defined but not used [-Wunused-function]
Signed-off-by: Shuah Khan <shuah.khan@hp.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Fengguang Wu run kernel build test to platform-drivers-x86/linux-next git tree
on x86_64 architecture and found a warning that was introduced by
727651bf738b6b917335025d09323d0962eda114 commit:
drivers/platform/x86/acer-wmi.c: In function âWMID_set_capabilitiesâ:
drivers/platform/x86/acer-wmi.c:1211: warning: âdevicesâ may be used
uninitialized in this function
This patch fixes the above warning message.
Cc: Carlos Corbacho <carlos@strangeworlds.co.uk>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Dmitry Torokhov <dtor@mail.ru>
Cc: Corentin Chary <corentincj@iksaif.net>
Cc: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Add support for the HP Pavilion 14 Chromebook's trackpad, which is a reuse
of the Samsung Series 5 550 trackpad.
Signed-off-by: Benson Leung <bleung@chromium.org>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>