mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hamed Abdelli <abdelli.hamed@yahoo.fr>
To: "dwmw2@infradead.org" <dwmw2@infradead.org>
Cc: "trivial@kernel.org" <trivial@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: [PATCH] x86: fix the delay when controlling brightness using hotkeys on ideapad laptops
Date: Mon, 4 Mar 2013 23:33:07 +0000 (GMT)	[thread overview]
Message-ID: <1362439987.98158.YahooMailNeo@web171602.mail.ir2.yahoo.com> (raw)

Fixes the lag when reading and writing hotkeys for backlight control on ideapad laptops by minimizing the timeout.

Applies to linux-3.8.2

Thanks,

Signed-off-by: Hamed ABDELLI <abdelli.hamed@yahoo.fr>

--- linux-3.8.2/drivers/platform/x86/ideapad-laptop.c.orig      2013-03-04 23:38:09.291989270 +0100
+++ linux-3.8.2/drivers/platform/x86/ideapad-laptop.c   2013-03-04 23:38:47.272988333 +0100
@@ -90,7 +90,7 @@ MODULE_PARM_DESC(no_bt_rfkill, "No rfkil
 /*
  * ACPI Helpers
  */
-#define IDEAPAD_EC_TIMEOUT (100) /* in ms */
+#define IDEAPAD_EC_TIMEOUT (1) /* in ms */

 static int read_method_int(acpi_handle handle, const char *method, int *val)
 {
@@ -157,7 +157,7 @@ static int read_ec_data(acpi_handle hand
        if (method_vpcw(handle, 1, cmd))
                return -1;

-       for (end_jiffies = jiffies+(HZ)*IDEAPAD_EC_TIMEOUT/1000+1;
+       for (end_jiffies = jiffies+(HZ)*IDEAPAD_EC_TIMEOUT/10000+1;
             time_before(jiffies, end_jiffies);) {
                schedule();
                if (method_vpcr(handle, 1, &val))
@@ -183,7 +183,7 @@ static int write_ec_cmd(acpi_handle hand
        if (method_vpcw(handle, 1, cmd))
                return -1;

-       for (end_jiffies = jiffies+(HZ)*IDEAPAD_EC_TIMEOUT/1000+1;
+       for (end_jiffies = jiffies+(HZ)*IDEAPAD_EC_TIMEOUT/10000+1;
             time_before(jiffies, end_jiffies);) {
                schedule();
                if (method_vpcr(handle, 1, &val))

                 reply	other threads:[~2013-03-04 23:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1362439987.98158.YahooMailNeo@web171602.mail.ir2.yahoo.com \
    --to=abdelli.hamed@yahoo.fr \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=trivial@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®