Re: drivers/x86: add thinkpad-wmi

2017-11-10 Thread Corentin Chary
gistered.
>> >>
>> >> Well, these aren't really "devices". I can register all methods to the
>
> With the WMI bus abstraction model Andy L. introduced, each GUID is a
> device, as Mario describes below.
>
>> >> BUS  though, but it'll be weird for the end user.
>> >> What is your suggestion here ?
>> >
>> > The WMI bus device model means that any "GUID" is a device associated to 
>> > the WMI
>> > bus.  I view your driver as putting another level of granularity on top of 
>> > that.
>> > Whether you adopt a character device or sysfs attributes for communicating 
>> > to the
>> > bus, you should still have some sort of driver that packs all the GUID's 
>> > into subdevices
>> > under say a platform device.
>> >
>> > I think you should look for some feedback from Darren or Andy on how they 
>> > want to
>> > see this work.
>>
>> My preference here is to try to have as much generic and flexible
>> interface in kernel that may allow user space application utilize
>> customisations.
>> Though I think Darren is more involved in WMI activity and can share
>> his view on all of this.
>>
>
> I would certainly prefer to see new drivers use this model - however!
> one of the requirements to exporting WMI devices to userspace via the
> generic mechanism is involvement from the vendor. Is Lenovo involved?
> Can we talk to them about their level of testing and input validation to
> ensure these methods don't do something else in addition to their
> stated purpose?

I have no link with Lenovo.

>
>> >> > 3) Your driver provides more granular data than mine (as that's how it 
>> >> > is
>> >> > exposed by Lenovo's design).  I think this is a good thing, and you 
>> >> > should
>> >> > find a way to programattically expose your attributes to sysfs instead 
>> >> > of
>> >> > debugfs if possible.
>> >>
>
> Using sysfs wherever possible is definitely preferred, yes.

The general idea with the current driver was to make these feature
available but still be free to change the interface, thus the use of
debugfs instead of sysfs for now.

>
>> >> > The driver looks very good to me though, a few nested comments:
>> >>
>> >> Thanks for the review Mario. I'm afraid I won't have much more time in
>> >> the near future to make changes to this driver. What do you think
>> >> would be the minimal set of changes to make this good enough to be
>> >> merged ?
>> >
>> > I'm just a contributor myself who has recently worked on a WMI driver 
>> > series.
>> > I would defer to Andy and Darren to decide what they would like to accept.
>>
>
> Holding off here until Corentin has a chance to respond to my inquiries
> above.
>
>> ...
>>
>> > it would be difficult to update to the
>> > newer model we're working towards when we have the kernel learning how to
>> > parse MOF and programmatically producing sysfs attributes for interacting 
>> > with
>> > character devices.
>>
>> ...and since your stuff is scheduled for v4.15 the possibility to
>> (re-)use as much as possible from it is a plus.
>>
>> > Since the kernel has to keep a stable interface to userspace you may run 
>> > into a
>> > situation that one day you want to update to the new interfaces and might 
>> > have a
>> > difficult time since you have to continue to offer a configuration option 
>> > to offer these
>> > old interfaces too.
>>
>> This is a good point.
>
> And one which debugfs helps skirt a bit. If this was done with sysfs and
> merged, we would basically have to create a new thinkpad-wmi-2 driver
> providing the new bus/driver/mof model.
>
> Let's talk about intel and vendor involvement above, and revisit next
> steps after that.
>
> --
> Darren Hart
> VMware Open Source Technology Center



-- 
Corentin Chary
http://xf.iksaif.net


Re: drivers/x86: add thinkpad-wmi

2017-11-10 Thread Corentin Chary
 I can register all methods to the
>
> With the WMI bus abstraction model Andy L. introduced, each GUID is a
> device, as Mario describes below.
>
>> >> BUS  though, but it'll be weird for the end user.
>> >> What is your suggestion here ?
>> >
>> > The WMI bus device model means that any "GUID" is a device associated to 
>> > the WMI
>> > bus.  I view your driver as putting another level of granularity on top of 
>> > that.
>> > Whether you adopt a character device or sysfs attributes for communicating 
>> > to the
>> > bus, you should still have some sort of driver that packs all the GUID's 
>> > into subdevices
>> > under say a platform device.
>> >
>> > I think you should look for some feedback from Darren or Andy on how they 
>> > want to
>> > see this work.
>>
>> My preference here is to try to have as much generic and flexible
>> interface in kernel that may allow user space application utilize
>> customisations.
>> Though I think Darren is more involved in WMI activity and can share
>> his view on all of this.
>>
>
> I would certainly prefer to see new drivers use this model - however!
> one of the requirements to exporting WMI devices to userspace via the
> generic mechanism is involvement from the vendor. Is Lenovo involved?
> Can we talk to them about their level of testing and input validation to
> ensure these methods don't do something else in addition to their
> stated purpose?

I have no link with Lenovo.

>
>> >> > 3) Your driver provides more granular data than mine (as that's how it 
>> >> > is
>> >> > exposed by Lenovo's design).  I think this is a good thing, and you 
>> >> > should
>> >> > find a way to programattically expose your attributes to sysfs instead 
>> >> > of
>> >> > debugfs if possible.
>> >>
>
> Using sysfs wherever possible is definitely preferred, yes.

The general idea with the current driver was to make these feature
available but still be free to change the interface, thus the use of
debugfs instead of sysfs for now.

>
>> >> > The driver looks very good to me though, a few nested comments:
>> >>
>> >> Thanks for the review Mario. I'm afraid I won't have much more time in
>> >> the near future to make changes to this driver. What do you think
>> >> would be the minimal set of changes to make this good enough to be
>> >> merged ?
>> >
>> > I'm just a contributor myself who has recently worked on a WMI driver 
>> > series.
>> > I would defer to Andy and Darren to decide what they would like to accept.
>>
>
> Holding off here until Corentin has a chance to respond to my inquiries
> above.
>
>> ...
>>
>> > it would be difficult to update to the
>> > newer model we're working towards when we have the kernel learning how to
>> > parse MOF and programmatically producing sysfs attributes for interacting 
>> > with
>> > character devices.
>>
>> ...and since your stuff is scheduled for v4.15 the possibility to
>> (re-)use as much as possible from it is a plus.
>>
>> > Since the kernel has to keep a stable interface to userspace you may run 
>> > into a
>> > situation that one day you want to update to the new interfaces and might 
>> > have a
>> > difficult time since you have to continue to offer a configuration option 
>> > to offer these
>> > old interfaces too.
>>
>> This is a good point.
>
> And one which debugfs helps skirt a bit. If this was done with sysfs and
> merged, we would basically have to create a new thinkpad-wmi-2 driver
> providing the new bus/driver/mof model.
>
> Let's talk about intel and vendor involvement above, and revisit next
> steps after that.
>
> --
> Darren Hart
> VMware Open Source Technology Center



-- 
Corentin Chary
http://xf.iksaif.net


Re: drivers/x86: add thinkpad-wmi

2017-11-04 Thread Corentin Chary
On Tue, Oct 24, 2017 at 10:59 PM, Mario Limonciello
<mario.limoncie...@dell.com> wrote:
> Hi Chary,
>
> I think it's interesting to see this submission coming in at this time.
> We're working on setting up precedent for how WMI vendor drivers should work
> right now and I have another patch series that sets up some concepts.  They
> do clash a little with what you've done here, so let me share some context.
>
> The hope is that eventually drivers on the WMI bus don't need to be very
> rich in code, but more intelligence comes from the bus.  That would mean
> that the bus parses the MOF and knows what types of data would be passed in
> individual method GUIDs.  The bus would know what size of data that is and
> what fields represent what in data objects.  The vendor drivers may add some
> filtering or permissions checking, but that would be it.
>
> We still don't have MOF parsing in the kernel, but I think that it's good to
> set up concepts that reflect how we want it to work until it's available.
> That should mean that if you get the interfaces right that later your driver
> can shrink.  My patch series isn't yet accepted, so what I'm doing isn't
> necessarily the way it will be done, I just want to let you know about it.
>
> The big notable differences with how we're approaching our drivers:
> 1) GUID's that provide methods are given direct execution paths in sysfs
> files through your patch.  This means that there could be a ton of different
> sysfs attributes that vary from vendor to vendor based on what they offer.
> I set up a concept that method type GUID's would be handled by the WMI bus
> by creating a character device in the /dev/wmi and copying in/out data for
> those method objects.

Wouldn't that be a little harder to use from userspace ? (But I can
see how it makes it more generic).

>
> 2) You don't register all devices with the WMI bus.  Each of your GUIDs that
> you interact with should really be registered with the bus.  Some of the
> data you're interested in should be exposed there.
> I can't speak on behalf of Darren and Andy here, but I would anticipate they
> don't want "new" WMI drivers introduced that don't register and use the WMI
> bus properly.  I only see the single GUID that registered.

Well, these aren't really "devices". I can register all methods to the
BUS  though, but it'll be weird for the end user.
What is your suggestion here ?

>
> 3) Your driver provides more granular data than mine (as that's how it is
> exposed by Lenovo's design).  I think this is a good thing, and you should
> find a way to programattically expose your attributes to sysfs instead of
> debugfs if possible.
>
> The driver looks very good to me though, a few nested comments:

Thanks for the review Mario. I'm afraid I won't have much more time in
the near future to make changes to this driver. What do you think
would be the minimal set of changes to make this good enough to be
merged ?

>
> On 10/21/2017 01:41 AM, Corentin Chary wrote:
>>
>> This driver has been available on
>> https://github.com/iksaif/thinkpad-wmi for
>> a few year and is already deployed on large
>> fleets of thinkpad laptops.
>>
>> The WMI interface is documented here:
>>
>> http://download.lenovo.com/ibmdl/pub/pc/pccbbs/thinkcentre_pdf/hrdeploy_en.pdf
>>
>> It mostly focused on changing BIOS/Firmware settings.
>>
>> Signed-off-by: Corentin Chary <corentin.ch...@gmail.com>
>> ---
>>   .../ABI/testing/sysfs-platform-thinkpad-wmi|   50 +
>>   Documentation/platform/thinkpad-wmi.txt|   92 ++
>>   drivers/platform/x86/Kconfig   |   10 +
>>   drivers/platform/x86/Makefile  |1 +
>>   drivers/platform/x86/thinkpad-wmi.c| 1210
>> 
>>   5 files changed, 1363 insertions(+)
>>   create mode 100644 Documentation/ABI/testing/sysfs-platform-thinkpad-wmi
>>   create mode 100644 Documentation/platform/thinkpad-wmi.txt
>>   create mode 100644 drivers/platform/x86/thinkpad-wmi.c
>>
>> diff --git a/Documentation/ABI/testing/sysfs-platform-thinkpad-wmi
>> b/Documentation/ABI/testing/sysfs-platform-thinkpad-wmi
>> new file mode 100644
>> index ..c3673876c5b3
>> --- /dev/null
>> +++ b/Documentation/ABI/testing/sysfs-platform-thinkpad-wmi
>> @@ -0,0 +1,50 @@
>> +What:  /sys/devices/platform/thinkpad-wmi/password
>> +Date:  Aug 2017
>> +KernelVersion: 4.14
>> +Contact:   "Corentin Chary" <corentin.ch...@gmail.com>
>> +Description:
>> +   BIOS password needs to be written in this file if set
>> +  

Re: drivers/x86: add thinkpad-wmi

2017-11-04 Thread Corentin Chary
On Tue, Oct 24, 2017 at 10:59 PM, Mario Limonciello
 wrote:
> Hi Chary,
>
> I think it's interesting to see this submission coming in at this time.
> We're working on setting up precedent for how WMI vendor drivers should work
> right now and I have another patch series that sets up some concepts.  They
> do clash a little with what you've done here, so let me share some context.
>
> The hope is that eventually drivers on the WMI bus don't need to be very
> rich in code, but more intelligence comes from the bus.  That would mean
> that the bus parses the MOF and knows what types of data would be passed in
> individual method GUIDs.  The bus would know what size of data that is and
> what fields represent what in data objects.  The vendor drivers may add some
> filtering or permissions checking, but that would be it.
>
> We still don't have MOF parsing in the kernel, but I think that it's good to
> set up concepts that reflect how we want it to work until it's available.
> That should mean that if you get the interfaces right that later your driver
> can shrink.  My patch series isn't yet accepted, so what I'm doing isn't
> necessarily the way it will be done, I just want to let you know about it.
>
> The big notable differences with how we're approaching our drivers:
> 1) GUID's that provide methods are given direct execution paths in sysfs
> files through your patch.  This means that there could be a ton of different
> sysfs attributes that vary from vendor to vendor based on what they offer.
> I set up a concept that method type GUID's would be handled by the WMI bus
> by creating a character device in the /dev/wmi and copying in/out data for
> those method objects.

Wouldn't that be a little harder to use from userspace ? (But I can
see how it makes it more generic).

>
> 2) You don't register all devices with the WMI bus.  Each of your GUIDs that
> you interact with should really be registered with the bus.  Some of the
> data you're interested in should be exposed there.
> I can't speak on behalf of Darren and Andy here, but I would anticipate they
> don't want "new" WMI drivers introduced that don't register and use the WMI
> bus properly.  I only see the single GUID that registered.

Well, these aren't really "devices". I can register all methods to the
BUS  though, but it'll be weird for the end user.
What is your suggestion here ?

>
> 3) Your driver provides more granular data than mine (as that's how it is
> exposed by Lenovo's design).  I think this is a good thing, and you should
> find a way to programattically expose your attributes to sysfs instead of
> debugfs if possible.
>
> The driver looks very good to me though, a few nested comments:

Thanks for the review Mario. I'm afraid I won't have much more time in
the near future to make changes to this driver. What do you think
would be the minimal set of changes to make this good enough to be
merged ?

>
> On 10/21/2017 01:41 AM, Corentin Chary wrote:
>>
>> This driver has been available on
>> https://github.com/iksaif/thinkpad-wmi for
>> a few year and is already deployed on large
>> fleets of thinkpad laptops.
>>
>> The WMI interface is documented here:
>>
>> http://download.lenovo.com/ibmdl/pub/pc/pccbbs/thinkcentre_pdf/hrdeploy_en.pdf
>>
>> It mostly focused on changing BIOS/Firmware settings.
>>
>> Signed-off-by: Corentin Chary 
>> ---
>>   .../ABI/testing/sysfs-platform-thinkpad-wmi|   50 +
>>   Documentation/platform/thinkpad-wmi.txt|   92 ++
>>   drivers/platform/x86/Kconfig   |   10 +
>>   drivers/platform/x86/Makefile  |1 +
>>   drivers/platform/x86/thinkpad-wmi.c| 1210
>> 
>>   5 files changed, 1363 insertions(+)
>>   create mode 100644 Documentation/ABI/testing/sysfs-platform-thinkpad-wmi
>>   create mode 100644 Documentation/platform/thinkpad-wmi.txt
>>   create mode 100644 drivers/platform/x86/thinkpad-wmi.c
>>
>> diff --git a/Documentation/ABI/testing/sysfs-platform-thinkpad-wmi
>> b/Documentation/ABI/testing/sysfs-platform-thinkpad-wmi
>> new file mode 100644
>> index ..c3673876c5b3
>> --- /dev/null
>> +++ b/Documentation/ABI/testing/sysfs-platform-thinkpad-wmi
>> @@ -0,0 +1,50 @@
>> +What:  /sys/devices/platform/thinkpad-wmi/password
>> +Date:  Aug 2017
>> +KernelVersion: 4.14
>> +Contact:   "Corentin Chary" 
>> +Description:
>> +   BIOS password needs to be written in this file if set
>> +   to be able to change BIOS settings.
>> +
>> +What:   

[PATCH] drivers/x86: add thinkpad-wmi

2017-10-21 Thread Corentin Chary
This driver has been available on
https://github.com/iksaif/thinkpad-wmi for
a few year and is already deployed on large
fleets of thinkpad laptops.

The WMI interface is documented here:
http://download.lenovo.com/ibmdl/pub/pc/pccbbs/thinkcentre_pdf/hrdeploy_en.pdf

It mostly focused on changing BIOS/Firmware settings.

Signed-off-by: Corentin Chary <corentin.ch...@gmail.com>
---
 .../ABI/testing/sysfs-platform-thinkpad-wmi|   50 +
 Documentation/platform/thinkpad-wmi.txt|   92 ++
 drivers/platform/x86/Kconfig   |   10 +
 drivers/platform/x86/Makefile  |1 +
 drivers/platform/x86/thinkpad-wmi.c| 1210 
 5 files changed, 1363 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-platform-thinkpad-wmi
 create mode 100644 Documentation/platform/thinkpad-wmi.txt
 create mode 100644 drivers/platform/x86/thinkpad-wmi.c

diff --git a/Documentation/ABI/testing/sysfs-platform-thinkpad-wmi 
b/Documentation/ABI/testing/sysfs-platform-thinkpad-wmi
new file mode 100644
index ..c3673876c5b3
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-platform-thinkpad-wmi
@@ -0,0 +1,50 @@
+What:  /sys/devices/platform/thinkpad-wmi/password
+Date:  Aug 2017
+KernelVersion: 4.14
+Contact:   "Corentin Chary" <corentin.ch...@gmail.com>
+Description:
+   BIOS password needs to be written in this file if set
+   to be able to change BIOS settings.
+
+What:  /sys/devices/platform/thinkpad-wmi/password_encoding
+Date:  Aug 2017
+KernelVersion: 4.14
+Contact:   "Corentin Chary" <corentin.ch...@gmail.com>
+Description:
+   Password encoding ('ascii' or 'scanmode').
+
+What:  /sys/devices/platform/thinkpad-wmi/password_kbd_lang
+Date:  Aug 2017
+KernelVersion: 4.14
+Contact:   "Corentin Chary" <corentin.ch...@gmail.com>
+Description:
+   Keyboard language used for password. One of 'us', 'fr' and 'gr'.
+
+What:  /sys/devices/platform/thinkpad-wmi/password_type
+Date:      Aug 2017
+KernelVersion: 4.14
+Contact:   "Corentin Chary" <corentin.ch...@gmail.com>
+Description:
+   Password type to be changed when password_change is written to, 
e.g. 'pap'.
+
+What:  /sys/devices/platform/thinkpad-wmi/password_change
+Date:  Aug 2017
+KernelVersion: 4.14
+Contact:   "Corentin Chary" <corentin.ch...@gmail.com>
+Description:
+   Writing to this file will set the password specified in 
password_type.
+   The new password will not take effect until the next reboot.
+
+What:  /sys/devices/platform/thinkpad-wmi/password_settings
+Date:  Oct 2015
+KernelVersion: 4.14
+Contact:   "Corentin Chary" <corentin.ch...@gmail.com>
+Description:
+   Display various password settings.
+
+What:  /sys/devices/platform/thinkpad-wmi/load_default_settings
+Date:  Oct 2015
+KernelVersion: 4.14
+Contact:   "Corentin Chary" <corentin.ch...@gmail.com>
+Description:
+   Write anything to this file to load default BIOS settings.
diff --git a/Documentation/platform/thinkpad-wmi.txt 
b/Documentation/platform/thinkpad-wmi.txt
new file mode 100644
index ..40d141aecc7b
--- /dev/null
+++ b/Documentation/platform/thinkpad-wmi.txt
@@ -0,0 +1,92 @@
+# thinkpad-wmi
+
+Linux Driver for Thinkpad WMI interface, allows you to control most
+BIOS settings from Linux, and maybe more.
+
+## sysfs interface
+
+Directory: /sys/bus/wmi/drivers/thinkpad-wmi/
+
+Each setting exposed by the WMI interface is available under its own name
+in this sysfs directory. Read from the file to get the current value (line 1)
+and list of options (line 2), and write an option to the file to set it.
+
+Additionally, there are some extra files for querying and managing BIOS
+password(s).
+
+### password
+
+Must contain the BIOS supervisor password (aka 'pap'), if set, to be able to do
+any change.
+
+Every subsequent password change will be authorized with this password. The
+password may be unloaded by writing an empty string. Writing an invalid
+password may trigger the BIOS' invalid password limit, such that a reboot will
+be required in order to make any further BIOS changes.
+
+### password_encoding
+
+Encoding used for the password, either '', 'scancode' or 'ascii'.
+
+Scan-code encoding appears to require the key-down scan codes, e.g. 0x1e, 0x30,
+0x2e for the ASCII encoded password 'abc'.
+
+### password_kbd_lang
+
+Keyboard language mapping, can be '', 'us', 'fr' or 'gr'.
+
+### password_type
+
+Specify the password type to be changed when password_change is written to.
+Can be:
+* 'pap': supervisor password
+* 'pop': power-on-password
+
+Other types may be valid, e.g. for user and master disk passwords.
+
+### passwo

[PATCH] drivers/x86: add thinkpad-wmi

2017-10-21 Thread Corentin Chary
This driver has been available on
https://github.com/iksaif/thinkpad-wmi for
a few year and is already deployed on large
fleets of thinkpad laptops.

The WMI interface is documented here:
http://download.lenovo.com/ibmdl/pub/pc/pccbbs/thinkcentre_pdf/hrdeploy_en.pdf

It mostly focused on changing BIOS/Firmware settings.

Signed-off-by: Corentin Chary 
---
 .../ABI/testing/sysfs-platform-thinkpad-wmi|   50 +
 Documentation/platform/thinkpad-wmi.txt|   92 ++
 drivers/platform/x86/Kconfig   |   10 +
 drivers/platform/x86/Makefile  |1 +
 drivers/platform/x86/thinkpad-wmi.c| 1210 
 5 files changed, 1363 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-platform-thinkpad-wmi
 create mode 100644 Documentation/platform/thinkpad-wmi.txt
 create mode 100644 drivers/platform/x86/thinkpad-wmi.c

diff --git a/Documentation/ABI/testing/sysfs-platform-thinkpad-wmi 
b/Documentation/ABI/testing/sysfs-platform-thinkpad-wmi
new file mode 100644
index ..c3673876c5b3
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-platform-thinkpad-wmi
@@ -0,0 +1,50 @@
+What:  /sys/devices/platform/thinkpad-wmi/password
+Date:  Aug 2017
+KernelVersion: 4.14
+Contact:   "Corentin Chary" 
+Description:
+   BIOS password needs to be written in this file if set
+   to be able to change BIOS settings.
+
+What:  /sys/devices/platform/thinkpad-wmi/password_encoding
+Date:  Aug 2017
+KernelVersion: 4.14
+Contact:   "Corentin Chary" 
+Description:
+   Password encoding ('ascii' or 'scanmode').
+
+What:  /sys/devices/platform/thinkpad-wmi/password_kbd_lang
+Date:  Aug 2017
+KernelVersion: 4.14
+Contact:   "Corentin Chary" 
+Description:
+   Keyboard language used for password. One of 'us', 'fr' and 'gr'.
+
+What:  /sys/devices/platform/thinkpad-wmi/password_type
+Date:  Aug 2017
+KernelVersion: 4.14
+Contact:   "Corentin Chary" 
+Description:
+   Password type to be changed when password_change is written to, 
e.g. 'pap'.
+
+What:  /sys/devices/platform/thinkpad-wmi/password_change
+Date:  Aug 2017
+KernelVersion: 4.14
+Contact:   "Corentin Chary" 
+Description:
+   Writing to this file will set the password specified in 
password_type.
+   The new password will not take effect until the next reboot.
+
+What:  /sys/devices/platform/thinkpad-wmi/password_settings
+Date:      Oct 2015
+KernelVersion: 4.14
+Contact:   "Corentin Chary" 
+Description:
+   Display various password settings.
+
+What:  /sys/devices/platform/thinkpad-wmi/load_default_settings
+Date:  Oct 2015
+KernelVersion: 4.14
+Contact:   "Corentin Chary" 
+Description:
+   Write anything to this file to load default BIOS settings.
diff --git a/Documentation/platform/thinkpad-wmi.txt 
b/Documentation/platform/thinkpad-wmi.txt
new file mode 100644
index ..40d141aecc7b
--- /dev/null
+++ b/Documentation/platform/thinkpad-wmi.txt
@@ -0,0 +1,92 @@
+# thinkpad-wmi
+
+Linux Driver for Thinkpad WMI interface, allows you to control most
+BIOS settings from Linux, and maybe more.
+
+## sysfs interface
+
+Directory: /sys/bus/wmi/drivers/thinkpad-wmi/
+
+Each setting exposed by the WMI interface is available under its own name
+in this sysfs directory. Read from the file to get the current value (line 1)
+and list of options (line 2), and write an option to the file to set it.
+
+Additionally, there are some extra files for querying and managing BIOS
+password(s).
+
+### password
+
+Must contain the BIOS supervisor password (aka 'pap'), if set, to be able to do
+any change.
+
+Every subsequent password change will be authorized with this password. The
+password may be unloaded by writing an empty string. Writing an invalid
+password may trigger the BIOS' invalid password limit, such that a reboot will
+be required in order to make any further BIOS changes.
+
+### password_encoding
+
+Encoding used for the password, either '', 'scancode' or 'ascii'.
+
+Scan-code encoding appears to require the key-down scan codes, e.g. 0x1e, 0x30,
+0x2e for the ASCII encoded password 'abc'.
+
+### password_kbd_lang
+
+Keyboard language mapping, can be '', 'us', 'fr' or 'gr'.
+
+### password_type
+
+Specify the password type to be changed when password_change is written to.
+Can be:
+* 'pap': supervisor password
+* 'pop': power-on-password
+
+Other types may be valid, e.g. for user and master disk passwords.
+
+### password_change
+
+Writing to this file will change the password specified by password_type. The
+new password will not take effect until the next reboot.
+
+### password_settings
+
+Display password related settings. This includes:
+
+* password_state: which 

Re: [PATCH] drivers/x86: add thinkpad-wmi

2017-10-06 Thread Corentin Chary
Yes, I'm just having trouble finding time to write it :)
I'll try to make that happen next week.

On Thu, Oct 5, 2017 at 4:49 AM, Darren Hart <dvh...@infradead.org> wrote:
> On Tue, Sep 05, 2017 at 09:07:27AM +0200, Corentin Chary wrote:
>> [re-send for the mailing list, I forgot that gmail was stupid]
>>
>> On Tue, Sep 5, 2017 at 9:05 AM, Corentin Chary <corentin.ch...@gmail.com> 
>> wrote:
>> >>
>> >> I didn't read the code, does it use WMI bus which Andy L. introduced
>> >> recently?
>> >>
>> >
>> > No, I wasn't aware of it. I checked the dell-wmi conversion patch and it
>> > should not be too hard.
>> > I'll probably sent that as a patch on top the existing driver (in the same
>> > series).
>
> Hi Corentin,
>
> Just to make sure I haven't missed it - I believe we're waiting for a v2 of 
> this
> patch. Is that right?
>
> --
> Darren Hart
> VMware Open Source Technology Center



-- 
Corentin Chary
http://xf.iksaif.net


Re: [PATCH] drivers/x86: add thinkpad-wmi

2017-10-06 Thread Corentin Chary
Yes, I'm just having trouble finding time to write it :)
I'll try to make that happen next week.

On Thu, Oct 5, 2017 at 4:49 AM, Darren Hart  wrote:
> On Tue, Sep 05, 2017 at 09:07:27AM +0200, Corentin Chary wrote:
>> [re-send for the mailing list, I forgot that gmail was stupid]
>>
>> On Tue, Sep 5, 2017 at 9:05 AM, Corentin Chary  
>> wrote:
>> >>
>> >> I didn't read the code, does it use WMI bus which Andy L. introduced
>> >> recently?
>> >>
>> >
>> > No, I wasn't aware of it. I checked the dell-wmi conversion patch and it
>> > should not be too hard.
>> > I'll probably sent that as a patch on top the existing driver (in the same
>> > series).
>
> Hi Corentin,
>
> Just to make sure I haven't missed it - I believe we're waiting for a v2 of 
> this
> patch. Is that right?
>
> --
> Darren Hart
> VMware Open Source Technology Center



-- 
Corentin Chary
http://xf.iksaif.net


Re: [PATCH] drivers/x86: add thinkpad-wmi

2017-09-05 Thread Corentin Chary
[re-send for the mailing list, I forgot that gmail was stupid]

On Tue, Sep 5, 2017 at 9:05 AM, Corentin Chary <corentin.ch...@gmail.com> wrote:
>
>
> On Mon, Sep 4, 2017 at 7:15 PM, Andy Shevchenko <andy.shevche...@gmail.com>
> wrote:
>>
>> On Mon, Sep 4, 2017 at 11:21 AM, Corentin Chary
>> <corentin.ch...@gmail.com> wrote:
>> > This driver has been available on https://github.com/iksaif/thinkpad-wmi
>> > for
>> > a few year and is already deployed on large fleets of thinkpad laptops.
>> >
>> > The WMI interface is documented here:
>> > http://download.lenovo.com/ibmdl/pub/pc/pccbbs/thinkcentre_pdf/hrdeploy_en.pdf
>> > It mostly focused on changing BIOS/Firmware settings.
>>
>> I will do full review later, few comments right now though.
>> Thanks for doing this btw.
>>
>> > +Date:  Aug 2017
>> > +KernelVersion: 4.14
>>
>> v4.15 apparently
>
>
> Done
>
>>
>>
>> > + * Thinkpad WMI hotkey driver
>>
>> Solely for hot keys?
>>
>
> /hotkey/configuration/
>
>>
>> > + *
>> > + * Copyright(C) 2012 Corentin Chary <corentin.ch...@gmail.com>
>>
>> 2012,2017?
>>
>
> done
>
>>
>>
>> > + *  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
>>
>> Remove this. It had been changed once, no guarantee it will not again.
>
>
> done
>
>>
>>
>>
>> > +#include 
>> > +#include 
>> > +#include 
>> > +#include 
>> > +#include 
>> > +#include 
>> > +#include 
>> > +#include 
>> > +#include 
>> > +#include 
>>
>> Alphabetical.
>>
>
> done
>
>>
>> > +static int __init thinkpad_wmi_init(void)
>> > +{
>> > +   platform_device = platform_create_bundle(_driver,
>> > +thinkpad_wmi_probe,
>> > +NULL, 0, NULL, 0);
>> > +   if (IS_ERR(platform_device))
>> > +   return PTR_ERR(platform_device);
>> > +   return 0;
>> > +}
>> > +
>> > +static void __exit thinkpad_wmi_exit(void)
>> > +{
>> > +   platform_device_unregister(platform_device);
>> > +   platform_driver_unregister(_driver);
>> > +}
>> > +
>> > +module_init(thinkpad_wmi_init);
>> > +module_exit(thinkpad_wmi_exit);
>>
>> I didn't read the code, does it use WMI bus which Andy L. introduced
>> recently?
>>
>
> No, I wasn't aware of it. I checked the dell-wmi conversion patch and it
> should not be too hard.
> I'll probably sent that as a patch on top the existing driver (in the same
> series).
>
>>
>> --
>> With Best Regards,
>> Andy Shevchenko
>
>
>
>
> --
> Corentin Chary
> http://xf.iksaif.net



-- 
Corentin Chary
http://xf.iksaif.net


Re: [PATCH] drivers/x86: add thinkpad-wmi

2017-09-05 Thread Corentin Chary
[re-send for the mailing list, I forgot that gmail was stupid]

On Tue, Sep 5, 2017 at 9:05 AM, Corentin Chary  wrote:
>
>
> On Mon, Sep 4, 2017 at 7:15 PM, Andy Shevchenko 
> wrote:
>>
>> On Mon, Sep 4, 2017 at 11:21 AM, Corentin Chary
>>  wrote:
>> > This driver has been available on https://github.com/iksaif/thinkpad-wmi
>> > for
>> > a few year and is already deployed on large fleets of thinkpad laptops.
>> >
>> > The WMI interface is documented here:
>> > http://download.lenovo.com/ibmdl/pub/pc/pccbbs/thinkcentre_pdf/hrdeploy_en.pdf
>> > It mostly focused on changing BIOS/Firmware settings.
>>
>> I will do full review later, few comments right now though.
>> Thanks for doing this btw.
>>
>> > +Date:  Aug 2017
>> > +KernelVersion: 4.14
>>
>> v4.15 apparently
>
>
> Done
>
>>
>>
>> > + * Thinkpad WMI hotkey driver
>>
>> Solely for hot keys?
>>
>
> /hotkey/configuration/
>
>>
>> > + *
>> > + * Copyright(C) 2012 Corentin Chary 
>>
>> 2012,2017?
>>
>
> done
>
>>
>>
>> > + *  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
>>
>> Remove this. It had been changed once, no guarantee it will not again.
>
>
> done
>
>>
>>
>>
>> > +#include 
>> > +#include 
>> > +#include 
>> > +#include 
>> > +#include 
>> > +#include 
>> > +#include 
>> > +#include 
>> > +#include 
>> > +#include 
>>
>> Alphabetical.
>>
>
> done
>
>>
>> > +static int __init thinkpad_wmi_init(void)
>> > +{
>> > +   platform_device = platform_create_bundle(_driver,
>> > +thinkpad_wmi_probe,
>> > +NULL, 0, NULL, 0);
>> > +   if (IS_ERR(platform_device))
>> > +   return PTR_ERR(platform_device);
>> > +   return 0;
>> > +}
>> > +
>> > +static void __exit thinkpad_wmi_exit(void)
>> > +{
>> > +   platform_device_unregister(platform_device);
>> > +   platform_driver_unregister(_driver);
>> > +}
>> > +
>> > +module_init(thinkpad_wmi_init);
>> > +module_exit(thinkpad_wmi_exit);
>>
>> I didn't read the code, does it use WMI bus which Andy L. introduced
>> recently?
>>
>
> No, I wasn't aware of it. I checked the dell-wmi conversion patch and it
> should not be too hard.
> I'll probably sent that as a patch on top the existing driver (in the same
> series).
>
>>
>> --
>> With Best Regards,
>> Andy Shevchenko
>
>
>
>
> --
> Corentin Chary
> http://xf.iksaif.net



-- 
Corentin Chary
http://xf.iksaif.net


[PATCH] drivers/x86: add thinkpad-wmi

2017-09-04 Thread Corentin Chary
This driver has been available on https://github.com/iksaif/thinkpad-wmi for
a few year and is already deployed on large fleets of thinkpad laptops.

The WMI interface is documented here: 
http://download.lenovo.com/ibmdl/pub/pc/pccbbs/thinkcentre_pdf/hrdeploy_en.pdf
It mostly focused on changing BIOS/Firmware settings.

Signed-off-by: Corentin Chary <corentin.ch...@gmail.com>
---
 .../ABI/testing/sysfs-platform-thinkpad-wmi|   50 +
 drivers/platform/x86/Kconfig   |   10 +
 drivers/platform/x86/Makefile  |1 +
 drivers/platform/x86/thinkpad-wmi.c| 1217 
 4 files changed, 1278 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-platform-thinkpad-wmi
 create mode 100644 drivers/platform/x86/thinkpad-wmi.c

diff --git a/Documentation/ABI/testing/sysfs-platform-thinkpad-wmi 
b/Documentation/ABI/testing/sysfs-platform-thinkpad-wmi
new file mode 100644
index ..c3673876c5b3
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-platform-thinkpad-wmi
@@ -0,0 +1,50 @@
+What:  /sys/devices/platform/thinkpad-wmi/password
+Date:  Aug 2017
+KernelVersion: 4.14
+Contact:   "Corentin Chary" <corentin.ch...@gmail.com>
+Description:
+   BIOS password needs to be written in this file if set
+   to be able to change BIOS settings.
+
+What:  /sys/devices/platform/thinkpad-wmi/password_encoding
+Date:  Aug 2017
+KernelVersion: 4.14
+Contact:   "Corentin Chary" <corentin.ch...@gmail.com>
+Description:
+   Password encoding ('ascii' or 'scanmode').
+
+What:  /sys/devices/platform/thinkpad-wmi/password_kbd_lang
+Date:  Aug 2017
+KernelVersion: 4.14
+Contact:   "Corentin Chary" <corentin.ch...@gmail.com>
+Description:
+   Keyboard language used for password. One of 'us', 'fr' and 'gr'.
+
+What:  /sys/devices/platform/thinkpad-wmi/password_type
+Date:      Aug 2017
+KernelVersion: 4.14
+Contact:   "Corentin Chary" <corentin.ch...@gmail.com>
+Description:
+   Password type to be changed when password_change is written to, 
e.g. 'pap'.
+
+What:  /sys/devices/platform/thinkpad-wmi/password_change
+Date:  Aug 2017
+KernelVersion: 4.14
+Contact:   "Corentin Chary" <corentin.ch...@gmail.com>
+Description:
+   Writing to this file will set the password specified in 
password_type.
+   The new password will not take effect until the next reboot.
+
+What:  /sys/devices/platform/thinkpad-wmi/password_settings
+Date:  Oct 2015
+KernelVersion: 4.14
+Contact:   "Corentin Chary" <corentin.ch...@gmail.com>
+Description:
+   Display various password settings.
+
+What:  /sys/devices/platform/thinkpad-wmi/load_default_settings
+Date:  Oct 2015
+KernelVersion: 4.14
+Contact:   "Corentin Chary" <corentin.ch...@gmail.com>
+Description:
+   Write anything to this file to load default BIOS settings.
diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
index 80b87954f6dd..4e2e8a04228a 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -511,6 +511,16 @@ config THINKPAD_ACPI_HOTKEY_POLL
  If you are not sure, say Y here.  The driver enables polling only if
  it is strictly necessary to do so.
 
+config THINKPAD_WMI
+   tristate "THINKPAD WMI Driver (EXPERIMENTAL)"
+   depends on ACPI_WMI
+   ---help---
+ This driver allow you to modify BIOS passwords, settings, and boot 
order
+ using Windows Management Instrumentation (WMI) through the Lenovo
+ client-management interface.
+
+ Say Y here if you have a WMI aware Thinkpad.
+
 config SENSORS_HDAPS
tristate "Thinkpad Hard Drive Active Protection System (hdaps)"
depends on INPUT
diff --git a/drivers/platform/x86/Makefile b/drivers/platform/x86/Makefile
index 91cec1751461..3b03f0744794 100644
--- a/drivers/platform/x86/Makefile
+++ b/drivers/platform/x86/Makefile
@@ -28,6 +28,7 @@ obj-$(CONFIG_TC1100_WMI)  += tc1100-wmi.o
 obj-$(CONFIG_SONY_LAPTOP)  += sony-laptop.o
 obj-$(CONFIG_IDEAPAD_LAPTOP)   += ideapad-laptop.o
 obj-$(CONFIG_THINKPAD_ACPI)+= thinkpad_acpi.o
+obj-$(CONFIG_THINKPAD_WMI) += thinkpad-wmi.o
 obj-$(CONFIG_SENSORS_HDAPS)+= hdaps.o
 obj-$(CONFIG_FUJITSU_LAPTOP)   += fujitsu-laptop.o
 obj-$(CONFIG_FUJITSU_TABLET)   += fujitsu-tablet.o
diff --git a/drivers/platform/x86/thinkpad-wmi.c 
b/drivers/platform/x86/thinkpad-wmi.c
new file mode 100644
index ..9f2d6d2c3e16
--- /dev/null
+++ b/drivers/platform/x86/thinkpad-wmi.c
@@ -0,0 +1,1217 @@
+/*
+ * Thinkpad WMI hotkey driver
+ *
+ * Copyright(C) 2012 Corentin Chary <corentin.ch...@gmail.com>
+ *

[PATCH] drivers/x86: add thinkpad-wmi

2017-09-04 Thread Corentin Chary
This driver has been available on https://github.com/iksaif/thinkpad-wmi for
a few year and is already deployed on large fleets of thinkpad laptops.

The WMI interface is documented here: 
http://download.lenovo.com/ibmdl/pub/pc/pccbbs/thinkcentre_pdf/hrdeploy_en.pdf
It mostly focused on changing BIOS/Firmware settings.

Signed-off-by: Corentin Chary 
---
 .../ABI/testing/sysfs-platform-thinkpad-wmi|   50 +
 drivers/platform/x86/Kconfig   |   10 +
 drivers/platform/x86/Makefile  |1 +
 drivers/platform/x86/thinkpad-wmi.c| 1217 
 4 files changed, 1278 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-platform-thinkpad-wmi
 create mode 100644 drivers/platform/x86/thinkpad-wmi.c

diff --git a/Documentation/ABI/testing/sysfs-platform-thinkpad-wmi 
b/Documentation/ABI/testing/sysfs-platform-thinkpad-wmi
new file mode 100644
index ..c3673876c5b3
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-platform-thinkpad-wmi
@@ -0,0 +1,50 @@
+What:  /sys/devices/platform/thinkpad-wmi/password
+Date:  Aug 2017
+KernelVersion: 4.14
+Contact:   "Corentin Chary" 
+Description:
+   BIOS password needs to be written in this file if set
+   to be able to change BIOS settings.
+
+What:  /sys/devices/platform/thinkpad-wmi/password_encoding
+Date:  Aug 2017
+KernelVersion: 4.14
+Contact:   "Corentin Chary" 
+Description:
+   Password encoding ('ascii' or 'scanmode').
+
+What:  /sys/devices/platform/thinkpad-wmi/password_kbd_lang
+Date:  Aug 2017
+KernelVersion: 4.14
+Contact:   "Corentin Chary" 
+Description:
+   Keyboard language used for password. One of 'us', 'fr' and 'gr'.
+
+What:  /sys/devices/platform/thinkpad-wmi/password_type
+Date:  Aug 2017
+KernelVersion: 4.14
+Contact:   "Corentin Chary" 
+Description:
+   Password type to be changed when password_change is written to, 
e.g. 'pap'.
+
+What:  /sys/devices/platform/thinkpad-wmi/password_change
+Date:  Aug 2017
+KernelVersion: 4.14
+Contact:   "Corentin Chary" 
+Description:
+   Writing to this file will set the password specified in 
password_type.
+   The new password will not take effect until the next reboot.
+
+What:  /sys/devices/platform/thinkpad-wmi/password_settings
+Date:      Oct 2015
+KernelVersion: 4.14
+Contact:   "Corentin Chary" 
+Description:
+   Display various password settings.
+
+What:  /sys/devices/platform/thinkpad-wmi/load_default_settings
+Date:  Oct 2015
+KernelVersion: 4.14
+Contact:   "Corentin Chary" 
+Description:
+   Write anything to this file to load default BIOS settings.
diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
index 80b87954f6dd..4e2e8a04228a 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -511,6 +511,16 @@ config THINKPAD_ACPI_HOTKEY_POLL
  If you are not sure, say Y here.  The driver enables polling only if
  it is strictly necessary to do so.
 
+config THINKPAD_WMI
+   tristate "THINKPAD WMI Driver (EXPERIMENTAL)"
+   depends on ACPI_WMI
+   ---help---
+ This driver allow you to modify BIOS passwords, settings, and boot 
order
+ using Windows Management Instrumentation (WMI) through the Lenovo
+ client-management interface.
+
+ Say Y here if you have a WMI aware Thinkpad.
+
 config SENSORS_HDAPS
tristate "Thinkpad Hard Drive Active Protection System (hdaps)"
depends on INPUT
diff --git a/drivers/platform/x86/Makefile b/drivers/platform/x86/Makefile
index 91cec1751461..3b03f0744794 100644
--- a/drivers/platform/x86/Makefile
+++ b/drivers/platform/x86/Makefile
@@ -28,6 +28,7 @@ obj-$(CONFIG_TC1100_WMI)  += tc1100-wmi.o
 obj-$(CONFIG_SONY_LAPTOP)  += sony-laptop.o
 obj-$(CONFIG_IDEAPAD_LAPTOP)   += ideapad-laptop.o
 obj-$(CONFIG_THINKPAD_ACPI)+= thinkpad_acpi.o
+obj-$(CONFIG_THINKPAD_WMI) += thinkpad-wmi.o
 obj-$(CONFIG_SENSORS_HDAPS)+= hdaps.o
 obj-$(CONFIG_FUJITSU_LAPTOP)   += fujitsu-laptop.o
 obj-$(CONFIG_FUJITSU_TABLET)   += fujitsu-tablet.o
diff --git a/drivers/platform/x86/thinkpad-wmi.c 
b/drivers/platform/x86/thinkpad-wmi.c
new file mode 100644
index ..9f2d6d2c3e16
--- /dev/null
+++ b/drivers/platform/x86/thinkpad-wmi.c
@@ -0,0 +1,1217 @@
+/*
+ * Thinkpad WMI hotkey driver
+ *
+ * Copyright(C) 2012 Corentin Chary 
+ *
+ *  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 i

Re: [PATCH 0/7] asus-wireless: LED control

2016-06-19 Thread Corentin Chary
On Mon, Jun 13, 2016 at 10:57 PM, João Paulo Rechi Vita
<jprv...@gmail.com> wrote:
> This series adds support for controlling the airplane-mode indicator LED
> present in some Asus laptops. It also creates a quirk in asus-wmi so it does 
> not
> create RFKill devices for platforms that use asus-wireless and where there is 
> a
> competition for the LED control (see "asus-wmi: Create quirk for airplane_mode
> LED" for more details).
>
> João Paulo Rechi Vita (7):
>   asus-wireless: Toggle airplane mode LED
>   asus-wmi: Create quirk for airplane_mode LED
>   asus-wmi: Add quirk_no_rfkill for the Asus N552VW
>   asus-wmi: Add quirk_no_rfkill for the Asus U303LB
>   asus-wmi: Add quirk_no_rfkill for the Asus Z550MA
>   asus-wmi: Add quirk_no_rfkill_wapf4 for the Asus X456UF
>   asus-wmi: Add quirk_no_rfkill_wapf4 for the Asus X456UA
>
>  drivers/platform/x86/Kconfig |  2 +
>  drivers/platform/x86/asus-nb-wmi.c   | 49 ++-
>  drivers/platform/x86/asus-wireless.c | 91 
> +++-
>  drivers/platform/x86/asus-wmi.c  |  8 ++--
>  drivers/platform/x86/asus-wmi.h  |  1 +
>  5 files changed, 145 insertions(+), 6 deletions(-)
>
> --
> 2.5.0
>

Looks good to me. I hope that we can get rid of all these quirks in
the near future.

Reviewed-by: Corentin Chary <corentin.ch...@gmail.com>

-- 
Corentin Chary
http://xf.iksaif.net


Re: [PATCH 0/7] asus-wireless: LED control

2016-06-19 Thread Corentin Chary
On Mon, Jun 13, 2016 at 10:57 PM, João Paulo Rechi Vita
 wrote:
> This series adds support for controlling the airplane-mode indicator LED
> present in some Asus laptops. It also creates a quirk in asus-wmi so it does 
> not
> create RFKill devices for platforms that use asus-wireless and where there is 
> a
> competition for the LED control (see "asus-wmi: Create quirk for airplane_mode
> LED" for more details).
>
> João Paulo Rechi Vita (7):
>   asus-wireless: Toggle airplane mode LED
>   asus-wmi: Create quirk for airplane_mode LED
>   asus-wmi: Add quirk_no_rfkill for the Asus N552VW
>   asus-wmi: Add quirk_no_rfkill for the Asus U303LB
>   asus-wmi: Add quirk_no_rfkill for the Asus Z550MA
>   asus-wmi: Add quirk_no_rfkill_wapf4 for the Asus X456UF
>   asus-wmi: Add quirk_no_rfkill_wapf4 for the Asus X456UA
>
>  drivers/platform/x86/Kconfig |  2 +
>  drivers/platform/x86/asus-nb-wmi.c   | 49 ++-
>  drivers/platform/x86/asus-wireless.c | 91 
> +++-
>  drivers/platform/x86/asus-wmi.c  |  8 ++--
>  drivers/platform/x86/asus-wmi.h  |  1 +
>  5 files changed, 145 insertions(+), 6 deletions(-)
>
> --
> 2.5.0
>

Looks good to me. I hope that we can get rid of all these quirks in
the near future.

Reviewed-by: Corentin Chary 

-- 
Corentin Chary
http://xf.iksaif.net


Re: [PATCH 2/7] asus-wmi: Create quirk for airplane_mode LED

2016-06-19 Thread Corentin Chary
On Mon, Jun 13, 2016 at 10:57 PM, João Paulo Rechi Vita
<jprv...@gmail.com> wrote:
>
> Some Asus laptops that have an airplane-mode indicator LED, also have
> the WMI WLAN user bit set, and the following bits in their DSDT:
>
> Scope (_SB)
> {
>   (...)
>   Device (ATKD)
>   {
> (...)
> Method (WMNB, 3, Serialized)
> {
>   (...)
>   If (LEqual (IIA0, 0x00010002))
>   {
> OWGD (IIA1)
> Return (One)
>   }
> }
>   }
> }
>
> So when asus-wmi uses ASUS_WMI_DEVID_WLAN_LED (0x00010002) to store the
> wlan state, it drives the airplane-mode indicator LED (through the call
> to OWGD) in an inverted fashion: the LED is ON when airplane mode is OFF
> (since wlan is ON), and vice-versa.

Have you tried check the values of SFUN for these laptops ? It's
supposed to have 1 bit per "feature"
maybe there is a bit that we could use to enable this quirk (this can
clearly be done after this whole series).

>
> This commit creates a quirk to not register a RFKill switch at all for
> these laptops, to allow the asus-wireless driver to drive the airplane
> mode LED correctly through the ASHS ACPI device. It also adds a match to
> that quirk for the Asus X555UB, which is affected by this problem.
>
> Signed-off-by: João Paulo Rechi Vita <jprv...@endlessm.com>
> ---
>  drivers/platform/x86/asus-nb-wmi.c | 13 +
>  drivers/platform/x86/asus-wmi.c|  8 +---
>  drivers/platform/x86/asus-wmi.h|  1 +
>  3 files changed, 19 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/platform/x86/asus-nb-wmi.c 
> b/drivers/platform/x86/asus-nb-wmi.c
> index 091ca7a..90c8f41 100644
> --- a/drivers/platform/x86/asus-nb-wmi.c
> +++ b/drivers/platform/x86/asus-nb-wmi.c
> @@ -78,6 +78,10 @@ static struct quirk_entry quirk_asus_x200ca = {
> .wapf = 2,
>  };
>
> +static struct quirk_entry quirk_no_rfkill = {
> +   .no_rfkill = true,
> +};
> +
>  static int dmi_matched(const struct dmi_system_id *dmi)
>  {
> quirks = dmi->driver_data;
> @@ -306,6 +310,15 @@ static const struct dmi_system_id asus_quirks[] = {
> },
> .driver_data = _asus_x200ca,
> },
> +   {
> +   .callback = dmi_matched,
> +   .ident = "ASUSTeK COMPUTER INC. X555UB",
> +   .matches = {
> +   DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
> +   DMI_MATCH(DMI_PRODUCT_NAME, "X555UB"),
> +   },
> +   .driver_data = _no_rfkill,
> +   },
> {},
>  };
>
> diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
> index a26dca3..7c093a0 100644
> --- a/drivers/platform/x86/asus-wmi.c
> +++ b/drivers/platform/x86/asus-wmi.c
> @@ -2069,9 +2069,11 @@ static int asus_wmi_add(struct platform_device *pdev)
> if (err)
> goto fail_leds;
>
> -   err = asus_wmi_rfkill_init(asus);
> -   if (err)
> -   goto fail_rfkill;
> +   if (!asus->driver->quirks->no_rfkill) {
> +   err = asus_wmi_rfkill_init(asus);
> +   if (err)
> +   goto fail_rfkill;
> +   }
>
> /* Some Asus desktop boards export an acpi-video backlight interface,
>stop this from showing up */
> diff --git a/drivers/platform/x86/asus-wmi.h b/drivers/platform/x86/asus-wmi.h
> index 4da4c8b..5de1df5 100644
> --- a/drivers/platform/x86/asus-wmi.h
> +++ b/drivers/platform/x86/asus-wmi.h
> @@ -38,6 +38,7 @@ struct key_entry;
>  struct asus_wmi;
>
>  struct quirk_entry {
> +   bool no_rfkill;
> bool hotplug_wireless;
> bool scalar_panel_brightness;
> bool store_backlight_power;
> --
> 2.5.0
>



-- 
Corentin Chary
http://xf.iksaif.net


Re: [PATCH 2/7] asus-wmi: Create quirk for airplane_mode LED

2016-06-19 Thread Corentin Chary
On Mon, Jun 13, 2016 at 10:57 PM, João Paulo Rechi Vita
 wrote:
>
> Some Asus laptops that have an airplane-mode indicator LED, also have
> the WMI WLAN user bit set, and the following bits in their DSDT:
>
> Scope (_SB)
> {
>   (...)
>   Device (ATKD)
>   {
> (...)
> Method (WMNB, 3, Serialized)
> {
>   (...)
>   If (LEqual (IIA0, 0x00010002))
>   {
> OWGD (IIA1)
> Return (One)
>   }
> }
>   }
> }
>
> So when asus-wmi uses ASUS_WMI_DEVID_WLAN_LED (0x00010002) to store the
> wlan state, it drives the airplane-mode indicator LED (through the call
> to OWGD) in an inverted fashion: the LED is ON when airplane mode is OFF
> (since wlan is ON), and vice-versa.

Have you tried check the values of SFUN for these laptops ? It's
supposed to have 1 bit per "feature"
maybe there is a bit that we could use to enable this quirk (this can
clearly be done after this whole series).

>
> This commit creates a quirk to not register a RFKill switch at all for
> these laptops, to allow the asus-wireless driver to drive the airplane
> mode LED correctly through the ASHS ACPI device. It also adds a match to
> that quirk for the Asus X555UB, which is affected by this problem.
>
> Signed-off-by: João Paulo Rechi Vita 
> ---
>  drivers/platform/x86/asus-nb-wmi.c | 13 +
>  drivers/platform/x86/asus-wmi.c|  8 +---
>  drivers/platform/x86/asus-wmi.h|  1 +
>  3 files changed, 19 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/platform/x86/asus-nb-wmi.c 
> b/drivers/platform/x86/asus-nb-wmi.c
> index 091ca7a..90c8f41 100644
> --- a/drivers/platform/x86/asus-nb-wmi.c
> +++ b/drivers/platform/x86/asus-nb-wmi.c
> @@ -78,6 +78,10 @@ static struct quirk_entry quirk_asus_x200ca = {
> .wapf = 2,
>  };
>
> +static struct quirk_entry quirk_no_rfkill = {
> +   .no_rfkill = true,
> +};
> +
>  static int dmi_matched(const struct dmi_system_id *dmi)
>  {
> quirks = dmi->driver_data;
> @@ -306,6 +310,15 @@ static const struct dmi_system_id asus_quirks[] = {
> },
> .driver_data = _asus_x200ca,
> },
> +   {
> +   .callback = dmi_matched,
> +   .ident = "ASUSTeK COMPUTER INC. X555UB",
> +   .matches = {
> +   DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
> +   DMI_MATCH(DMI_PRODUCT_NAME, "X555UB"),
> +   },
> +   .driver_data = _no_rfkill,
> +   },
> {},
>  };
>
> diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
> index a26dca3..7c093a0 100644
> --- a/drivers/platform/x86/asus-wmi.c
> +++ b/drivers/platform/x86/asus-wmi.c
> @@ -2069,9 +2069,11 @@ static int asus_wmi_add(struct platform_device *pdev)
> if (err)
> goto fail_leds;
>
> -   err = asus_wmi_rfkill_init(asus);
> -   if (err)
> -   goto fail_rfkill;
> +   if (!asus->driver->quirks->no_rfkill) {
> +   err = asus_wmi_rfkill_init(asus);
> +   if (err)
> +   goto fail_rfkill;
> +   }
>
> /* Some Asus desktop boards export an acpi-video backlight interface,
>stop this from showing up */
> diff --git a/drivers/platform/x86/asus-wmi.h b/drivers/platform/x86/asus-wmi.h
> index 4da4c8b..5de1df5 100644
> --- a/drivers/platform/x86/asus-wmi.h
> +++ b/drivers/platform/x86/asus-wmi.h
> @@ -38,6 +38,7 @@ struct key_entry;
>  struct asus_wmi;
>
>  struct quirk_entry {
> +   bool no_rfkill;
> bool hotplug_wireless;
> bool scalar_panel_brightness;
> bool store_backlight_power;
> --
> 2.5.0
>



-- 
Corentin Chary
http://xf.iksaif.net


Re: [PATCH 2/5] asus-wmi: Create quirk for airplane_mode LED

2016-05-25 Thread Corentin Chary
On Mon, Feb 8, 2016 at 6:05 PM, João Paulo Rechi Vita <jprv...@gmail.com> wrote:
> Some Asus laptops that have an "airplane mode" indicator LED, also have
> the WMI WLAN user bit set, and the following bits in their DSDT:
>
> Scope (_SB)
> {
>   (...)
>   Device (ATKD)
>   {
> (...)
> Method (WMNB, 3, Serialized)
> {
>   (...)
>   If (LEqual (IIA0, 0x00010002))
>   {
> OWGD (IIA1)
> Return (One)
>   }
> }
>   }
> }
>
> So when asus-wmi uses ASUS_WMI_DEVID_WLAN_LED (0x00010002) to store the
> wlan state, it drives the airplane mode indicator LED (through the call
> to OWGD) in an inverted fashion: the LED is ON when airplane mode is OFF
> (since wlan is ON), and vice-versa.
>
> This commit creates a quirk to not register a RFKill switch at all for
> these laptops, to allow the asus-wireless driver to drive the airplane
> mode LED correctly. It also adds a match to that quirk for the Asus
> X555UB.

This is really something that should get merged, multiple users are
affected by this. I do not own any of these laptops, but would there
be a way to detect this behavior instead of having static quircks ?

> Signed-off-by: João Paulo Rechi Vita <jprv...@endlessm.com>
> ---
>  drivers/platform/x86/asus-nb-wmi.c | 13 +
>  drivers/platform/x86/asus-wmi.c|  8 +---
>  drivers/platform/x86/asus-wmi.h|  1 +
>  3 files changed, 19 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/platform/x86/asus-nb-wmi.c 
> b/drivers/platform/x86/asus-nb-wmi.c
> index 131fee2..cfee863 100644
> --- a/drivers/platform/x86/asus-nb-wmi.c
> +++ b/drivers/platform/x86/asus-nb-wmi.c
> @@ -78,6 +78,10 @@ static struct quirk_entry quirk_asus_x200ca = {
> .wapf = 2,
>  };
>
> +static struct quirk_entry quirk_no_rfkill = {
> +   .no_rfkill = true,
> +};
> +
>  static int dmi_matched(const struct dmi_system_id *dmi)
>  {
> quirks = dmi->driver_data;
> @@ -297,6 +301,15 @@ static const struct dmi_system_id asus_quirks[] = {
> },
> .driver_data = _asus_x200ca,
> },
> +   {
> +   .callback = dmi_matched,
> +   .ident = "ASUSTeK COMPUTER INC. X555UB",
> +   .matches = {
> +   DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
> +   DMI_MATCH(DMI_PRODUCT_NAME, "X555UB"),
> +   },
> +   .driver_data = _no_rfkill,
> +   },
> {},
>  };
>
> diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
> index a96630d..370fa347 100644
> --- a/drivers/platform/x86/asus-wmi.c
> +++ b/drivers/platform/x86/asus-wmi.c
> @@ -2064,9 +2064,11 @@ static int asus_wmi_add(struct platform_device *pdev)
> if (err)
> goto fail_leds;
>
> -   err = asus_wmi_rfkill_init(asus);
> -   if (err)
> -   goto fail_rfkill;
> +   if (!asus->driver->quirks->no_rfkill) {
> +   err = asus_wmi_rfkill_init(asus);
> +   if (err)
> +   goto fail_rfkill;
> +   }
>
> /* Some Asus desktop boards export an acpi-video backlight interface,
>stop this from showing up */
> diff --git a/drivers/platform/x86/asus-wmi.h b/drivers/platform/x86/asus-wmi.h
> index 4da4c8b..5de1df5 100644
> --- a/drivers/platform/x86/asus-wmi.h
> +++ b/drivers/platform/x86/asus-wmi.h
> @@ -38,6 +38,7 @@ struct key_entry;
>  struct asus_wmi;
>
>  struct quirk_entry {
> +   bool no_rfkill;
> bool hotplug_wireless;
> bool scalar_panel_brightness;
> bool store_backlight_power;
> --
> 2.5.0
>



-- 
Corentin Chary
http://xf.iksaif.net


Re: [PATCH 2/5] asus-wmi: Create quirk for airplane_mode LED

2016-05-25 Thread Corentin Chary
On Mon, Feb 8, 2016 at 6:05 PM, João Paulo Rechi Vita  wrote:
> Some Asus laptops that have an "airplane mode" indicator LED, also have
> the WMI WLAN user bit set, and the following bits in their DSDT:
>
> Scope (_SB)
> {
>   (...)
>   Device (ATKD)
>   {
> (...)
> Method (WMNB, 3, Serialized)
> {
>   (...)
>   If (LEqual (IIA0, 0x00010002))
>   {
> OWGD (IIA1)
> Return (One)
>   }
> }
>   }
> }
>
> So when asus-wmi uses ASUS_WMI_DEVID_WLAN_LED (0x00010002) to store the
> wlan state, it drives the airplane mode indicator LED (through the call
> to OWGD) in an inverted fashion: the LED is ON when airplane mode is OFF
> (since wlan is ON), and vice-versa.
>
> This commit creates a quirk to not register a RFKill switch at all for
> these laptops, to allow the asus-wireless driver to drive the airplane
> mode LED correctly. It also adds a match to that quirk for the Asus
> X555UB.

This is really something that should get merged, multiple users are
affected by this. I do not own any of these laptops, but would there
be a way to detect this behavior instead of having static quircks ?

> Signed-off-by: João Paulo Rechi Vita 
> ---
>  drivers/platform/x86/asus-nb-wmi.c | 13 +
>  drivers/platform/x86/asus-wmi.c|  8 +---
>  drivers/platform/x86/asus-wmi.h|  1 +
>  3 files changed, 19 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/platform/x86/asus-nb-wmi.c 
> b/drivers/platform/x86/asus-nb-wmi.c
> index 131fee2..cfee863 100644
> --- a/drivers/platform/x86/asus-nb-wmi.c
> +++ b/drivers/platform/x86/asus-nb-wmi.c
> @@ -78,6 +78,10 @@ static struct quirk_entry quirk_asus_x200ca = {
> .wapf = 2,
>  };
>
> +static struct quirk_entry quirk_no_rfkill = {
> +   .no_rfkill = true,
> +};
> +
>  static int dmi_matched(const struct dmi_system_id *dmi)
>  {
> quirks = dmi->driver_data;
> @@ -297,6 +301,15 @@ static const struct dmi_system_id asus_quirks[] = {
> },
> .driver_data = _asus_x200ca,
> },
> +   {
> +   .callback = dmi_matched,
> +   .ident = "ASUSTeK COMPUTER INC. X555UB",
> +   .matches = {
> +   DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
> +   DMI_MATCH(DMI_PRODUCT_NAME, "X555UB"),
> +   },
> +   .driver_data = _no_rfkill,
> +   },
> {},
>  };
>
> diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
> index a96630d..370fa347 100644
> --- a/drivers/platform/x86/asus-wmi.c
> +++ b/drivers/platform/x86/asus-wmi.c
> @@ -2064,9 +2064,11 @@ static int asus_wmi_add(struct platform_device *pdev)
> if (err)
> goto fail_leds;
>
> -   err = asus_wmi_rfkill_init(asus);
> -   if (err)
> -   goto fail_rfkill;
> +   if (!asus->driver->quirks->no_rfkill) {
> +   err = asus_wmi_rfkill_init(asus);
> +   if (err)
> +   goto fail_rfkill;
> +   }
>
> /* Some Asus desktop boards export an acpi-video backlight interface,
>stop this from showing up */
> diff --git a/drivers/platform/x86/asus-wmi.h b/drivers/platform/x86/asus-wmi.h
> index 4da4c8b..5de1df5 100644
> --- a/drivers/platform/x86/asus-wmi.h
> +++ b/drivers/platform/x86/asus-wmi.h
> @@ -38,6 +38,7 @@ struct key_entry;
>  struct asus_wmi;
>
>  struct quirk_entry {
> +   bool no_rfkill;
> bool hotplug_wireless;
> bool scalar_panel_brightness;
> bool store_backlight_power;
> --
> 2.5.0
>



-- 
Corentin Chary
http://xf.iksaif.net


Re: [PATCH v2] asus-laptop: Add key found on Asus F3M

2015-08-12 Thread Corentin Chary
On Wed, Aug 5, 2015 at 10:29 PM, Darren Hart  wrote:
> On Wed, Jul 29, 2015 at 09:31:23PM +0200, Łukasz Stelmach wrote:
>> 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 
>
> Thanks Łukasz.
>
> Corentin, any concerns?

Acked-by: Corentin Chary 

Sorry for the delay, I won't really have a stable internet connection
until October.

>
>> ---
>>  drivers/platform/x86/asus-laptop.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/platform/x86/asus-laptop.c 
>> b/drivers/platform/x86/asus-laptop.c
>> index 58d29c4..f2b5d0a 100644
>> --- a/drivers/platform/x86/asus-laptop.c
>> +++ b/drivers/platform/x86/asus-laptop.c
>> @@ -332,6 +332,7 @@ static const struct key_entry asus_keymap[] = {
>>   {KE_KEY, 0x65, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + TV */
>>   {KE_KEY, 0x66, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV */
>>   {KE_KEY, 0x67, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV */
>> + {KE_KEY, 0x6A, { KEY_TOUCHPAD_TOGGLE } }, /* Lock Touchpad Fn + F9 */
>>   {KE_KEY, 0x6B, { KEY_TOUCHPAD_TOGGLE } }, /* Lock Touchpad */
>>   {KE_KEY, 0x6C, { KEY_SLEEP } }, /* Suspend */
>>   {KE_KEY, 0x6D, { KEY_SLEEP } }, /* Hibernate */
>> --
>> 2.1.4
>>
>>
>
> --
> Darren Hart
> Intel Open Source Technology Center



-- 
Corentin Chary
http://xf.iksaif.net
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] asus-laptop: Add key found on Asus F3M

2015-08-12 Thread Corentin Chary
On Wed, Aug 5, 2015 at 10:29 PM, Darren Hart dvh...@infradead.org wrote:
 On Wed, Jul 29, 2015 at 09:31:23PM +0200, Łukasz Stelmach wrote:
 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 stl...@poczta.fm

 Thanks Łukasz.

 Corentin, any concerns?

Acked-by: Corentin Chary corentin.ch...@gmail.com

Sorry for the delay, I won't really have a stable internet connection
until October.


 ---
  drivers/platform/x86/asus-laptop.c | 1 +
  1 file changed, 1 insertion(+)

 diff --git a/drivers/platform/x86/asus-laptop.c 
 b/drivers/platform/x86/asus-laptop.c
 index 58d29c4..f2b5d0a 100644
 --- a/drivers/platform/x86/asus-laptop.c
 +++ b/drivers/platform/x86/asus-laptop.c
 @@ -332,6 +332,7 @@ static const struct key_entry asus_keymap[] = {
   {KE_KEY, 0x65, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + TV */
   {KE_KEY, 0x66, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV */
   {KE_KEY, 0x67, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV */
 + {KE_KEY, 0x6A, { KEY_TOUCHPAD_TOGGLE } }, /* Lock Touchpad Fn + F9 */
   {KE_KEY, 0x6B, { KEY_TOUCHPAD_TOGGLE } }, /* Lock Touchpad */
   {KE_KEY, 0x6C, { KEY_SLEEP } }, /* Suspend */
   {KE_KEY, 0x6D, { KEY_SLEEP } }, /* Hibernate */
 --
 2.1.4



 --
 Darren Hart
 Intel Open Source Technology Center



-- 
Corentin Chary
http://xf.iksaif.net
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH][v2] asus-rbtn: new driver for asus radio button for Windows 8

2015-07-12 Thread Corentin Chary
On Fri, Jul 10, 2015 at 3:52 AM, Alex Hung  wrote:
> On Fri, Jul 10, 2015 at 4:52 AM, Darren Hart  wrote:
>> On Tue, Jul 07, 2015 at 04:25:18PM +0200, Pali Rohár wrote:
>>> On Monday 06 July 2015 15:43:28 Darren Hart wrote:
>>> > On Mon, Jul 06, 2015 at 09:35:40AM +0800, Alex Hung wrote:
>>> > > ATK4001 is an ACPI device for wireless hotkey, similar to how Dell and
>>> > > HP are doing it.  It is just ASUS who decides LED should be controlled
>>> > > by software unlike HP whose LED is driven by hardware pins on mini
>>> > > card.
>>> >
>>> > Alex, please refrain from top posting on Linux kernel mailing lists, it 
>>> > breaks
>>> > the established practice the readers are setup for.
>>> >
>>> > Regarding the ATK4001 device, it did sound like it did more than control 
>>> > the
>>> > radios and the associcated LED. If that is all it does, then asus-rbtn is 
>>> > fine.
>>> > If it does something beyond that, we need understand what that is, as a 
>>> > more
>>> > platform-centric name would be more appropriate.
>>> >
>>> > Thanks,
>>>
>>> Yes, I understand too that ATK4001 device has more functions as one for
>>> LED control. And in this case it is not good to use name from one
>>> specific functionality.
>>>
>>> And about name:
>>>
>>> I chose name rbtn for dell driver because ACPI device in DSDT table is
>>> named RBTN and acpi id is DELRBTN.
>>>
>>> I think that acpi-rbtn.c (radio button) is not ideal name for driver
>>> which at SW level controls LED device associated with wireless devices.
>>>
>>> I would rather follow acpi device name, but in this case ATK4001 is even
>>> worse name which does not say anything...
>>>
>>> Maybe better name could be asus-wireless? Still I do not have any good
>>> name, so choose something...
>>
>> I suggested rbtn to try and start showing some kind of consistency in the
>> directory - however, it's no better than many of the other existing options,
>> including -rfkill -wireless -laptop, etc.
>>
>> Speaking of -laptop, the asus-laptop driver supports ATK0100 and ATK0101. 
>> This
>> ATK4001 device appears to perform the same type of features. The question is
>> whether or not it can be reasonably incorporated into the existing 
>> asus-laptop
>> driver or not.
>>
>> (I intended to do that review myself, but I haven't found the time in 48 
>> hours,
>> so I'm just going to send this out and ask that Alex have a look and provide 
>> his
>> thoughts on asus-laptop)
>>
>> --
>> Darren Hart
>> Intel Open Source Technology Center
>
> Certainly, I should have time to look into asus-laptop next week.
>
>
> --
> Cheers,
> Alex Hung

asus-laptop has some assumption regarding the methosd provided by the
ACPI device, but you may be able to integrate with it.
Hard to know if it make sense though, really depend how similar these
interfaces are.

-- 
Corentin Chary
http://xf.iksaif.net
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH][v2] asus-rbtn: new driver for asus radio button for Windows 8

2015-07-12 Thread Corentin Chary
On Fri, Jul 10, 2015 at 3:52 AM, Alex Hung alex.h...@canonical.com wrote:
 On Fri, Jul 10, 2015 at 4:52 AM, Darren Hart dvh...@infradead.org wrote:
 On Tue, Jul 07, 2015 at 04:25:18PM +0200, Pali Rohár wrote:
 On Monday 06 July 2015 15:43:28 Darren Hart wrote:
  On Mon, Jul 06, 2015 at 09:35:40AM +0800, Alex Hung wrote:
   ATK4001 is an ACPI device for wireless hotkey, similar to how Dell and
   HP are doing it.  It is just ASUS who decides LED should be controlled
   by software unlike HP whose LED is driven by hardware pins on mini
   card.
 
  Alex, please refrain from top posting on Linux kernel mailing lists, it 
  breaks
  the established practice the readers are setup for.
 
  Regarding the ATK4001 device, it did sound like it did more than control 
  the
  radios and the associcated LED. If that is all it does, then asus-rbtn is 
  fine.
  If it does something beyond that, we need understand what that is, as a 
  more
  platform-centric name would be more appropriate.
 
  Thanks,

 Yes, I understand too that ATK4001 device has more functions as one for
 LED control. And in this case it is not good to use name from one
 specific functionality.

 And about name:

 I chose name rbtn for dell driver because ACPI device in DSDT table is
 named RBTN and acpi id is DELRBTN.

 I think that acpi-rbtn.c (radio button) is not ideal name for driver
 which at SW level controls LED device associated with wireless devices.

 I would rather follow acpi device name, but in this case ATK4001 is even
 worse name which does not say anything...

 Maybe better name could be asus-wireless? Still I do not have any good
 name, so choose something...

 I suggested rbtn to try and start showing some kind of consistency in the
 directory - however, it's no better than many of the other existing options,
 including -rfkill -wireless -laptop, etc.

 Speaking of -laptop, the asus-laptop driver supports ATK0100 and ATK0101. 
 This
 ATK4001 device appears to perform the same type of features. The question is
 whether or not it can be reasonably incorporated into the existing 
 asus-laptop
 driver or not.

 (I intended to do that review myself, but I haven't found the time in 48 
 hours,
 so I'm just going to send this out and ask that Alex have a look and provide 
 his
 thoughts on asus-laptop)

 --
 Darren Hart
 Intel Open Source Technology Center

 Certainly, I should have time to look into asus-laptop next week.


 --
 Cheers,
 Alex Hung

asus-laptop has some assumption regarding the methosd provided by the
ACPI device, but you may be able to integrate with it.
Hard to know if it make sense though, really depend how similar these
interfaces are.

-- 
Corentin Chary
http://xf.iksaif.net
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] asus-nb-wmi: Add wapf4 quirk for X200MA

2015-06-04 Thread Corentin Chary
On Fri, May 29, 2015 at 9:14 PM, Dmitry Tunin  wrote:
> Wireless is not blocked without this quirk, but
> wireless LED does not follow wireless status.
> With this quirk it accurately reflects if wireless is on or off.
>
> Signed-off-by: Dmitry Tunin 
> Cc: sta...@vger.kernel.org
> ---
>  drivers/platform/x86/asus-nb-wmi.c | 9 +
>  1 file changed, 9 insertions(+)
>
> diff --git a/drivers/platform/x86/asus-nb-wmi.c 
> b/drivers/platform/x86/asus-nb-wmi.c
> index abdaed3..bc86a71 100644
> --- a/drivers/platform/x86/asus-nb-wmi.c
> +++ b/drivers/platform/x86/asus-nb-wmi.c
> @@ -101,6 +101,15 @@ static const struct dmi_system_id asus_quirks[] = {
> },
> {
> .callback = dmi_matched,
> +   .ident = "ASUSTeK COMPUTER INC. X200MA",
> +   .matches = {
> +   DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
> +   DMI_MATCH(DMI_PRODUCT_NAME, "X200MA"),
> +   },
> +   .driver_data = _asus_wapf4,
> +   },
> +   {
> +   .callback = dmi_matched,
> .ident = "ASUSTeK COMPUTER INC. X401U",
> .matches = {
> DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
> --
> 1.9.1
>

Acked-by: Corentin Chary http://xf.iksaif.net
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] asus-nb-wmi: Add wapf4 quirk for X200MA

2015-06-04 Thread Corentin Chary
On Fri, May 29, 2015 at 9:14 PM, Dmitry Tunin hanipouspi...@gmail.com wrote:
 Wireless is not blocked without this quirk, but
 wireless LED does not follow wireless status.
 With this quirk it accurately reflects if wireless is on or off.

 Signed-off-by: Dmitry Tunin hanipouspi...@gmail.com
 Cc: sta...@vger.kernel.org
 ---
  drivers/platform/x86/asus-nb-wmi.c | 9 +
  1 file changed, 9 insertions(+)

 diff --git a/drivers/platform/x86/asus-nb-wmi.c 
 b/drivers/platform/x86/asus-nb-wmi.c
 index abdaed3..bc86a71 100644
 --- a/drivers/platform/x86/asus-nb-wmi.c
 +++ b/drivers/platform/x86/asus-nb-wmi.c
 @@ -101,6 +101,15 @@ static const struct dmi_system_id asus_quirks[] = {
 },
 {
 .callback = dmi_matched,
 +   .ident = ASUSTeK COMPUTER INC. X200MA,
 +   .matches = {
 +   DMI_MATCH(DMI_SYS_VENDOR, ASUSTeK COMPUTER INC.),
 +   DMI_MATCH(DMI_PRODUCT_NAME, X200MA),
 +   },
 +   .driver_data = quirk_asus_wapf4,
 +   },
 +   {
 +   .callback = dmi_matched,
 .ident = ASUSTeK COMPUTER INC. X401U,
 .matches = {
 DMI_MATCH(DMI_SYS_VENDOR, ASUSTeK COMPUTER INC.),
 --
 1.9.1


Acked-by: Corentin Chary corentin.ch...@gmail.com)

-- 
Corentin Chary
http://xf.iksaif.net
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC v4] asus-wmi: add fan control

2015-05-13 Thread Corentin Chary
On Wed, May 13, 2015 at 12:09 AM, Kast Bernd  wrote:
> This patch is partially based on Felipe Contrera's earlier patch, that
> was discussed here: https://lkml.org/lkml/2013/10/8/800
> Some problems of that patch are solved, now:
>
> 1) The main obstacle for the earlier patch seemed to be the use of
> virt_to_phys, which is accepted, now
>
> 2) random memory corruption occurred on my notebook, thus DMA-able memory
> is allocated now, which solves this problem
>
> 3) hwmon interface is used instead of the thermal interface, as a
> hwmon device is already set up by this driver and seemed more
> appropriate than the thermal interface
>
> 4) Calling the ACPI-functions was modularized thus it's possible to call
> some multifunctions easily, now (by using
> asus_wmi_evaluate_method_agfn).
>
> Unfortunately the WMI doesn't support controlling both fans on
> a dual-fan notebook because of an restriction in the acpi-method
> "SFNS", that is callable through the wmi. If "SFNV" would be called
> directly even dual fan configurations could be controlled, but not by using
> wmi.
>
> Speed readings only work on auto-mode, thus "-1" will be reported in
> manual mode.
> Additionally the speed readings are reported as hundreds of RPM thus
> they are not too precise.
>
> This patch is tested only on one notebook (N551JK) but a similar module,
> that contained some code to try to control the second fan also, was
> reported to work on an UX32VD, at least for the first fan.
>
> As Felipe already mentioned the low-level functions are described here:
> http://forum.notebookreview.com/threads/fan-control-on-asus-prime-ux31-ux31a-ux32a-ux32vd.705656/
>
> Signed-off-by: Kast Bernd 
> Cc: Corentin Chary 
> Cc: Darren Hart 
> Cc: Matthew Garrett 
> Cc: Rafael J. Wysocki 
> ---
> Changes for v4:
> suggested by Darren Hart:
> - removed some compiler warnings
> - fixed last block comment
> - fixed variable ordering
> Changes for v3:
> suggested by Darren Hart:
> - changed formating of multi-line comment blocks
> - changed return paths
> - changed confusing variable name
> Changes for v2:
> suggested by Darren Hart:
> - variable ordering from longest to shortest
> - fail label removed in asus_wmi_evaluate_method_agfn
> - removed unnecessary ternary operator
> - used NULL instead of 0
> - used DEVICE_ATTR_(RO|RW)
> suggested by Corentin Chary:
> - asus_hwmon_agfn_fan_speed split to two functions
> - added some logging
> - used existing function to clamp values
> suggested by both:
> - updated comments
> - tried to return proper error codes
> - removed some magic numbers
> These warnings didn't show up - even when compiling with "make W=12".
> Do you use the default settings? Or do I need to change something else to
> get it more verbose?
> Thanks in advance
> Bernd
>  drivers/platform/x86/asus-wmi.c | 344 
> +---
>  1 file changed, 323 insertions(+), 21 deletions(-)
>
> diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
> index 7543a56..85422d4 100644
> --- a/drivers/platform/x86/asus-wmi.c
> +++ b/drivers/platform/x86/asus-wmi.c
> @@ -78,6 +78,7 @@ MODULE_LICENSE("GPL");
>  #define ASUS_WMI_METHODID_GPID 0x44495047 /* Get Panel ID?? (Resol) 
> */
>  #define ASUS_WMI_METHODID_QMOD 0x444F4D51 /* Quiet MODe */
>  #define ASUS_WMI_METHODID_SPLV 0x4C425053 /* Set Panel Light Value */
> +#define ASUS_WMI_METHODID_AGFN 0x4E464741 /* FaN? */
>  #define ASUS_WMI_METHODID_SFUN 0x4E554653 /* FUNCtionalities */
>  #define ASUS_WMI_METHODID_SDSP 0x50534453 /* Set DiSPlay output */
>  #define ASUS_WMI_METHODID_GDSP 0x50534447 /* Get DiSPlay output */
> @@ -150,12 +151,38 @@ MODULE_LICENSE("GPL");
>  #define ASUS_WMI_DSTS_BRIGHTNESS_MASK  0x00FF
>  #define ASUS_WMI_DSTS_MAX_BRIGTH_MASK  0xFF00
>
> +#define ASUS_FAN_DESC  "cpu_fan"
> +#define ASUS_FAN_MFUN  0x13
> +#define ASUS_FAN_SFUN_READ 0x06
> +#define ASUS_FAN_SFUN_WRITE0x07
> +#define ASUS_FAN_CTRL_MANUAL   1
> +#define ASUS_FAN_CTRL_AUTO 2
> +
>  struct bios_args {
> u32 arg0;
> u32 arg1;
>  } __packed;
>
>  /*
> + * Struct that's used for all methods called via AGFN. Naming is
&

Re: [RFC v4] asus-wmi: add fan control

2015-05-13 Thread Corentin Chary
On Wed, May 13, 2015 at 12:09 AM, Kast Bernd kastbe...@gmx.de wrote:
 This patch is partially based on Felipe Contrera's earlier patch, that
 was discussed here: https://lkml.org/lkml/2013/10/8/800
 Some problems of that patch are solved, now:

 1) The main obstacle for the earlier patch seemed to be the use of
 virt_to_phys, which is accepted, now

 2) random memory corruption occurred on my notebook, thus DMA-able memory
 is allocated now, which solves this problem

 3) hwmon interface is used instead of the thermal interface, as a
 hwmon device is already set up by this driver and seemed more
 appropriate than the thermal interface

 4) Calling the ACPI-functions was modularized thus it's possible to call
 some multifunctions easily, now (by using
 asus_wmi_evaluate_method_agfn).

 Unfortunately the WMI doesn't support controlling both fans on
 a dual-fan notebook because of an restriction in the acpi-method
 SFNS, that is callable through the wmi. If SFNV would be called
 directly even dual fan configurations could be controlled, but not by using
 wmi.

 Speed readings only work on auto-mode, thus -1 will be reported in
 manual mode.
 Additionally the speed readings are reported as hundreds of RPM thus
 they are not too precise.

 This patch is tested only on one notebook (N551JK) but a similar module,
 that contained some code to try to control the second fan also, was
 reported to work on an UX32VD, at least for the first fan.

 As Felipe already mentioned the low-level functions are described here:
 http://forum.notebookreview.com/threads/fan-control-on-asus-prime-ux31-ux31a-ux32a-ux32vd.705656/

 Signed-off-by: Kast Bernd kastbe...@gmx.de
 Cc: Corentin Chary corentin.ch...@gmail.com
 Cc: Darren Hart dvh...@infradead.org
 Cc: Matthew Garrett mj...@srcf.ucam.org
 Cc: Rafael J. Wysocki r...@rjwysocki.net
 ---
 Changes for v4:
 suggested by Darren Hart:
 - removed some compiler warnings
 - fixed last block comment
 - fixed variable ordering
 Changes for v3:
 suggested by Darren Hart:
 - changed formating of multi-line comment blocks
 - changed return paths
 - changed confusing variable name
 Changes for v2:
 suggested by Darren Hart:
 - variable ordering from longest to shortest
 - fail label removed in asus_wmi_evaluate_method_agfn
 - removed unnecessary ternary operator
 - used NULL instead of 0
 - used DEVICE_ATTR_(RO|RW)
 suggested by Corentin Chary:
 - asus_hwmon_agfn_fan_speed split to two functions
 - added some logging
 - used existing function to clamp values
 suggested by both:
 - updated comments
 - tried to return proper error codes
 - removed some magic numbers
 These warnings didn't show up - even when compiling with make W=12.
 Do you use the default settings? Or do I need to change something else to
 get it more verbose?
 Thanks in advance
 Bernd
  drivers/platform/x86/asus-wmi.c | 344 
 +---
  1 file changed, 323 insertions(+), 21 deletions(-)

 diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
 index 7543a56..85422d4 100644
 --- a/drivers/platform/x86/asus-wmi.c
 +++ b/drivers/platform/x86/asus-wmi.c
 @@ -78,6 +78,7 @@ MODULE_LICENSE(GPL);
  #define ASUS_WMI_METHODID_GPID 0x44495047 /* Get Panel ID?? (Resol) 
 */
  #define ASUS_WMI_METHODID_QMOD 0x444F4D51 /* Quiet MODe */
  #define ASUS_WMI_METHODID_SPLV 0x4C425053 /* Set Panel Light Value */
 +#define ASUS_WMI_METHODID_AGFN 0x4E464741 /* FaN? */
  #define ASUS_WMI_METHODID_SFUN 0x4E554653 /* FUNCtionalities */
  #define ASUS_WMI_METHODID_SDSP 0x50534453 /* Set DiSPlay output */
  #define ASUS_WMI_METHODID_GDSP 0x50534447 /* Get DiSPlay output */
 @@ -150,12 +151,38 @@ MODULE_LICENSE(GPL);
  #define ASUS_WMI_DSTS_BRIGHTNESS_MASK  0x00FF
  #define ASUS_WMI_DSTS_MAX_BRIGTH_MASK  0xFF00

 +#define ASUS_FAN_DESC  cpu_fan
 +#define ASUS_FAN_MFUN  0x13
 +#define ASUS_FAN_SFUN_READ 0x06
 +#define ASUS_FAN_SFUN_WRITE0x07
 +#define ASUS_FAN_CTRL_MANUAL   1
 +#define ASUS_FAN_CTRL_AUTO 2
 +
  struct bios_args {
 u32 arg0;
 u32 arg1;
  } __packed;

  /*
 + * Struct that's used for all methods called via AGFN. Naming is
 + * identically to the AML code.
 + */
 +struct agfn_args {
 +   u16 mfun; /* probably Multi-function to be called */
 +   u16 sfun; /* probably Sub-function to be called */
 +   u16 len;  /* size of the hole struct, including subfunction fields */
 +   u8 stas;  /* not used by now */
 +   u8 err;   /* zero on success */
 +} __packed;
 +
 +/* struct used for calling fan read and write

Re: [RFC 2/2] asus-wmi: add fan control

2015-05-02 Thread Corentin Chary
  || attr == _attr_pwm1_enable.attr) {
> +   fan_attr = 1;
> +   }
> +
> if (dev_id != -1) {
> int err = asus_wmi_get_devstate(asus, dev_id, );
>
> -   if (err < 0)
> +   if (err < 0 && fan_attr == -1)
> return 0; /* can't return negative here */
> }
>
> @@ -1112,10 +1340,16 @@ static umode_t asus_hwmon_sysfs_is_visible(struct 
> kobject *kobj,
> if (value == ASUS_WMI_UNSUPPORTED_METHOD || value & 0xFFF8
> || (!asus->sfun && !(value & ASUS_WMI_DSTS_PRESENCE_BIT)))
> ok = false;
> +   else
> +   ok = fan_attr <= asus->asus_hwmon_num_fans;
> } else if (dev_id == ASUS_WMI_DEVID_THERMAL_CTRL) {
> /* If value is zero, something is clearly wrong */
> -   if (value == 0)
> +   if (!value)
> ok = false;
> +   } else if (fan_attr <= asus->asus_hwmon_num_fans && fan_attr != -1) {
> +   ok = true;
> +   } else {
> +   ok = false;
> }
>
> return ok ? attr->mode : 0;
> @@ -1723,6 +1957,25 @@ error_debugfs:
> return -ENOMEM;
>  }
>
> +static int asus_wmi_fan_init(struct asus_wmi *asus)
> +{
> +   int status;
> +
> +   asus->asus_hwmon_pwm = -1;
> +   asus->asus_hwmon_num_fans = -1;
> +   asus->asus_hwmon_fan_manual_mode = 0;
> +
> +   status = asus_hwmon_get_fan_number(asus, >asus_hwmon_num_fans);
> +   if (status) {
> +   asus->asus_hwmon_num_fans = 0;
> +   pr_warn("Could not determine number of fans: %d\n", status);
> +   return -1;
> +   }
> +
> +   pr_info("Number of fans: %d\n", asus->asus_hwmon_num_fans);
> +   return 0;
> +}
> +
>  /*
>   * WMI Driver
>   */
> @@ -1756,6 +2009,9 @@ static int asus_wmi_add(struct platform_device *pdev)
> if (err)
> goto fail_input;
>
> +   err = asus_wmi_fan_init(asus); /* probably no problems on error */
> +   asus_hwmon_fan_set_auto(asus);
> +
> err = asus_wmi_hwmon_init(asus);
> if (err)
> goto fail_hwmon;
> @@ -1832,6 +2088,7 @@ static int asus_wmi_remove(struct platform_device 
> *device)
> asus_wmi_rfkill_exit(asus);
> asus_wmi_debugfs_exit(asus);
> asus_wmi_platform_exit(asus);
> +   asus_hwmon_fan_set_auto(asus);
>
> kfree(asus);
> return 0;
> --
> 2.3.5
>



-- 
Corentin Chary
http://xf.iksaif.net
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC 2/2] asus-wmi: add fan control

2015-05-02 Thread Corentin Chary
(Number of fans: %d\n, asus-asus_hwmon_num_fans);
 +   return 0;
 +}
 +
  /*
   * WMI Driver
   */
 @@ -1756,6 +2009,9 @@ static int asus_wmi_add(struct platform_device *pdev)
 if (err)
 goto fail_input;

 +   err = asus_wmi_fan_init(asus); /* probably no problems on error */
 +   asus_hwmon_fan_set_auto(asus);
 +
 err = asus_wmi_hwmon_init(asus);
 if (err)
 goto fail_hwmon;
 @@ -1832,6 +2088,7 @@ static int asus_wmi_remove(struct platform_device 
 *device)
 asus_wmi_rfkill_exit(asus);
 asus_wmi_debugfs_exit(asus);
 asus_wmi_platform_exit(asus);
 +   asus_hwmon_fan_set_auto(asus);

 kfree(asus);
 return 0;
 --
 2.3.5




-- 
Corentin Chary
http://xf.iksaif.net
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] samsung-laptop: enable better lid handling

2015-01-27 Thread Corentin Chary
On Tue, Jan 27, 2015 at 2:52 AM, Darren Hart  wrote:
> On Thu, Dec 11, 2014 at 09:18:35PM +, Julijonas Kikutis wrote:
>
> Hi Julijonas,
>
> Please Cc the maintainer listed in the MAINTERS file for a faster response.

The easiest to do that is to use " git send-email
--cc-cmd=scripts/get_maintainer.pl"

He did cc me though, I just don't have enough time to monitor this
mailing list currently, sorry for that.

>> Some Samsung laptops with SABI3 delay the sleep for 10 seconds after
>> the lid is closed and do not wake up from sleep after the lid is opened.
>> A SABI command is needed to enable the better behavior.
>>
>> Command = 0x6e, d0 = 0x81 enables this behavior. Returns d0 = 0x01.
>> Command = 0x6e, d0 = 0x80 disables this behavior. Returns d0 = 0x00.
>>
>> Command = 0x6d and any d0 queries the state. This returns:
>> d0 = 0x0*01, d1 = 0x00, d2 = 0x00, d3 = 0x0* when it is enabled.
>> d0 = 0x0*00, d1 = 0x00, d2 = 0x00, d3 = 0x0* when it is disabled.
>> Where * is 0 - laptop has never slept or hibernated after switch on,
>>1 - laptop has hibernated just before,
>>2 - laptop has slept just before.
>>
>> Patch addresses bug https://bugzilla.kernel.org/show_bug.cgi?id=75901.
>> It adds a sysfs attribute lid_handling with description and also an
>> addition to the quirks structure to enable the mode by default.
>>
>> However, a user with another laptop in the bug report says that "power
>> button has to be pressed twice to wake the machine" in this mode.
>
> This is with this patch applied?
>
>> Therefore, it is enabled by default only for the single laptop that I
>> have tested.
>>
>> This mode is also needed in UEFI, but there samsung-laptop is
>> unfortunately disabled.
>
> I don't follow. What are you saying here?

samsung-laptop doesn't current load when the laptop boots in UEFI mode
becaue this used to brick the laptop.
I don't think this is the case anymore with new laptops, unfortunately
I don't own any of these.

> This looks pretty much ready. The only comments I have are argued against by
> staying consistent with the existing driver. So just the above questions and 
> one
> comment below. Please clarify, update, and resend. Be sure to add me to Cc 
> this
> time :-)
>
>>
>> Signed-off-by: Julijonas Kikutis 
>> ---
>
> ...
>
>> @@ -,7 +1208,7 @@ static int __init samsung_backlight_init(struct 
>> samsung_laptop *samsung)
>>  }
>>
>>  static umode_t samsung_sysfs_is_visible(struct kobject *kobj,
>> -struct attribute *attr, int idx)
>> + struct attribute *attr, int idx)
>>  {
>>   struct device *dev = container_of(kobj, struct device, kobj);
>>   struct platform_device *pdev = to_platform_device(dev);
>> @@ -1124,6 +1221,8 @@ static umode_t samsung_sysfs_is_visible(struct kobject 
>> *kobj,
>>   ok = !!(read_battery_life_extender(samsung) >= 0);
>>   if (attr == _attr_usb_charge.attr)
>>   ok = !!(read_usb_charge(samsung) >= 0);
>> + if (attr == _attr_lid_handling.attr)
>> + ok = !!(read_lid_handling(samsung) >= 0);
>>
>>   return ok ? attr->mode : 0;
>>  }
>> @@ -1436,6 +1535,10 @@ static int samsung_pm_notification(struct 
>> notifier_block *nb,
>>   samsung->quirks->enable_kbd_backlight)
>>   kbd_backlight_enable(samsung);
>>
>> + if (val == PM_POST_HIBERNATION &&
>> + samsung->quirks->lid_handling)
>
> This can be one line.
>
>
> --
> Darren Hart
> Intel Open Source Technology Center



-- 
Corentin Chary
http://xf.iksaif.net
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] samsung-laptop: enable better lid handling

2015-01-27 Thread Corentin Chary
On Tue, Jan 27, 2015 at 2:52 AM, Darren Hart dvh...@infradead.org wrote:
 On Thu, Dec 11, 2014 at 09:18:35PM +, Julijonas Kikutis wrote:

 Hi Julijonas,

 Please Cc the maintainer listed in the MAINTERS file for a faster response.

The easiest to do that is to use  git send-email
--cc-cmd=scripts/get_maintainer.pl

He did cc me though, I just don't have enough time to monitor this
mailing list currently, sorry for that.

 Some Samsung laptops with SABI3 delay the sleep for 10 seconds after
 the lid is closed and do not wake up from sleep after the lid is opened.
 A SABI command is needed to enable the better behavior.

 Command = 0x6e, d0 = 0x81 enables this behavior. Returns d0 = 0x01.
 Command = 0x6e, d0 = 0x80 disables this behavior. Returns d0 = 0x00.

 Command = 0x6d and any d0 queries the state. This returns:
 d0 = 0x0*01, d1 = 0x00, d2 = 0x00, d3 = 0x0* when it is enabled.
 d0 = 0x0*00, d1 = 0x00, d2 = 0x00, d3 = 0x0* when it is disabled.
 Where * is 0 - laptop has never slept or hibernated after switch on,
1 - laptop has hibernated just before,
2 - laptop has slept just before.

 Patch addresses bug https://bugzilla.kernel.org/show_bug.cgi?id=75901.
 It adds a sysfs attribute lid_handling with description and also an
 addition to the quirks structure to enable the mode by default.

 However, a user with another laptop in the bug report says that power
 button has to be pressed twice to wake the machine in this mode.

 This is with this patch applied?

 Therefore, it is enabled by default only for the single laptop that I
 have tested.

 This mode is also needed in UEFI, but there samsung-laptop is
 unfortunately disabled.

 I don't follow. What are you saying here?

samsung-laptop doesn't current load when the laptop boots in UEFI mode
becaue this used to brick the laptop.
I don't think this is the case anymore with new laptops, unfortunately
I don't own any of these.

 This looks pretty much ready. The only comments I have are argued against by
 staying consistent with the existing driver. So just the above questions and 
 one
 comment below. Please clarify, update, and resend. Be sure to add me to Cc 
 this
 time :-)


 Signed-off-by: Julijonas Kikutis julijonas.kiku...@gmail.com
 ---

 ...

 @@ -,7 +1208,7 @@ static int __init samsung_backlight_init(struct 
 samsung_laptop *samsung)
  }

  static umode_t samsung_sysfs_is_visible(struct kobject *kobj,
 -struct attribute *attr, int idx)
 + struct attribute *attr, int idx)
  {
   struct device *dev = container_of(kobj, struct device, kobj);
   struct platform_device *pdev = to_platform_device(dev);
 @@ -1124,6 +1221,8 @@ static umode_t samsung_sysfs_is_visible(struct kobject 
 *kobj,
   ok = !!(read_battery_life_extender(samsung) = 0);
   if (attr == dev_attr_usb_charge.attr)
   ok = !!(read_usb_charge(samsung) = 0);
 + if (attr == dev_attr_lid_handling.attr)
 + ok = !!(read_lid_handling(samsung) = 0);

   return ok ? attr-mode : 0;
  }
 @@ -1436,6 +1535,10 @@ static int samsung_pm_notification(struct 
 notifier_block *nb,
   samsung-quirks-enable_kbd_backlight)
   kbd_backlight_enable(samsung);

 + if (val == PM_POST_HIBERNATION 
 + samsung-quirks-lid_handling)

 This can be one line.


 --
 Darren Hart
 Intel Open Source Technology Center



-- 
Corentin Chary
http://xf.iksaif.net
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 3/3] asus-laptop: cleanup is_visible

2015-01-20 Thread Corentin Chary
 _attr_ls_value.attr) {
> -   supported = asus->is_pega_lucid;
> -   } else if (attr == _attr_gps.attr) {
> -   supported = !acpi_check_handle(handle, METHOD_GPS_ON, NULL) &&
> -   !acpi_check_handle(handle, METHOD_GPS_OFF, NULL) 
> &&
> -   !acpi_check_handle(handle, METHOD_GPS_STATUS, 
> NULL);
> -   } else {
> -   supported = true;
> +   } else if (index == 9) {
> +   ret = asus->is_pega_lucid ||
> +   (!acpi_check_handle(handle, METHOD_ALS_CONTROL, NULL) 
> &&
> +    !acpi_check_handle(handle, METHOD_ALS_LEVEL, NULL));
> +   } else if (index == 10) {
> +   ret = !acpi_check_handle(handle, METHOD_GPS_ON, NULL) &&
> +   !acpi_check_handle(handle, METHOD_GPS_OFF, NULL) &&
> +   !acpi_check_handle(handle, METHOD_GPS_STATUS, NULL);
> }
>
> -   return supported ? attr->mode : 0;
> +   return ret ? attr->mode : 0;
>  }
>
>
> --
> 2.2.2
>



-- 
Corentin Chary
http://xf.iksaif.net
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 3/3] asus-laptop: cleanup is_visible

2015-01-20 Thread Corentin Chary
);
 -   } else {
 -   supported = true;
 +   } else if (index == 9) {
 +   ret = asus-is_pega_lucid ||
 +   (!acpi_check_handle(handle, METHOD_ALS_CONTROL, NULL) 
 
 +!acpi_check_handle(handle, METHOD_ALS_LEVEL, NULL));
 +   } else if (index == 10) {
 +   ret = !acpi_check_handle(handle, METHOD_GPS_ON, NULL) 
 +   !acpi_check_handle(handle, METHOD_GPS_OFF, NULL) 
 +   !acpi_check_handle(handle, METHOD_GPS_STATUS, NULL);
 }

 -   return supported ? attr-mode : 0;
 +   return ret ? attr-mode : 0;
  }


 --
 2.2.2




-- 
Corentin Chary
http://xf.iksaif.net
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [GIT] x86 platform driver updates for 3.8

2013-03-06 Thread Corentin Chary
On Mon, Jan 7, 2013 at 5:22 PM, Linus Torvalds
 wrote:
> On Mon, Jan 7, 2013 at 9:17 AM, Matthew Garrett
>  wrote:
>>
>> A bit delayed (new job fun), but there's nothing terribly exciting in
>> here.
>
> Nonetheless, this does not seem to be appropriate for outside the merge 
> window.

Was this re-sent for 3.9 ? Or will this hit 3.10 instead ?

-- 
Corentin Chary
http://xf.iksaif.net
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [GIT] x86 platform driver updates for 3.8

2013-03-06 Thread Corentin Chary
On Mon, Jan 7, 2013 at 5:22 PM, Linus Torvalds
torva...@linux-foundation.org wrote:
 On Mon, Jan 7, 2013 at 9:17 AM, Matthew Garrett
 matthew.garr...@nebula.com wrote:

 A bit delayed (new job fun), but there's nothing terribly exciting in
 here.

 Nonetheless, this does not seem to be appropriate for outside the merge 
 window.

Was this re-sent for 3.9 ? Or will this hit 3.10 instead ?

-- 
Corentin Chary
http://xf.iksaif.net
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH TRIVIAL] asus-wmi: Fix unused function build warning

2013-01-23 Thread Corentin Chary
On Mon, Jan 14, 2013 at 10:50 PM, Shuah Khan  wrote:
> 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 
> ---
>  drivers/platform/x86/asus-wmi.c |5 -
>  1 file changed, 5 deletions(-)
>
> diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
> index e41eae3..c11b242 100644
> --- a/drivers/platform/x86/asus-wmi.c
> +++ b/drivers/platform/x86/asus-wmi.c
> @@ -1353,11 +1353,6 @@ static int is_display_toggle(int code)
> return 0;
>  }
>
> -static void do_nothing(void)
> -{
> -   return;
> -}
> -
>  static void asus_wmi_notify(u32 value, void *context)
>  {
>     struct asus_wmi *asus = context;
> --
> 1.7.9.5
>
>
>

Acked-by: Corentin Chary 



--
Corentin Chary
http://xf.iksaif.net
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH TRIVIAL] asus-wmi: Fix unused function build warning

2013-01-23 Thread Corentin Chary
On Mon, Jan 14, 2013 at 10:50 PM, Shuah Khan shuah.k...@hp.com wrote:
 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.k...@hp.com
 ---
  drivers/platform/x86/asus-wmi.c |5 -
  1 file changed, 5 deletions(-)

 diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
 index e41eae3..c11b242 100644
 --- a/drivers/platform/x86/asus-wmi.c
 +++ b/drivers/platform/x86/asus-wmi.c
 @@ -1353,11 +1353,6 @@ static int is_display_toggle(int code)
 return 0;
  }

 -static void do_nothing(void)
 -{
 -   return;
 -}
 -
  static void asus_wmi_notify(u32 value, void *context)
  {
 struct asus_wmi *asus = context;
 --
 1.7.9.5




Acked-by: Corentin Chary corentin.ch...@gmail.com



--
Corentin Chary
http://xf.iksaif.net
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] samsung-laptop: Set keyboard backlight initially

2013-01-03 Thread Corentin Chary
Sorry for the lag...

On Mon, Dec 24, 2012 at 12:55 PM, Roland Stigge  wrote:
> On 24/12/12 09:41, Corentin Chary wrote:
>> On Sun, Dec 23, 2012 at 6:21 PM, Roland Stigge  wrote:
>>> After boot, 
>>> /sys/devices/platform/samsung/leds/samsung::kbd_backlight/brightness
>>> shows the maximum value (8) by readout, but the led is off. I need to 
>>> manually
>>> set it to the respective value to have keyboard backlight.
>>
>> If the led is set to 0, what's the value after reboot ? 0 or 8 ?
>
> Right - when writing 0 there before restart, the led value is actually 8
> after reboot, and the LED hardware is ON. This holds for both reboot and
> halt+poweron cycle.

Ok,

> Maybe this is related to the "#define MAX_BRIGHT 0x07" (which is unused
> in samsung-laptop.c)? A bit confusing in the code - but your question
> hints for some other bug (to be solved differently). Tell me if I can
> help somehow, here.

I don't think this is really used.

>> What's the behavior on windows ?
>
> There is no windows available on this machine.

Too bad, let's assume your patch is the best behavior :). Will merge it soon.



--
Corentin Chary
http://xf.iksaif.net
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] samsung-laptop: Set keyboard backlight initially

2013-01-03 Thread Corentin Chary
Sorry for the lag...

On Mon, Dec 24, 2012 at 12:55 PM, Roland Stigge sti...@antcom.de wrote:
 On 24/12/12 09:41, Corentin Chary wrote:
 On Sun, Dec 23, 2012 at 6:21 PM, Roland Stigge sti...@antcom.de wrote:
 After boot, 
 /sys/devices/platform/samsung/leds/samsung::kbd_backlight/brightness
 shows the maximum value (8) by readout, but the led is off. I need to 
 manually
 set it to the respective value to have keyboard backlight.

 If the led is set to 0, what's the value after reboot ? 0 or 8 ?

 Right - when writing 0 there before restart, the led value is actually 8
 after reboot, and the LED hardware is ON. This holds for both reboot and
 halt+poweron cycle.

Ok,

 Maybe this is related to the #define MAX_BRIGHT 0x07 (which is unused
 in samsung-laptop.c)? A bit confusing in the code - but your question
 hints for some other bug (to be solved differently). Tell me if I can
 help somehow, here.

I don't think this is really used.

 What's the behavior on windows ?

 There is no windows available on this machine.

Too bad, let's assume your patch is the best behavior :). Will merge it soon.



--
Corentin Chary
http://xf.iksaif.net
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] samsung-laptop: Set keyboard backlight initially

2012-12-24 Thread Corentin Chary
On Sun, Dec 23, 2012 at 6:21 PM, Roland Stigge  wrote:
> After boot, 
> /sys/devices/platform/samsung/leds/samsung::kbd_backlight/brightness
> shows the maximum value (8) by readout, but the led is off. I need to manually
> set it to the respective value to have keyboard backlight.

If the led is set to 0, what's the value after reboot ? 0 or 8 ?
What's the behavior on windows ?

--
Corentin Chary
http://xf.iksaif.net
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] samsung-laptop: Set keyboard backlight initially

2012-12-24 Thread Corentin Chary
On Sun, Dec 23, 2012 at 6:21 PM, Roland Stigge sti...@antcom.de wrote:
 After boot, 
 /sys/devices/platform/samsung/leds/samsung::kbd_backlight/brightness
 shows the maximum value (8) by readout, but the led is off. I need to manually
 set it to the respective value to have keyboard backlight.

If the led is set to 0, what's the value after reboot ? 0 or 8 ?
What's the behavior on windows ?

--
Corentin Chary
http://xf.iksaif.net
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 03/11] asus-{nb-wmi|laptop}.c: sync keymaps

2012-11-29 Thread Corentin Chary
Maybe this should be shared in another module...

Signed-off-by: Corentin Chary 
---
 drivers/platform/x86/asus-laptop.c |   36 ++--
 drivers/platform/x86/asus-nb-wmi.c |   24 
 2 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/drivers/platform/x86/asus-laptop.c 
b/drivers/platform/x86/asus-laptop.c
index 68257ed..09c477a 100644
--- a/drivers/platform/x86/asus-laptop.c
+++ b/drivers/platform/x86/asus-laptop.c
@@ -304,40 +304,40 @@ static const struct key_entry asus_keymap[] = {
{KE_KEY, 0x30, { KEY_VOLUMEUP } },
{KE_KEY, 0x31, { KEY_VOLUMEDOWN } },
{KE_KEY, 0x32, { KEY_MUTE } },
-   {KE_KEY, 0x33, { KEY_SWITCHVIDEOMODE } },
-   {KE_KEY, 0x34, { KEY_SWITCHVIDEOMODE } },
+   {KE_KEY, 0x33, { KEY_DISPLAYTOGGLE } }, /* LCD on */
+   {KE_KEY, 0x34, { KEY_DISPLAY_OFF } }, /* LCD off */
{KE_KEY, 0x40, { KEY_PREVIOUSSONG } },
{KE_KEY, 0x41, { KEY_NEXTSONG } },
-   {KE_KEY, 0x43, { KEY_STOPCD } },
+   {KE_KEY, 0x43, { KEY_STOPCD } }, /* Stop/Eject */
{KE_KEY, 0x45, { KEY_PLAYPAUSE } },
-   {KE_KEY, 0x4c, { KEY_MEDIA } },
+   {KE_KEY, 0x4c, { KEY_MEDIA } }, /* WMP Key */
{KE_KEY, 0x50, { KEY_EMAIL } },
{KE_KEY, 0x51, { KEY_WWW } },
{KE_KEY, 0x55, { KEY_CALC } },
{KE_IGNORE, 0x57, },  /* Battery mode */
{KE_IGNORE, 0x58, },  /* AC mode */
{KE_KEY, 0x5C, { KEY_SCREENLOCK } },  /* Screenlock */
-   {KE_KEY, 0x5D, { KEY_WLAN } },
-   {KE_KEY, 0x5E, { KEY_WLAN } },
-   {KE_KEY, 0x5F, { KEY_WLAN } },
+   {KE_KEY, 0x5D, { KEY_WLAN } }, /* WLAN Toggle */
+   {KE_KEY, 0x5E, { KEY_WLAN } }, /* WLAN Enable */
+   {KE_KEY, 0x5F, { KEY_WLAN } }, /* WLAN Disable */
{KE_KEY, 0x60, { KEY_SWITCHVIDEOMODE } },
-   {KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } },
-   {KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } },
-   {KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } },
-   {KE_KEY, 0x6B, { KEY_F13 } }, /* Lock Touchpad */
+   {KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } }, /* LCD Only */
+   {KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, /* CRT Only */
+   {KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, /* LCD + CRT */
+   {KE_KEY, 0x6B, { KEY_TOUCHPAD_TOGGLE } }, /* Lock Touchpad */
{KE_KEY, 0x6C, { KEY_SLEEP } }, /* Suspend */
{KE_KEY, 0x6D, { KEY_SLEEP } }, /* Hibernate */
{KE_IGNORE, 0x6E, },  /* Low Battery notification */
-   {KE_KEY, 0x7E, { KEY_BLUETOOTH } },
-   {KE_KEY, 0x7D, { KEY_BLUETOOTH } },
+   {KE_KEY, 0x7D, { KEY_BLUETOOTH } }, /* Bluetooth Enable */
+   {KE_KEY, 0x7E, { KEY_BLUETOOTH } }, /* Bluetooth Disable */
{KE_KEY, 0x82, { KEY_CAMERA } },
-   {KE_KEY, 0x88, { KEY_WLAN  } },
-   {KE_KEY, 0x8A, { KEY_PROG1 } },
+   {KE_KEY, 0x88, { KEY_RFKILL  } }, /* Radio Toggle Key */
+   {KE_KEY, 0x8A, { KEY_PROG1 } }, /* Color enhancement mode */
{KE_KEY, 0x95, { KEY_MEDIA } },
{KE_KEY, 0x99, { KEY_PHONE } },
-   {KE_KEY, 0xc4, { KEY_KBDILLUMUP } },
-   {KE_KEY, 0xc5, { KEY_KBDILLUMDOWN } },
-   {KE_KEY, 0xb5, { KEY_CALC } },
+   {KE_KEY, 0xB5, { KEY_CALC } },
+   {KE_KEY, 0xC4, { KEY_KBDILLUMUP } },
+   {KE_KEY, 0xC5, { KEY_KBDILLUMDOWN } },
{KE_END, 0},
 };
 
diff --git a/drivers/platform/x86/asus-nb-wmi.c 
b/drivers/platform/x86/asus-nb-wmi.c
index b70425c..9f1caa7 100644
--- a/drivers/platform/x86/asus-nb-wmi.c
+++ b/drivers/platform/x86/asus-nb-wmi.c
@@ -168,9 +168,9 @@ static const struct key_entry asus_nb_wmi_keymap[] = {
{ KE_KEY, 0x34, { KEY_DISPLAY_OFF } }, /* LCD off */
{ KE_KEY, 0x40, { KEY_PREVIOUSSONG } },
{ KE_KEY, 0x41, { KEY_NEXTSONG } },
-   { KE_KEY, 0x43, { KEY_STOPCD } },
+   { KE_KEY, 0x43, { KEY_STOPCD } }, /* Stop/Eject */
{ KE_KEY, 0x45, { KEY_PLAYPAUSE } },
-   { KE_KEY, 0x4c, { KEY_MEDIA } },
+   { KE_KEY, 0x4c, { KEY_MEDIA } }, /* WMP Key */
{ KE_KEY, 0x50, { KEY_EMAIL } },
{ KE_KEY, 0x51, { KEY_WWW } },
{ KE_KEY, 0x55, { KEY_CALC } },
@@ -181,25 +181,25 @@ static const struct key_entry asus_nb_wmi_keymap[] = {
{ KE_KEY, 0x5E, { KEY_WLAN } }, /* Wireless console Enable */
{ KE_KEY, 0x5F, { KEY_WLAN } }, /* Wireless console Disable */
{ KE_KEY, 0x60, { KEY_SWITCHVIDEOMODE } },
-   { KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } },
-   { KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } },
-   { KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } },
+   { KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } }, /* LCD Only */
+   { KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, /* CRT Only */
+   { KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, /* LCD + CRT */
{ KE_KEY, 0x6B, { KEY_TOUCHPAD_TOGGLE } },
{ KE_IGNORE, 0x6E, },  /* Low Battery notification */
-   { KE_KEY, 0x7D, { KEY_BLUETOOTH } },
-   { KE_KEY, 0x7E, { KEY_BLUETOOTH } },
+   { KE_KEY, 0x7D, { KEY_BLUETOOTH

[PATCH 08/11] asus-wmi: add display toggle quirk

2012-11-29 Thread Corentin Chary
From: AceLan Kao 

For machines with AMD graphic chips, it will send out WMI event and ACPI
interrupt at the same time while hitting the hotkey. BIOS will notify the
system the next display output mode throught WMI event code, so that
windows' application can show an OSD to tell the user which mode will be
taken effect. User can hit the display toggle key many times within 2
seconds to choose the mode they want. After 2 seconds, WMI dirver should
send a WMIMethod(SDSP) command to tell the BIOS which mode the user chose.
And then BIOS will raise another ACPI interrupt to tell the system to
really switch the display mode.

In Linux desktop, we don't have this kind of OSD to let users to choose
the mode they want, so we don't need to call WMIMethod(SDSP) to have
another ACPI interrupt. To simplify the problem, we just have to ignore
the WMI event, and let the first ACPI interrupt to send out the key event.

For the need, here comes another quirk to add machines with this kind of
behavior. When the WMI driver receives the display toggle WMI event, and
found the machin is in the list, it will do nothing and let ACPI video
driver to report the key event.

Signed-off-by: AceLan Kao 
Signed-off-by: Corentin Chary 
Signed-off-by: Corentin Chary 
---
 drivers/platform/x86/asus-nb-wmi.c |   31 ++-
 drivers/platform/x86/asus-wmi.c|   26 +++---
 drivers/platform/x86/asus-wmi.h|7 +++
 3 files changed, 60 insertions(+), 4 deletions(-)

diff --git a/drivers/platform/x86/asus-nb-wmi.c 
b/drivers/platform/x86/asus-nb-wmi.c
index 87d45e0..9aa6642 100644
--- a/drivers/platform/x86/asus-nb-wmi.c
+++ b/drivers/platform/x86/asus-nb-wmi.c
@@ -59,6 +59,17 @@ static struct quirk_entry quirk_asus_unknown = {
.wapf = 0,
 };
 
+/*
+ * For those machines that need software to control bt/wifi status
+ * and can't adjust brightness through ACPI interface
+ * and have duplicate events(ACPI and WMI) for display toggle
+ */
+static struct quirk_entry quirk_asus_x55u = {
+   .wapf = 4,
+   .wmi_backlight_power = true,
+   .no_display_toggle = true,
+};
+
 static struct quirk_entry quirk_asus_x401u = {
.wapf = 4,
 };
@@ -77,6 +88,15 @@ static struct dmi_system_id asus_quirks[] = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_MATCH(DMI_PRODUCT_NAME, "X401U"),
},
+   .driver_data = _asus_x55u,
+   },
+   {
+   .callback = dmi_matched,
+   .ident = "ASUSTeK COMPUTER INC. X401A",
+   .matches = {
+   DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
+   DMI_MATCH(DMI_PRODUCT_NAME, "X401A"),
+   },
.driver_data = _asus_x401u,
},
{
@@ -95,6 +115,15 @@ static struct dmi_system_id asus_quirks[] = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_MATCH(DMI_PRODUCT_NAME, "X501U"),
},
+   .driver_data = _asus_x55u,
+   },
+   {
+   .callback = dmi_matched,
+   .ident = "ASUSTeK COMPUTER INC. X501A",
+   .matches = {
+   DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
+   DMI_MATCH(DMI_PRODUCT_NAME, "X501A"),
+   },
.driver_data = _asus_x401u,
},
{
@@ -131,7 +160,7 @@ static struct dmi_system_id asus_quirks[] = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_MATCH(DMI_PRODUCT_NAME, "X55U"),
},
-   .driver_data = _asus_x401u,
+   .driver_data = _asus_x55u,
},
{
.callback = dmi_matched,
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 912ec7d..6327a1b 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -1341,6 +1341,18 @@ static void asus_wmi_backlight_exit(struct asus_wmi 
*asus)
asus->backlight_device = NULL;
 }
 
+static int is_display_toggle(int code)
+{
+   /* display toggle keys */
+   if ((code >= 0x61 && code <= 0x67) ||
+   (code >= 0x8c && code <= 0x93) ||
+   (code >= 0xa0 && code <= 0xa7) ||
+   (code >= 0xd0 && code <= 0xd5))
+   return 1;
+
+   return 0;
+}
+
 static void asus_wmi_notify(u32 value, void *context)
 {
struct asus_wmi *asus = context;
@@ -1380,10 +1392,18 @@ static void asus_wmi_notify(u32 value, void *context)
code = NOTIFY_BRNDOWN_MIN;
 
if (code == NOTIFY_BRNUP_MIN || code == NOTIFY_BRNDOWN_MIN) {
-   if (!acpi_video_backlight_suppor

[PATCH 11/11] asus-laptop: always report brightness key events

2012-11-29 Thread Corentin Chary
Signed-off-by: Corentin Chary 
---
 drivers/platform/x86/asus-laptop.c |   24 
 1 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/drivers/platform/x86/asus-laptop.c 
b/drivers/platform/x86/asus-laptop.c
index 0fc4e30..a8a7755 100644
--- a/drivers/platform/x86/asus-laptop.c
+++ b/drivers/platform/x86/asus-laptop.c
@@ -128,10 +128,12 @@ MODULE_PARM_DESC(als_status, "Set the ALS status on boot "
 /*
  * Some events we use, same for all Asus
  */
-#define ATKD_BR_UP 0x10/* (event & ~ATKD_BR_UP) = brightness level */
-#define ATKD_BR_DOWN   0x20/* (event & ~ATKD_BR_DOWN) = britghness level */
-#define ATKD_BR_MINATKD_BR_UP
-#define ATKD_BR_MAX(ATKD_BR_DOWN | 0xF)/* 0x2f */
+#define ATKD_BRNUP_MIN 0x10
+#define ATKD_BRNUP_MAX 0x1f
+#define ATKD_BRNDOWN_MIN   0x20
+#define ATKD_BRNDOWN_MAX   0x2f
+#define ATKD_BRNDOWN   0x20
+#define ATKD_BRNUP 0x2f
 #define ATKD_LCD_ON0x33
 #define ATKD_LCD_OFF   0x34
 
@@ -301,6 +303,8 @@ static const struct key_entry asus_keymap[] = {
{KE_KEY, 0x17, { KEY_ZOOM } },
{KE_KEY, 0x1f, { KEY_BATTERY } },
/* End of Lenovo SL Specific keycodes */
+   {KE_KEY, ATKD_BRNDOWN, { KEY_BRIGHTNESSDOWN } },
+   {KE_KEY, ATKD_BRNUP, { KEY_BRIGHTNESSUP } },
{KE_KEY, 0x30, { KEY_VOLUMEUP } },
{KE_KEY, 0x31, { KEY_VOLUMEDOWN } },
{KE_KEY, 0x32, { KEY_MUTE } },
@@ -1544,15 +1548,19 @@ static void asus_acpi_notify(struct acpi_device 
*device, u32 event)
dev_name(>device->dev), event,
count);
 
-   /* Brightness events are special */
-   if (event >= ATKD_BR_MIN && event <= ATKD_BR_MAX) {
+   if (event >= ATKD_BRNUP_MIN && event <= ATKD_BRNUP_MAX)
+   event = ATKD_BRNUP;
+   else if (event >= ATKD_BRNDOWN_MIN &&
+event <= ATKD_BRNDOWN_MAX)
+   event = ATKD_BRNDOWN;
 
-   /* Ignore them completely if the acpi video driver is used */
+   /* Brightness events are special */
+   if (event == ATKD_BRNDOWN && event == ATKD_BRNUP) {
if (asus->backlight_device != NULL) {
/* Update the backlight device. */
asus_backlight_notify(asus);
+   return ;
}
-   return ;
}
 
/* Accelerometer "coarse orientation change" event */
-- 
1.7.8.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 10/11] asus-wmi: always report brightness key events

2012-11-29 Thread Corentin Chary
Signed-off-by: Corentin Chary 
---
 drivers/platform/x86/asus-nb-wmi.c |2 ++
 drivers/platform/x86/asus-wmi.c|8 
 drivers/platform/x86/asus-wmi.h|2 ++
 drivers/platform/x86/eeepc-wmi.c   |2 ++
 4 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/platform/x86/asus-nb-wmi.c 
b/drivers/platform/x86/asus-nb-wmi.c
index 9aa6642..210b5b8 100644
--- a/drivers/platform/x86/asus-nb-wmi.c
+++ b/drivers/platform/x86/asus-nb-wmi.c
@@ -190,6 +190,8 @@ static void asus_nb_wmi_quirks(struct asus_wmi_driver 
*driver)
 }
 
 static const struct key_entry asus_nb_wmi_keymap[] = {
+   { KE_KEY, ASUS_WMI_BRN_DOWN, { KEY_BRIGHTNESSDOWN } },
+   { KE_KEY, ASUS_WMI_BRN_UP, { KEY_BRIGHTNESSUP } },
{ KE_KEY, 0x30, { KEY_VOLUMEUP } },
{ KE_KEY, 0x31, { KEY_VOLUMEDOWN } },
{ KE_KEY, 0x32, { KEY_MUTE } },
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 6327a1b..c11b242 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -1386,16 +1386,16 @@ static void asus_wmi_notify(u32 value, void *context)
}
 
if (code >= NOTIFY_BRNUP_MIN && code <= NOTIFY_BRNUP_MAX)
-   code = NOTIFY_BRNUP_MIN;
+   code = ASUS_WMI_BRN_UP;
else if (code >= NOTIFY_BRNDOWN_MIN &&
 code <= NOTIFY_BRNDOWN_MAX)
-   code = NOTIFY_BRNDOWN_MIN;
+   code = ASUS_WMI_BRN_DOWN;
 
-   if (code == NOTIFY_BRNUP_MIN || code == NOTIFY_BRNDOWN_MIN) {
+   if (code == ASUS_WMI_BRN_DOWN || code == ASUS_WMI_BRN_UP) {
if (!acpi_video_backlight_support()) {
asus_wmi_backlight_notify(asus, orig_code);
+   goto exit;
}
-   goto exit;
}
 
if (is_display_toggle(code) &&
diff --git a/drivers/platform/x86/asus-wmi.h b/drivers/platform/x86/asus-wmi.h
index 776524c..4da4c8b 100644
--- a/drivers/platform/x86/asus-wmi.h
+++ b/drivers/platform/x86/asus-wmi.h
@@ -30,6 +30,8 @@
 #include 
 
 #define ASUS_WMI_KEY_IGNORE (-1)
+#define ASUS_WMI_BRN_DOWN  0x20
+#define ASUS_WMI_BRN_UP0x2f
 
 struct module;
 struct key_entry;
diff --git a/drivers/platform/x86/eeepc-wmi.c b/drivers/platform/x86/eeepc-wmi.c
index 60cb76a..af67e6e 100644
--- a/drivers/platform/x86/eeepc-wmi.c
+++ b/drivers/platform/x86/eeepc-wmi.c
@@ -63,6 +63,8 @@ MODULE_PARM_DESC(hotplug_wireless,
 #define HOME_RELEASE   0xe5
 
 static const struct key_entry eeepc_wmi_keymap[] = {
+   { KE_KEY, ASUS_WMI_BRN_DOWN, { KEY_BRIGHTNESSDOWN } },
+   { KE_KEY, ASUS_WMI_BRN_UP, { KEY_BRIGHTNESSUP } },
/* Sleep already handled via generic ACPI code */
{ KE_KEY, 0x30, { KEY_VOLUMEUP } },
{ KE_KEY, 0x31, { KEY_VOLUMEDOWN } },
-- 
1.7.8.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 09/11] asus-laptop: Do not call HWRS on init

2012-11-29 Thread Corentin Chary
From: Ben Hutchings 

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 
References: http://bugs.debian.org/692436
Signed-off-by: Ben Hutchings 
Signed-off-by: Corentin Chary 
---
 drivers/platform/x86/asus-laptop.c |   17 -
 1 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/drivers/platform/x86/asus-laptop.c 
b/drivers/platform/x86/asus-laptop.c
index 0d371d0..0fc4e30 100644
--- a/drivers/platform/x86/asus-laptop.c
+++ b/drivers/platform/x86/asus-laptop.c
@@ -883,8 +883,10 @@ static ssize_t show_infos(struct device *dev,
/*
 * The HWRS method return informations about the hardware.
 * 0x80 bit is for WLAN, 0x100 for Bluetooth.
+* 0x40 for WWAN, 0x10 for WIMAX.
 * The significance of others is yet to be found.
-* If we don't find the method, we assume the device are present.
+* We don't currently use this for device detection, and it
+* takes several seconds to run on some systems.
 */
rv = acpi_evaluate_integer(asus->handle, "HWRS", NULL, );
if (!ACPI_FAILURE(rv))
@@ -1705,7 +1707,7 @@ static int asus_laptop_get_info(struct asus_laptop *asus)
 {
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
union acpi_object *model = NULL;
-   unsigned long long bsts_result, hwrs_result;
+   unsigned long long bsts_result;
char *string = NULL;
acpi_status status;
 
@@ -1767,17 +1769,6 @@ static int asus_laptop_get_info(struct asus_laptop *asus)
if (*string)
pr_notice("  %s model detected\n", string);
 
-   /*
-* The HWRS method return informations about the hardware.
-* 0x80 bit is for WLAN, 0x100 for Bluetooth,
-* 0x40 for WWAN, 0x10 for WIMAX.
-* The significance of others is yet to be found.
-*/
-   status =
-   acpi_evaluate_integer(asus->handle, "HWRS", NULL, _result);
-   if (!ACPI_FAILURE(status))
-   pr_notice("  HWRS returned %x", (int)hwrs_result);
-
if (!acpi_check_handle(asus->handle, METHOD_WL_STATUS, NULL))
asus->have_rsts = true;
 
-- 
1.7.8.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 07/11] asus-nb-wmi: add all video switch keys

2012-11-29 Thread Corentin Chary
From: AceLan Kao 

Fill up all the video switch keys in the map.

Signed-off-by: AceLan Kao 
Signed-off-by: Corentin Chary 
---
 drivers/platform/x86/asus-nb-wmi.c |   22 +++---
 1 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/drivers/platform/x86/asus-nb-wmi.c 
b/drivers/platform/x86/asus-nb-wmi.c
index 75ce18c..87d45e0 100644
--- a/drivers/platform/x86/asus-nb-wmi.c
+++ b/drivers/platform/x86/asus-nb-wmi.c
@@ -181,9 +181,13 @@ static const struct key_entry asus_nb_wmi_keymap[] = {
{ KE_KEY, 0x5E, { KEY_WLAN } }, /* Wireless console Enable */
{ KE_KEY, 0x5F, { KEY_WLAN } }, /* Wireless console Disable */
{ KE_KEY, 0x60, { KEY_TOUCHPAD_ON } },
-   { KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } }, /* LCD Only */
-   { KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, /* CRT Only */
-   { KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, /* LCD + CRT */
+   { KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD only */
+   { KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT only */
+   { KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT */
+   { KE_KEY, 0x64, { KEY_SWITCHVIDEOMODE } }, /* SDSP TV */
+   { KE_KEY, 0x65, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + TV */
+   { KE_KEY, 0x66, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV */
+   { KE_KEY, 0x67, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV */
{ KE_KEY, 0x6B, { KEY_TOUCHPAD_TOGGLE } },
{ KE_IGNORE, 0x6E, },  /* Low Battery notification */
{ KE_KEY, 0x7D, { KEY_BLUETOOTH } }, /* Bluetooth Enable */
@@ -191,12 +195,24 @@ static const struct key_entry asus_nb_wmi_keymap[] = {
{ KE_KEY, 0x82, { KEY_CAMERA } },
{ KE_KEY, 0x88, { KEY_RFKILL  } }, /* Radio Toggle Key */
{ KE_KEY, 0x8A, { KEY_PROG1 } }, /* Color enhancement mode */
+   { KE_KEY, 0x8C, { KEY_SWITCHVIDEOMODE } }, /* SDSP DVI only */
+   { KE_KEY, 0x8D, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + DVI */
+   { KE_KEY, 0x8E, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + DVI */
+   { KE_KEY, 0x8F, { KEY_SWITCHVIDEOMODE } }, /* SDSP TV + DVI */
+   { KE_KEY, 0x90, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + DVI */
+   { KE_KEY, 0x91, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + TV + DVI */
+   { KE_KEY, 0x92, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV + DVI */
+   { KE_KEY, 0x93, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV + DVI 
*/
{ KE_KEY, 0x95, { KEY_MEDIA } },
{ KE_KEY, 0x99, { KEY_PHONE } },
{ KE_KEY, 0xA0, { KEY_SWITCHVIDEOMODE } }, /* SDSP HDMI only */
{ KE_KEY, 0xA1, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + HDMI */
{ KE_KEY, 0xA2, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + HDMI */
{ KE_KEY, 0xA3, { KEY_SWITCHVIDEOMODE } }, /* SDSP TV + HDMI */
+   { KE_KEY, 0xA4, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + HDMI */
+   { KE_KEY, 0xA5, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + TV + HDMI */
+   { KE_KEY, 0xA6, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV + HDMI */
+   { KE_KEY, 0xA7, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV + 
HDMI */
{ KE_KEY, 0xB5, { KEY_CALC } },
{ KE_KEY, 0xC4, { KEY_KBDILLUMUP } },
{ KE_KEY, 0xC5, { KEY_KBDILLUMDOWN } },
-- 
1.7.8.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 06/11] asus-nb-wmi: correct a touchpad hotkey mapping

2012-11-29 Thread Corentin Chary
From: AceLan Kao 

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

Signed-off-by: AceLan Kao 
Signed-off-by: Corentin Chary 
---
 drivers/platform/x86/asus-nb-wmi.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/platform/x86/asus-nb-wmi.c 
b/drivers/platform/x86/asus-nb-wmi.c
index 9f1caa7..75ce18c 100644
--- a/drivers/platform/x86/asus-nb-wmi.c
+++ b/drivers/platform/x86/asus-nb-wmi.c
@@ -180,7 +180,7 @@ static const struct key_entry asus_nb_wmi_keymap[] = {
{ KE_KEY, 0x5D, { KEY_WLAN } }, /* Wireless console Toggle */
{ KE_KEY, 0x5E, { KEY_WLAN } }, /* Wireless console Enable */
{ KE_KEY, 0x5F, { KEY_WLAN } }, /* Wireless console Disable */
-   { KE_KEY, 0x60, { KEY_SWITCHVIDEOMODE } },
+   { KE_KEY, 0x60, { KEY_TOUCHPAD_ON } },
{ KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } }, /* LCD Only */
{ KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, /* CRT Only */
{ KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, /* LCD + CRT */
-- 
1.7.8.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 04/11] asus-laptop: correct a touchpad hotkey mapping

2012-11-29 Thread Corentin Chary
From: AceLan Kao 

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

Signed-off-by: AceLan Kao 
Signed-off-by: Corentin Chary 
---
 drivers/platform/x86/asus-laptop.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/platform/x86/asus-laptop.c 
b/drivers/platform/x86/asus-laptop.c
index 09c477a..73d0198 100644
--- a/drivers/platform/x86/asus-laptop.c
+++ b/drivers/platform/x86/asus-laptop.c
@@ -320,7 +320,7 @@ static const struct key_entry asus_keymap[] = {
{KE_KEY, 0x5D, { KEY_WLAN } }, /* WLAN Toggle */
{KE_KEY, 0x5E, { KEY_WLAN } }, /* WLAN Enable */
{KE_KEY, 0x5F, { KEY_WLAN } }, /* WLAN Disable */
-   {KE_KEY, 0x60, { KEY_SWITCHVIDEOMODE } },
+   {KE_KEY, 0x60, { KEY_TOUCHPAD_ON } },
{KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } }, /* LCD Only */
{KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, /* CRT Only */
{KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, /* LCD + CRT */
-- 
1.7.8.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 05/11] asus-laptop: add all video switch keys

2012-11-29 Thread Corentin Chary
From: AceLan Kao 

Fill up all the video switch keys in the map.

Signed-off-by: AceLan Kao 
Signed-off-by: Corentin Chary 
---
 drivers/platform/x86/asus-laptop.c |   26 +++---
 1 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/drivers/platform/x86/asus-laptop.c 
b/drivers/platform/x86/asus-laptop.c
index 73d0198..0d371d0 100644
--- a/drivers/platform/x86/asus-laptop.c
+++ b/drivers/platform/x86/asus-laptop.c
@@ -321,9 +321,13 @@ static const struct key_entry asus_keymap[] = {
{KE_KEY, 0x5E, { KEY_WLAN } }, /* WLAN Enable */
{KE_KEY, 0x5F, { KEY_WLAN } }, /* WLAN Disable */
{KE_KEY, 0x60, { KEY_TOUCHPAD_ON } },
-   {KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } }, /* LCD Only */
-   {KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, /* CRT Only */
-   {KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, /* LCD + CRT */
+   {KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD only */
+   {KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT only */
+   {KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT */
+   {KE_KEY, 0x64, { KEY_SWITCHVIDEOMODE } }, /* SDSP TV */
+   {KE_KEY, 0x65, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + TV */
+   {KE_KEY, 0x66, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV */
+   {KE_KEY, 0x67, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV */
{KE_KEY, 0x6B, { KEY_TOUCHPAD_TOGGLE } }, /* Lock Touchpad */
{KE_KEY, 0x6C, { KEY_SLEEP } }, /* Suspend */
{KE_KEY, 0x6D, { KEY_SLEEP } }, /* Hibernate */
@@ -333,8 +337,24 @@ static const struct key_entry asus_keymap[] = {
{KE_KEY, 0x82, { KEY_CAMERA } },
{KE_KEY, 0x88, { KEY_RFKILL  } }, /* Radio Toggle Key */
{KE_KEY, 0x8A, { KEY_PROG1 } }, /* Color enhancement mode */
+   {KE_KEY, 0x8C, { KEY_SWITCHVIDEOMODE } }, /* SDSP DVI only */
+   {KE_KEY, 0x8D, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + DVI */
+   {KE_KEY, 0x8E, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + DVI */
+   {KE_KEY, 0x8F, { KEY_SWITCHVIDEOMODE } }, /* SDSP TV + DVI */
+   {KE_KEY, 0x90, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + DVI */
+   {KE_KEY, 0x91, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + TV + DVI */
+   {KE_KEY, 0x92, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV + DVI */
+   {KE_KEY, 0x93, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV + DVI 
*/
{KE_KEY, 0x95, { KEY_MEDIA } },
{KE_KEY, 0x99, { KEY_PHONE } },
+   {KE_KEY, 0xA0, { KEY_SWITCHVIDEOMODE } }, /* SDSP HDMI only */
+   {KE_KEY, 0xA1, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + HDMI */
+   {KE_KEY, 0xA2, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + HDMI */
+   {KE_KEY, 0xA3, { KEY_SWITCHVIDEOMODE } }, /* SDSP TV + HDMI */
+   {KE_KEY, 0xA4, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + HDMI */
+   {KE_KEY, 0xA5, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + TV + HDMI */
+   {KE_KEY, 0xA6, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV + HDMI */
+   {KE_KEY, 0xA7, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV + HDMI 
*/
{KE_KEY, 0xB5, { KEY_CALC } },
{KE_KEY, 0xC4, { KEY_KBDILLUMUP } },
{KE_KEY, 0xC5, { KEY_KBDILLUMDOWN } },
-- 
1.7.8.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 02/11] asus-laptop: map some new keys

2012-11-29 Thread Corentin Chary
Signed-off-by: Corentin Chary 
---
 drivers/platform/x86/asus-laptop.c |3 +++
 drivers/platform/x86/asus-nb-wmi.c |1 +
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/platform/x86/asus-laptop.c 
b/drivers/platform/x86/asus-laptop.c
index 4b568df..68257ed 100644
--- a/drivers/platform/x86/asus-laptop.c
+++ b/drivers/platform/x86/asus-laptop.c
@@ -314,6 +314,8 @@ static const struct key_entry asus_keymap[] = {
{KE_KEY, 0x50, { KEY_EMAIL } },
{KE_KEY, 0x51, { KEY_WWW } },
{KE_KEY, 0x55, { KEY_CALC } },
+   {KE_IGNORE, 0x57, },  /* Battery mode */
+   {KE_IGNORE, 0x58, },  /* AC mode */
{KE_KEY, 0x5C, { KEY_SCREENLOCK } },  /* Screenlock */
{KE_KEY, 0x5D, { KEY_WLAN } },
{KE_KEY, 0x5E, { KEY_WLAN } },
@@ -325,6 +327,7 @@ static const struct key_entry asus_keymap[] = {
{KE_KEY, 0x6B, { KEY_F13 } }, /* Lock Touchpad */
{KE_KEY, 0x6C, { KEY_SLEEP } }, /* Suspend */
{KE_KEY, 0x6D, { KEY_SLEEP } }, /* Hibernate */
+   {KE_IGNORE, 0x6E, },  /* Low Battery notification */
{KE_KEY, 0x7E, { KEY_BLUETOOTH } },
{KE_KEY, 0x7D, { KEY_BLUETOOTH } },
{KE_KEY, 0x82, { KEY_CAMERA } },
diff --git a/drivers/platform/x86/asus-nb-wmi.c 
b/drivers/platform/x86/asus-nb-wmi.c
index be79040..b70425c 100644
--- a/drivers/platform/x86/asus-nb-wmi.c
+++ b/drivers/platform/x86/asus-nb-wmi.c
@@ -185,6 +185,7 @@ static const struct key_entry asus_nb_wmi_keymap[] = {
{ KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } },
{ KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } },
{ KE_KEY, 0x6B, { KEY_TOUCHPAD_TOGGLE } },
+   { KE_IGNORE, 0x6E, },  /* Low Battery notification */
{ KE_KEY, 0x7D, { KEY_BLUETOOTH } },
{ KE_KEY, 0x7E, { KEY_BLUETOOTH } },
{ KE_KEY, 0x82, { KEY_CAMERA } },
-- 
1.7.8.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 01/11] platform-drivers-x86: change my mail

2012-11-29 Thread Corentin Chary
Signed-off-by: Corentin Chary 
---
 MAINTAINERS|4 ++--
 drivers/platform/x86/asus-nb-wmi.c |2 +-
 drivers/platform/x86/asus-wmi.c|2 +-
 drivers/platform/x86/eeepc-wmi.c   |2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 656a8b0..f5ea7c7 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1278,7 +1278,7 @@ F:Documentation/hwmon/asc7621
 F: drivers/hwmon/asc7621.c
 
 ASUS NOTEBOOKS AND EEEPC ACPI/WMI EXTRAS DRIVERS
-M: Corentin Chary 
+M: Corentin Chary 
 L: acpi4asus-u...@lists.sourceforge.net
 L: platform-driver-...@vger.kernel.org
 W: http://acpi4asus.sf.net
@@ -6471,7 +6471,7 @@ F:drivers/media/pci/saa7146/
 F: include/media/saa7146*
 
 SAMSUNG LAPTOP DRIVER
-M: Corentin Chary 
+M: Corentin Chary 
 L: platform-driver-...@vger.kernel.org
 S: Maintained
 F: drivers/platform/x86/samsung-laptop.c
diff --git a/drivers/platform/x86/asus-nb-wmi.c 
b/drivers/platform/x86/asus-nb-wmi.c
index 6b0ebde..be79040 100644
--- a/drivers/platform/x86/asus-nb-wmi.c
+++ b/drivers/platform/x86/asus-nb-wmi.c
@@ -32,7 +32,7 @@
 
 #defineASUS_NB_WMI_FILE"asus-nb-wmi"
 
-MODULE_AUTHOR("Corentin Chary ");
+MODULE_AUTHOR("Corentin Chary ");
 MODULE_DESCRIPTION("Asus Notebooks WMI Hotkey Driver");
 MODULE_LICENSE("GPL");
 
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 18f5169..912ec7d 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -51,7 +51,7 @@
 
 #include "asus-wmi.h"
 
-MODULE_AUTHOR("Corentin Chary , "
+MODULE_AUTHOR("Corentin Chary , "
  "Yong Wang ");
 MODULE_DESCRIPTION("Asus Generic WMI Driver");
 MODULE_LICENSE("GPL");
diff --git a/drivers/platform/x86/eeepc-wmi.c b/drivers/platform/x86/eeepc-wmi.c
index 5838332..60cb76a 100644
--- a/drivers/platform/x86/eeepc-wmi.c
+++ b/drivers/platform/x86/eeepc-wmi.c
@@ -39,7 +39,7 @@
 
 #defineEEEPC_WMI_FILE  "eeepc-wmi"
 
-MODULE_AUTHOR("Corentin Chary ");
+MODULE_AUTHOR("Corentin Chary ");
 MODULE_DESCRIPTION("Eee PC WMI Hotkey Driver");
 MODULE_LICENSE("GPL");
 
-- 
1.7.8.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 01/11] platform-drivers-x86: change my mail

2012-11-29 Thread Corentin Chary
Signed-off-by: Corentin Chary corentin.ch...@gmail.com
---
 MAINTAINERS|4 ++--
 drivers/platform/x86/asus-nb-wmi.c |2 +-
 drivers/platform/x86/asus-wmi.c|2 +-
 drivers/platform/x86/eeepc-wmi.c   |2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 656a8b0..f5ea7c7 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1278,7 +1278,7 @@ F:Documentation/hwmon/asc7621
 F: drivers/hwmon/asc7621.c
 
 ASUS NOTEBOOKS AND EEEPC ACPI/WMI EXTRAS DRIVERS
-M: Corentin Chary corenti...@iksaif.net
+M: Corentin Chary corentin.ch...@gmail.com
 L: acpi4asus-u...@lists.sourceforge.net
 L: platform-driver-...@vger.kernel.org
 W: http://acpi4asus.sf.net
@@ -6471,7 +6471,7 @@ F:drivers/media/pci/saa7146/
 F: include/media/saa7146*
 
 SAMSUNG LAPTOP DRIVER
-M: Corentin Chary corenti...@iksaif.net
+M: Corentin Chary corentin.ch...@gmail.com
 L: platform-driver-...@vger.kernel.org
 S: Maintained
 F: drivers/platform/x86/samsung-laptop.c
diff --git a/drivers/platform/x86/asus-nb-wmi.c 
b/drivers/platform/x86/asus-nb-wmi.c
index 6b0ebde..be79040 100644
--- a/drivers/platform/x86/asus-nb-wmi.c
+++ b/drivers/platform/x86/asus-nb-wmi.c
@@ -32,7 +32,7 @@
 
 #defineASUS_NB_WMI_FILEasus-nb-wmi
 
-MODULE_AUTHOR(Corentin Chary corenti...@iksaif.net);
+MODULE_AUTHOR(Corentin Chary corentin.ch...@gmail.com);
 MODULE_DESCRIPTION(Asus Notebooks WMI Hotkey Driver);
 MODULE_LICENSE(GPL);
 
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 18f5169..912ec7d 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -51,7 +51,7 @@
 
 #include asus-wmi.h
 
-MODULE_AUTHOR(Corentin Chary corenti...@iksaif.net, 
+MODULE_AUTHOR(Corentin Chary corentin.ch...@gmail.com, 
  Yong Wang yong.y.w...@intel.com);
 MODULE_DESCRIPTION(Asus Generic WMI Driver);
 MODULE_LICENSE(GPL);
diff --git a/drivers/platform/x86/eeepc-wmi.c b/drivers/platform/x86/eeepc-wmi.c
index 5838332..60cb76a 100644
--- a/drivers/platform/x86/eeepc-wmi.c
+++ b/drivers/platform/x86/eeepc-wmi.c
@@ -39,7 +39,7 @@
 
 #defineEEEPC_WMI_FILE  eeepc-wmi
 
-MODULE_AUTHOR(Corentin Chary corenti...@iksaif.net);
+MODULE_AUTHOR(Corentin Chary corentin.ch...@gmail.com);
 MODULE_DESCRIPTION(Eee PC WMI Hotkey Driver);
 MODULE_LICENSE(GPL);
 
-- 
1.7.8.6

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 02/11] asus-laptop: map some new keys

2012-11-29 Thread Corentin Chary
Signed-off-by: Corentin Chary corentin.ch...@gmail.com
---
 drivers/platform/x86/asus-laptop.c |3 +++
 drivers/platform/x86/asus-nb-wmi.c |1 +
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/platform/x86/asus-laptop.c 
b/drivers/platform/x86/asus-laptop.c
index 4b568df..68257ed 100644
--- a/drivers/platform/x86/asus-laptop.c
+++ b/drivers/platform/x86/asus-laptop.c
@@ -314,6 +314,8 @@ static const struct key_entry asus_keymap[] = {
{KE_KEY, 0x50, { KEY_EMAIL } },
{KE_KEY, 0x51, { KEY_WWW } },
{KE_KEY, 0x55, { KEY_CALC } },
+   {KE_IGNORE, 0x57, },  /* Battery mode */
+   {KE_IGNORE, 0x58, },  /* AC mode */
{KE_KEY, 0x5C, { KEY_SCREENLOCK } },  /* Screenlock */
{KE_KEY, 0x5D, { KEY_WLAN } },
{KE_KEY, 0x5E, { KEY_WLAN } },
@@ -325,6 +327,7 @@ static const struct key_entry asus_keymap[] = {
{KE_KEY, 0x6B, { KEY_F13 } }, /* Lock Touchpad */
{KE_KEY, 0x6C, { KEY_SLEEP } }, /* Suspend */
{KE_KEY, 0x6D, { KEY_SLEEP } }, /* Hibernate */
+   {KE_IGNORE, 0x6E, },  /* Low Battery notification */
{KE_KEY, 0x7E, { KEY_BLUETOOTH } },
{KE_KEY, 0x7D, { KEY_BLUETOOTH } },
{KE_KEY, 0x82, { KEY_CAMERA } },
diff --git a/drivers/platform/x86/asus-nb-wmi.c 
b/drivers/platform/x86/asus-nb-wmi.c
index be79040..b70425c 100644
--- a/drivers/platform/x86/asus-nb-wmi.c
+++ b/drivers/platform/x86/asus-nb-wmi.c
@@ -185,6 +185,7 @@ static const struct key_entry asus_nb_wmi_keymap[] = {
{ KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } },
{ KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } },
{ KE_KEY, 0x6B, { KEY_TOUCHPAD_TOGGLE } },
+   { KE_IGNORE, 0x6E, },  /* Low Battery notification */
{ KE_KEY, 0x7D, { KEY_BLUETOOTH } },
{ KE_KEY, 0x7E, { KEY_BLUETOOTH } },
{ KE_KEY, 0x82, { KEY_CAMERA } },
-- 
1.7.8.6

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 04/11] asus-laptop: correct a touchpad hotkey mapping

2012-11-29 Thread Corentin Chary
From: AceLan Kao acelan@canonical.com

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

Signed-off-by: AceLan Kao acelan@canonical.com
Signed-off-by: Corentin Chary corentin.ch...@gmail.com
---
 drivers/platform/x86/asus-laptop.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/platform/x86/asus-laptop.c 
b/drivers/platform/x86/asus-laptop.c
index 09c477a..73d0198 100644
--- a/drivers/platform/x86/asus-laptop.c
+++ b/drivers/platform/x86/asus-laptop.c
@@ -320,7 +320,7 @@ static const struct key_entry asus_keymap[] = {
{KE_KEY, 0x5D, { KEY_WLAN } }, /* WLAN Toggle */
{KE_KEY, 0x5E, { KEY_WLAN } }, /* WLAN Enable */
{KE_KEY, 0x5F, { KEY_WLAN } }, /* WLAN Disable */
-   {KE_KEY, 0x60, { KEY_SWITCHVIDEOMODE } },
+   {KE_KEY, 0x60, { KEY_TOUCHPAD_ON } },
{KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } }, /* LCD Only */
{KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, /* CRT Only */
{KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, /* LCD + CRT */
-- 
1.7.8.6

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 05/11] asus-laptop: add all video switch keys

2012-11-29 Thread Corentin Chary
From: AceLan Kao acelan@canonical.com

Fill up all the video switch keys in the map.

Signed-off-by: AceLan Kao acelan@canonical.com
Signed-off-by: Corentin Chary corentin.ch...@gmail.com
---
 drivers/platform/x86/asus-laptop.c |   26 +++---
 1 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/drivers/platform/x86/asus-laptop.c 
b/drivers/platform/x86/asus-laptop.c
index 73d0198..0d371d0 100644
--- a/drivers/platform/x86/asus-laptop.c
+++ b/drivers/platform/x86/asus-laptop.c
@@ -321,9 +321,13 @@ static const struct key_entry asus_keymap[] = {
{KE_KEY, 0x5E, { KEY_WLAN } }, /* WLAN Enable */
{KE_KEY, 0x5F, { KEY_WLAN } }, /* WLAN Disable */
{KE_KEY, 0x60, { KEY_TOUCHPAD_ON } },
-   {KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } }, /* LCD Only */
-   {KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, /* CRT Only */
-   {KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, /* LCD + CRT */
+   {KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD only */
+   {KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT only */
+   {KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT */
+   {KE_KEY, 0x64, { KEY_SWITCHVIDEOMODE } }, /* SDSP TV */
+   {KE_KEY, 0x65, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + TV */
+   {KE_KEY, 0x66, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV */
+   {KE_KEY, 0x67, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV */
{KE_KEY, 0x6B, { KEY_TOUCHPAD_TOGGLE } }, /* Lock Touchpad */
{KE_KEY, 0x6C, { KEY_SLEEP } }, /* Suspend */
{KE_KEY, 0x6D, { KEY_SLEEP } }, /* Hibernate */
@@ -333,8 +337,24 @@ static const struct key_entry asus_keymap[] = {
{KE_KEY, 0x82, { KEY_CAMERA } },
{KE_KEY, 0x88, { KEY_RFKILL  } }, /* Radio Toggle Key */
{KE_KEY, 0x8A, { KEY_PROG1 } }, /* Color enhancement mode */
+   {KE_KEY, 0x8C, { KEY_SWITCHVIDEOMODE } }, /* SDSP DVI only */
+   {KE_KEY, 0x8D, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + DVI */
+   {KE_KEY, 0x8E, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + DVI */
+   {KE_KEY, 0x8F, { KEY_SWITCHVIDEOMODE } }, /* SDSP TV + DVI */
+   {KE_KEY, 0x90, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + DVI */
+   {KE_KEY, 0x91, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + TV + DVI */
+   {KE_KEY, 0x92, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV + DVI */
+   {KE_KEY, 0x93, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV + DVI 
*/
{KE_KEY, 0x95, { KEY_MEDIA } },
{KE_KEY, 0x99, { KEY_PHONE } },
+   {KE_KEY, 0xA0, { KEY_SWITCHVIDEOMODE } }, /* SDSP HDMI only */
+   {KE_KEY, 0xA1, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + HDMI */
+   {KE_KEY, 0xA2, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + HDMI */
+   {KE_KEY, 0xA3, { KEY_SWITCHVIDEOMODE } }, /* SDSP TV + HDMI */
+   {KE_KEY, 0xA4, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + HDMI */
+   {KE_KEY, 0xA5, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + TV + HDMI */
+   {KE_KEY, 0xA6, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV + HDMI */
+   {KE_KEY, 0xA7, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV + HDMI 
*/
{KE_KEY, 0xB5, { KEY_CALC } },
{KE_KEY, 0xC4, { KEY_KBDILLUMUP } },
{KE_KEY, 0xC5, { KEY_KBDILLUMDOWN } },
-- 
1.7.8.6

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 06/11] asus-nb-wmi: correct a touchpad hotkey mapping

2012-11-29 Thread Corentin Chary
From: AceLan Kao acelan@canonical.com

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

Signed-off-by: AceLan Kao acelan@canonical.com
Signed-off-by: Corentin Chary corentin.ch...@gmail.com
---
 drivers/platform/x86/asus-nb-wmi.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/platform/x86/asus-nb-wmi.c 
b/drivers/platform/x86/asus-nb-wmi.c
index 9f1caa7..75ce18c 100644
--- a/drivers/platform/x86/asus-nb-wmi.c
+++ b/drivers/platform/x86/asus-nb-wmi.c
@@ -180,7 +180,7 @@ static const struct key_entry asus_nb_wmi_keymap[] = {
{ KE_KEY, 0x5D, { KEY_WLAN } }, /* Wireless console Toggle */
{ KE_KEY, 0x5E, { KEY_WLAN } }, /* Wireless console Enable */
{ KE_KEY, 0x5F, { KEY_WLAN } }, /* Wireless console Disable */
-   { KE_KEY, 0x60, { KEY_SWITCHVIDEOMODE } },
+   { KE_KEY, 0x60, { KEY_TOUCHPAD_ON } },
{ KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } }, /* LCD Only */
{ KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, /* CRT Only */
{ KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, /* LCD + CRT */
-- 
1.7.8.6

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 07/11] asus-nb-wmi: add all video switch keys

2012-11-29 Thread Corentin Chary
From: AceLan Kao acelan@canonical.com

Fill up all the video switch keys in the map.

Signed-off-by: AceLan Kao acelan@canonical.com
Signed-off-by: Corentin Chary corentin.ch...@gmail.com
---
 drivers/platform/x86/asus-nb-wmi.c |   22 +++---
 1 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/drivers/platform/x86/asus-nb-wmi.c 
b/drivers/platform/x86/asus-nb-wmi.c
index 75ce18c..87d45e0 100644
--- a/drivers/platform/x86/asus-nb-wmi.c
+++ b/drivers/platform/x86/asus-nb-wmi.c
@@ -181,9 +181,13 @@ static const struct key_entry asus_nb_wmi_keymap[] = {
{ KE_KEY, 0x5E, { KEY_WLAN } }, /* Wireless console Enable */
{ KE_KEY, 0x5F, { KEY_WLAN } }, /* Wireless console Disable */
{ KE_KEY, 0x60, { KEY_TOUCHPAD_ON } },
-   { KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } }, /* LCD Only */
-   { KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, /* CRT Only */
-   { KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, /* LCD + CRT */
+   { KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD only */
+   { KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT only */
+   { KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT */
+   { KE_KEY, 0x64, { KEY_SWITCHVIDEOMODE } }, /* SDSP TV */
+   { KE_KEY, 0x65, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + TV */
+   { KE_KEY, 0x66, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV */
+   { KE_KEY, 0x67, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV */
{ KE_KEY, 0x6B, { KEY_TOUCHPAD_TOGGLE } },
{ KE_IGNORE, 0x6E, },  /* Low Battery notification */
{ KE_KEY, 0x7D, { KEY_BLUETOOTH } }, /* Bluetooth Enable */
@@ -191,12 +195,24 @@ static const struct key_entry asus_nb_wmi_keymap[] = {
{ KE_KEY, 0x82, { KEY_CAMERA } },
{ KE_KEY, 0x88, { KEY_RFKILL  } }, /* Radio Toggle Key */
{ KE_KEY, 0x8A, { KEY_PROG1 } }, /* Color enhancement mode */
+   { KE_KEY, 0x8C, { KEY_SWITCHVIDEOMODE } }, /* SDSP DVI only */
+   { KE_KEY, 0x8D, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + DVI */
+   { KE_KEY, 0x8E, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + DVI */
+   { KE_KEY, 0x8F, { KEY_SWITCHVIDEOMODE } }, /* SDSP TV + DVI */
+   { KE_KEY, 0x90, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + DVI */
+   { KE_KEY, 0x91, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + TV + DVI */
+   { KE_KEY, 0x92, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV + DVI */
+   { KE_KEY, 0x93, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV + DVI 
*/
{ KE_KEY, 0x95, { KEY_MEDIA } },
{ KE_KEY, 0x99, { KEY_PHONE } },
{ KE_KEY, 0xA0, { KEY_SWITCHVIDEOMODE } }, /* SDSP HDMI only */
{ KE_KEY, 0xA1, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + HDMI */
{ KE_KEY, 0xA2, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + HDMI */
{ KE_KEY, 0xA3, { KEY_SWITCHVIDEOMODE } }, /* SDSP TV + HDMI */
+   { KE_KEY, 0xA4, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + HDMI */
+   { KE_KEY, 0xA5, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + TV + HDMI */
+   { KE_KEY, 0xA6, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV + HDMI */
+   { KE_KEY, 0xA7, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV + 
HDMI */
{ KE_KEY, 0xB5, { KEY_CALC } },
{ KE_KEY, 0xC4, { KEY_KBDILLUMUP } },
{ KE_KEY, 0xC5, { KEY_KBDILLUMDOWN } },
-- 
1.7.8.6

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 10/11] asus-wmi: always report brightness key events

2012-11-29 Thread Corentin Chary
Signed-off-by: Corentin Chary corentin.ch...@gmail.com
---
 drivers/platform/x86/asus-nb-wmi.c |2 ++
 drivers/platform/x86/asus-wmi.c|8 
 drivers/platform/x86/asus-wmi.h|2 ++
 drivers/platform/x86/eeepc-wmi.c   |2 ++
 4 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/platform/x86/asus-nb-wmi.c 
b/drivers/platform/x86/asus-nb-wmi.c
index 9aa6642..210b5b8 100644
--- a/drivers/platform/x86/asus-nb-wmi.c
+++ b/drivers/platform/x86/asus-nb-wmi.c
@@ -190,6 +190,8 @@ static void asus_nb_wmi_quirks(struct asus_wmi_driver 
*driver)
 }
 
 static const struct key_entry asus_nb_wmi_keymap[] = {
+   { KE_KEY, ASUS_WMI_BRN_DOWN, { KEY_BRIGHTNESSDOWN } },
+   { KE_KEY, ASUS_WMI_BRN_UP, { KEY_BRIGHTNESSUP } },
{ KE_KEY, 0x30, { KEY_VOLUMEUP } },
{ KE_KEY, 0x31, { KEY_VOLUMEDOWN } },
{ KE_KEY, 0x32, { KEY_MUTE } },
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 6327a1b..c11b242 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -1386,16 +1386,16 @@ static void asus_wmi_notify(u32 value, void *context)
}
 
if (code = NOTIFY_BRNUP_MIN  code = NOTIFY_BRNUP_MAX)
-   code = NOTIFY_BRNUP_MIN;
+   code = ASUS_WMI_BRN_UP;
else if (code = NOTIFY_BRNDOWN_MIN 
 code = NOTIFY_BRNDOWN_MAX)
-   code = NOTIFY_BRNDOWN_MIN;
+   code = ASUS_WMI_BRN_DOWN;
 
-   if (code == NOTIFY_BRNUP_MIN || code == NOTIFY_BRNDOWN_MIN) {
+   if (code == ASUS_WMI_BRN_DOWN || code == ASUS_WMI_BRN_UP) {
if (!acpi_video_backlight_support()) {
asus_wmi_backlight_notify(asus, orig_code);
+   goto exit;
}
-   goto exit;
}
 
if (is_display_toggle(code) 
diff --git a/drivers/platform/x86/asus-wmi.h b/drivers/platform/x86/asus-wmi.h
index 776524c..4da4c8b 100644
--- a/drivers/platform/x86/asus-wmi.h
+++ b/drivers/platform/x86/asus-wmi.h
@@ -30,6 +30,8 @@
 #include linux/platform_device.h
 
 #define ASUS_WMI_KEY_IGNORE (-1)
+#define ASUS_WMI_BRN_DOWN  0x20
+#define ASUS_WMI_BRN_UP0x2f
 
 struct module;
 struct key_entry;
diff --git a/drivers/platform/x86/eeepc-wmi.c b/drivers/platform/x86/eeepc-wmi.c
index 60cb76a..af67e6e 100644
--- a/drivers/platform/x86/eeepc-wmi.c
+++ b/drivers/platform/x86/eeepc-wmi.c
@@ -63,6 +63,8 @@ MODULE_PARM_DESC(hotplug_wireless,
 #define HOME_RELEASE   0xe5
 
 static const struct key_entry eeepc_wmi_keymap[] = {
+   { KE_KEY, ASUS_WMI_BRN_DOWN, { KEY_BRIGHTNESSDOWN } },
+   { KE_KEY, ASUS_WMI_BRN_UP, { KEY_BRIGHTNESSUP } },
/* Sleep already handled via generic ACPI code */
{ KE_KEY, 0x30, { KEY_VOLUMEUP } },
{ KE_KEY, 0x31, { KEY_VOLUMEDOWN } },
-- 
1.7.8.6

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 11/11] asus-laptop: always report brightness key events

2012-11-29 Thread Corentin Chary
Signed-off-by: Corentin Chary corentin.ch...@gmail.com
---
 drivers/platform/x86/asus-laptop.c |   24 
 1 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/drivers/platform/x86/asus-laptop.c 
b/drivers/platform/x86/asus-laptop.c
index 0fc4e30..a8a7755 100644
--- a/drivers/platform/x86/asus-laptop.c
+++ b/drivers/platform/x86/asus-laptop.c
@@ -128,10 +128,12 @@ MODULE_PARM_DESC(als_status, Set the ALS status on boot 
 /*
  * Some events we use, same for all Asus
  */
-#define ATKD_BR_UP 0x10/* (event  ~ATKD_BR_UP) = brightness level */
-#define ATKD_BR_DOWN   0x20/* (event  ~ATKD_BR_DOWN) = britghness level */
-#define ATKD_BR_MINATKD_BR_UP
-#define ATKD_BR_MAX(ATKD_BR_DOWN | 0xF)/* 0x2f */
+#define ATKD_BRNUP_MIN 0x10
+#define ATKD_BRNUP_MAX 0x1f
+#define ATKD_BRNDOWN_MIN   0x20
+#define ATKD_BRNDOWN_MAX   0x2f
+#define ATKD_BRNDOWN   0x20
+#define ATKD_BRNUP 0x2f
 #define ATKD_LCD_ON0x33
 #define ATKD_LCD_OFF   0x34
 
@@ -301,6 +303,8 @@ static const struct key_entry asus_keymap[] = {
{KE_KEY, 0x17, { KEY_ZOOM } },
{KE_KEY, 0x1f, { KEY_BATTERY } },
/* End of Lenovo SL Specific keycodes */
+   {KE_KEY, ATKD_BRNDOWN, { KEY_BRIGHTNESSDOWN } },
+   {KE_KEY, ATKD_BRNUP, { KEY_BRIGHTNESSUP } },
{KE_KEY, 0x30, { KEY_VOLUMEUP } },
{KE_KEY, 0x31, { KEY_VOLUMEDOWN } },
{KE_KEY, 0x32, { KEY_MUTE } },
@@ -1544,15 +1548,19 @@ static void asus_acpi_notify(struct acpi_device 
*device, u32 event)
dev_name(asus-device-dev), event,
count);
 
-   /* Brightness events are special */
-   if (event = ATKD_BR_MIN  event = ATKD_BR_MAX) {
+   if (event = ATKD_BRNUP_MIN  event = ATKD_BRNUP_MAX)
+   event = ATKD_BRNUP;
+   else if (event = ATKD_BRNDOWN_MIN 
+event = ATKD_BRNDOWN_MAX)
+   event = ATKD_BRNDOWN;
 
-   /* Ignore them completely if the acpi video driver is used */
+   /* Brightness events are special */
+   if (event == ATKD_BRNDOWN  event == ATKD_BRNUP) {
if (asus-backlight_device != NULL) {
/* Update the backlight device. */
asus_backlight_notify(asus);
+   return ;
}
-   return ;
}
 
/* Accelerometer coarse orientation change event */
-- 
1.7.8.6

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 09/11] asus-laptop: Do not call HWRS on init

2012-11-29 Thread Corentin Chary
From: Ben Hutchings b...@decadent.org.uk

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+...@gmail.com
References: http://bugs.debian.org/692436
Signed-off-by: Ben Hutchings b...@decadent.org.uk
Signed-off-by: Corentin Chary corentin.ch...@gmail.com
---
 drivers/platform/x86/asus-laptop.c |   17 -
 1 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/drivers/platform/x86/asus-laptop.c 
b/drivers/platform/x86/asus-laptop.c
index 0d371d0..0fc4e30 100644
--- a/drivers/platform/x86/asus-laptop.c
+++ b/drivers/platform/x86/asus-laptop.c
@@ -883,8 +883,10 @@ static ssize_t show_infos(struct device *dev,
/*
 * The HWRS method return informations about the hardware.
 * 0x80 bit is for WLAN, 0x100 for Bluetooth.
+* 0x40 for WWAN, 0x10 for WIMAX.
 * The significance of others is yet to be found.
-* If we don't find the method, we assume the device are present.
+* We don't currently use this for device detection, and it
+* takes several seconds to run on some systems.
 */
rv = acpi_evaluate_integer(asus-handle, HWRS, NULL, temp);
if (!ACPI_FAILURE(rv))
@@ -1705,7 +1707,7 @@ static int asus_laptop_get_info(struct asus_laptop *asus)
 {
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
union acpi_object *model = NULL;
-   unsigned long long bsts_result, hwrs_result;
+   unsigned long long bsts_result;
char *string = NULL;
acpi_status status;
 
@@ -1767,17 +1769,6 @@ static int asus_laptop_get_info(struct asus_laptop *asus)
if (*string)
pr_notice(  %s model detected\n, string);
 
-   /*
-* The HWRS method return informations about the hardware.
-* 0x80 bit is for WLAN, 0x100 for Bluetooth,
-* 0x40 for WWAN, 0x10 for WIMAX.
-* The significance of others is yet to be found.
-*/
-   status =
-   acpi_evaluate_integer(asus-handle, HWRS, NULL, hwrs_result);
-   if (!ACPI_FAILURE(status))
-   pr_notice(  HWRS returned %x, (int)hwrs_result);
-
if (!acpi_check_handle(asus-handle, METHOD_WL_STATUS, NULL))
asus-have_rsts = true;
 
-- 
1.7.8.6

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 08/11] asus-wmi: add display toggle quirk

2012-11-29 Thread Corentin Chary
From: AceLan Kao acelan@canonical.com

For machines with AMD graphic chips, it will send out WMI event and ACPI
interrupt at the same time while hitting the hotkey. BIOS will notify the
system the next display output mode throught WMI event code, so that
windows' application can show an OSD to tell the user which mode will be
taken effect. User can hit the display toggle key many times within 2
seconds to choose the mode they want. After 2 seconds, WMI dirver should
send a WMIMethod(SDSP) command to tell the BIOS which mode the user chose.
And then BIOS will raise another ACPI interrupt to tell the system to
really switch the display mode.

In Linux desktop, we don't have this kind of OSD to let users to choose
the mode they want, so we don't need to call WMIMethod(SDSP) to have
another ACPI interrupt. To simplify the problem, we just have to ignore
the WMI event, and let the first ACPI interrupt to send out the key event.

For the need, here comes another quirk to add machines with this kind of
behavior. When the WMI driver receives the display toggle WMI event, and
found the machin is in the list, it will do nothing and let ACPI video
driver to report the key event.

Signed-off-by: AceLan Kao acelan@canonical.com
Signed-off-by: Corentin Chary corenti...@iksaif.net
Signed-off-by: Corentin Chary corentin.ch...@gmail.com
---
 drivers/platform/x86/asus-nb-wmi.c |   31 ++-
 drivers/platform/x86/asus-wmi.c|   26 +++---
 drivers/platform/x86/asus-wmi.h|7 +++
 3 files changed, 60 insertions(+), 4 deletions(-)

diff --git a/drivers/platform/x86/asus-nb-wmi.c 
b/drivers/platform/x86/asus-nb-wmi.c
index 87d45e0..9aa6642 100644
--- a/drivers/platform/x86/asus-nb-wmi.c
+++ b/drivers/platform/x86/asus-nb-wmi.c
@@ -59,6 +59,17 @@ static struct quirk_entry quirk_asus_unknown = {
.wapf = 0,
 };
 
+/*
+ * For those machines that need software to control bt/wifi status
+ * and can't adjust brightness through ACPI interface
+ * and have duplicate events(ACPI and WMI) for display toggle
+ */
+static struct quirk_entry quirk_asus_x55u = {
+   .wapf = 4,
+   .wmi_backlight_power = true,
+   .no_display_toggle = true,
+};
+
 static struct quirk_entry quirk_asus_x401u = {
.wapf = 4,
 };
@@ -77,6 +88,15 @@ static struct dmi_system_id asus_quirks[] = {
DMI_MATCH(DMI_SYS_VENDOR, ASUSTeK COMPUTER INC.),
DMI_MATCH(DMI_PRODUCT_NAME, X401U),
},
+   .driver_data = quirk_asus_x55u,
+   },
+   {
+   .callback = dmi_matched,
+   .ident = ASUSTeK COMPUTER INC. X401A,
+   .matches = {
+   DMI_MATCH(DMI_SYS_VENDOR, ASUSTeK COMPUTER INC.),
+   DMI_MATCH(DMI_PRODUCT_NAME, X401A),
+   },
.driver_data = quirk_asus_x401u,
},
{
@@ -95,6 +115,15 @@ static struct dmi_system_id asus_quirks[] = {
DMI_MATCH(DMI_SYS_VENDOR, ASUSTeK COMPUTER INC.),
DMI_MATCH(DMI_PRODUCT_NAME, X501U),
},
+   .driver_data = quirk_asus_x55u,
+   },
+   {
+   .callback = dmi_matched,
+   .ident = ASUSTeK COMPUTER INC. X501A,
+   .matches = {
+   DMI_MATCH(DMI_SYS_VENDOR, ASUSTeK COMPUTER INC.),
+   DMI_MATCH(DMI_PRODUCT_NAME, X501A),
+   },
.driver_data = quirk_asus_x401u,
},
{
@@ -131,7 +160,7 @@ static struct dmi_system_id asus_quirks[] = {
DMI_MATCH(DMI_SYS_VENDOR, ASUSTeK COMPUTER INC.),
DMI_MATCH(DMI_PRODUCT_NAME, X55U),
},
-   .driver_data = quirk_asus_x401u,
+   .driver_data = quirk_asus_x55u,
},
{
.callback = dmi_matched,
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 912ec7d..6327a1b 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -1341,6 +1341,18 @@ static void asus_wmi_backlight_exit(struct asus_wmi 
*asus)
asus-backlight_device = NULL;
 }
 
+static int is_display_toggle(int code)
+{
+   /* display toggle keys */
+   if ((code = 0x61  code = 0x67) ||
+   (code = 0x8c  code = 0x93) ||
+   (code = 0xa0  code = 0xa7) ||
+   (code = 0xd0  code = 0xd5))
+   return 1;
+
+   return 0;
+}
+
 static void asus_wmi_notify(u32 value, void *context)
 {
struct asus_wmi *asus = context;
@@ -1380,10 +1392,18 @@ static void asus_wmi_notify(u32 value, void *context)
code = NOTIFY_BRNDOWN_MIN;
 
if (code == NOTIFY_BRNUP_MIN || code == NOTIFY_BRNDOWN_MIN) {
-   if (!acpi_video_backlight_support())
+   if (!acpi_video_backlight_support

[PATCH 03/11] asus-{nb-wmi|laptop}.c: sync keymaps

2012-11-29 Thread Corentin Chary
Maybe this should be shared in another module...

Signed-off-by: Corentin Chary corentin.ch...@gmail.com
---
 drivers/platform/x86/asus-laptop.c |   36 ++--
 drivers/platform/x86/asus-nb-wmi.c |   24 
 2 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/drivers/platform/x86/asus-laptop.c 
b/drivers/platform/x86/asus-laptop.c
index 68257ed..09c477a 100644
--- a/drivers/platform/x86/asus-laptop.c
+++ b/drivers/platform/x86/asus-laptop.c
@@ -304,40 +304,40 @@ static const struct key_entry asus_keymap[] = {
{KE_KEY, 0x30, { KEY_VOLUMEUP } },
{KE_KEY, 0x31, { KEY_VOLUMEDOWN } },
{KE_KEY, 0x32, { KEY_MUTE } },
-   {KE_KEY, 0x33, { KEY_SWITCHVIDEOMODE } },
-   {KE_KEY, 0x34, { KEY_SWITCHVIDEOMODE } },
+   {KE_KEY, 0x33, { KEY_DISPLAYTOGGLE } }, /* LCD on */
+   {KE_KEY, 0x34, { KEY_DISPLAY_OFF } }, /* LCD off */
{KE_KEY, 0x40, { KEY_PREVIOUSSONG } },
{KE_KEY, 0x41, { KEY_NEXTSONG } },
-   {KE_KEY, 0x43, { KEY_STOPCD } },
+   {KE_KEY, 0x43, { KEY_STOPCD } }, /* Stop/Eject */
{KE_KEY, 0x45, { KEY_PLAYPAUSE } },
-   {KE_KEY, 0x4c, { KEY_MEDIA } },
+   {KE_KEY, 0x4c, { KEY_MEDIA } }, /* WMP Key */
{KE_KEY, 0x50, { KEY_EMAIL } },
{KE_KEY, 0x51, { KEY_WWW } },
{KE_KEY, 0x55, { KEY_CALC } },
{KE_IGNORE, 0x57, },  /* Battery mode */
{KE_IGNORE, 0x58, },  /* AC mode */
{KE_KEY, 0x5C, { KEY_SCREENLOCK } },  /* Screenlock */
-   {KE_KEY, 0x5D, { KEY_WLAN } },
-   {KE_KEY, 0x5E, { KEY_WLAN } },
-   {KE_KEY, 0x5F, { KEY_WLAN } },
+   {KE_KEY, 0x5D, { KEY_WLAN } }, /* WLAN Toggle */
+   {KE_KEY, 0x5E, { KEY_WLAN } }, /* WLAN Enable */
+   {KE_KEY, 0x5F, { KEY_WLAN } }, /* WLAN Disable */
{KE_KEY, 0x60, { KEY_SWITCHVIDEOMODE } },
-   {KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } },
-   {KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } },
-   {KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } },
-   {KE_KEY, 0x6B, { KEY_F13 } }, /* Lock Touchpad */
+   {KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } }, /* LCD Only */
+   {KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, /* CRT Only */
+   {KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, /* LCD + CRT */
+   {KE_KEY, 0x6B, { KEY_TOUCHPAD_TOGGLE } }, /* Lock Touchpad */
{KE_KEY, 0x6C, { KEY_SLEEP } }, /* Suspend */
{KE_KEY, 0x6D, { KEY_SLEEP } }, /* Hibernate */
{KE_IGNORE, 0x6E, },  /* Low Battery notification */
-   {KE_KEY, 0x7E, { KEY_BLUETOOTH } },
-   {KE_KEY, 0x7D, { KEY_BLUETOOTH } },
+   {KE_KEY, 0x7D, { KEY_BLUETOOTH } }, /* Bluetooth Enable */
+   {KE_KEY, 0x7E, { KEY_BLUETOOTH } }, /* Bluetooth Disable */
{KE_KEY, 0x82, { KEY_CAMERA } },
-   {KE_KEY, 0x88, { KEY_WLAN  } },
-   {KE_KEY, 0x8A, { KEY_PROG1 } },
+   {KE_KEY, 0x88, { KEY_RFKILL  } }, /* Radio Toggle Key */
+   {KE_KEY, 0x8A, { KEY_PROG1 } }, /* Color enhancement mode */
{KE_KEY, 0x95, { KEY_MEDIA } },
{KE_KEY, 0x99, { KEY_PHONE } },
-   {KE_KEY, 0xc4, { KEY_KBDILLUMUP } },
-   {KE_KEY, 0xc5, { KEY_KBDILLUMDOWN } },
-   {KE_KEY, 0xb5, { KEY_CALC } },
+   {KE_KEY, 0xB5, { KEY_CALC } },
+   {KE_KEY, 0xC4, { KEY_KBDILLUMUP } },
+   {KE_KEY, 0xC5, { KEY_KBDILLUMDOWN } },
{KE_END, 0},
 };
 
diff --git a/drivers/platform/x86/asus-nb-wmi.c 
b/drivers/platform/x86/asus-nb-wmi.c
index b70425c..9f1caa7 100644
--- a/drivers/platform/x86/asus-nb-wmi.c
+++ b/drivers/platform/x86/asus-nb-wmi.c
@@ -168,9 +168,9 @@ static const struct key_entry asus_nb_wmi_keymap[] = {
{ KE_KEY, 0x34, { KEY_DISPLAY_OFF } }, /* LCD off */
{ KE_KEY, 0x40, { KEY_PREVIOUSSONG } },
{ KE_KEY, 0x41, { KEY_NEXTSONG } },
-   { KE_KEY, 0x43, { KEY_STOPCD } },
+   { KE_KEY, 0x43, { KEY_STOPCD } }, /* Stop/Eject */
{ KE_KEY, 0x45, { KEY_PLAYPAUSE } },
-   { KE_KEY, 0x4c, { KEY_MEDIA } },
+   { KE_KEY, 0x4c, { KEY_MEDIA } }, /* WMP Key */
{ KE_KEY, 0x50, { KEY_EMAIL } },
{ KE_KEY, 0x51, { KEY_WWW } },
{ KE_KEY, 0x55, { KEY_CALC } },
@@ -181,25 +181,25 @@ static const struct key_entry asus_nb_wmi_keymap[] = {
{ KE_KEY, 0x5E, { KEY_WLAN } }, /* Wireless console Enable */
{ KE_KEY, 0x5F, { KEY_WLAN } }, /* Wireless console Disable */
{ KE_KEY, 0x60, { KEY_SWITCHVIDEOMODE } },
-   { KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } },
-   { KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } },
-   { KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } },
+   { KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } }, /* LCD Only */
+   { KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, /* CRT Only */
+   { KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, /* LCD + CRT */
{ KE_KEY, 0x6B, { KEY_TOUCHPAD_TOGGLE } },
{ KE_IGNORE, 0x6E, },  /* Low Battery notification */
-   { KE_KEY, 0x7D, { KEY_BLUETOOTH } },
-   { KE_KEY, 0x7E, { KEY_BLUETOOTH } },
+   { KE_KEY, 0x7D

Re: [PATCH] samsung-laptop: Disable if CONFIG_EFI=y

2012-11-05 Thread Corentin Chary
On Sun, Nov 4, 2012 at 7:37 PM, Alan Cox  wrote:
>> Acked-by: Corentin Chary 
>
> This is totally bogus and prevents users build a kernel which can work in
> either mode. As such its a regression.

Arg.. Sorry for that, I didn't realized that CONFIG_EFI=y was not
something rare these days.

> Do the detection check at runtime. If it was booted via EFI then don't
> grovel in places you shouldn't. Indeed its possible EFI should reserve
> those memory regions ?

I wonder how the windows driver works in this case.. Maybe they use
something completly different, and the SABI interface is still there
because nobody removed/disabled it ? In this case it's probably not a
good idea to use it on these machines since the implementation is
likely to be completly broken.

--
Corentin Chary
http://xf.iksaif.net
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] samsung-laptop: Disable if CONFIG_EFI=y

2012-11-05 Thread Corentin Chary
On Sun, Nov 4, 2012 at 7:37 PM, Alan Cox a...@lxorguk.ukuu.org.uk wrote:
 Acked-by: Corentin Chary corentin.ch...@gmail.com

 This is totally bogus and prevents users build a kernel which can work in
 either mode. As such its a regression.

Arg.. Sorry for that, I didn't realized that CONFIG_EFI=y was not
something rare these days.

 Do the detection check at runtime. If it was booted via EFI then don't
 grovel in places you shouldn't. Indeed its possible EFI should reserve
 those memory regions ?

I wonder how the windows driver works in this case.. Maybe they use
something completly different, and the SABI interface is still there
because nobody removed/disabled it ? In this case it's probably not a
good idea to use it on these machines since the implementation is
likely to be completly broken.

--
Corentin Chary
http://xf.iksaif.net
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] samsung-laptop: Disable if CONFIG_EFI=y

2012-11-04 Thread Corentin Chary
On Sun, Nov 4, 2012 at 5:35 PM, Matt Fleming  wrote:
> From: Matt Fleming 
>
> We've started getting reports of users seeing Machine Check Exceptions
> when booting their Samsung laptops in UEFI mode,
>
>  https://bugzilla.kernel.org/show_bug.cgi?id=47121
>
> This module seems to be the culprit as it's grovelling around in the
> 0xf region which has no mapping in either the e820 or EFI memory
> maps on the affected machines.
>
> Reported-by: Alessandro Crismani 
> Reported-by: Mikhail Bakhterev 
> Tested-by: Patrick H 
> Cc: H. Peter Anvin 
> Cc: Matthew Garrett 
> Cc: Corentin Chary 
> Cc: sta...@vger.kernel.org
> Signed-off-by: Matt Fleming 
> ---
>  drivers/platform/x86/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
> index c86bae8..0fe5200 100644
> --- a/drivers/platform/x86/Kconfig
> +++ b/drivers/platform/x86/Kconfig
> @@ -717,7 +717,7 @@ config XO15_EBOOK
>
>  config SAMSUNG_LAPTOP
> tristate "Samsung Laptop driver"
> -   depends on X86
> +   depends on X86 && !EFI
> depends on RFKILL || RFKILL = n
> depends on BACKLIGHT_CLASS_DEVICE
> select LEDS_CLASS
> --
> 1.7.11.7
>

Acked-by: Corentin Chary 

Matthew could you merge this in your tree ? Thanks.

Matt, any idea if SABI doesn't exist on these machines, or is just
mapped somewhere else ?
By any luck, could Samsung tell you how to safely detect SABI aware machines ?

--
Corentin Chary
http://xf.iksaif.net
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] samsung-laptop: Disable if CONFIG_EFI=y

2012-11-04 Thread Corentin Chary
On Sun, Nov 4, 2012 at 5:35 PM, Matt Fleming m...@console-pimps.org wrote:
 From: Matt Fleming matt.flem...@intel.com

 We've started getting reports of users seeing Machine Check Exceptions
 when booting their Samsung laptops in UEFI mode,

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

 This module seems to be the culprit as it's grovelling around in the
 0xf region which has no mapping in either the e820 or EFI memory
 maps on the affected machines.

 Reported-by: Alessandro Crismani alessandro.crism...@gmail.com
 Reported-by: Mikhail Bakhterev mike.bakhte...@gmail.com
 Tested-by: Patrick H ker...@feystorm.net
 Cc: H. Peter Anvin h...@zytor.com
 Cc: Matthew Garrett m...@redhat.com
 Cc: Corentin Chary corenti...@iksaif.net
 Cc: sta...@vger.kernel.org
 Signed-off-by: Matt Fleming matt.flem...@intel.com
 ---
  drivers/platform/x86/Kconfig | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

 diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
 index c86bae8..0fe5200 100644
 --- a/drivers/platform/x86/Kconfig
 +++ b/drivers/platform/x86/Kconfig
 @@ -717,7 +717,7 @@ config XO15_EBOOK

  config SAMSUNG_LAPTOP
 tristate Samsung Laptop driver
 -   depends on X86
 +   depends on X86  !EFI
 depends on RFKILL || RFKILL = n
 depends on BACKLIGHT_CLASS_DEVICE
 select LEDS_CLASS
 --
 1.7.11.7


Acked-by: Corentin Chary corentin.ch...@gmail.com

Matthew could you merge this in your tree ? Thanks.

Matt, any idea if SABI doesn't exist on these machines, or is just
mapped somewhere else ?
By any luck, could Samsung tell you how to safely detect SABI aware machines ?

--
Corentin Chary
http://xf.iksaif.net
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 1/1] Platform: x86: Add Chrome OS Laptop driver

2012-11-02 Thread Corentin Chary
On Fri, Nov 2, 2012 at 1:09 PM, Olof Johansson  wrote:
> On Fri, Nov 2, 2012 at 2:03 PM, Corentin Chary  
> wrote:
>> On Fri, Nov 2, 2012 at 12:45 PM, Olof Johansson  wrote:
>>> On Fri, Oct 26, 2012 at 10:30 AM, Corentin Chary
>>>  wrote:
>>>
>>>> Looks better, but I'm curious, what is the final purpose of this driver ?
>>>> What ABI will be exposed, who will use it ?
>>>>
>>>> If it is going to be bigger, it may be a good idea to convert it to a
>>>> real platform driver (platform_drivers/platform_device stuff).
>>>
>>> It's not a driver per se. It's platform glue that, based on the DMI
>>> table, registers platform and i2c devices (at this time only i2c
>>> devices).
>>>
>>> Unfortunately there's no way to do this nicely from userspace after
>>> boot, since there's limits to how much data you can provide with the
>>> simpler userspace-driven i2c probing protocol.
>>>
>>> So, there's no user-facing ABI on this, and no one is expected to use
>>> it from userspace. It's just there to make sure that the un-probably
>>> devices on this kind of hardware gets bound to drivers properly.
>>>
>>> If it's converted to a platform_driver, how do you expect that to
>>> probe, where would the platform_device be registered?
>>
>> I guess I would check dmi in the module init method, and then use the
>> probe callback of platform_create_bundle to do more probing if
>> necessary.
>
> Maybe I'm dense but I don't see how that could possibly be better than
> what the code does today. It would just add more overhead and clutter
> by creating a unnecessary dummy device/driver setup just to, in the
> end, register the same i2c devices.
>

Well that was the point of "If it is going to be bigger".
Of course, as long as it only register those i2c devices, it doesn't
really matter.

--
Corentin Chary
http://xf.iksaif.net
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 1/1] Platform: x86: Add Chrome OS Laptop driver

2012-11-02 Thread Corentin Chary
On Fri, Nov 2, 2012 at 12:45 PM, Olof Johansson  wrote:
> On Fri, Oct 26, 2012 at 10:30 AM, Corentin Chary
>  wrote:
>
>> Looks better, but I'm curious, what is the final purpose of this driver ?
>> What ABI will be exposed, who will use it ?
>>
>> If it is going to be bigger, it may be a good idea to convert it to a
>> real platform driver (platform_drivers/platform_device stuff).
>
> It's not a driver per se. It's platform glue that, based on the DMI
> table, registers platform and i2c devices (at this time only i2c
> devices).
>
> Unfortunately there's no way to do this nicely from userspace after
> boot, since there's limits to how much data you can provide with the
> simpler userspace-driven i2c probing protocol.
>
> So, there's no user-facing ABI on this, and no one is expected to use
> it from userspace. It's just there to make sure that the un-probably
> devices on this kind of hardware gets bound to drivers properly.
>
> If it's converted to a platform_driver, how do you expect that to
> probe, where would the platform_device be registered?

I guess I would check dmi in the module init method, and then use the
probe callback of platform_create_bundle to do more probing if
necessary.


--
Corentin Chary
http://xf.iksaif.net
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 1/1] Platform: x86: Add Chrome OS Laptop driver

2012-11-02 Thread Corentin Chary
On Fri, Nov 2, 2012 at 12:45 PM, Olof Johansson o...@lixom.net wrote:
 On Fri, Oct 26, 2012 at 10:30 AM, Corentin Chary
 corentin.ch...@gmail.com wrote:

 Looks better, but I'm curious, what is the final purpose of this driver ?
 What ABI will be exposed, who will use it ?

 If it is going to be bigger, it may be a good idea to convert it to a
 real platform driver (platform_drivers/platform_device stuff).

 It's not a driver per se. It's platform glue that, based on the DMI
 table, registers platform and i2c devices (at this time only i2c
 devices).

 Unfortunately there's no way to do this nicely from userspace after
 boot, since there's limits to how much data you can provide with the
 simpler userspace-driven i2c probing protocol.

 So, there's no user-facing ABI on this, and no one is expected to use
 it from userspace. It's just there to make sure that the un-probably
 devices on this kind of hardware gets bound to drivers properly.

 If it's converted to a platform_driver, how do you expect that to
 probe, where would the platform_device be registered?

I guess I would check dmi in the module init method, and then use the
probe callback of platform_create_bundle to do more probing if
necessary.


--
Corentin Chary
http://xf.iksaif.net
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 1/1] Platform: x86: Add Chrome OS Laptop driver

2012-11-02 Thread Corentin Chary
On Fri, Nov 2, 2012 at 1:09 PM, Olof Johansson o...@lixom.net wrote:
 On Fri, Nov 2, 2012 at 2:03 PM, Corentin Chary corentin.ch...@gmail.com 
 wrote:
 On Fri, Nov 2, 2012 at 12:45 PM, Olof Johansson o...@lixom.net wrote:
 On Fri, Oct 26, 2012 at 10:30 AM, Corentin Chary
 corentin.ch...@gmail.com wrote:

 Looks better, but I'm curious, what is the final purpose of this driver ?
 What ABI will be exposed, who will use it ?

 If it is going to be bigger, it may be a good idea to convert it to a
 real platform driver (platform_drivers/platform_device stuff).

 It's not a driver per se. It's platform glue that, based on the DMI
 table, registers platform and i2c devices (at this time only i2c
 devices).

 Unfortunately there's no way to do this nicely from userspace after
 boot, since there's limits to how much data you can provide with the
 simpler userspace-driven i2c probing protocol.

 So, there's no user-facing ABI on this, and no one is expected to use
 it from userspace. It's just there to make sure that the un-probably
 devices on this kind of hardware gets bound to drivers properly.

 If it's converted to a platform_driver, how do you expect that to
 probe, where would the platform_device be registered?

 I guess I would check dmi in the module init method, and then use the
 probe callback of platform_create_bundle to do more probing if
 necessary.

 Maybe I'm dense but I don't see how that could possibly be better than
 what the code does today. It would just add more overhead and clutter
 by creating a unnecessary dummy device/driver setup just to, in the
 end, register the same i2c devices.


Well that was the point of If it is going to be bigger.
Of course, as long as it only register those i2c devices, it doesn't
really matter.

--
Corentin Chary
http://xf.iksaif.net
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 1/1] Platform: x86: Add Chrome OS Laptop driver

2012-10-26 Thread Corentin Chary
gt; +* If a name is specified, look for irq platform information stashed
> +* in DMI_DEV_TYPE_DEV_ONBOARD by the Chrome OS custom system 
> firmware.
> +*/
> +   if (name) {
> +   dmi_dev = dmi_find_device(DMI_DEV_TYPE_DEV_ONBOARD, name, 
> NULL);
> +   if (!dmi_dev) {
> +   pr_err("%s failed to dmi find device %s.\n",
> +  __func__,
> +  name);
> +   return NULL;
> +   }
> +   dev_data = (struct dmi_dev_onboard *)dmi_dev->device_data;
> +   if (!dev_data) {
> +   pr_err("%s failed to get data from dmi for %s.\n",
> +  __func__, name);
> +   return NULL;
> +   }
> +   info->irq = dev_data->instance;
> +   }
> +
> +   adapter = i2c_get_adapter(bus);
> +   if (!adapter) {
> +   pr_err("%s failed to get i2c adapter %d.\n", __func__, bus);
> +   return NULL;
> +   }
> +
> +   /* add the i2c device */
> +   client = i2c_new_probed_device(adapter, info, addrs, NULL);
> +   if (!client)
> +   pr_err("%s failed to register device %d-%02x\n",
> +  __func__, bus, info->addr);
> +   else
> +   pr_debug("%s added i2c device %d-%02x\n",
> +__func__, bus, info->addr);
> +
> +   i2c_put_adapter(adapter);
> +   return client;
> +}
> +
> +static int __init __find_i2c_adap(struct device *dev, void *data)
> +{
> +   const char *name = data;
> +   static const char *prefix = "i2c-";
> +   struct i2c_adapter *adapter;
> +   if (strncmp(dev_name(dev), prefix, strlen(prefix)) != 0)
> +   return 0;
> +   adapter = to_i2c_adapter(dev);
> +   return (strncmp(adapter->name, name, strlen(name)) == 0);
> +}
> +
> +static int __init find_i2c_adapter_num(enum i2c_adapter_type type)
> +{
> +   struct device *dev = NULL;
> +   struct i2c_adapter *adapter;
> +   const char *name = i2c_adapter_names[type];
> +   /* find the adapter by name */
> +   dev = bus_find_device(_bus_type, NULL, (void *)name,
> + __find_i2c_adap);
> +   if (!dev) {
> +   pr_err("%s: i2c adapter %s not found on system.\n", __func__,
> +  name);
> +   return -ENODEV;
> +   }
> +   adapter = to_i2c_adapter(dev);
> +   return adapter->nr;
> +}
> +
> +/*
> + * Probes for a device at a single address, the one provided by
> + * info->addr.
> + * Returns NULL if no device found.
> + */
> +static struct i2c_client __init *add_smbus_device(const char *name,
> + struct i2c_board_info *info)
> +{
> +   const unsigned short addr_list[] = { info->addr, I2C_CLIENT_END };
> +   return __add_probed_i2c_device(name,
> +  
> find_i2c_adapter_num(I2C_ADAPTER_SMBUS),
> +  info,
> +  addr_list);
> +}
> +
> +static int __init setup_lumpy_tp(const struct dmi_system_id *id)
> +{
> +   /* add cyapa touchpad on smbus */
> +   tp = add_smbus_device("trackpad", _device);
> +   return 0;
> +}
> +
> +static int __init setup_isl29018_als(const struct dmi_system_id *id)
> +{
> +   /* add isl29018 light sensor */
> +   als = add_smbus_device("lightsensor", _als_device);
> +   return 0;
> +}
> +
> +static struct dmi_system_id __initdata chromeos_laptop_dmi_table[] = {
> +   {
> +   .ident = "Samsung Series 5 550 - Touchpad",
> +   .matches = {
> +   DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG"),
> +   DMI_MATCH(DMI_PRODUCT_NAME, "Lumpy"),
> +   },
> +   .callback = setup_lumpy_tp,
> +   },
> +   {
> +   .ident = "Samsung Series 5 550 - Light Sensor",
> +   .matches = {
> +   DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG"),
> +   DMI_MATCH(DMI_PRODUCT_NAME, "Lumpy"),
> +   },
> +   .callback = setup_isl29018_als,
> +   },
> +   { }
> +};
> +MODULE_DEVICE_TABLE(dmi, chromeos_laptop_dmi_table);
> +
> +static int __init chromeos_laptop_init(void)
> +{
> +   if (!dmi_check_system(chr

Re: [PATCH v2 1/1] Platform: x86: Add Chrome OS Laptop driver

2012-10-26 Thread Corentin Chary
);
 +   return NULL;
 +   }
 +   dev_data = (struct dmi_dev_onboard *)dmi_dev-device_data;
 +   if (!dev_data) {
 +   pr_err(%s failed to get data from dmi for %s.\n,
 +  __func__, name);
 +   return NULL;
 +   }
 +   info-irq = dev_data-instance;
 +   }
 +
 +   adapter = i2c_get_adapter(bus);
 +   if (!adapter) {
 +   pr_err(%s failed to get i2c adapter %d.\n, __func__, bus);
 +   return NULL;
 +   }
 +
 +   /* add the i2c device */
 +   client = i2c_new_probed_device(adapter, info, addrs, NULL);
 +   if (!client)
 +   pr_err(%s failed to register device %d-%02x\n,
 +  __func__, bus, info-addr);
 +   else
 +   pr_debug(%s added i2c device %d-%02x\n,
 +__func__, bus, info-addr);
 +
 +   i2c_put_adapter(adapter);
 +   return client;
 +}
 +
 +static int __init __find_i2c_adap(struct device *dev, void *data)
 +{
 +   const char *name = data;
 +   static const char *prefix = i2c-;
 +   struct i2c_adapter *adapter;
 +   if (strncmp(dev_name(dev), prefix, strlen(prefix)) != 0)
 +   return 0;
 +   adapter = to_i2c_adapter(dev);
 +   return (strncmp(adapter-name, name, strlen(name)) == 0);
 +}
 +
 +static int __init find_i2c_adapter_num(enum i2c_adapter_type type)
 +{
 +   struct device *dev = NULL;
 +   struct i2c_adapter *adapter;
 +   const char *name = i2c_adapter_names[type];
 +   /* find the adapter by name */
 +   dev = bus_find_device(i2c_bus_type, NULL, (void *)name,
 + __find_i2c_adap);
 +   if (!dev) {
 +   pr_err(%s: i2c adapter %s not found on system.\n, __func__,
 +  name);
 +   return -ENODEV;
 +   }
 +   adapter = to_i2c_adapter(dev);
 +   return adapter-nr;
 +}
 +
 +/*
 + * Probes for a device at a single address, the one provided by
 + * info-addr.
 + * Returns NULL if no device found.
 + */
 +static struct i2c_client __init *add_smbus_device(const char *name,
 + struct i2c_board_info *info)
 +{
 +   const unsigned short addr_list[] = { info-addr, I2C_CLIENT_END };
 +   return __add_probed_i2c_device(name,
 +  
 find_i2c_adapter_num(I2C_ADAPTER_SMBUS),
 +  info,
 +  addr_list);
 +}
 +
 +static int __init setup_lumpy_tp(const struct dmi_system_id *id)
 +{
 +   /* add cyapa touchpad on smbus */
 +   tp = add_smbus_device(trackpad, cyapa_device);
 +   return 0;
 +}
 +
 +static int __init setup_isl29018_als(const struct dmi_system_id *id)
 +{
 +   /* add isl29018 light sensor */
 +   als = add_smbus_device(lightsensor, isl_als_device);
 +   return 0;
 +}
 +
 +static struct dmi_system_id __initdata chromeos_laptop_dmi_table[] = {
 +   {
 +   .ident = Samsung Series 5 550 - Touchpad,
 +   .matches = {
 +   DMI_MATCH(DMI_SYS_VENDOR, SAMSUNG),
 +   DMI_MATCH(DMI_PRODUCT_NAME, Lumpy),
 +   },
 +   .callback = setup_lumpy_tp,
 +   },
 +   {
 +   .ident = Samsung Series 5 550 - Light Sensor,
 +   .matches = {
 +   DMI_MATCH(DMI_SYS_VENDOR, SAMSUNG),
 +   DMI_MATCH(DMI_PRODUCT_NAME, Lumpy),
 +   },
 +   .callback = setup_isl29018_als,
 +   },
 +   { }
 +};
 +MODULE_DEVICE_TABLE(dmi, chromeos_laptop_dmi_table);
 +
 +static int __init chromeos_laptop_init(void)
 +{
 +   if (!dmi_check_system(chromeos_laptop_dmi_table)) {
 +   pr_debug(%s unsupported system.\n, __func__);
 +   return -ENODEV;
 +   }
 +   return 0;
 +}
 +
 +static void __exit chromeos_laptop_exit(void)
 +{
 +   if (als)
 +   i2c_unregister_device(als);
 +   if (tp)
 +   i2c_unregister_device(tp);
 +}
 +
 +module_init(chromeos_laptop_init);
 +module_exit(chromeos_laptop_exit);
 +
 +MODULE_DESCRIPTION(Chrome OS Laptop driver);
 +MODULE_AUTHOR(Benson Leung ble...@chromium.org);
 +MODULE_LICENSE(GPL);
 --
 1.7.7.3

Looks better, but I'm curious, what is the final purpose of this driver ?
What ABI will be exposed, who will use it ?

If it is going to be bigger, it may be a good idea to convert it to a
real platform driver (platform_drivers/platform_device stuff).

Thanks,

-- 
Corentin Chary
http://xf.iksaif.net
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Platform: x86: Add Chrome OS Laptop driver

2012-10-24 Thread Corentin Chary
nd device %s.\n",
> +  __func__,
> +  name);
> +   return NULL;
> +   }
> +   dev_data = (struct dmi_dev_onboard *)dmi_dev->device_data;
> +   if (!dev_data) {
> +   pr_err("%s failed to get data from dmi for %s.\n",
> +  __func__, name);
> +   return NULL;
> +   }
> +   info->irq = dev_data->instance;
> +   }
> +
> +   adapter = i2c_get_adapter(bus);
> +   if (!adapter) {
> +   pr_err("%s failed to get i2c adapter %d.\n", __func__, bus);
> +   return NULL;
> +   }
> +
> +   /* add the i2c device */
> +   client = i2c_new_probed_device(adapter, info, addrs, NULL);
> +   if (!client)
> +   pr_err("%s failed to register device %d-%02x\n",
> +  __func__, bus, info->addr);
> +   else
> +   pr_debug("%s added i2c device %d-%02x\n",
> +__func__, bus, info->addr);
> +
> +   i2c_put_adapter(adapter);
> +   return client;
> +}
> +
> +static int __init __find_i2c_adap(struct device *dev, void *data)
> +{
> +   const char *name = data;
> +   const char *prefix = "i2c-";

static const ?

> +   struct i2c_adapter *adapter;
> +   if (strncmp(dev_name(dev), prefix, strlen(prefix)))
> +   return 0;
> +   adapter = to_i2c_adapter(dev);
> +   return !strncmp(adapter->name, name, strlen(name));
> +}
> +
> +static int __init find_i2c_adapter_num(enum i2c_adapter_type type)
> +{
> +   struct device *dev = NULL;
> +   struct i2c_adapter *adapter;
> +   const char *name = i2c_adapter_names[type];
> +   /* find the adapter by name */
> +   dev = bus_find_device(_bus_type, NULL, (void *)name,
> + __find_i2c_adap);
> +   if (!dev) {
> +   pr_err("%s: i2c adapter %s not found on system.\n", __func__,
> +  name);
> +   return -ENODEV;
> +   }
> +   adapter = to_i2c_adapter(dev);
> +   return adapter->nr;
> +}
> +
> +/*
> + * Probes for a device at a single address, the one provided by
> + * info->addr.
> + * Returns NULL if no device found.
> + */
> +static __init struct i2c_client *add_smbus_device(const char *name,
> + struct i2c_board_info *info)
> +{
> +   const unsigned short addr_list[] = { info->addr, I2C_CLIENT_END };
> +   return __add_probed_i2c_device(name,
> +  
> find_i2c_adapter_num(I2C_ADAPTER_SMBUS),
> +  info,
> +  addr_list);
> +}
> +
> +static int __init setup_lumpy_tp(const struct dmi_system_id *id)
> +{
> +   /* add cyapa touchpad on smbus */
> +   tp = add_smbus_device("trackpad", _device);
> +   return 0;
> +}
> +
> +static int __init setup_isl29018_als(const struct dmi_system_id *id)
> +{
> +   /* add isl29018 light sensor */
> +   als = add_smbus_device("lightsensor", _als_device);
> +   return 0;
> +}
> +
> +static const struct __initdata dmi_system_id chromeos_laptop_dmi_table[] = {
> +   {
> +   .ident = "Samsung Series 5 550 - Touchpad",
> +   .matches = {
> +   DMI_MATCH(DMI_PRODUCT_NAME, "Lumpy"),
> +   },
> +   .callback = setup_lumpy_tp,
> +   },
> +   {
> +   .ident = "Samsung Series 5 550 - Light Sensor",
> +   .matches = {
> +   DMI_MATCH(DMI_PRODUCT_NAME, "Lumpy"),
> +   },
> +   .callback = setup_isl29018_als,

Maybe you should match on something more specific that only product name ?

> +   },
> +   { }
> +};
> +
> +static int __init chromeos_laptop_init(void)
> +{
> +   if (!dmi_check_system(chromeos_laptop_dmi_table)) {
> +   pr_debug("%s unsupported system.\n", __func__);
> +   return -ENODEV;
> +   }
> +   return 0;
> +}
> +
> +static void __exit chromeos_laptop_exit(void)
> +{
> +   if (als)
> +   i2c_unregister_device(als);
> +   if (tp)
> +   i2c_unregister_device(tp);
> +}
> +
> +module_init(chromeos_laptop_init);
> +module_exit(chromeos_laptop_exit);
> +
> +MODULE_DESCRIPTION("Chrome OS Laptop driver");
> +MODULE_AUTHOR("Benson Leung ");
> +MODULE_LICENSE("GPL");
> --
> 1.7.7.3

Some __initdata and __init keywords are positioned before type, others
after, please fix that to be consistent.
Thanks,

-- 
Corentin Chary
http://xf.iksaif.net
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Platform: x86: Add Chrome OS Laptop driver

2012-10-24 Thread Corentin Chary
;
 +   }
 +
 +   adapter = i2c_get_adapter(bus);
 +   if (!adapter) {
 +   pr_err(%s failed to get i2c adapter %d.\n, __func__, bus);
 +   return NULL;
 +   }
 +
 +   /* add the i2c device */
 +   client = i2c_new_probed_device(adapter, info, addrs, NULL);
 +   if (!client)
 +   pr_err(%s failed to register device %d-%02x\n,
 +  __func__, bus, info-addr);
 +   else
 +   pr_debug(%s added i2c device %d-%02x\n,
 +__func__, bus, info-addr);
 +
 +   i2c_put_adapter(adapter);
 +   return client;
 +}
 +
 +static int __init __find_i2c_adap(struct device *dev, void *data)
 +{
 +   const char *name = data;
 +   const char *prefix = i2c-;

static const ?

 +   struct i2c_adapter *adapter;
 +   if (strncmp(dev_name(dev), prefix, strlen(prefix)))
 +   return 0;
 +   adapter = to_i2c_adapter(dev);
 +   return !strncmp(adapter-name, name, strlen(name));
 +}
 +
 +static int __init find_i2c_adapter_num(enum i2c_adapter_type type)
 +{
 +   struct device *dev = NULL;
 +   struct i2c_adapter *adapter;
 +   const char *name = i2c_adapter_names[type];
 +   /* find the adapter by name */
 +   dev = bus_find_device(i2c_bus_type, NULL, (void *)name,
 + __find_i2c_adap);
 +   if (!dev) {
 +   pr_err(%s: i2c adapter %s not found on system.\n, __func__,
 +  name);
 +   return -ENODEV;
 +   }
 +   adapter = to_i2c_adapter(dev);
 +   return adapter-nr;
 +}
 +
 +/*
 + * Probes for a device at a single address, the one provided by
 + * info-addr.
 + * Returns NULL if no device found.
 + */
 +static __init struct i2c_client *add_smbus_device(const char *name,
 + struct i2c_board_info *info)
 +{
 +   const unsigned short addr_list[] = { info-addr, I2C_CLIENT_END };
 +   return __add_probed_i2c_device(name,
 +  
 find_i2c_adapter_num(I2C_ADAPTER_SMBUS),
 +  info,
 +  addr_list);
 +}
 +
 +static int __init setup_lumpy_tp(const struct dmi_system_id *id)
 +{
 +   /* add cyapa touchpad on smbus */
 +   tp = add_smbus_device(trackpad, cyapa_device);
 +   return 0;
 +}
 +
 +static int __init setup_isl29018_als(const struct dmi_system_id *id)
 +{
 +   /* add isl29018 light sensor */
 +   als = add_smbus_device(lightsensor, isl_als_device);
 +   return 0;
 +}
 +
 +static const struct __initdata dmi_system_id chromeos_laptop_dmi_table[] = {
 +   {
 +   .ident = Samsung Series 5 550 - Touchpad,
 +   .matches = {
 +   DMI_MATCH(DMI_PRODUCT_NAME, Lumpy),
 +   },
 +   .callback = setup_lumpy_tp,
 +   },
 +   {
 +   .ident = Samsung Series 5 550 - Light Sensor,
 +   .matches = {
 +   DMI_MATCH(DMI_PRODUCT_NAME, Lumpy),
 +   },
 +   .callback = setup_isl29018_als,

Maybe you should match on something more specific that only product name ?

 +   },
 +   { }
 +};
 +
 +static int __init chromeos_laptop_init(void)
 +{
 +   if (!dmi_check_system(chromeos_laptop_dmi_table)) {
 +   pr_debug(%s unsupported system.\n, __func__);
 +   return -ENODEV;
 +   }
 +   return 0;
 +}
 +
 +static void __exit chromeos_laptop_exit(void)
 +{
 +   if (als)
 +   i2c_unregister_device(als);
 +   if (tp)
 +   i2c_unregister_device(tp);
 +}
 +
 +module_init(chromeos_laptop_init);
 +module_exit(chromeos_laptop_exit);
 +
 +MODULE_DESCRIPTION(Chrome OS Laptop driver);
 +MODULE_AUTHOR(Benson Leung ble...@chromium.org);
 +MODULE_LICENSE(GPL);
 --
 1.7.7.3

Some __initdata and __init keywords are positioned before type, others
after, please fix that to be consistent.
Thanks,

-- 
Corentin Chary
http://xf.iksaif.net
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 7/8] asus-nb-wmi: add all video switch keys

2012-10-03 Thread Corentin Chary
From: AceLan Kao 

Fill up all the video switch keys in the map.

Signed-off-by: AceLan Kao 
Signed-off-by: Corentin Chary 
---
 drivers/platform/x86/asus-nb-wmi.c |   22 +++---
 1 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/drivers/platform/x86/asus-nb-wmi.c 
b/drivers/platform/x86/asus-nb-wmi.c
index 75ce18c..87d45e0 100644
--- a/drivers/platform/x86/asus-nb-wmi.c
+++ b/drivers/platform/x86/asus-nb-wmi.c
@@ -181,9 +181,13 @@ static const struct key_entry asus_nb_wmi_keymap[] = {
{ KE_KEY, 0x5E, { KEY_WLAN } }, /* Wireless console Enable */
{ KE_KEY, 0x5F, { KEY_WLAN } }, /* Wireless console Disable */
{ KE_KEY, 0x60, { KEY_TOUCHPAD_ON } },
-   { KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } }, /* LCD Only */
-   { KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, /* CRT Only */
-   { KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, /* LCD + CRT */
+   { KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD only */
+   { KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT only */
+   { KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT */
+   { KE_KEY, 0x64, { KEY_SWITCHVIDEOMODE } }, /* SDSP TV */
+   { KE_KEY, 0x65, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + TV */
+   { KE_KEY, 0x66, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV */
+   { KE_KEY, 0x67, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV */
{ KE_KEY, 0x6B, { KEY_TOUCHPAD_TOGGLE } },
{ KE_IGNORE, 0x6E, },  /* Low Battery notification */
{ KE_KEY, 0x7D, { KEY_BLUETOOTH } }, /* Bluetooth Enable */
@@ -191,12 +195,24 @@ static const struct key_entry asus_nb_wmi_keymap[] = {
{ KE_KEY, 0x82, { KEY_CAMERA } },
{ KE_KEY, 0x88, { KEY_RFKILL  } }, /* Radio Toggle Key */
{ KE_KEY, 0x8A, { KEY_PROG1 } }, /* Color enhancement mode */
+   { KE_KEY, 0x8C, { KEY_SWITCHVIDEOMODE } }, /* SDSP DVI only */
+   { KE_KEY, 0x8D, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + DVI */
+   { KE_KEY, 0x8E, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + DVI */
+   { KE_KEY, 0x8F, { KEY_SWITCHVIDEOMODE } }, /* SDSP TV + DVI */
+   { KE_KEY, 0x90, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + DVI */
+   { KE_KEY, 0x91, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + TV + DVI */
+   { KE_KEY, 0x92, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV + DVI */
+   { KE_KEY, 0x93, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV + DVI 
*/
{ KE_KEY, 0x95, { KEY_MEDIA } },
{ KE_KEY, 0x99, { KEY_PHONE } },
{ KE_KEY, 0xA0, { KEY_SWITCHVIDEOMODE } }, /* SDSP HDMI only */
{ KE_KEY, 0xA1, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + HDMI */
{ KE_KEY, 0xA2, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + HDMI */
{ KE_KEY, 0xA3, { KEY_SWITCHVIDEOMODE } }, /* SDSP TV + HDMI */
+   { KE_KEY, 0xA4, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + HDMI */
+   { KE_KEY, 0xA5, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + TV + HDMI */
+   { KE_KEY, 0xA6, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV + HDMI */
+   { KE_KEY, 0xA7, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV + 
HDMI */
{ KE_KEY, 0xB5, { KEY_CALC } },
{ KE_KEY, 0xC4, { KEY_KBDILLUMUP } },
{ KE_KEY, 0xC5, { KEY_KBDILLUMDOWN } },
-- 
1.7.8.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 8/8] asus-wmi: add display toggle quirk

2012-10-03 Thread Corentin Chary
From: AceLan Kao 

For machines with AMD graphic chips, it will send out WMI event and ACPI
interrupt at the same time while hitting the hotkey. BIOS will notify the
system the next display output mode throught WMI event code, so that
windows' application can show an OSD to tell the user which mode will be
taken effect. User can hit the display toggle key many times within 2
seconds to choose the mode they want. After 2 seconds, WMI dirver should
send a WMIMethod(SDSP) command to tell the BIOS which mode the user chose.
And then BIOS will raise another ACPI interrupt to tell the system to
really switch the display mode.

In Linux desktop, we don't have this kind of OSD to let users to choose
the mode they want, so we don't need to call WMIMethod(SDSP) to have
another ACPI interrupt. To simplify the problem, we just have to ignore
the WMI event, and let the first ACPI interrupt to send out the key event.

For the need, here comes another quirk to add machines with this kind of
behavior. When the WMI driver receives the display toggle WMI event, and
found the machin is in the list, it will do nothing and let ACPI video
driver to report the key event.

Signed-off-by: AceLan Kao 
Signed-off-by: Corentin Chary 
---
 drivers/platform/x86/asus-nb-wmi.c |   31 ++-
 drivers/platform/x86/asus-wmi.c|   31 ---
 drivers/platform/x86/asus-wmi.h|7 +++
 3 files changed, 65 insertions(+), 4 deletions(-)

diff --git a/drivers/platform/x86/asus-nb-wmi.c 
b/drivers/platform/x86/asus-nb-wmi.c
index 87d45e0..9aa6642 100644
--- a/drivers/platform/x86/asus-nb-wmi.c
+++ b/drivers/platform/x86/asus-nb-wmi.c
@@ -59,6 +59,17 @@ static struct quirk_entry quirk_asus_unknown = {
.wapf = 0,
 };
 
+/*
+ * For those machines that need software to control bt/wifi status
+ * and can't adjust brightness through ACPI interface
+ * and have duplicate events(ACPI and WMI) for display toggle
+ */
+static struct quirk_entry quirk_asus_x55u = {
+   .wapf = 4,
+   .wmi_backlight_power = true,
+   .no_display_toggle = true,
+};
+
 static struct quirk_entry quirk_asus_x401u = {
.wapf = 4,
 };
@@ -77,6 +88,15 @@ static struct dmi_system_id asus_quirks[] = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_MATCH(DMI_PRODUCT_NAME, "X401U"),
},
+   .driver_data = _asus_x55u,
+   },
+   {
+   .callback = dmi_matched,
+   .ident = "ASUSTeK COMPUTER INC. X401A",
+   .matches = {
+   DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
+   DMI_MATCH(DMI_PRODUCT_NAME, "X401A"),
+   },
.driver_data = _asus_x401u,
},
{
@@ -95,6 +115,15 @@ static struct dmi_system_id asus_quirks[] = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_MATCH(DMI_PRODUCT_NAME, "X501U"),
},
+   .driver_data = _asus_x55u,
+   },
+   {
+   .callback = dmi_matched,
+   .ident = "ASUSTeK COMPUTER INC. X501A",
+   .matches = {
+   DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
+   DMI_MATCH(DMI_PRODUCT_NAME, "X501A"),
+   },
.driver_data = _asus_x401u,
},
{
@@ -131,7 +160,7 @@ static struct dmi_system_id asus_quirks[] = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_MATCH(DMI_PRODUCT_NAME, "X55U"),
},
-   .driver_data = _asus_x401u,
+   .driver_data = _asus_x55u,
},
{
.callback = dmi_matched,
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 912ec7d..b4db530 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -1341,6 +1341,23 @@ static void asus_wmi_backlight_exit(struct asus_wmi 
*asus)
asus->backlight_device = NULL;
 }
 
+static int is_display_toggle(int code)
+{
+   /* display toggle keys */
+   if ((code >= 0x61 && code <= 0x67) ||
+   (code >= 0x8c && code <= 0x93) ||
+   (code >= 0xa0 && code <= 0xa7) ||
+   (code >= 0xd0 && code <= 0xd5))
+   return 1;
+
+   return 0;
+}
+
+static void do_nothing(void)
+{
+   return;
+}
+
 static void asus_wmi_notify(u32 value, void *context)
 {
struct asus_wmi *asus = context;
@@ -1380,10 +1397,18 @@ static void asus_wmi_notify(u32 value, void *context)
code = NOTIFY_BRNDOWN_MIN;
 
if (code == NOTIFY_BRNUP_MIN || code == NOTIFY_BRNDOWN_MIN) {
-  

[PATCH 4/8] asus-laptop: correct a touchpad hotkey mapping

2012-10-03 Thread Corentin Chary
From: AceLan Kao 

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

Signed-off-by: AceLan Kao 
Signed-off-by: Corentin Chary 
---
 drivers/platform/x86/asus-laptop.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/platform/x86/asus-laptop.c 
b/drivers/platform/x86/asus-laptop.c
index 09c477a..73d0198 100644
--- a/drivers/platform/x86/asus-laptop.c
+++ b/drivers/platform/x86/asus-laptop.c
@@ -320,7 +320,7 @@ static const struct key_entry asus_keymap[] = {
{KE_KEY, 0x5D, { KEY_WLAN } }, /* WLAN Toggle */
{KE_KEY, 0x5E, { KEY_WLAN } }, /* WLAN Enable */
{KE_KEY, 0x5F, { KEY_WLAN } }, /* WLAN Disable */
-   {KE_KEY, 0x60, { KEY_SWITCHVIDEOMODE } },
+   {KE_KEY, 0x60, { KEY_TOUCHPAD_ON } },
{KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } }, /* LCD Only */
{KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, /* CRT Only */
{KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, /* LCD + CRT */
-- 
1.7.8.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 5/8] asus-laptop: add all video switch keys

2012-10-03 Thread Corentin Chary
From: AceLan Kao 

Fill up all the video switch keys in the map.

Signed-off-by: AceLan Kao 
Signed-off-by: Corentin Chary 
---
 drivers/platform/x86/asus-laptop.c |   26 +++---
 1 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/drivers/platform/x86/asus-laptop.c 
b/drivers/platform/x86/asus-laptop.c
index 73d0198..0d371d0 100644
--- a/drivers/platform/x86/asus-laptop.c
+++ b/drivers/platform/x86/asus-laptop.c
@@ -321,9 +321,13 @@ static const struct key_entry asus_keymap[] = {
{KE_KEY, 0x5E, { KEY_WLAN } }, /* WLAN Enable */
{KE_KEY, 0x5F, { KEY_WLAN } }, /* WLAN Disable */
{KE_KEY, 0x60, { KEY_TOUCHPAD_ON } },
-   {KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } }, /* LCD Only */
-   {KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, /* CRT Only */
-   {KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, /* LCD + CRT */
+   {KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD only */
+   {KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT only */
+   {KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT */
+   {KE_KEY, 0x64, { KEY_SWITCHVIDEOMODE } }, /* SDSP TV */
+   {KE_KEY, 0x65, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + TV */
+   {KE_KEY, 0x66, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV */
+   {KE_KEY, 0x67, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV */
{KE_KEY, 0x6B, { KEY_TOUCHPAD_TOGGLE } }, /* Lock Touchpad */
{KE_KEY, 0x6C, { KEY_SLEEP } }, /* Suspend */
{KE_KEY, 0x6D, { KEY_SLEEP } }, /* Hibernate */
@@ -333,8 +337,24 @@ static const struct key_entry asus_keymap[] = {
{KE_KEY, 0x82, { KEY_CAMERA } },
{KE_KEY, 0x88, { KEY_RFKILL  } }, /* Radio Toggle Key */
{KE_KEY, 0x8A, { KEY_PROG1 } }, /* Color enhancement mode */
+   {KE_KEY, 0x8C, { KEY_SWITCHVIDEOMODE } }, /* SDSP DVI only */
+   {KE_KEY, 0x8D, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + DVI */
+   {KE_KEY, 0x8E, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + DVI */
+   {KE_KEY, 0x8F, { KEY_SWITCHVIDEOMODE } }, /* SDSP TV + DVI */
+   {KE_KEY, 0x90, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + DVI */
+   {KE_KEY, 0x91, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + TV + DVI */
+   {KE_KEY, 0x92, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV + DVI */
+   {KE_KEY, 0x93, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV + DVI 
*/
{KE_KEY, 0x95, { KEY_MEDIA } },
{KE_KEY, 0x99, { KEY_PHONE } },
+   {KE_KEY, 0xA0, { KEY_SWITCHVIDEOMODE } }, /* SDSP HDMI only */
+   {KE_KEY, 0xA1, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + HDMI */
+   {KE_KEY, 0xA2, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + HDMI */
+   {KE_KEY, 0xA3, { KEY_SWITCHVIDEOMODE } }, /* SDSP TV + HDMI */
+   {KE_KEY, 0xA4, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + HDMI */
+   {KE_KEY, 0xA5, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + TV + HDMI */
+   {KE_KEY, 0xA6, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV + HDMI */
+   {KE_KEY, 0xA7, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV + HDMI 
*/
{KE_KEY, 0xB5, { KEY_CALC } },
{KE_KEY, 0xC4, { KEY_KBDILLUMUP } },
{KE_KEY, 0xC5, { KEY_KBDILLUMDOWN } },
-- 
1.7.8.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 6/8] asus-nb-wmi: correct a touchpad hotkey mapping

2012-10-03 Thread Corentin Chary
From: AceLan Kao 

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

Signed-off-by: AceLan Kao 
Signed-off-by: Corentin Chary 
---
 drivers/platform/x86/asus-nb-wmi.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/platform/x86/asus-nb-wmi.c 
b/drivers/platform/x86/asus-nb-wmi.c
index 9f1caa7..75ce18c 100644
--- a/drivers/platform/x86/asus-nb-wmi.c
+++ b/drivers/platform/x86/asus-nb-wmi.c
@@ -180,7 +180,7 @@ static const struct key_entry asus_nb_wmi_keymap[] = {
{ KE_KEY, 0x5D, { KEY_WLAN } }, /* Wireless console Toggle */
{ KE_KEY, 0x5E, { KEY_WLAN } }, /* Wireless console Enable */
{ KE_KEY, 0x5F, { KEY_WLAN } }, /* Wireless console Disable */
-   { KE_KEY, 0x60, { KEY_SWITCHVIDEOMODE } },
+   { KE_KEY, 0x60, { KEY_TOUCHPAD_ON } },
{ KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } }, /* LCD Only */
{ KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, /* CRT Only */
{ KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, /* LCD + CRT */
-- 
1.7.8.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3/8] asus-{nb-wmi|laptop}.c: sync keymaps

2012-10-03 Thread Corentin Chary
Maybe this should be shared in another module...

Signed-off-by: Corentin Chary 
---
 drivers/platform/x86/asus-laptop.c |   36 ++--
 drivers/platform/x86/asus-nb-wmi.c |   24 
 2 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/drivers/platform/x86/asus-laptop.c 
b/drivers/platform/x86/asus-laptop.c
index 68257ed..09c477a 100644
--- a/drivers/platform/x86/asus-laptop.c
+++ b/drivers/platform/x86/asus-laptop.c
@@ -304,40 +304,40 @@ static const struct key_entry asus_keymap[] = {
{KE_KEY, 0x30, { KEY_VOLUMEUP } },
{KE_KEY, 0x31, { KEY_VOLUMEDOWN } },
{KE_KEY, 0x32, { KEY_MUTE } },
-   {KE_KEY, 0x33, { KEY_SWITCHVIDEOMODE } },
-   {KE_KEY, 0x34, { KEY_SWITCHVIDEOMODE } },
+   {KE_KEY, 0x33, { KEY_DISPLAYTOGGLE } }, /* LCD on */
+   {KE_KEY, 0x34, { KEY_DISPLAY_OFF } }, /* LCD off */
{KE_KEY, 0x40, { KEY_PREVIOUSSONG } },
{KE_KEY, 0x41, { KEY_NEXTSONG } },
-   {KE_KEY, 0x43, { KEY_STOPCD } },
+   {KE_KEY, 0x43, { KEY_STOPCD } }, /* Stop/Eject */
{KE_KEY, 0x45, { KEY_PLAYPAUSE } },
-   {KE_KEY, 0x4c, { KEY_MEDIA } },
+   {KE_KEY, 0x4c, { KEY_MEDIA } }, /* WMP Key */
{KE_KEY, 0x50, { KEY_EMAIL } },
{KE_KEY, 0x51, { KEY_WWW } },
{KE_KEY, 0x55, { KEY_CALC } },
{KE_IGNORE, 0x57, },  /* Battery mode */
{KE_IGNORE, 0x58, },  /* AC mode */
{KE_KEY, 0x5C, { KEY_SCREENLOCK } },  /* Screenlock */
-   {KE_KEY, 0x5D, { KEY_WLAN } },
-   {KE_KEY, 0x5E, { KEY_WLAN } },
-   {KE_KEY, 0x5F, { KEY_WLAN } },
+   {KE_KEY, 0x5D, { KEY_WLAN } }, /* WLAN Toggle */
+   {KE_KEY, 0x5E, { KEY_WLAN } }, /* WLAN Enable */
+   {KE_KEY, 0x5F, { KEY_WLAN } }, /* WLAN Disable */
{KE_KEY, 0x60, { KEY_SWITCHVIDEOMODE } },
-   {KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } },
-   {KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } },
-   {KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } },
-   {KE_KEY, 0x6B, { KEY_F13 } }, /* Lock Touchpad */
+   {KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } }, /* LCD Only */
+   {KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, /* CRT Only */
+   {KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, /* LCD + CRT */
+   {KE_KEY, 0x6B, { KEY_TOUCHPAD_TOGGLE } }, /* Lock Touchpad */
{KE_KEY, 0x6C, { KEY_SLEEP } }, /* Suspend */
{KE_KEY, 0x6D, { KEY_SLEEP } }, /* Hibernate */
{KE_IGNORE, 0x6E, },  /* Low Battery notification */
-   {KE_KEY, 0x7E, { KEY_BLUETOOTH } },
-   {KE_KEY, 0x7D, { KEY_BLUETOOTH } },
+   {KE_KEY, 0x7D, { KEY_BLUETOOTH } }, /* Bluetooth Enable */
+   {KE_KEY, 0x7E, { KEY_BLUETOOTH } }, /* Bluetooth Disable */
{KE_KEY, 0x82, { KEY_CAMERA } },
-   {KE_KEY, 0x88, { KEY_WLAN  } },
-   {KE_KEY, 0x8A, { KEY_PROG1 } },
+   {KE_KEY, 0x88, { KEY_RFKILL  } }, /* Radio Toggle Key */
+   {KE_KEY, 0x8A, { KEY_PROG1 } }, /* Color enhancement mode */
{KE_KEY, 0x95, { KEY_MEDIA } },
{KE_KEY, 0x99, { KEY_PHONE } },
-   {KE_KEY, 0xc4, { KEY_KBDILLUMUP } },
-   {KE_KEY, 0xc5, { KEY_KBDILLUMDOWN } },
-   {KE_KEY, 0xb5, { KEY_CALC } },
+   {KE_KEY, 0xB5, { KEY_CALC } },
+   {KE_KEY, 0xC4, { KEY_KBDILLUMUP } },
+   {KE_KEY, 0xC5, { KEY_KBDILLUMDOWN } },
{KE_END, 0},
 };
 
diff --git a/drivers/platform/x86/asus-nb-wmi.c 
b/drivers/platform/x86/asus-nb-wmi.c
index b70425c..9f1caa7 100644
--- a/drivers/platform/x86/asus-nb-wmi.c
+++ b/drivers/platform/x86/asus-nb-wmi.c
@@ -168,9 +168,9 @@ static const struct key_entry asus_nb_wmi_keymap[] = {
{ KE_KEY, 0x34, { KEY_DISPLAY_OFF } }, /* LCD off */
{ KE_KEY, 0x40, { KEY_PREVIOUSSONG } },
{ KE_KEY, 0x41, { KEY_NEXTSONG } },
-   { KE_KEY, 0x43, { KEY_STOPCD } },
+   { KE_KEY, 0x43, { KEY_STOPCD } }, /* Stop/Eject */
{ KE_KEY, 0x45, { KEY_PLAYPAUSE } },
-   { KE_KEY, 0x4c, { KEY_MEDIA } },
+   { KE_KEY, 0x4c, { KEY_MEDIA } }, /* WMP Key */
{ KE_KEY, 0x50, { KEY_EMAIL } },
{ KE_KEY, 0x51, { KEY_WWW } },
{ KE_KEY, 0x55, { KEY_CALC } },
@@ -181,25 +181,25 @@ static const struct key_entry asus_nb_wmi_keymap[] = {
{ KE_KEY, 0x5E, { KEY_WLAN } }, /* Wireless console Enable */
{ KE_KEY, 0x5F, { KEY_WLAN } }, /* Wireless console Disable */
{ KE_KEY, 0x60, { KEY_SWITCHVIDEOMODE } },
-   { KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } },
-   { KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } },
-   { KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } },
+   { KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } }, /* LCD Only */
+   { KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, /* CRT Only */
+   { KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, /* LCD + CRT */
{ KE_KEY, 0x6B, { KEY_TOUCHPAD_TOGGLE } },
{ KE_IGNORE, 0x6E, },  /* Low Battery notification */
-   { KE_KEY, 0x7D, { KEY_BLUETOOTH } },
-   { KE_KEY, 0x7E, { KEY_BLUETOOTH } },
+   { KE_KEY, 0x7D, { KEY_BLUETOOTH

[PATCH 1/8] platform-drivers-x86: change my mail

2012-10-03 Thread Corentin Chary
Signed-off-by: Corentin Chary 
---
 MAINTAINERS|4 ++--
 drivers/platform/x86/asus-nb-wmi.c |2 +-
 drivers/platform/x86/asus-wmi.c|2 +-
 drivers/platform/x86/eeepc-wmi.c   |2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index fdc0119..bbf52c2 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1217,7 +1217,7 @@ F:Documentation/hwmon/asc7621
 F: drivers/hwmon/asc7621.c
 
 ASUS NOTEBOOKS AND EEEPC ACPI/WMI EXTRAS DRIVERS
-M: Corentin Chary 
+M: Corentin Chary 
 L: acpi4asus-u...@lists.sourceforge.net
 L: platform-driver-...@vger.kernel.org
 W: http://acpi4asus.sf.net
@@ -5903,7 +5903,7 @@ F:drivers/media/video/*7146*
 F: include/media/*7146*
 
 SAMSUNG LAPTOP DRIVER
-M: Corentin Chary 
+M: Corentin Chary 
 L: platform-driver-...@vger.kernel.org
 S: Maintained
 F: drivers/platform/x86/samsung-laptop.c
diff --git a/drivers/platform/x86/asus-nb-wmi.c 
b/drivers/platform/x86/asus-nb-wmi.c
index 6b0ebde..be79040 100644
--- a/drivers/platform/x86/asus-nb-wmi.c
+++ b/drivers/platform/x86/asus-nb-wmi.c
@@ -32,7 +32,7 @@
 
 #defineASUS_NB_WMI_FILE"asus-nb-wmi"
 
-MODULE_AUTHOR("Corentin Chary ");
+MODULE_AUTHOR("Corentin Chary ");
 MODULE_DESCRIPTION("Asus Notebooks WMI Hotkey Driver");
 MODULE_LICENSE("GPL");
 
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 18f5169..912ec7d 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -51,7 +51,7 @@
 
 #include "asus-wmi.h"
 
-MODULE_AUTHOR("Corentin Chary , "
+MODULE_AUTHOR("Corentin Chary , "
  "Yong Wang ");
 MODULE_DESCRIPTION("Asus Generic WMI Driver");
 MODULE_LICENSE("GPL");
diff --git a/drivers/platform/x86/eeepc-wmi.c b/drivers/platform/x86/eeepc-wmi.c
index 5838332..60cb76a 100644
--- a/drivers/platform/x86/eeepc-wmi.c
+++ b/drivers/platform/x86/eeepc-wmi.c
@@ -39,7 +39,7 @@
 
 #defineEEEPC_WMI_FILE  "eeepc-wmi"
 
-MODULE_AUTHOR("Corentin Chary ");
+MODULE_AUTHOR("Corentin Chary ");
 MODULE_DESCRIPTION("Eee PC WMI Hotkey Driver");
 MODULE_LICENSE("GPL");
 
-- 
1.7.8.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/8] asus-laptop: map some new keys

2012-10-03 Thread Corentin Chary
Signed-off-by: Corentin Chary 
---
 drivers/platform/x86/asus-laptop.c |3 +++
 drivers/platform/x86/asus-nb-wmi.c |1 +
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/platform/x86/asus-laptop.c 
b/drivers/platform/x86/asus-laptop.c
index 4b568df..68257ed 100644
--- a/drivers/platform/x86/asus-laptop.c
+++ b/drivers/platform/x86/asus-laptop.c
@@ -314,6 +314,8 @@ static const struct key_entry asus_keymap[] = {
{KE_KEY, 0x50, { KEY_EMAIL } },
{KE_KEY, 0x51, { KEY_WWW } },
{KE_KEY, 0x55, { KEY_CALC } },
+   {KE_IGNORE, 0x57, },  /* Battery mode */
+   {KE_IGNORE, 0x58, },  /* AC mode */
{KE_KEY, 0x5C, { KEY_SCREENLOCK } },  /* Screenlock */
{KE_KEY, 0x5D, { KEY_WLAN } },
{KE_KEY, 0x5E, { KEY_WLAN } },
@@ -325,6 +327,7 @@ static const struct key_entry asus_keymap[] = {
{KE_KEY, 0x6B, { KEY_F13 } }, /* Lock Touchpad */
{KE_KEY, 0x6C, { KEY_SLEEP } }, /* Suspend */
{KE_KEY, 0x6D, { KEY_SLEEP } }, /* Hibernate */
+   {KE_IGNORE, 0x6E, },  /* Low Battery notification */
{KE_KEY, 0x7E, { KEY_BLUETOOTH } },
{KE_KEY, 0x7D, { KEY_BLUETOOTH } },
{KE_KEY, 0x82, { KEY_CAMERA } },
diff --git a/drivers/platform/x86/asus-nb-wmi.c 
b/drivers/platform/x86/asus-nb-wmi.c
index be79040..b70425c 100644
--- a/drivers/platform/x86/asus-nb-wmi.c
+++ b/drivers/platform/x86/asus-nb-wmi.c
@@ -185,6 +185,7 @@ static const struct key_entry asus_nb_wmi_keymap[] = {
{ KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } },
{ KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } },
{ KE_KEY, 0x6B, { KEY_TOUCHPAD_TOGGLE } },
+   { KE_IGNORE, 0x6E, },  /* Low Battery notification */
{ KE_KEY, 0x7D, { KEY_BLUETOOTH } },
{ KE_KEY, 0x7E, { KEY_BLUETOOTH } },
{ KE_KEY, 0x82, { KEY_CAMERA } },
-- 
1.7.8.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/8] asus-laptop: map some new keys

2012-10-03 Thread Corentin Chary
Signed-off-by: Corentin Chary corentin.ch...@gmail.com
---
 drivers/platform/x86/asus-laptop.c |3 +++
 drivers/platform/x86/asus-nb-wmi.c |1 +
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/platform/x86/asus-laptop.c 
b/drivers/platform/x86/asus-laptop.c
index 4b568df..68257ed 100644
--- a/drivers/platform/x86/asus-laptop.c
+++ b/drivers/platform/x86/asus-laptop.c
@@ -314,6 +314,8 @@ static const struct key_entry asus_keymap[] = {
{KE_KEY, 0x50, { KEY_EMAIL } },
{KE_KEY, 0x51, { KEY_WWW } },
{KE_KEY, 0x55, { KEY_CALC } },
+   {KE_IGNORE, 0x57, },  /* Battery mode */
+   {KE_IGNORE, 0x58, },  /* AC mode */
{KE_KEY, 0x5C, { KEY_SCREENLOCK } },  /* Screenlock */
{KE_KEY, 0x5D, { KEY_WLAN } },
{KE_KEY, 0x5E, { KEY_WLAN } },
@@ -325,6 +327,7 @@ static const struct key_entry asus_keymap[] = {
{KE_KEY, 0x6B, { KEY_F13 } }, /* Lock Touchpad */
{KE_KEY, 0x6C, { KEY_SLEEP } }, /* Suspend */
{KE_KEY, 0x6D, { KEY_SLEEP } }, /* Hibernate */
+   {KE_IGNORE, 0x6E, },  /* Low Battery notification */
{KE_KEY, 0x7E, { KEY_BLUETOOTH } },
{KE_KEY, 0x7D, { KEY_BLUETOOTH } },
{KE_KEY, 0x82, { KEY_CAMERA } },
diff --git a/drivers/platform/x86/asus-nb-wmi.c 
b/drivers/platform/x86/asus-nb-wmi.c
index be79040..b70425c 100644
--- a/drivers/platform/x86/asus-nb-wmi.c
+++ b/drivers/platform/x86/asus-nb-wmi.c
@@ -185,6 +185,7 @@ static const struct key_entry asus_nb_wmi_keymap[] = {
{ KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } },
{ KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } },
{ KE_KEY, 0x6B, { KEY_TOUCHPAD_TOGGLE } },
+   { KE_IGNORE, 0x6E, },  /* Low Battery notification */
{ KE_KEY, 0x7D, { KEY_BLUETOOTH } },
{ KE_KEY, 0x7E, { KEY_BLUETOOTH } },
{ KE_KEY, 0x82, { KEY_CAMERA } },
-- 
1.7.8.6

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/8] platform-drivers-x86: change my mail

2012-10-03 Thread Corentin Chary
Signed-off-by: Corentin Chary corentin.ch...@gmail.com
---
 MAINTAINERS|4 ++--
 drivers/platform/x86/asus-nb-wmi.c |2 +-
 drivers/platform/x86/asus-wmi.c|2 +-
 drivers/platform/x86/eeepc-wmi.c   |2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index fdc0119..bbf52c2 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1217,7 +1217,7 @@ F:Documentation/hwmon/asc7621
 F: drivers/hwmon/asc7621.c
 
 ASUS NOTEBOOKS AND EEEPC ACPI/WMI EXTRAS DRIVERS
-M: Corentin Chary corenti...@iksaif.net
+M: Corentin Chary corentin.ch...@gmail.com
 L: acpi4asus-u...@lists.sourceforge.net
 L: platform-driver-...@vger.kernel.org
 W: http://acpi4asus.sf.net
@@ -5903,7 +5903,7 @@ F:drivers/media/video/*7146*
 F: include/media/*7146*
 
 SAMSUNG LAPTOP DRIVER
-M: Corentin Chary corenti...@iksaif.net
+M: Corentin Chary corentin.ch...@gmail.com
 L: platform-driver-...@vger.kernel.org
 S: Maintained
 F: drivers/platform/x86/samsung-laptop.c
diff --git a/drivers/platform/x86/asus-nb-wmi.c 
b/drivers/platform/x86/asus-nb-wmi.c
index 6b0ebde..be79040 100644
--- a/drivers/platform/x86/asus-nb-wmi.c
+++ b/drivers/platform/x86/asus-nb-wmi.c
@@ -32,7 +32,7 @@
 
 #defineASUS_NB_WMI_FILEasus-nb-wmi
 
-MODULE_AUTHOR(Corentin Chary corenti...@iksaif.net);
+MODULE_AUTHOR(Corentin Chary corentin.ch...@gmail.com);
 MODULE_DESCRIPTION(Asus Notebooks WMI Hotkey Driver);
 MODULE_LICENSE(GPL);
 
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 18f5169..912ec7d 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -51,7 +51,7 @@
 
 #include asus-wmi.h
 
-MODULE_AUTHOR(Corentin Chary corenti...@iksaif.net, 
+MODULE_AUTHOR(Corentin Chary corentin.ch...@gmail.com, 
  Yong Wang yong.y.w...@intel.com);
 MODULE_DESCRIPTION(Asus Generic WMI Driver);
 MODULE_LICENSE(GPL);
diff --git a/drivers/platform/x86/eeepc-wmi.c b/drivers/platform/x86/eeepc-wmi.c
index 5838332..60cb76a 100644
--- a/drivers/platform/x86/eeepc-wmi.c
+++ b/drivers/platform/x86/eeepc-wmi.c
@@ -39,7 +39,7 @@
 
 #defineEEEPC_WMI_FILE  eeepc-wmi
 
-MODULE_AUTHOR(Corentin Chary corenti...@iksaif.net);
+MODULE_AUTHOR(Corentin Chary corentin.ch...@gmail.com);
 MODULE_DESCRIPTION(Eee PC WMI Hotkey Driver);
 MODULE_LICENSE(GPL);
 
-- 
1.7.8.6

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3/8] asus-{nb-wmi|laptop}.c: sync keymaps

2012-10-03 Thread Corentin Chary
Maybe this should be shared in another module...

Signed-off-by: Corentin Chary corentin.ch...@gmail.com
---
 drivers/platform/x86/asus-laptop.c |   36 ++--
 drivers/platform/x86/asus-nb-wmi.c |   24 
 2 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/drivers/platform/x86/asus-laptop.c 
b/drivers/platform/x86/asus-laptop.c
index 68257ed..09c477a 100644
--- a/drivers/platform/x86/asus-laptop.c
+++ b/drivers/platform/x86/asus-laptop.c
@@ -304,40 +304,40 @@ static const struct key_entry asus_keymap[] = {
{KE_KEY, 0x30, { KEY_VOLUMEUP } },
{KE_KEY, 0x31, { KEY_VOLUMEDOWN } },
{KE_KEY, 0x32, { KEY_MUTE } },
-   {KE_KEY, 0x33, { KEY_SWITCHVIDEOMODE } },
-   {KE_KEY, 0x34, { KEY_SWITCHVIDEOMODE } },
+   {KE_KEY, 0x33, { KEY_DISPLAYTOGGLE } }, /* LCD on */
+   {KE_KEY, 0x34, { KEY_DISPLAY_OFF } }, /* LCD off */
{KE_KEY, 0x40, { KEY_PREVIOUSSONG } },
{KE_KEY, 0x41, { KEY_NEXTSONG } },
-   {KE_KEY, 0x43, { KEY_STOPCD } },
+   {KE_KEY, 0x43, { KEY_STOPCD } }, /* Stop/Eject */
{KE_KEY, 0x45, { KEY_PLAYPAUSE } },
-   {KE_KEY, 0x4c, { KEY_MEDIA } },
+   {KE_KEY, 0x4c, { KEY_MEDIA } }, /* WMP Key */
{KE_KEY, 0x50, { KEY_EMAIL } },
{KE_KEY, 0x51, { KEY_WWW } },
{KE_KEY, 0x55, { KEY_CALC } },
{KE_IGNORE, 0x57, },  /* Battery mode */
{KE_IGNORE, 0x58, },  /* AC mode */
{KE_KEY, 0x5C, { KEY_SCREENLOCK } },  /* Screenlock */
-   {KE_KEY, 0x5D, { KEY_WLAN } },
-   {KE_KEY, 0x5E, { KEY_WLAN } },
-   {KE_KEY, 0x5F, { KEY_WLAN } },
+   {KE_KEY, 0x5D, { KEY_WLAN } }, /* WLAN Toggle */
+   {KE_KEY, 0x5E, { KEY_WLAN } }, /* WLAN Enable */
+   {KE_KEY, 0x5F, { KEY_WLAN } }, /* WLAN Disable */
{KE_KEY, 0x60, { KEY_SWITCHVIDEOMODE } },
-   {KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } },
-   {KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } },
-   {KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } },
-   {KE_KEY, 0x6B, { KEY_F13 } }, /* Lock Touchpad */
+   {KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } }, /* LCD Only */
+   {KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, /* CRT Only */
+   {KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, /* LCD + CRT */
+   {KE_KEY, 0x6B, { KEY_TOUCHPAD_TOGGLE } }, /* Lock Touchpad */
{KE_KEY, 0x6C, { KEY_SLEEP } }, /* Suspend */
{KE_KEY, 0x6D, { KEY_SLEEP } }, /* Hibernate */
{KE_IGNORE, 0x6E, },  /* Low Battery notification */
-   {KE_KEY, 0x7E, { KEY_BLUETOOTH } },
-   {KE_KEY, 0x7D, { KEY_BLUETOOTH } },
+   {KE_KEY, 0x7D, { KEY_BLUETOOTH } }, /* Bluetooth Enable */
+   {KE_KEY, 0x7E, { KEY_BLUETOOTH } }, /* Bluetooth Disable */
{KE_KEY, 0x82, { KEY_CAMERA } },
-   {KE_KEY, 0x88, { KEY_WLAN  } },
-   {KE_KEY, 0x8A, { KEY_PROG1 } },
+   {KE_KEY, 0x88, { KEY_RFKILL  } }, /* Radio Toggle Key */
+   {KE_KEY, 0x8A, { KEY_PROG1 } }, /* Color enhancement mode */
{KE_KEY, 0x95, { KEY_MEDIA } },
{KE_KEY, 0x99, { KEY_PHONE } },
-   {KE_KEY, 0xc4, { KEY_KBDILLUMUP } },
-   {KE_KEY, 0xc5, { KEY_KBDILLUMDOWN } },
-   {KE_KEY, 0xb5, { KEY_CALC } },
+   {KE_KEY, 0xB5, { KEY_CALC } },
+   {KE_KEY, 0xC4, { KEY_KBDILLUMUP } },
+   {KE_KEY, 0xC5, { KEY_KBDILLUMDOWN } },
{KE_END, 0},
 };
 
diff --git a/drivers/platform/x86/asus-nb-wmi.c 
b/drivers/platform/x86/asus-nb-wmi.c
index b70425c..9f1caa7 100644
--- a/drivers/platform/x86/asus-nb-wmi.c
+++ b/drivers/platform/x86/asus-nb-wmi.c
@@ -168,9 +168,9 @@ static const struct key_entry asus_nb_wmi_keymap[] = {
{ KE_KEY, 0x34, { KEY_DISPLAY_OFF } }, /* LCD off */
{ KE_KEY, 0x40, { KEY_PREVIOUSSONG } },
{ KE_KEY, 0x41, { KEY_NEXTSONG } },
-   { KE_KEY, 0x43, { KEY_STOPCD } },
+   { KE_KEY, 0x43, { KEY_STOPCD } }, /* Stop/Eject */
{ KE_KEY, 0x45, { KEY_PLAYPAUSE } },
-   { KE_KEY, 0x4c, { KEY_MEDIA } },
+   { KE_KEY, 0x4c, { KEY_MEDIA } }, /* WMP Key */
{ KE_KEY, 0x50, { KEY_EMAIL } },
{ KE_KEY, 0x51, { KEY_WWW } },
{ KE_KEY, 0x55, { KEY_CALC } },
@@ -181,25 +181,25 @@ static const struct key_entry asus_nb_wmi_keymap[] = {
{ KE_KEY, 0x5E, { KEY_WLAN } }, /* Wireless console Enable */
{ KE_KEY, 0x5F, { KEY_WLAN } }, /* Wireless console Disable */
{ KE_KEY, 0x60, { KEY_SWITCHVIDEOMODE } },
-   { KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } },
-   { KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } },
-   { KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } },
+   { KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } }, /* LCD Only */
+   { KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, /* CRT Only */
+   { KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, /* LCD + CRT */
{ KE_KEY, 0x6B, { KEY_TOUCHPAD_TOGGLE } },
{ KE_IGNORE, 0x6E, },  /* Low Battery notification */
-   { KE_KEY, 0x7D, { KEY_BLUETOOTH } },
-   { KE_KEY, 0x7E, { KEY_BLUETOOTH } },
+   { KE_KEY, 0x7D

[PATCH 6/8] asus-nb-wmi: correct a touchpad hotkey mapping

2012-10-03 Thread Corentin Chary
From: AceLan Kao acelan@canonical.com

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

Signed-off-by: AceLan Kao acelan@canonical.com
Signed-off-by: Corentin Chary corentin.ch...@gmail.com
---
 drivers/platform/x86/asus-nb-wmi.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/platform/x86/asus-nb-wmi.c 
b/drivers/platform/x86/asus-nb-wmi.c
index 9f1caa7..75ce18c 100644
--- a/drivers/platform/x86/asus-nb-wmi.c
+++ b/drivers/platform/x86/asus-nb-wmi.c
@@ -180,7 +180,7 @@ static const struct key_entry asus_nb_wmi_keymap[] = {
{ KE_KEY, 0x5D, { KEY_WLAN } }, /* Wireless console Toggle */
{ KE_KEY, 0x5E, { KEY_WLAN } }, /* Wireless console Enable */
{ KE_KEY, 0x5F, { KEY_WLAN } }, /* Wireless console Disable */
-   { KE_KEY, 0x60, { KEY_SWITCHVIDEOMODE } },
+   { KE_KEY, 0x60, { KEY_TOUCHPAD_ON } },
{ KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } }, /* LCD Only */
{ KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, /* CRT Only */
{ KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, /* LCD + CRT */
-- 
1.7.8.6

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 5/8] asus-laptop: add all video switch keys

2012-10-03 Thread Corentin Chary
From: AceLan Kao acelan@canonical.com

Fill up all the video switch keys in the map.

Signed-off-by: AceLan Kao acelan@canonical.com
Signed-off-by: Corentin Chary corentin.ch...@gmail.com
---
 drivers/platform/x86/asus-laptop.c |   26 +++---
 1 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/drivers/platform/x86/asus-laptop.c 
b/drivers/platform/x86/asus-laptop.c
index 73d0198..0d371d0 100644
--- a/drivers/platform/x86/asus-laptop.c
+++ b/drivers/platform/x86/asus-laptop.c
@@ -321,9 +321,13 @@ static const struct key_entry asus_keymap[] = {
{KE_KEY, 0x5E, { KEY_WLAN } }, /* WLAN Enable */
{KE_KEY, 0x5F, { KEY_WLAN } }, /* WLAN Disable */
{KE_KEY, 0x60, { KEY_TOUCHPAD_ON } },
-   {KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } }, /* LCD Only */
-   {KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, /* CRT Only */
-   {KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, /* LCD + CRT */
+   {KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD only */
+   {KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT only */
+   {KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT */
+   {KE_KEY, 0x64, { KEY_SWITCHVIDEOMODE } }, /* SDSP TV */
+   {KE_KEY, 0x65, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + TV */
+   {KE_KEY, 0x66, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV */
+   {KE_KEY, 0x67, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV */
{KE_KEY, 0x6B, { KEY_TOUCHPAD_TOGGLE } }, /* Lock Touchpad */
{KE_KEY, 0x6C, { KEY_SLEEP } }, /* Suspend */
{KE_KEY, 0x6D, { KEY_SLEEP } }, /* Hibernate */
@@ -333,8 +337,24 @@ static const struct key_entry asus_keymap[] = {
{KE_KEY, 0x82, { KEY_CAMERA } },
{KE_KEY, 0x88, { KEY_RFKILL  } }, /* Radio Toggle Key */
{KE_KEY, 0x8A, { KEY_PROG1 } }, /* Color enhancement mode */
+   {KE_KEY, 0x8C, { KEY_SWITCHVIDEOMODE } }, /* SDSP DVI only */
+   {KE_KEY, 0x8D, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + DVI */
+   {KE_KEY, 0x8E, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + DVI */
+   {KE_KEY, 0x8F, { KEY_SWITCHVIDEOMODE } }, /* SDSP TV + DVI */
+   {KE_KEY, 0x90, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + DVI */
+   {KE_KEY, 0x91, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + TV + DVI */
+   {KE_KEY, 0x92, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV + DVI */
+   {KE_KEY, 0x93, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV + DVI 
*/
{KE_KEY, 0x95, { KEY_MEDIA } },
{KE_KEY, 0x99, { KEY_PHONE } },
+   {KE_KEY, 0xA0, { KEY_SWITCHVIDEOMODE } }, /* SDSP HDMI only */
+   {KE_KEY, 0xA1, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + HDMI */
+   {KE_KEY, 0xA2, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + HDMI */
+   {KE_KEY, 0xA3, { KEY_SWITCHVIDEOMODE } }, /* SDSP TV + HDMI */
+   {KE_KEY, 0xA4, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + HDMI */
+   {KE_KEY, 0xA5, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + TV + HDMI */
+   {KE_KEY, 0xA6, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV + HDMI */
+   {KE_KEY, 0xA7, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV + HDMI 
*/
{KE_KEY, 0xB5, { KEY_CALC } },
{KE_KEY, 0xC4, { KEY_KBDILLUMUP } },
{KE_KEY, 0xC5, { KEY_KBDILLUMDOWN } },
-- 
1.7.8.6

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 4/8] asus-laptop: correct a touchpad hotkey mapping

2012-10-03 Thread Corentin Chary
From: AceLan Kao acelan@canonical.com

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

Signed-off-by: AceLan Kao acelan@canonical.com
Signed-off-by: Corentin Chary corentin.ch...@gmail.com
---
 drivers/platform/x86/asus-laptop.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/platform/x86/asus-laptop.c 
b/drivers/platform/x86/asus-laptop.c
index 09c477a..73d0198 100644
--- a/drivers/platform/x86/asus-laptop.c
+++ b/drivers/platform/x86/asus-laptop.c
@@ -320,7 +320,7 @@ static const struct key_entry asus_keymap[] = {
{KE_KEY, 0x5D, { KEY_WLAN } }, /* WLAN Toggle */
{KE_KEY, 0x5E, { KEY_WLAN } }, /* WLAN Enable */
{KE_KEY, 0x5F, { KEY_WLAN } }, /* WLAN Disable */
-   {KE_KEY, 0x60, { KEY_SWITCHVIDEOMODE } },
+   {KE_KEY, 0x60, { KEY_TOUCHPAD_ON } },
{KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } }, /* LCD Only */
{KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, /* CRT Only */
{KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, /* LCD + CRT */
-- 
1.7.8.6

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 8/8] asus-wmi: add display toggle quirk

2012-10-03 Thread Corentin Chary
From: AceLan Kao acelan@canonical.com

For machines with AMD graphic chips, it will send out WMI event and ACPI
interrupt at the same time while hitting the hotkey. BIOS will notify the
system the next display output mode throught WMI event code, so that
windows' application can show an OSD to tell the user which mode will be
taken effect. User can hit the display toggle key many times within 2
seconds to choose the mode they want. After 2 seconds, WMI dirver should
send a WMIMethod(SDSP) command to tell the BIOS which mode the user chose.
And then BIOS will raise another ACPI interrupt to tell the system to
really switch the display mode.

In Linux desktop, we don't have this kind of OSD to let users to choose
the mode they want, so we don't need to call WMIMethod(SDSP) to have
another ACPI interrupt. To simplify the problem, we just have to ignore
the WMI event, and let the first ACPI interrupt to send out the key event.

For the need, here comes another quirk to add machines with this kind of
behavior. When the WMI driver receives the display toggle WMI event, and
found the machin is in the list, it will do nothing and let ACPI video
driver to report the key event.

Signed-off-by: AceLan Kao acelan@canonical.com
Signed-off-by: Corentin Chary corenti...@iksaif.net
---
 drivers/platform/x86/asus-nb-wmi.c |   31 ++-
 drivers/platform/x86/asus-wmi.c|   31 ---
 drivers/platform/x86/asus-wmi.h|7 +++
 3 files changed, 65 insertions(+), 4 deletions(-)

diff --git a/drivers/platform/x86/asus-nb-wmi.c 
b/drivers/platform/x86/asus-nb-wmi.c
index 87d45e0..9aa6642 100644
--- a/drivers/platform/x86/asus-nb-wmi.c
+++ b/drivers/platform/x86/asus-nb-wmi.c
@@ -59,6 +59,17 @@ static struct quirk_entry quirk_asus_unknown = {
.wapf = 0,
 };
 
+/*
+ * For those machines that need software to control bt/wifi status
+ * and can't adjust brightness through ACPI interface
+ * and have duplicate events(ACPI and WMI) for display toggle
+ */
+static struct quirk_entry quirk_asus_x55u = {
+   .wapf = 4,
+   .wmi_backlight_power = true,
+   .no_display_toggle = true,
+};
+
 static struct quirk_entry quirk_asus_x401u = {
.wapf = 4,
 };
@@ -77,6 +88,15 @@ static struct dmi_system_id asus_quirks[] = {
DMI_MATCH(DMI_SYS_VENDOR, ASUSTeK COMPUTER INC.),
DMI_MATCH(DMI_PRODUCT_NAME, X401U),
},
+   .driver_data = quirk_asus_x55u,
+   },
+   {
+   .callback = dmi_matched,
+   .ident = ASUSTeK COMPUTER INC. X401A,
+   .matches = {
+   DMI_MATCH(DMI_SYS_VENDOR, ASUSTeK COMPUTER INC.),
+   DMI_MATCH(DMI_PRODUCT_NAME, X401A),
+   },
.driver_data = quirk_asus_x401u,
},
{
@@ -95,6 +115,15 @@ static struct dmi_system_id asus_quirks[] = {
DMI_MATCH(DMI_SYS_VENDOR, ASUSTeK COMPUTER INC.),
DMI_MATCH(DMI_PRODUCT_NAME, X501U),
},
+   .driver_data = quirk_asus_x55u,
+   },
+   {
+   .callback = dmi_matched,
+   .ident = ASUSTeK COMPUTER INC. X501A,
+   .matches = {
+   DMI_MATCH(DMI_SYS_VENDOR, ASUSTeK COMPUTER INC.),
+   DMI_MATCH(DMI_PRODUCT_NAME, X501A),
+   },
.driver_data = quirk_asus_x401u,
},
{
@@ -131,7 +160,7 @@ static struct dmi_system_id asus_quirks[] = {
DMI_MATCH(DMI_SYS_VENDOR, ASUSTeK COMPUTER INC.),
DMI_MATCH(DMI_PRODUCT_NAME, X55U),
},
-   .driver_data = quirk_asus_x401u,
+   .driver_data = quirk_asus_x55u,
},
{
.callback = dmi_matched,
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 912ec7d..b4db530 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -1341,6 +1341,23 @@ static void asus_wmi_backlight_exit(struct asus_wmi 
*asus)
asus-backlight_device = NULL;
 }
 
+static int is_display_toggle(int code)
+{
+   /* display toggle keys */
+   if ((code = 0x61  code = 0x67) ||
+   (code = 0x8c  code = 0x93) ||
+   (code = 0xa0  code = 0xa7) ||
+   (code = 0xd0  code = 0xd5))
+   return 1;
+
+   return 0;
+}
+
+static void do_nothing(void)
+{
+   return;
+}
+
 static void asus_wmi_notify(u32 value, void *context)
 {
struct asus_wmi *asus = context;
@@ -1380,10 +1397,18 @@ static void asus_wmi_notify(u32 value, void *context)
code = NOTIFY_BRNDOWN_MIN;
 
if (code == NOTIFY_BRNUP_MIN || code == NOTIFY_BRNDOWN_MIN) {
-   if (!acpi_video_backlight_support())
+   if (!acpi_video_backlight_support

[PATCH 7/8] asus-nb-wmi: add all video switch keys

2012-10-03 Thread Corentin Chary
From: AceLan Kao acelan@canonical.com

Fill up all the video switch keys in the map.

Signed-off-by: AceLan Kao acelan@canonical.com
Signed-off-by: Corentin Chary corentin.ch...@gmail.com
---
 drivers/platform/x86/asus-nb-wmi.c |   22 +++---
 1 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/drivers/platform/x86/asus-nb-wmi.c 
b/drivers/platform/x86/asus-nb-wmi.c
index 75ce18c..87d45e0 100644
--- a/drivers/platform/x86/asus-nb-wmi.c
+++ b/drivers/platform/x86/asus-nb-wmi.c
@@ -181,9 +181,13 @@ static const struct key_entry asus_nb_wmi_keymap[] = {
{ KE_KEY, 0x5E, { KEY_WLAN } }, /* Wireless console Enable */
{ KE_KEY, 0x5F, { KEY_WLAN } }, /* Wireless console Disable */
{ KE_KEY, 0x60, { KEY_TOUCHPAD_ON } },
-   { KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } }, /* LCD Only */
-   { KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, /* CRT Only */
-   { KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, /* LCD + CRT */
+   { KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD only */
+   { KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT only */
+   { KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT */
+   { KE_KEY, 0x64, { KEY_SWITCHVIDEOMODE } }, /* SDSP TV */
+   { KE_KEY, 0x65, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + TV */
+   { KE_KEY, 0x66, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV */
+   { KE_KEY, 0x67, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV */
{ KE_KEY, 0x6B, { KEY_TOUCHPAD_TOGGLE } },
{ KE_IGNORE, 0x6E, },  /* Low Battery notification */
{ KE_KEY, 0x7D, { KEY_BLUETOOTH } }, /* Bluetooth Enable */
@@ -191,12 +195,24 @@ static const struct key_entry asus_nb_wmi_keymap[] = {
{ KE_KEY, 0x82, { KEY_CAMERA } },
{ KE_KEY, 0x88, { KEY_RFKILL  } }, /* Radio Toggle Key */
{ KE_KEY, 0x8A, { KEY_PROG1 } }, /* Color enhancement mode */
+   { KE_KEY, 0x8C, { KEY_SWITCHVIDEOMODE } }, /* SDSP DVI only */
+   { KE_KEY, 0x8D, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + DVI */
+   { KE_KEY, 0x8E, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + DVI */
+   { KE_KEY, 0x8F, { KEY_SWITCHVIDEOMODE } }, /* SDSP TV + DVI */
+   { KE_KEY, 0x90, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + DVI */
+   { KE_KEY, 0x91, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + TV + DVI */
+   { KE_KEY, 0x92, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV + DVI */
+   { KE_KEY, 0x93, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV + DVI 
*/
{ KE_KEY, 0x95, { KEY_MEDIA } },
{ KE_KEY, 0x99, { KEY_PHONE } },
{ KE_KEY, 0xA0, { KEY_SWITCHVIDEOMODE } }, /* SDSP HDMI only */
{ KE_KEY, 0xA1, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + HDMI */
{ KE_KEY, 0xA2, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + HDMI */
{ KE_KEY, 0xA3, { KEY_SWITCHVIDEOMODE } }, /* SDSP TV + HDMI */
+   { KE_KEY, 0xA4, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + HDMI */
+   { KE_KEY, 0xA5, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + TV + HDMI */
+   { KE_KEY, 0xA6, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV + HDMI */
+   { KE_KEY, 0xA7, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV + 
HDMI */
{ KE_KEY, 0xB5, { KEY_CALC } },
{ KE_KEY, 0xC4, { KEY_KBDILLUMUP } },
{ KE_KEY, 0xC5, { KEY_KBDILLUMDOWN } },
-- 
1.7.8.6

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] asus-wmi: use ASUS_WMI_METHODID_DSTS2 as default DSTS ID.

2012-09-18 Thread Corentin Chary
Hi,

On Tue, Sep 18, 2012 at 11:21 AM, Carsten Otto
 wrote:
> Dear all,
>
> the patch seems to be integrated in 3.5.4 (current stable kernel). When
> rebasing using git I see that the patch is not applied on top, most
> likely because it was already included somewhere in the official stable
> Linux itself.

Easy workaround is to blacklist/remove asus-wmi (and/or
eeepc-wmi/asus-nb-wmi). I think ubuntu guys are working on it, and
since they seems to be working with Asus (and I'm not), it will be
easier for them.

> As mentioned in the following Ubuntu bug report, this patch causes
> problems (which I also observe).
> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1041883
>
> It takes me about 10 tries to successfully boot my system. In the
> unsuccessful tries the screen is blanked shortly during the boot process
> and nothing happens (the magic keys don't work, network access cannot be
> tested that early).
>
> Bye,
> --
> Carsten Otto   o...@informatik.rwth-aachen.de
> LuFG Informatik 2  http://verify.rwth-aachen.de/otto/
> RWTH Aachenphone: +49 241 80-21211
>
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.12 (GNU/Linux)
>
> iEYEARECAAYFAlBYSzUACgkQjUF4jpCSQBQpbgCfSUUvaZbs1krkcRKa8iTcyKxA
> 7AQAn1NfXugZ5553+Z9LOB46lJqFcXt8
> =avwS
> -END PGP SIGNATURE-
>



-- 
Corentin Chary
http://xf.iksaif.net
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] asus-wmi: use ASUS_WMI_METHODID_DSTS2 as default DSTS ID.

2012-09-18 Thread Corentin Chary
Hi,

On Tue, Sep 18, 2012 at 11:21 AM, Carsten Otto
o...@informatik.rwth-aachen.de wrote:
 Dear all,

 the patch seems to be integrated in 3.5.4 (current stable kernel). When
 rebasing using git I see that the patch is not applied on top, most
 likely because it was already included somewhere in the official stable
 Linux itself.

Easy workaround is to blacklist/remove asus-wmi (and/or
eeepc-wmi/asus-nb-wmi). I think ubuntu guys are working on it, and
since they seems to be working with Asus (and I'm not), it will be
easier for them.

 As mentioned in the following Ubuntu bug report, this patch causes
 problems (which I also observe).
 https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1041883

 It takes me about 10 tries to successfully boot my system. In the
 unsuccessful tries the screen is blanked shortly during the boot process
 and nothing happens (the magic keys don't work, network access cannot be
 tested that early).

 Bye,
 --
 Carsten Otto   o...@informatik.rwth-aachen.de
 LuFG Informatik 2  http://verify.rwth-aachen.de/otto/
 RWTH Aachenphone: +49 241 80-21211

 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.12 (GNU/Linux)

 iEYEARECAAYFAlBYSzUACgkQjUF4jpCSQBQpbgCfSUUvaZbs1krkcRKa8iTcyKxA
 7AQAn1NfXugZ5553+Z9LOB46lJqFcXt8
 =avwS
 -END PGP SIGNATURE-




-- 
Corentin Chary
http://xf.iksaif.net
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/3] drivers-platform-x86: remove useless #ifdef CONFIG_ACPI_VIDEO

2012-09-07 Thread Corentin Chary
On Mon, Aug 20, 2012 at 10:01 PM, Corentin Chary
 wrote:
> Signed-off-by: Corentin Chary 
> ---
>  drivers/platform/x86/acer-wmi.c   |2 --
>  drivers/platform/x86/apple-gmux.c |4 
>  drivers/platform/x86/asus-wmi.c   |4 
>  drivers/platform/x86/samsung-laptop.c |4 
>  4 files changed, 14 deletions(-)
>
> diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
> index 3782e1c..934d861 100644
> --- a/drivers/platform/x86/acer-wmi.c
> +++ b/drivers/platform/x86/acer-wmi.c
> @@ -2196,10 +2196,8 @@ static int __init acer_wmi_init(void)
> interface->capability &= ~ACER_CAP_BRIGHTNESS;
> pr_info("Brightness must be controlled by acpi video 
> driver\n");
> } else {
> -#ifdef CONFIG_ACPI_VIDEO
> pr_info("Disabling ACPI video driver\n");
> acpi_video_unregister();
> -#endif
> }
>
> if (wmi_has_guid(WMID_GUID3)) {
> diff --git a/drivers/platform/x86/apple-gmux.c 
> b/drivers/platform/x86/apple-gmux.c
> index dfb1a92..dca31ce 100644
> --- a/drivers/platform/x86/apple-gmux.c
> +++ b/drivers/platform/x86/apple-gmux.c
> @@ -505,9 +505,7 @@ static int __devinit gmux_probe(struct pnp_dev *pnp,
>  * Disable the other backlight choices.
>  */
> acpi_video_dmi_promote_vendor();
> -#if defined (CONFIG_ACPI_VIDEO) || defined (CONFIG_ACPI_VIDEO_MODULE)
> acpi_video_unregister();
> -#endif
> apple_bl_unregister();
>
> gmux_data->power_state = VGA_SWITCHEROO_ON;
> @@ -593,9 +591,7 @@ static void __devexit gmux_remove(struct pnp_dev *pnp)
> kfree(gmux_data);
>
> acpi_video_dmi_demote_vendor();
> -#if defined (CONFIG_ACPI_VIDEO) || defined (CONFIG_ACPI_VIDEO_MODULE)
> acpi_video_register();
> -#endif
> apple_bl_register();
>  }
>
> diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
> index 6a91a0c..912ec7d 100644
> --- a/drivers/platform/x86/asus-wmi.c
> +++ b/drivers/platform/x86/asus-wmi.c
> @@ -47,9 +47,7 @@
>  #include 
>  #include 
>  #include 
> -#ifdef CONFIG_ACPI_VIDEO
>  #include 
> -#endif
>
>  #include "asus-wmi.h"
>
> @@ -1780,10 +1778,8 @@ static int asus_wmi_add(struct platform_device *pdev)
> if (asus->driver->quirks->wmi_backlight_power)
> acpi_video_dmi_promote_vendor();
> if (!acpi_video_backlight_support()) {
> -#ifdef CONFIG_ACPI_VIDEO
> pr_info("Disabling ACPI video driver\n");
> acpi_video_unregister();
> -#endif
> err = asus_wmi_backlight_init(asus);
> if (err && err != -ENODEV)
> goto fail_backlight;
> diff --git a/drivers/platform/x86/samsung-laptop.c 
> b/drivers/platform/x86/samsung-laptop.c
> index c1ca7bc..dd90d15 100644
> --- a/drivers/platform/x86/samsung-laptop.c
> +++ b/drivers/platform/x86/samsung-laptop.c
> @@ -26,9 +26,7 @@
>  #include 
>  #include 
>  #include 
> -#ifdef CONFIG_ACPI_VIDEO
>  #include 
> -#endif
>
>  /*
>   * This driver is needed because a number of Samsung laptops do not hook
> @@ -1558,9 +1556,7 @@ static int __init samsung_init(void)
> samsung->handle_backlight = false;
> } else if (samsung->quirks->broken_acpi_video) {
> pr_info("Disabling ACPI video driver\n");
> -#ifdef CONFIG_ACPI_VIDEO
> acpi_video_unregister();
> -#endif
> }
>  #endif
>
> --
> 1.7.9.5
>

Any news on that ? This should really be merged before the end of rcs.
Thanks,

-- 
Corentin Chary
http://xf.iksaif.net
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/3] drivers-platform-x86: remove useless #ifdef CONFIG_ACPI_VIDEO

2012-09-07 Thread Corentin Chary
On Mon, Aug 20, 2012 at 10:01 PM, Corentin Chary
corentin.ch...@gmail.com wrote:
 Signed-off-by: Corentin Chary corentin.ch...@gmail.com
 ---
  drivers/platform/x86/acer-wmi.c   |2 --
  drivers/platform/x86/apple-gmux.c |4 
  drivers/platform/x86/asus-wmi.c   |4 
  drivers/platform/x86/samsung-laptop.c |4 
  4 files changed, 14 deletions(-)

 diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
 index 3782e1c..934d861 100644
 --- a/drivers/platform/x86/acer-wmi.c
 +++ b/drivers/platform/x86/acer-wmi.c
 @@ -2196,10 +2196,8 @@ static int __init acer_wmi_init(void)
 interface-capability = ~ACER_CAP_BRIGHTNESS;
 pr_info(Brightness must be controlled by acpi video 
 driver\n);
 } else {
 -#ifdef CONFIG_ACPI_VIDEO
 pr_info(Disabling ACPI video driver\n);
 acpi_video_unregister();
 -#endif
 }

 if (wmi_has_guid(WMID_GUID3)) {
 diff --git a/drivers/platform/x86/apple-gmux.c 
 b/drivers/platform/x86/apple-gmux.c
 index dfb1a92..dca31ce 100644
 --- a/drivers/platform/x86/apple-gmux.c
 +++ b/drivers/platform/x86/apple-gmux.c
 @@ -505,9 +505,7 @@ static int __devinit gmux_probe(struct pnp_dev *pnp,
  * Disable the other backlight choices.
  */
 acpi_video_dmi_promote_vendor();
 -#if defined (CONFIG_ACPI_VIDEO) || defined (CONFIG_ACPI_VIDEO_MODULE)
 acpi_video_unregister();
 -#endif
 apple_bl_unregister();

 gmux_data-power_state = VGA_SWITCHEROO_ON;
 @@ -593,9 +591,7 @@ static void __devexit gmux_remove(struct pnp_dev *pnp)
 kfree(gmux_data);

 acpi_video_dmi_demote_vendor();
 -#if defined (CONFIG_ACPI_VIDEO) || defined (CONFIG_ACPI_VIDEO_MODULE)
 acpi_video_register();
 -#endif
 apple_bl_register();
  }

 diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
 index 6a91a0c..912ec7d 100644
 --- a/drivers/platform/x86/asus-wmi.c
 +++ b/drivers/platform/x86/asus-wmi.c
 @@ -47,9 +47,7 @@
  #include linux/thermal.h
  #include acpi/acpi_bus.h
  #include acpi/acpi_drivers.h
 -#ifdef CONFIG_ACPI_VIDEO
  #include acpi/video.h
 -#endif

  #include asus-wmi.h

 @@ -1780,10 +1778,8 @@ static int asus_wmi_add(struct platform_device *pdev)
 if (asus-driver-quirks-wmi_backlight_power)
 acpi_video_dmi_promote_vendor();
 if (!acpi_video_backlight_support()) {
 -#ifdef CONFIG_ACPI_VIDEO
 pr_info(Disabling ACPI video driver\n);
 acpi_video_unregister();
 -#endif
 err = asus_wmi_backlight_init(asus);
 if (err  err != -ENODEV)
 goto fail_backlight;
 diff --git a/drivers/platform/x86/samsung-laptop.c 
 b/drivers/platform/x86/samsung-laptop.c
 index c1ca7bc..dd90d15 100644
 --- a/drivers/platform/x86/samsung-laptop.c
 +++ b/drivers/platform/x86/samsung-laptop.c
 @@ -26,9 +26,7 @@
  #include linux/seq_file.h
  #include linux/debugfs.h
  #include linux/ctype.h
 -#ifdef CONFIG_ACPI_VIDEO
  #include acpi/video.h
 -#endif

  /*
   * This driver is needed because a number of Samsung laptops do not hook
 @@ -1558,9 +1556,7 @@ static int __init samsung_init(void)
 samsung-handle_backlight = false;
 } else if (samsung-quirks-broken_acpi_video) {
 pr_info(Disabling ACPI video driver\n);
 -#ifdef CONFIG_ACPI_VIDEO
 acpi_video_unregister();
 -#endif
 }
  #endif

 --
 1.7.9.5


Any news on that ? This should really be merged before the end of rcs.
Thanks,

-- 
Corentin Chary
http://xf.iksaif.net
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/3] asus-laptop: HRWS/HWRS typo

2012-08-20 Thread Corentin Chary
Signed-off-by: Corentin Chary 
---
 drivers/platform/x86/asus-laptop.c |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/platform/x86/asus-laptop.c 
b/drivers/platform/x86/asus-laptop.c
index e38f91b..110c777 100644
--- a/drivers/platform/x86/asus-laptop.c
+++ b/drivers/platform/x86/asus-laptop.c
@@ -863,9 +863,9 @@ static ssize_t show_infos(struct device *dev,
 * The significance of others is yet to be found.
 * If we don't find the method, we assume the device are present.
 */
-   rv = acpi_evaluate_integer(asus->handle, "HRWS", NULL, );
+   rv = acpi_evaluate_integer(asus->handle, "HWRS", NULL, );
if (!ACPI_FAILURE(rv))
-   len += sprintf(page + len, "HRWS value : %#x\n",
+   len += sprintf(page + len, "HWRS value : %#x\n",
   (uint) temp);
/*
 * Another value for userspace: the ASYM method returns 0x02 for
@@ -1751,9 +1751,9 @@ static int asus_laptop_get_info(struct asus_laptop *asus)
 * The significance of others is yet to be found.
 */
status =
-   acpi_evaluate_integer(asus->handle, "HRWS", NULL, _result);
+   acpi_evaluate_integer(asus->handle, "HWRS", NULL, _result);
if (!ACPI_FAILURE(status))
-   pr_notice("  HRWS returned %x", (int)hwrs_result);
+   pr_notice("  HWRS returned %x", (int)hwrs_result);
 
if (!acpi_check_handle(asus->handle, METHOD_WL_STATUS, NULL))
asus->have_rsts = true;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3/3] platform/x86: fix asus_laptop.wled_type description

2012-08-20 Thread Corentin Chary
From: Maxim Nikulin 

MODULE_PARM_DESC for wlan_status is further in the same file

Signed-off-by: Maxim A. Nikulin 
Signed-off-by: Corentin Chary 
---
 drivers/platform/x86/asus-laptop.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/x86/asus-laptop.c 
b/drivers/platform/x86/asus-laptop.c
index 110c777..4b568df 100644
--- a/drivers/platform/x86/asus-laptop.c
+++ b/drivers/platform/x86/asus-laptop.c
@@ -85,7 +85,7 @@ static char *wled_type = "unknown";
 static char *bled_type = "unknown";
 
 module_param(wled_type, charp, 0444);
-MODULE_PARM_DESC(wlan_status, "Set the wled type on boot "
+MODULE_PARM_DESC(wled_type, "Set the wled type on boot "
 "(unknown, led or rfkill). "
 "default is unknown");
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/3] drivers-platform-x86: remove useless #ifdef CONFIG_ACPI_VIDEO

2012-08-20 Thread Corentin Chary
Signed-off-by: Corentin Chary 
---
 drivers/platform/x86/acer-wmi.c   |2 --
 drivers/platform/x86/apple-gmux.c |4 
 drivers/platform/x86/asus-wmi.c   |4 
 drivers/platform/x86/samsung-laptop.c |4 
 4 files changed, 14 deletions(-)

diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
index 3782e1c..934d861 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -2196,10 +2196,8 @@ static int __init acer_wmi_init(void)
interface->capability &= ~ACER_CAP_BRIGHTNESS;
pr_info("Brightness must be controlled by acpi video driver\n");
} else {
-#ifdef CONFIG_ACPI_VIDEO
pr_info("Disabling ACPI video driver\n");
acpi_video_unregister();
-#endif
}
 
if (wmi_has_guid(WMID_GUID3)) {
diff --git a/drivers/platform/x86/apple-gmux.c 
b/drivers/platform/x86/apple-gmux.c
index dfb1a92..dca31ce 100644
--- a/drivers/platform/x86/apple-gmux.c
+++ b/drivers/platform/x86/apple-gmux.c
@@ -505,9 +505,7 @@ static int __devinit gmux_probe(struct pnp_dev *pnp,
 * Disable the other backlight choices.
 */
acpi_video_dmi_promote_vendor();
-#if defined (CONFIG_ACPI_VIDEO) || defined (CONFIG_ACPI_VIDEO_MODULE)
acpi_video_unregister();
-#endif
apple_bl_unregister();
 
gmux_data->power_state = VGA_SWITCHEROO_ON;
@@ -593,9 +591,7 @@ static void __devexit gmux_remove(struct pnp_dev *pnp)
kfree(gmux_data);
 
acpi_video_dmi_demote_vendor();
-#if defined (CONFIG_ACPI_VIDEO) || defined (CONFIG_ACPI_VIDEO_MODULE)
acpi_video_register();
-#endif
apple_bl_register();
 }
 
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 6a91a0c..912ec7d 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -47,9 +47,7 @@
 #include 
 #include 
 #include 
-#ifdef CONFIG_ACPI_VIDEO
 #include 
-#endif
 
 #include "asus-wmi.h"
 
@@ -1780,10 +1778,8 @@ static int asus_wmi_add(struct platform_device *pdev)
if (asus->driver->quirks->wmi_backlight_power)
acpi_video_dmi_promote_vendor();
if (!acpi_video_backlight_support()) {
-#ifdef CONFIG_ACPI_VIDEO
pr_info("Disabling ACPI video driver\n");
acpi_video_unregister();
-#endif
err = asus_wmi_backlight_init(asus);
if (err && err != -ENODEV)
goto fail_backlight;
diff --git a/drivers/platform/x86/samsung-laptop.c 
b/drivers/platform/x86/samsung-laptop.c
index c1ca7bc..dd90d15 100644
--- a/drivers/platform/x86/samsung-laptop.c
+++ b/drivers/platform/x86/samsung-laptop.c
@@ -26,9 +26,7 @@
 #include 
 #include 
 #include 
-#ifdef CONFIG_ACPI_VIDEO
 #include 
-#endif
 
 /*
  * This driver is needed because a number of Samsung laptops do not hook
@@ -1558,9 +1556,7 @@ static int __init samsung_init(void)
samsung->handle_backlight = false;
} else if (samsung->quirks->broken_acpi_video) {
pr_info("Disabling ACPI video driver\n");
-#ifdef CONFIG_ACPI_VIDEO
acpi_video_unregister();
-#endif
}
 #endif
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/3] drivers-platform-x86: remove useless #ifdef CONFIG_ACPI_VIDEO

2012-08-20 Thread Corentin Chary
Signed-off-by: Corentin Chary corentin.ch...@gmail.com
---
 drivers/platform/x86/acer-wmi.c   |2 --
 drivers/platform/x86/apple-gmux.c |4 
 drivers/platform/x86/asus-wmi.c   |4 
 drivers/platform/x86/samsung-laptop.c |4 
 4 files changed, 14 deletions(-)

diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
index 3782e1c..934d861 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -2196,10 +2196,8 @@ static int __init acer_wmi_init(void)
interface-capability = ~ACER_CAP_BRIGHTNESS;
pr_info(Brightness must be controlled by acpi video driver\n);
} else {
-#ifdef CONFIG_ACPI_VIDEO
pr_info(Disabling ACPI video driver\n);
acpi_video_unregister();
-#endif
}
 
if (wmi_has_guid(WMID_GUID3)) {
diff --git a/drivers/platform/x86/apple-gmux.c 
b/drivers/platform/x86/apple-gmux.c
index dfb1a92..dca31ce 100644
--- a/drivers/platform/x86/apple-gmux.c
+++ b/drivers/platform/x86/apple-gmux.c
@@ -505,9 +505,7 @@ static int __devinit gmux_probe(struct pnp_dev *pnp,
 * Disable the other backlight choices.
 */
acpi_video_dmi_promote_vendor();
-#if defined (CONFIG_ACPI_VIDEO) || defined (CONFIG_ACPI_VIDEO_MODULE)
acpi_video_unregister();
-#endif
apple_bl_unregister();
 
gmux_data-power_state = VGA_SWITCHEROO_ON;
@@ -593,9 +591,7 @@ static void __devexit gmux_remove(struct pnp_dev *pnp)
kfree(gmux_data);
 
acpi_video_dmi_demote_vendor();
-#if defined (CONFIG_ACPI_VIDEO) || defined (CONFIG_ACPI_VIDEO_MODULE)
acpi_video_register();
-#endif
apple_bl_register();
 }
 
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 6a91a0c..912ec7d 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -47,9 +47,7 @@
 #include linux/thermal.h
 #include acpi/acpi_bus.h
 #include acpi/acpi_drivers.h
-#ifdef CONFIG_ACPI_VIDEO
 #include acpi/video.h
-#endif
 
 #include asus-wmi.h
 
@@ -1780,10 +1778,8 @@ static int asus_wmi_add(struct platform_device *pdev)
if (asus-driver-quirks-wmi_backlight_power)
acpi_video_dmi_promote_vendor();
if (!acpi_video_backlight_support()) {
-#ifdef CONFIG_ACPI_VIDEO
pr_info(Disabling ACPI video driver\n);
acpi_video_unregister();
-#endif
err = asus_wmi_backlight_init(asus);
if (err  err != -ENODEV)
goto fail_backlight;
diff --git a/drivers/platform/x86/samsung-laptop.c 
b/drivers/platform/x86/samsung-laptop.c
index c1ca7bc..dd90d15 100644
--- a/drivers/platform/x86/samsung-laptop.c
+++ b/drivers/platform/x86/samsung-laptop.c
@@ -26,9 +26,7 @@
 #include linux/seq_file.h
 #include linux/debugfs.h
 #include linux/ctype.h
-#ifdef CONFIG_ACPI_VIDEO
 #include acpi/video.h
-#endif
 
 /*
  * This driver is needed because a number of Samsung laptops do not hook
@@ -1558,9 +1556,7 @@ static int __init samsung_init(void)
samsung-handle_backlight = false;
} else if (samsung-quirks-broken_acpi_video) {
pr_info(Disabling ACPI video driver\n);
-#ifdef CONFIG_ACPI_VIDEO
acpi_video_unregister();
-#endif
}
 #endif
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3/3] platform/x86: fix asus_laptop.wled_type description

2012-08-20 Thread Corentin Chary
From: Maxim Nikulin m.a.niku...@gmail.com

MODULE_PARM_DESC for wlan_status is further in the same file

Signed-off-by: Maxim A. Nikulin m.a.niku...@gmail.com
Signed-off-by: Corentin Chary corentin.ch...@gmail.com
---
 drivers/platform/x86/asus-laptop.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/x86/asus-laptop.c 
b/drivers/platform/x86/asus-laptop.c
index 110c777..4b568df 100644
--- a/drivers/platform/x86/asus-laptop.c
+++ b/drivers/platform/x86/asus-laptop.c
@@ -85,7 +85,7 @@ static char *wled_type = unknown;
 static char *bled_type = unknown;
 
 module_param(wled_type, charp, 0444);
-MODULE_PARM_DESC(wlan_status, Set the wled type on boot 
+MODULE_PARM_DESC(wled_type, Set the wled type on boot 
 (unknown, led or rfkill). 
 default is unknown);
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/3] asus-laptop: HRWS/HWRS typo

2012-08-20 Thread Corentin Chary
Signed-off-by: Corentin Chary corentin.ch...@gmail.com
---
 drivers/platform/x86/asus-laptop.c |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/platform/x86/asus-laptop.c 
b/drivers/platform/x86/asus-laptop.c
index e38f91b..110c777 100644
--- a/drivers/platform/x86/asus-laptop.c
+++ b/drivers/platform/x86/asus-laptop.c
@@ -863,9 +863,9 @@ static ssize_t show_infos(struct device *dev,
 * The significance of others is yet to be found.
 * If we don't find the method, we assume the device are present.
 */
-   rv = acpi_evaluate_integer(asus-handle, HRWS, NULL, temp);
+   rv = acpi_evaluate_integer(asus-handle, HWRS, NULL, temp);
if (!ACPI_FAILURE(rv))
-   len += sprintf(page + len, HRWS value : %#x\n,
+   len += sprintf(page + len, HWRS value : %#x\n,
   (uint) temp);
/*
 * Another value for userspace: the ASYM method returns 0x02 for
@@ -1751,9 +1751,9 @@ static int asus_laptop_get_info(struct asus_laptop *asus)
 * The significance of others is yet to be found.
 */
status =
-   acpi_evaluate_integer(asus-handle, HRWS, NULL, hwrs_result);
+   acpi_evaluate_integer(asus-handle, HWRS, NULL, hwrs_result);
if (!ACPI_FAILURE(status))
-   pr_notice(  HRWS returned %x, (int)hwrs_result);
+   pr_notice(  HWRS returned %x, (int)hwrs_result);
 
if (!acpi_check_handle(asus-handle, METHOD_WL_STATUS, NULL))
asus-have_rsts = true;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


  1   2   >