All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mattia Dongili <malattia@linux.it>
To: Karol Babioch <karol@babioch.de>
Cc: platform-driver-x86@vger.kernel.org
Subject: Re: sony_laptop: Default values for keyboard backlight
Date: Sat, 23 Nov 2013 07:11:56 +0900	[thread overview]
Message-ID: <20131122221156.GA8993@taihen.jp> (raw)
In-Reply-To: <528E91A6.1070403@babioch.de>

On Fri, Nov 22, 2013 at 12:05:10AM +0100, Karol Babioch wrote:
> Hi,
> 
> Am 18.11.2013 23:30, schrieb Mattia Dongili:
> > I guess this is not the case on your
> > machine. If you don't load sony-laptop module you still have the 10
> > seconds timeout that you see in the BIOS? Only _after_ you load the
> > module the backlight never goes off?
> 
> After playing around with this for a while I think that I narrowed the
> issue down (or at least one aspect of it):
> 
> So when actually rebooting and/or powering up the device for the first
> time, it works just fine by default without setting any module
> parameters explicitly. The keyboard backlight is enabled and the timeout
> is set to 10 seconds, which is the default.
> 
> But as soon as I suspend the machine it absolutely makes a difference
> whether or not the module parameter is set. When it is not set
> explicitly (sysfs interface reporting "-1") the keyboard backlight will
> stay on from the moment I resume the machine and press a button. When
> the module parameters are set explicitly it works just fine and as
> expected.

Ha! good catch, I missed this bit in the patch that you already
identified. Can you apply it and see if it makes a difference?

commit 0d72d73e594828381d8ea0291bffa5770fe020a2
Author: Mattia Dongili <malattia@linux.it>
Date:   Sat Nov 23 06:55:40 2013 +0900

    sony-laptop: do not poke the keyboard backlight on resume
    
    Follow-up to 294d31e8227c9892a89d6b3e58d17886b79ea4e6, avoid messing up
    the state on resume leaving it to what was before suspending as it's
    likely that we don't know what value we should write to the EC
    registers.
    
    Signed-off-by: Mattia Dongili <malattia@linux.it>

diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
index 8d80f2c..921b2a9 100644
--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
@@ -140,7 +140,6 @@ MODULE_PARM_DESC(kbd_backlight_timeout,
 		 "on the model (default: no change from current value)");
 
 #ifdef CONFIG_PM_SLEEP
-static void sony_nc_kbd_backlight_resume(void);
 static void sony_nc_thermal_resume(void);
 #endif
 static int sony_nc_kbd_backlight_setup(struct platform_device *pd,
@@ -1487,13 +1486,6 @@ static void sony_nc_function_resume(void)
 		case 0x0135:
 			sony_nc_rfkill_update();
 			break;
-		case 0x0137:
-		case 0x0143:
-		case 0x014b:
-		case 0x014c:
-		case 0x0163:
-			sony_nc_kbd_backlight_resume();
-			break;
 		default:
 			continue;
 		}
@@ -1902,25 +1894,6 @@ static void sony_nc_kbd_backlight_cleanup(struct platform_device *pd,
 	}
 }
 
-#ifdef CONFIG_PM_SLEEP
-static void sony_nc_kbd_backlight_resume(void)
-{
-	int ignore = 0;
-
-	if (!kbdbl_ctl)
-		return;
-
-	if (kbdbl_ctl->mode == 0)
-		sony_call_snc_handle(kbdbl_ctl->handle, kbdbl_ctl->base,
-				&ignore);
-
-	if (kbdbl_ctl->timeout != 0)
-		sony_call_snc_handle(kbdbl_ctl->handle,
-				(kbdbl_ctl->base + 0x200) |
-				(kbdbl_ctl->timeout << 0x10), &ignore);
-}
-#endif
-
 struct battery_care_control {
 	struct device_attribute attrs[2];
 	unsigned int handle;
-- 
mattia
:wq!

  reply	other threads:[~2013-11-22 22:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-18 10:48 sony_laptop: Default values for keyboard backlight Karol Babioch
2013-11-18 22:30 ` Mattia Dongili
2013-11-21 23:05   ` Karol Babioch
2013-11-22 22:11     ` Mattia Dongili [this message]
2013-11-25 12:09       ` Karol Babioch
2013-11-25 22:43         ` [PATCH] sony-laptop: do not scribble keyboard backlight registers on resume Mattia Dongili
2013-11-26  4:16           ` Linus Torvalds

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=20131122221156.GA8993@taihen.jp \
    --to=malattia@linux.it \
    --cc=karol@babioch.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.