History log of /linux-master/drivers/platform/x86/asus-laptop.c
Revision Date Author Comments
# 3799b5d2 16-Oct-2023 Edson Juliano Drosdeck <edson.drosdeck@gmail.com>

platform/x86: asus-laptop: remove redundant braces in if statements

Adhere to Linux kernel coding style.

Reported by checkpatch:

WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Edson Juliano Drosdeck <edson.drosdeck@gmail.com>
Link: https://lore.kernel.org/r/20231016191349.3856-1-edson.drosdeck@gmail.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>


# 6c0eb5ba 13-Nov-2022 Dawei Li <set_pte_at@outlook.com>

ACPI: make remove callback of ACPI driver void

For bus-based driver, device removal is implemented as:
1 device_remove()->
2 bus->remove()->
3 driver->remove()

Driver core needs no inform from callee(bus driver) about the
result of remove callback. In that case, commit fc7a6209d571
("bus: Make remove callback return void") forces bus_type::remove
be void-returned.

Now we have the situation that both 1 & 2 of calling chain are
void-returned, so it does not make much sense for 3(driver->remove)
to return non-void to its caller.

So the basic idea behind this change is making remove() callback of
any bus-based driver to be void-returned.

This change, for itself, is for device drivers based on acpi-bus.

Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Lee Jones <lee@kernel.org>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dawei Li <set_pte_at@outlook.com>
Reviewed-by: Maximilian Luz <luzmaximilian@gmail.com> # for drivers/platform/surface/*
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 8d05fc03 30-Sep-2022 Barnabás Pőcze <pobrn@protonmail.com>

platform/x86: use PLATFORM_DEVID_NONE instead of -1

Use the `PLATFORM_DEVID_NONE` constant instead of
hard-coding -1 when creating a platform device.

No functional changes are intended.

Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>
Link: https://lore.kernel.org/r/20220930104857.2796923-1-pobrn@protonmail.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>


# 70505a71 17-Mar-2021 kernel test robot <lkp@intel.com>

platform/x86: asus-laptop: fix kobj_to_dev.cocci warnings

Use kobj_to_dev() instead of container_of()

Generated by: scripts/coccinelle/api/kobj_to_dev.cocci

CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
Link: https://lore.kernel.org/r/alpine.DEB.2.22.394.2103171258010.2981@hadrien
Signed-off-by: Hans de Goede <hdegoede@redhat.com>


# 10e92724 26-Jan-2021 Bjorn Helgaas <bhelgaas@google.com>

ACPI: Test for ACPI_SUCCESS rather than !ACPI_FAILURE

The double negative makes it hard to read "if (!ACPI_FAILURE(status))".
Replace it with "if (ACPI_SUCCESS(status))".

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 55523aba 07-May-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

platform/x86: asus-laptop: Drop duplicate check for led_classdev_unregister()

led_classdev_unregister() already has the very same check, so,
drop a duplicate in the driver.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# ab556109 17-Oct-2019 Kefeng Wang <wangkefeng.wang@huawei.com>

platform/x86: asus-laptop: Use pr_warn instead of pr_warning

As said in commit f2c2cbcc35d4 ("powerpc: Use pr_warn instead of
pr_warning"), removing pr_warning so all logging messages use a
consistent <prefix>_warn style. Let's do it.

Link: http://lkml.kernel.org/r/20191018031850.48498-19-wangkefeng.wang@huawei.com
To: linux-kernel@vger.kernel.org
Cc: Corentin Chary <corentin.chary@gmail.com>
Cc: Darren Hart <dvhart@infradead.org>
Cc: Andy Shevchenko <andy@infradead.org>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Acked-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>


# 2011176d 01-Oct-2019 Dmitry Torokhov <dmitry.torokhov@gmail.com>

platform/x86: asus-laptop: switch to using polled mode of input devices

We have added polled mode to the normal input devices with the intent of
retiring input_polled_dev. This converts Asus laptop driver to use the
polling mode of standard input devices and removes dependency on
INPUT_POLLDEV.

Also removed no longed needed set_bit(EV_ABS, ...) as
input_set_abs_oarams() does it for us.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# 1a59d1b8 27-May-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156

Based on 1 normalized pattern(s):

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license as published by
the free software foundation either version 2 of the license or at
your option any later version this program is distributed in the
hope that it will be useful but without any warranty without even
the implied warranty of merchantability or fitness for a particular
purpose see the gnu general public license for more details you
should have received a copy of the gnu general public license along
with this program if not write to the free software foundation inc
59 temple place suite 330 boston ma 02111 1307 usa

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-or-later

has been chosen to replace the boilerplate/reference in 1334 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Reviewed-by: Richard Fontana <rfontana@redhat.com>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190527070033.113240726@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# d605ca29 19-Apr-2018 Wolfram Sang <wsa+renesas@sang-engineering.com>

platform/x86: Simplify getting .drvdata

We should get drvdata from struct device directly. Going via
platform_device is an unneeded step back and forth.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>


# f118b312 09-Mar-2017 Michał Kępień <kernel@kempniu.pl>

platform/x86: asus-laptop: remove sparse_keymap_free() calls

As sparse_keymap_setup() now uses a managed memory allocation for the
keymap copy it creates, the latter is freed automatically. Remove all
calls to sparse_keymap_free().

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# 6f7e357b 05-Aug-2016 Giedrius Statkevičius <giedrius.statkevicius@gmail.com>

platform/x86: asus-laptop: get rid of parse_arg()

parse_arg() duplicates the funcionality of kstrtoint() so use the latter
function instead. There is no funcionality change except that in the
case of input being too big -ERANGE will be returned instead of -EINVAL
which is not bad because -ERANGE makes more sense here. The check for
!count is already done by the sysfs core so no need to duplicate it
again. Also, add some minor corrections to error handling to accommodate
the change in return values (parse_arg returned count if everything
succeeded whereas kstrtoint returns 0 in the same situation)

As a result of this patch asus-laptop.ko size is reduced by almost 1%:
add/remove: 0/1 grow/shrink: 1/6 up/down: 1/-149 (-148)
function old new delta
__UNIQUE_ID_vermagic0 69 70 +1
ls_switch_store 133 117 -16
ledd_store 175 159 -16
display_store 157 141 -16
ls_level_store 193 176 -17
gps_store 200 178 -22
sysfs_acpi_set.isra 148 125 -23
parse_arg.part 39 - -39
Total: Before=19160, After=19012, chg -0.77%

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>


# 19d46ee1 15-Apr-2016 Giedrius Statkevičius <giedrius.statkevicius@gmail.com>

asus-laptop: correct error handling in sysfs_acpi_set

Properly return rv back to the caller in the case of an error in
parse_arg. In the process remove a unused variable 'out'.

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>


# 2ce6d993 15-Apr-2016 Giedrius Statkevičius <giedrius.statkevicius@gmail.com>

asus-laptop: remove redundant initializers

Initializing rv to AE_OK is pointless because later function results are
assigned to them and only then the variable is used

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com>
Acked-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>


# 198b618a 15-Apr-2016 Giedrius Statkevičius <giedrius.statkevicius@gmail.com>

asus-laptop: correct error handling in asus_read_brightness()

It is possible that acpi_evaluate_integer might fail and value would not be
set to any value so correct this defect by returning 0 in case of an
error. This is also the correct thing to return because the backlight
subsystem will print the old value of brightness in this case.

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>


# 97ade769 29-Jul-2015 Łukasz Stelmach <stlman@poczta.fm>

asus-laptop: Add key found on Asus F3M

Asus F3M has two keys labeled with an icon of a touchpad. The first,
reported as 0x6B is next to the power key and the second, reported as
0x6A, is F9 combined with Fn button. When I was pressing the latter, I was
getting "Unknown key 6a pressed" message before applying this patch.

Asus F3M does not support WMI so the commit does not update key mappings
in the asus-nb-wmi.c file.

I have not tested this mapping on any other Asus laptop.

Signed-off-by: Łukasz Stelmach <stlman@poczta.fm>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>


# 8b9e6b70 16-Jun-2015 Hans de Goede <hdegoede@redhat.com>

asus-laptop: Port to new backlight interface selection API

Port the backlight selection logic to the new backlight interface
selection API.

This commit also removes various obsolete pr_xxx messages related to
backlight interface selection. These are obsolete because they assume
there is only a vendor or acpi backlight driver and no other choice.
Also they are not necessary, if the user wants to know which backlight
interfaces are registered a simple "ls /sys/class/backlight" suffices.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# ed52ccbc 23-Jan-2015 Vivien Didelot <vivien.didelot@gmail.com>

asus-laptop: use DEVICE_ATTR_xx macros

Use DEVICE_ATTR_{RO,WO,RW} macros to simplify sysfs attributes
declaration.

To declare a "foo" attribute, DEVICE_ATTR_RW() requires foo_show() and
foo_store(), so rename a few functions to satisfy this requirement.

Also put the macro below each related show/store functions for clarity.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>


# 03070e7c 18-Jan-2015 Vivien Didelot <vivien.didelot@gmail.com>

asus-laptop: Fix is_visible return value

With a Lucid platform, asus_sysfs_is_visible() returned a boolean for
ls_switch and ls_level attributes.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>


# 00981810 24-Nov-2014 Markus Elfring <elfring@users.sourceforge.net>

platform: x86: Deletion of checks before backlight_device_unregister()

The backlight_device_unregister() function tests whether its argument is NULL
and then returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
For msi-wmi.c:
Acked-by: Anisse Astier <anisse@astier.eu>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>


# 3493f414 20-Oct-2014 Wolfram Sang <wsa@kernel.org>

platform: x86: drop owner assignment from platform_drivers

A platform_driver does not need to set an owner, it will be populated by the
driver core.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>


# 8b48463f 02-Dec-2013 Lv Zheng <lv.zheng@intel.com>

ACPI: Clean up inclusions of ACPI header files

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>


# b222cca6 23-Oct-2013 Joe Perches <joe@perches.com>

platform:x86: Remove OOM message after input_allocate_device

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>


# 1696d9dc 15-Jul-2013 Thomas Renninger <trenn@suse.de>

ACPI: Remove the old /proc/acpi/event interface

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>


# 38bdd729 19-May-2013 Libo Chen <clbchenlibo.chen@huawei.com>

x86: asus-laptop: fix invalid point access

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>


# 2740e1bd 29-Nov-2012 Corentin Chary <corentin.chary@gmail.com>

asus-laptop: always report brightness key events

Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>


# 3da4cd20 03-Oct-2012 AceLan Kao <acelan.kao@canonical.com>

asus-laptop: add all video switch keys

Fill up all the video switch keys in the map.

Signed-off-by: AceLan Kao <acelan.kao@canonical.com>
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>


# 19d3ab12 03-Oct-2012 AceLan Kao <acelan.kao@canonical.com>

asus-laptop: correct a touchpad hotkey mapping

0x60 is touchpad enable key, but is misdefined in the keymap.

Signed-off-by: AceLan Kao <acelan.kao@canonical.com>
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>


# a935eaec 03-Oct-2012 Corentin Chary <corentin.chary@gmail.com>

asus-{nb-wmi|laptop}.c: sync keymaps

Maybe this should be shared in another module...

Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>


# 982d385a 03-Oct-2012 Corentin Chary <corentin.chary@gmail.com>

asus-laptop: map some new keys

Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>


# 51fac838 23-Jan-2013 Rafael J. Wysocki <rafael.j.wysocki@intel.com>

ACPI: Remove useless type argument of driver .remove() operation

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>


# 9f897484 28-Dec-2012 Matthew Garrett <matthew.garrett@nebula.com>

asus-laptop: Fix potential invalid pointer dereference

The 0-day build testing backend noticed that a string could be dereferenced
without validation. Fix that.

Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>


# cb7da022 29-Nov-2012 Ben Hutchings <ben@decadent.org.uk>

asus-laptop: Do not call HWRS on init

Since commit 8871e99f89b7 ('asus-laptop: HRWS/HWRS typo'), module
initialisation is very slow on the Asus UL30A. The HWRS method takes
about 12 seconds to run, and subsequent initialisation also seems to
be delayed. Since we don't really need the result, don't bother
calling it on init. Those who are curious can still get the result
through the 'infos' device attribute.

Update the comment about HWRS in show_infos().

Reported-by: ryan <draziw+deb@gmail.com>
References: http://bugs.debian.org/692436
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>


# b859f159 21-Dec-2012 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Drivers: platform: x86: remove __dev* attributes.

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>


# 3f5449bf 20-Aug-2012 Maxim Nikulin <m.a.nikulin@gmail.com>

platform/x86: fix asus_laptop.wled_type description

MODULE_PARM_DESC for wlan_status is further in the same file

Signed-off-by: Maxim A. Nikulin <M.A.Nikulin@gmail.com>
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>


# 8871e99f 20-Aug-2012 Corentin Chary <corentin.chary@gmail.com>

asus-laptop: HRWS/HWRS typo

Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=24222
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>


# 8421ed81 16-Aug-2012 Maxim Nikulin <m.a.nikulin@gmail.com>

platform/x86: fix asus_laptop.wled_type module parameter

MODULE_PARM_DESC for wlan_status is further in the same file

Signed-off-by: Maxim A. Nikulin <M.A.Nikulin@gmail.com>
Acked-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>


# a2d5dd24 15-Dec-2011 Corentin Chary <corentin.chary@gmail.com>

asus-laptop: add some keys found on Lenovo SL500

Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>


# 26594dd4 15-Dec-2011 Corentin Chary <corentin.chary@gmail.com>

asus-laptop: check WLED and BLED presence before adding rfkill

Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>


# 3c8671ff 15-Dec-2011 Corentin Chary <corentin.chary@gmail.com>

asus-laptop: add rfkill interfaces for wlan and wwan

But don't try to do than on pegatron tablets to avoid any
conflict.

Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>


# 774b0678 15-Dec-2011 Corentin Chary <corentin.chary@gmail.com>

asus-laptop: control how BLED and WLED should be exposed

Let the user tells if BLED and WLED should be exposed as led or
rfkill (the old sysfs are still here, but this adds a standard
interface to control the device).

For example on my A6JC, with WAPF=1, I would do:

$ modprobe asus-laptop wled_type=led bluetooth_type=rfkill

There is still no known way to automatically guess what BLED
and WLED methods will control, it's why user information is needed.

A userspace database could do that automatically, and maybe some DMI
matching in the driver.

Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>


# 40969c7d 15-Dec-2011 Corentin Chary <corentincj@iksaif.net>

asus-laptop: cleanup rfkill code

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Matthew Garrett <mjg@redhat.com>


# e0ac9133 15-Dec-2011 Corentin Chary <corentin.chary@gmail.com>

asus-laptop: log unknown keys

Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>


# 587a1f16 23-Jul-2011 Al Viro <viro@zeniv.linux.org.uk>

switch ->is_visible() to returning umode_t

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>


# 14908399 14-Oct-2011 Anisse Astier <anisse@astier.eu>

asus-laptop: Add rfkill support for Pegatron Lucid tablet

Add three new rfkill switches in this driver that are specific to
Pegatron Lucid tablet.
Please note that you might not need all three switches. For example if
you don't have a 3G module inside your tablet.

Also, on my device, the gpio for the wifi/bt module is connected to the
bluetooth line. Therefore to activate your wireless lan interface, you
need to use the "pega-bt" rfkill switch.

Finally, the rfkill switch only works before the wireless module is
loaded the first time. Unloading ath9k doesn't help, a reboot is
necessary.

Signed-off-by: Anisse Astier <anisse@astier.eu>
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Matthew Garrett <mjg@redhat.com>


# b93f8281 14-Oct-2011 Anisse Astier <anisse@astier.eu>

asus-laptop: pega_accel - Report accelerometer orientation change through udev

Signed-off-by: Anisse Astier <anisse@astier.eu>
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>


# 16cbf933 14-Oct-2011 Corentin Chary <corentin.chary@gmail.com>

asus-laptop: fix module description

Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>


# 8d38e42c 14-Oct-2011 Corentin Chary <corentin.chary@gmail.com>

asus-laptop: hide leds on Pegatron Lucid

Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>


# b23910c2 14-Oct-2011 Andy Ross <andy.ross@windriver.com>

asus-laptop: Pegatron Lucid accelerometer

Support the built-in accelerometer on the Lucid tablets as a standard
3-axis input device.

Signed-off-by: Andy Ross <andy.ross@windriver.com>
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>


# abec04db 14-Oct-2011 Andy Ross <andy.ross@windriver.com>

asus-laptop: allow boot time control of Pegatron ALS sensor

Signed-off-by: Andy Ross <andy.ross@windriver.com>
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>


# 8fcf71aa 08-Aug-2011 Axel Lin <axel.lin@gmail.com>

platform-drivers-x86: asus-laptop: fix wrong test for successful registered led_classdev

device_create returns &struct device pointer on success, or ERR_PTR() on error.
Thus if led_classdev_register fails, led_cdev->dev is always not NULL.

Thus to unregister a successful registered led_classdev, we should check
IS_ERR_OR_NULL macro for led_cdev->dev instead of checking if led_cdev->dev
is NULL or not.

we use IS_ERR_OR_NULL instead of IS_ERR because if we havn't call
led_classdev_register, the led_cdev->dev is NULL.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>


# 33989ba6 14-Oct-2011 Andy Ross <andy.ross@windriver.com>

asus-laptop: Pegatron Lucid ALS sensor

Ambient light sensor for Pegatron Lucid. Supports pre-existing
ls_switch sysfs interface to en/disable automatic control, and exports
the brightness from the device as "ls_value".

Signed-off-by: Andy Ross <andy.ross@windriver.com>
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>


# 8819de7f 14-Oct-2011 Andy Ross <andy.ross@windriver.com>

asus-laptop: Platform detection for Pegatron Lucid

Recognize the Pegatron Lucid tablets by their method signatures.

Signed-off-by: Andy Ross <andy.ross@windriver.com>
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>


# fddbfed5 01-Jul-2011 Corentin Chary <corentin.chary@gmail.com>

asus-wmi: add CWAP support and clarify the meaning of WAPF bits

ref: http://dev.iksaif.net/projects/3/wiki/Asus-laptop_WAPF

Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>


# 5ad77dcf 29-Mar-2011 Joe Perches <joe@perches.com>

asus: Add pr_fmt and convert printks to pr_<level>

Add pr_fmt, prefixes each log message.
Convert printks to pr_<level>.
Convert pr_warning to pr_warn.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>


# c8440336 17-Mar-2011 Lucas De Marchi <lucas.de.marchi@gmail.com>

platform-drivers: x86: fix common misspellings

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
Signed-off-by: Matthew Garrett <mjg@redhat.com>


# 3b81cf9d 06-Feb-2011 Corentin Chary <corentin.chary@gmail.com>

asus-laptop: remove deprecated interfaces (lcd_switch and display_get)

I should have done that one year ago, so it's more than
time to do it.

These two features use non-standard interfaces. There are the
only features that really need multiple path to guess what's
the right method name on a specific laptop.

Removing them allow to remove a lot of code an significantly
clean the driver.

This will affect the backlight code which won't be able to know
if the backlight is on or off.

The platform display file will also be write only (like the one
in eeepc-laptop).

Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>


# af96f877 06-Feb-2011 Corentin Chary <corentin.chary@gmail.com>

asus-laptop: let WLED alone on L1400B

Asus took the DSDT from another model (L84F), made some change
to make it work, but forgot to remove WLED method (the laptop
doesn't have a wireless card). They even didn't change the model
name.

ref: https://bugzilla.kernel.org/show_bug.cgi?id=25712

Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>


# bb7ca747 22-Mar-2011 Matthew Garrett <mjg@redhat.com>

backlight: add backlight type

There may be multiple ways of controlling the backlight on a given
machine. Allow drivers to expose the type of interface they are
providing, making it possible for userspace to make appropriate policy
decisions.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: David Airlie <airlied@linux.ie>
Cc: Alex Deucher <alexdeucher@gmail.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Len Brown <lenb@kernel.org>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# ba1ff5be 14-Nov-2010 Corentin Chary <corentincj@iksaif.net>

asus-laptop: add wimax and wwan support

Asus UL30A has a 3G chip, but the radio is disabled by default.
The DSDT also reference a WIMAX device, which is not present on this model.

This patch adds two new files: wwan and wimax to control WWAN and
WIMAX devices. It does not use rfkill, because like WLED and BLED,
we don't know yet that the two ACPI functions will always control the
radio, they may control only the leds on some hardware.

We may add rfkill switchs later.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Matthew Garrett <mjg@redhat.com>


# acc2472e 16-Nov-2010 Lionel Debroux <lionel_debroux@yahoo.fr>

backlight: constify backlight_ops

backlight_device_register has been expecting a const "ops" argument, and using
it as such, since 9905a43b2d563e6f89e4c63c4278ada03f2ebb14. Let's make the
remaining backlight_ops instances const.

Inspired by hunks of the grsecurity patch, updated for newer kernels.

Signed-off-by: Lionel Debroux <lionel_debroux@yahoo.fr>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>


# ac9b1e5b 26-Aug-2010 Dmitry Torokhov <dmitry.torokhov@gmail.com>

asus-laptop: use attribute group to manage attributes

Instead of registering (and removing) every attribute individually
switch to using sysfs attribute group. This makes sure that we
properly unwind and do not try to remove non-existent attributes which
may not be safe to do in the future.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Matthew Garrett <mjg@redhat.com>


# b404ecbf 25-Aug-2010 Dmitry Torokhov <dmitry.torokhov@gmail.com>

asus-laptop: remove no longer used keycode_map field

The driver uses sparse keymap library and does not use this field
anymore.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Matthew Garrett <mjg@redhat.com>


# 23f45c3a 24-Aug-2010 Corentin Chary <corentincj@iksaif.net>

asus-laptop: fix gps rfkill

The GPS rfkill crappy code. The ops_data argument wasn't
set, and was totally misused. The fix have been tested
on an Asus R2H.

Cc: stable@kernel.org
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Matthew Garrett <mjg@redhat.com>


# b58baecd 24-Aug-2010 Corentin Chary <corentincj@iksaif.net>

asus-laptop: Add key found on Asus N61JQ

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Matthew Garrett <mjg@redhat.com>


# 71e687dc 24-Aug-2010 Corentin Chary <corentincj@iksaif.net>

platform-x86: sync eeepc-laptop and asus-laptop

Makes asus-laptop and eeepc-laptop _init/_exit functions
looks exactly the same as they do the same thing.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Matthew Garrett <mjg@redhat.com>


# 45036ae1 05-Jul-2010 Axel Lin <axel.lin@gmail.com>

asus-laptop: fix asus_input_init error path

This patch includes below fixes:
1. return -ENOMEM instead of 0 if input_allocate_device fail.
2. fix wrong goto if sparse_keymap_setup fail.
3. fix wrong goto if input_register_device fail.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>


# c26d85cb 20-Jul-2010 Axel Lin <axel.lin@gmail.com>

asus-laptop: fix wapf, wlan_status and bluetooth_status module_param permissions

The wapf module parameters defines the behavior of the Fn+Fx wlan key.
The wlan_status and bluetooth_status module parameters are for setting the
wlan/bluetooth status on boot.

All above module parameters are determinated only at the module load time.
Change the value after the module is loaded does not make sense and has
no effect at all, thus set the permissions to 0444 instead of 0644.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Cc: Corentin Chary <corentincj@iksaif.net>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>


# 6a984a06 20-Jul-2010 Axel Lin <axel.lin@gmail.com>

asus-laptop: return proper error for store_ledd if write_acpi_int fail

In current implementation, store_ledd() does not return error if
write_acpi_int fail. This patch fixes it by return -ENODEV if
write_acpi_int fail.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Corentin Chary <corentincj@iksaif.net>
Cc: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>


# 9fb866f3 20-Jul-2010 Axel Lin <axel.lin@gmail.com>

asus-laptop: fix incorrect return value for write_acpi_int_ret if handle is NULL

According to the comments of write_acpi_int_ret(), write_acpi_int_ret()
should return 0 if write is successful, -1 else. Thus if handle is NULL,
the write does not happen, it should return -1.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Corentin Chary <corentincj@iksaif.net>
Cc: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>


# d8eca110 28-Jun-2010 Axel Lin <axel.lin@gmail.com>

asus-laptop: fix a memory leak in asus_laptop_get_info error path

The callers of write_acpi_int_ret() pass ACPI_ALLOCATE_BUFFER,
the caller must kfree the returned buffer if AE_OK is returned.

This patch adds a missing kfree(buffer.pointer) before return -ENOMEM
if kstrdup fail.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Matthew Garrett <mjg@redhat.com>


# 668f4a03 06-Apr-2010 Dan Carpenter <error27@gmail.com>

asus: don't modify bluetooth/wlan on boot

We were storing -1 as an unsigned int and as a result the effect of
passing -1 was the same as using 1.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Acked-by: Corentin Chary <corentincj@iksaif.net>


# 16721511 02-Mar-2010 Corentin Chary <corentincj@iksaif.net>

asus-laptop: fix warning in asus_handle_init

In function 'asus_laptop_get_info':
warning: passing argument 3 of 'asus_handle_init' from incompatible pointer type
note: expected 'char **' but argument is of type 'const char **'

Introduced by commit c21085108a02e1b838c34f3650c8cc9fbd178615
("asus-laptop: fix style problems reported by checkpath.pl").

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Matthew Garrett <mjg@redhat.com>


# 5a0e3ad6 24-Mar-2010 Tejun Heo <tj@kernel.org>

include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h

percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.

2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).

* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>


# a19a6ee6 17-Feb-2010 Matthew Garrett <mjg@redhat.com>

backlight: Allow properties to be passed at registration

Values such as max_brightness should be set before backlights are
registered, but the current API doesn't allow that. Add a parameter to
backlight_device_register and update drivers to ensure that they
set this correctly.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>


# 060cbce6 28-Jan-2010 Corentin Chary <corentincj@iksaif.net>

asus-laptop: fix style problems reported by checkpath.pl

Signed-off-by: Corentin Chary <corentincj@iksaif.net>


# 2a1fd64c 26-Jan-2010 Corentin Chary <corentincj@iksaif.net>

asus-laptop: use device_create_file() instead of platform_group

There is two reason to do that:
- we don't want a "gps" file if the model doesn't have a gps
- we don't want to use global variables anymore

Signed-off-by: Corentin Chary <corentincj@iksaif.net>


# aee0afb8 26-Jan-2010 Corentin Chary <corentincj@iksaif.net>

asus-laptop: clean led code

Remove all "templates" and add a generic struct asus_led instead.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>


# 18e1311e 25-Jan-2010 Corentin Chary <corentincj@iksaif.net>

asus-laptop: add gps rfkill

The rfkill subsystem will enable gps by default.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>


# 47ee0e99 24-Jan-2010 Corentin Chary <corentin.chary@gmail.com>

asus-laptop: set initial lcd state

There is no way to find the initial lcd state. A quick workaround
is to set it "on" by default. Anyway this feature is scheduled for removal.

Signed-off-by: Corentin Chary <corentin.chary@gmail.com>


# 75747129 24-Jan-2010 Corentin Chary <corentin.chary@gmail.com>

asus-laptop: leds, remove dead code and fix asus_led_exit()/asus_led_init()

These bug where introduced in "asus-laptop: code movement".

Signed-off-by: Corentin Chary <corentin.chary@gmail.com>


# a539df5e 25-Jan-2010 Corentin Chary <corentincj@iksaif.net>

asus-laptop: add backlight changes notifications

We don't want to send KEY_BRIGHTNESSDOWN or KEY_BRIGHTNESSUP
because it would be a lie to tell userspace that we want
to change the brightness while it's actually done by the
firmware.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>


# 7f607d71 17-Jan-2010 Corentin Chary <corentincj@iksaif.net>

asus-laptop: add bluetooth keys found on M9V

Reported by Andrey F. Ilchuk

Signed-off-by: Corentin Chary <corentincj@iksaif.net>


# 66a71dd1 25-Jan-2010 Corentin Chary <corentincj@iksaif.net>

asus-laptop: switch to sparse keymap library

This patch is based on Dmitry Torokhov's patch with
some modifications and cleanups.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>


# d0930a2d 17-Jan-2010 Corentin Chary <corentincj@iksaif.net>

asus-laptop: rename wireless_status to wlan_status to avoid confusion

Signed-off-by: Corentin Chary <corentincj@iksaif.net>


# e5593bf1 17-Jan-2010 Corentin Chary <corentincj@iksaif.net>

asus-laptop: add error check for write_acpi_int calls

Also add to helpers for bluetooth and wlan.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>


# d99b577c 22-Jan-2010 Corentin Chary <corentin.chary@gmail.com>

asus-laptop: stop using ASUS_HANDLE and use relative methods instead

Stop using ASUS_HANDLE because most of the time it is not needed.
This macro was introduced to display_get and lcd_switch which are not
part of the interface provided by Asus, and are scheduled for removal.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>


# 4d441513 13-Jan-2010 Corentin Chary <corentincj@iksaif.net>

asus-laptop: rename function talking directly to acpi with asus_xxx scheme

Signed-off-by: Corentin Chary <corentincj@iksaif.net>


# 17e78f62 13-Jan-2010 Corentin Chary <corentincj@iksaif.net>

asus-laptop: removing read_status/store_status/write_status and asus->status

Signed-off-by: Corentin Chary <corentincj@iksaif.net>


# 3e68ae7c 13-Jan-2010 Corentin Chary <corentincj@iksaif.net>

asus-laptop: stop using read_status for lcd

(anyway lcd code is scheduled for removal)

Signed-off-by: Corentin Chary <corentincj@iksaif.net>


# 6358bf2c 13-Jan-2010 Corentin Chary <corentincj@iksaif.net>

asus-laptop: stop using read_status and store_status for GPS

Signed-off-by: Corentin Chary <corentincj@iksaif.net>


# aa9df930 13-Jan-2010 Corentin Chary <corentincj@iksaif.net>

asus-laptop: stop using read_status for bluetooth and wlan

Signed-off-by: Corentin Chary <corentincj@iksaif.net>


# be4ee82d 06-Dec-2009 Corentin Chary <corentincj@iksaif.net>

asus-laptop: code movement

The asus-laptop driver implements a number of interfaces like the
backlight class driver. This change makes it easier to examine the
implementation of one interface at at a time, without having to search
through the file to find init() and exit() functions etc.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>


# 9129d14d 01-Dec-2009 Corentin Chary <corentincj@iksaif.net>

asus-laptop: callbacks should use "driver data" parameter or field

(Changelog stolen from Alan's patch for eeepc-laptop, but this patch
does the same thing for asus-laptop)

Callback methods should not refer to a variable like "asus" (formally
"hotk"). Instead, they should extract the data they need either from
a "driver data" parameter, or the "driver data" field of the object
which they operate on. The "asus" variable can then be removed.

In practice, drivers under "drivers/platform" can get away without using
driver data, because it doesn't make sense to have more than one
instance of them. However this makes it harder to review them for
correctness. This is especially true for core ACPI developers who have
not previously been exposed to this anti-pattern :-).

This will serve as an example of best practice for new driver writers
(whether they find it themselves, or have it pointed out during review
:-).

Signed-off-by: Corentin Chary <corentincj@iksaif.net>


# 7c247645 30-Nov-2009 Corentin Chary <corentincj@iksaif.net>

asus-laptop: move backlight and dsdt info inside asus_laptop struct

Prepare the use of "driver data" for callbacks.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>


# 50a90c4d 30-Nov-2009 Corentin Chary <corentincj@iksaif.net>

asus-laptop: revise names

asus-laptop now does a lot more than just hotkeys. Replace the "hotk"
names used throughout the driver with some slightly more appropriate
names. The actual strings used in kernel messages and sysfs are left
unchanged.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>


# 600ad520 30-Nov-2009 Corentin Chary <corentincj@iksaif.net>

asus-laptop: change initialization order

Clean asus-laptop initialization to match new eeepc-laptop code.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>


# 619d8b11 28-Nov-2009 Corentin Chary <corentincj@iksaif.net>

asus-laptop: remove unecessary hotk != NULL check

Signed-off-by: Corentin Chary <corentincj@iksaif.net>


# 91687cc8 28-Nov-2009 Corentin Chary <corentincj@iksaif.net>

asus-laptop: use tabs to indent macros and remove unused ones

Signed-off-by: Corentin Chary <corentincj@iksaif.net>


# d8c67323 28-Nov-2009 Corentin Chary <corentincj@iksaif.net>

asus-laptop: simplify write_acpi_int

We only need a buffer for "INIT". Adds write_acpi_init_ret for it.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>


# e5b50f6a 28-Nov-2009 Corentin Chary <corentincj@iksaif.net>

asus-laptop: no need to check argument of set_brightness()

We already tell the backlight class our maximum brightness value; it
will validate the user requested values for us.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>


# 0e875f49 10-Jan-2010 Corentin Chary <corentincj@iksaif.net>

asus-laptop: add wireless and bluetooth status parameter

These to parameter allow to set the status of wlan and bluetooth
device when the module load. On some models, the device will
always be down on boot, so the default behavior is to always
enable these devices.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>


# d951d4cc 07-Dec-2009 Corentin Chary <corentincj@iksaif.net>

asus-laptop: change light sens default values.

The light sensor disable brightness key and
/sys/class/backlight/ control. There was a lot of report
from users who didn't understand why they couldn't change their
brightness, including:

https://bugs.launchpad.net/bugs/222171
https://bugzilla.novell.com/show_bug.cgi?id=514747
http://bugzilla.kernel.org/show_bug.cgi?id=13671
http://bugzilla.kernel.org/show_bug.cgi?id=14432

Now the light sensor is disabled, and if the user want to enable
it, the level should be ok.

The funny thing is that comments where ok, not code.

Cc: stable@kernel.org
Cc: Thomas Renninger <trenn@suse.de>
Cc: Peter Küppers <peter-mailbox@web.de>
Cc: Michael Franzl <michaelfranzl@gmx.at>
Cc: Ian Turner <vectro@vectro.org>
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>


# 1f0233ee 03-Dec-2009 Corentin Chary <corentincj@iksaif.net>

asus-laptop: Add wlan switch found on V6V

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>


# 14f8af31 03-Dec-2009 Ike Panhc <ike.pan@canonical.com>

asus-laptop: add Lenovo SL hotkey support

Lenovo SL series laptop has a very similar DSDT with Asus laptops. We can
easily have the extra ACPI function support with little modification in
asus-laptop.c

Here is the hotkey enablement for Lenovo SL series laptop.

This patch will enable the following hotkey:
- Volumn Up
- Volumn Down
- Mute
- Screen Lock (Fn+F2)
- Battery Status (Fn+F3)
- WLAN switch (Fn+F5)
- Video output switch (Fn+F7)
- Touchpad switch (Fn+F8)
- Screen Magnifier (Fn+Space)

The following function of Lenovo SL laptop is still need to be enabled:
- Hotkey: KEY_SUSPEND (Fn+F4), KEY_SLEEP (Fn+F12), Dock Eject (Fn+F9)
- Rfkill for bluetooth and wlan
- LenovoCare LED
- Hwmon for fan speed
- Fingerprint scanner
- Active Protection System

Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Len Brown <len.brown@intel.com>


# 16851f92 03-Dec-2009 Corentin Chary <corentincj@iksaif.net>

asus-laptop: use KEY_F13 to map "Disable Touchpad" event

The same key is used in toshiba-laptop, and there is no
reserved key for that.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>


# edf62452 03-Dec-2009 Alan Jenkins <alan-jenkins@tuffmail.co.uk>

asus-laptop: set acpi_driver.owner

The owner field provides the link between drivers and modules in sysfs,
but no ACPI driver was setting it.

After setting the owner field, we can see which module provides which
driver and vice versa by looking at /sys/bus/acpi/driver/*/module and
/sys/module/*/drivers/acpi:*.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Signed-off-by: Len Brown <len.brown@intel.com>


# b7fab7a0 03-Dec-2009 Alan Jenkins <alan-jenkins@tuffmail.co.uk>

asus-laptop: Remove uneccesary acpi_disabled check

acpi_bus_register_driver() already checks acpi_disabled, so acpi bus
drivers don't need to.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Signed-off-by: Len Brown <len.brown@intel.com>


# 1df8d8d4 03-Dec-2009 Alan Jenkins <alan-jenkins@tuffmail.co.uk>

asus-laptop: Remove redundant NULL checks

The acpi device callbacks add, start, remove, suspend and resume can
never be called with a NULL acpi_device. Each callsite in acpi/scan.c
has to dereference the device in order to get the ops structure, e.g.

struct acpi_device *acpi_dev = to_acpi_device(dev);
struct acpi_driver *acpi_drv = acpi_dev->driver;

if (acpi_drv && acpi_drv->ops.suspend)
return acpi_drv->ops.suspend(acpi_dev, state);

Remove all checks for acpi_dev == NULL within these callbacks.

Also remove the checks for acpi_driver_data(acpi_dev) == NULL. None of
these checks could fail unless the driver does something strange
(which none of them do), the acpi core did something terribly wrong,
or we have a memory corruption issue. If this does happen then it's
best to dereference the pointer and crash noisily.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Signed-off-by: Len Brown <len.brown@intel.com>


# be966660 29-Aug-2009 Corentin Chary <corentincj@iksaif.net>

asus-laptop: Fix coding style for comments

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>


# 0aa20f7d 27-Aug-2009 Corentin Chary <corentincj@iksaif.net>

asus-laptop: Add "calculator" hotkey

Found on UX50V.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>


# 4644d0e5 27-Aug-2009 Corentin Chary <corentincj@iksaif.net>

asus-laptop: Add suport for another "Media" key

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>


# dc795260 27-Aug-2009 Corentin Chary <corentincj@iksaif.net>

asus-laptop: handle keyboard backlight keys

Add support for the Fn+F3/Fn+F4 keys and map them
as KEY_KBDILLUMUP and KEY_KBDILLUMDOWN.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>


# b7d3fbc2 27-Aug-2009 Corentin Chary <corentincj@iksaif.net>

asus-laptop: Add support for Keyboard backlight

Add support for keyboard backlight found in Asus U50VG.

The SMC driver for the Apples does it via LED. To be
consistent with that we create /sys/class/leds/asus::kbd_backlight/
to control the keyboard backlight.

SLKB and GLKB are used to get/set the backlight. On
the U50VG is supports 4 brightness level, but this may
change with other models.

SLKB take a 8 bit integer where the higher bit is used
to toggle the backlight, and the over 7 bits control the
brightness level.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>


# 977c328d 27-Aug-2009 Corentin Chary <corentincj@iksaif.net>

asus-laptop: set maximum led brightness

Set the right maximum brightness which is one, because
they can only be on or off.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>


# f641375b 27-Aug-2009 Corentin Chary <corentincj@iksaif.net>

asus-laptop: Map X50R hotkeys

Map some new hotkeys found on X50R.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>


# abfa57e1 27-Aug-2009 Corentin Chary <corentincj@iksaif.net>

asus-laptop: Add *_led_get() functions

Add support for getting led brightness directly from
the hardware. Currently we don't need it, but it is needed
to support keyboard backlight/led.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>


# 1d4a3800 27-Aug-2009 Corentin Chary <corentincj@iksaif.net>

asus-laptop: Show HRWS in infos and fix output format

Show HRWS in /sys/platform/devices/asus-laptop/infos.
HRWS is a bitfield used to get information about Hardware
available in the laptop.
Also change sprintf format from 0x%04x to %#x.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>


# 2fcc23da 19-Jun-2009 Corentin Chary <corentincj@iksaif.net>

asus-laptop: use pr_fmt and pr_<level>

Convert the unusual printk(ASUS_<level> uses to
the more standard pr_fmt and pr_<level>(.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>


# 116bf2e0 16-Jun-2009 Corentin Chary <corentincj@iksaif.net>

asus-laptop: platform dev as parent for led and backlight

Makes asus-laptop platform device the parent device of
backlight and led classes.

With this patch, leds and backlight are also available in
/sys/devices/platform/asus-laptop/ like thinkpad_acpi.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>


# 586ed160 30-Apr-2009 Bjorn Helgaas <bjorn.helgaas@hp.com>

ACPI: asus-laptop: use .notify method instead of installing handler directly

This patch adds a .notify() method. The presence of .notify() causes
Linux/ACPI to manage event handlers and notify handlers on our behalf,
so we don't have to install and remove them ourselves.

This driver apparently relies on seeing ALL notify events, not just
device-specific ones (because it used ACPI_ALL_NOTIFY). We use the
ACPI_DRIVER_ALL_NOTIFY_EVENTS driver flag to request all events.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
CC: Corentin Chary <corentincj@iksaif.net>
CC: acpi4asus-user@lists.sourceforge.net
Signed-off-by: Len Brown <len.brown@intel.com>


# 309f5fbd 27-Apr-2009 Corentin Chary <corentincj@iksaif.net>

asus-laptop: fix input keycode

KEY_STOP is now KEY_STOPCD
It's the correct key to stop a media
BTN_EXTRA is now KEY_SCREENLOCK:
The laptop manual tells us that this key is for screenlock
KEY_TV is now KEY_PROG1
So it can be reported to X server

Ref: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/361505

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>


# 6050c8dd 15-Feb-2009 Corentin Chary <corentincj@iksaif.net>

asus-laptop: restore acpi_generate_proc_event()

Restore acpi_generate_proc_event() for backward
compatibility with old acpi scripts.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>


# ed6f4421 20-Jan-2009 Corentin Chary <corentincj@iksaif.net>

asus-laptop: fix label indentation

Fix the label indentation

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>


# 034ce90a 20-Jan-2009 Corentin Chary <corentincj@iksaif.net>

asus-laptop: hotkeys via the generic input interface

This patch is based on eeepc-laptop.c and the patchs
from Nicolas Trangez and Daniel Nascimento (mainly for the keymap).

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>


# 2a7dc0d8 20-Jan-2009 Corentin Chary <corentincj@iksaif.net>

asus-laptop: use generic netlink interface

To be prepared for /proc/acpi/event removal we export events
also through generic netlink interface.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>


# 41b16dce 30-Nov-2008 Len Brown <len.brown@intel.com>

create drivers/platform/x86/ from drivers/misc/

Move x86 platform specific drivers from drivers/misc/
to a new home under drivers/platform/x86/.

The community has been maintaining x86 vendor-specific
platform specific drivers under /drivers/misc/ for a few years.
The oldest ones started life under drivers/acpi.
They moved out of drivers/acpi/ because they don't actually
implement the ACPI specification, but either simply
use ACPI, or implement vendor-specific ACPI extensions.

In the future we anticipate...
drivers/misc/ will go away.
other architectures will create drivers/platform/<arch>

Signed-off-by: Len Brown <len.brown@intel.com>