mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Corentin Chary <corentin.chary@gmail.com>
To: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: platform-driver-x86@vger.kernel.org,
	Corentin Chary <corentin.chary@gmail.com>,
	Matthew Garrett <mjg@redhat.com>,
	acpi4asus-user@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: [PATCH 11/11] asus-laptop: always report brightness key events
Date: Thu, 29 Nov 2012 09:12:39 +0100	[thread overview]
Message-ID: <1354176759-630-12-git-send-email-corentin.chary@gmail.com> (raw)
In-Reply-To: <1354176759-630-1-git-send-email-corentin.chary@gmail.com>

Signed-off-by: Corentin Chary <corentin.chary@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_MIN	ATKD_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_ON	0x33
 #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


      parent reply	other threads:[~2012-11-29  8:14 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1354176759-630-1-git-send-email-corentin.chary@gmail.com>
2012-11-29  8:12 ` [PATCH 01/11] platform-drivers-x86: change my mail Corentin Chary
2012-11-29  8:12 ` [PATCH 02/11] asus-laptop: map some new keys Corentin Chary
2012-11-29  8:12 ` [PATCH 03/11] asus-{nb-wmi|laptop}.c: sync keymaps Corentin Chary
2012-11-29  8:12 ` [PATCH 04/11] asus-laptop: correct a touchpad hotkey mapping Corentin Chary
2012-11-29  8:12 ` [PATCH 05/11] asus-laptop: add all video switch keys Corentin Chary
2012-11-29  8:12 ` [PATCH 06/11] asus-nb-wmi: correct a touchpad hotkey mapping Corentin Chary
2012-11-29  8:12 ` [PATCH 07/11] asus-nb-wmi: add all video switch keys Corentin Chary
2012-11-29  8:12 ` [PATCH 08/11] asus-wmi: add display toggle quirk Corentin Chary
2012-11-29  8:12 ` [PATCH 09/11] asus-laptop: Do not call HWRS on init Corentin Chary
2012-11-29 14:10   ` Ben Hutchings
2012-11-29  8:12 ` [PATCH 10/11] asus-wmi: always report brightness key events Corentin Chary
2012-11-29  8:12 ` Corentin Chary [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1354176759-630-12-git-send-email-corentin.chary@gmail.com \
    --to=corentin.chary@gmail.com \
    --cc=acpi4asus-user@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjg59@srcf.ucam.org \
    --cc=mjg@redhat.com \
    --cc=platform-driver-x86@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®