All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sony-laptop: Reading gfx_switch_status in SVS13A15GLB
@ 2013-05-26  0:12 Daniel Serpell
  2013-05-26 22:16 ` Mattia Dongili
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Serpell @ 2013-05-26  0:12 UTC (permalink / raw)
  To: Mattia Dongili, platform-driver-x86

[-- Attachment #1: Type: text/plain, Size: 998 bytes --]

Hi,

Thank you for your work in the sony-laptop kernel module.

I have a Vaio SVS13A15GLB laptop, and today tried the module in the
kernel version 3.10-rc2, that allows reading back the status of the
"gfx" switch.

But in my laptop, when the switch is in the STAMINA position, the
driver reports "speed", and in the "SPEED" position, reports "stamina"
:-(

Reading the status produced the following log in dmesg, with "debug=1":

In SPEED position:
[30084.337256] sony_laptop: found handle 0x015b (offset: 0x05)
[30084.337613] sony_laptop: __call_snc_method: [SN07:0x0000000000000005]
[30084.337618] sony_laptop: called SN07 with 0x0005 (result: 0x0000)

In STAMINA position:
[29976.398723] sony_laptop: found handle 0x015b (offset: 0x05)
[29976.399087] sony_laptop: __call_snc_method: [SN07:0x0000000000000005]
[29976.399092] sony_laptop: called SN07 with 0x0005 (result: 0x0001)

Reading the code, it seems that the status shown is not ok.

Attached is a patch to fix this.

Thanks,

    Daniel.

[-- Attachment #2: gfx-reporting.patch --]
[-- Type: application/octet-stream, Size: 668 bytes --]

From: Daniel Serpell <daniel.serpell@gmail.com>

Fix reporting of sony-laptop gfx_switch_status.

Signed-off-by: Daniel Serpell <daniel.serpell@gmail.com>

diff a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
--- a/drivers/platform/x86/sony-laptop.c	2013-05-25 19:28:41.766486807 -0400
+++ b/drivers/platform/x86/sony-laptop.c	2013-05-25 20:05:14.274429335 -0400
@@ -2440,7 +2440,7 @@
 	if (pos < 0)
 		return pos;
 
-	return snprintf(buffer, PAGE_SIZE, "%s\n", pos ? "speed" : "stamina");
+	return snprintf(buffer, PAGE_SIZE, "%s\n", pos == SPEED ? "speed" : "stamina");
 }
 
 static int sony_nc_gfx_switch_setup(struct platform_device *pd,

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] sony-laptop: Reading gfx_switch_status in SVS13A15GLB
  2013-05-26  0:12 [PATCH] sony-laptop: Reading gfx_switch_status in SVS13A15GLB Daniel Serpell
@ 2013-05-26 22:16 ` Mattia Dongili
  2013-05-26 23:37   ` Daniel Serpell
  2013-05-27 17:34   ` Arthur Wirski
  0 siblings, 2 replies; 4+ messages in thread
From: Mattia Dongili @ 2013-05-26 22:16 UTC (permalink / raw)
  To: Daniel Serpell, Arthur Wirski; +Cc: platform-driver-x86

On Sat, May 25, 2013 at 08:12:43PM -0400, Daniel Serpell wrote:
> Hi,
> 
> Thank you for your work in the sony-laptop kernel module.
> 
> I have a Vaio SVS13A15GLB laptop, and today tried the module in the
> kernel version 3.10-rc2, that allows reading back the status of the
> "gfx" switch.
> 
> But in my laptop, when the switch is in the STAMINA position, the
> driver reports "speed", and in the "SPEED" position, reports "stamina"
> :-(
> 
> Reading the status produced the following log in dmesg, with "debug=1":
> 
> In SPEED position:
> [30084.337256] sony_laptop: found handle 0x015b (offset: 0x05)
> [30084.337613] sony_laptop: __call_snc_method: [SN07:0x0000000000000005]
> [30084.337618] sony_laptop: called SN07 with 0x0005 (result: 0x0000)
> 
> In STAMINA position:
> [29976.398723] sony_laptop: found handle 0x015b (offset: 0x05)
> [29976.399087] sony_laptop: __call_snc_method: [SN07:0x0000000000000005]
> [29976.399092] sony_laptop: called SN07 with 0x0005 (result: 0x0001)
> 
> Reading the code, it seems that the status shown is not ok.
> 
> Attached is a patch to fix this.

oh, nice. we've been reporting the opposite for all this time... And it
looks like we're missing the AUTO value of the enum when setting the
buffer.
Mind adding that and resending the patch (as inline attachment)?

Arthur,
just in case, it's unlikely that two models of the same series have an
opposite behaviour, could you double check Daniel's comment?

Thanks!
-- 
mattia
:wq!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] sony-laptop: Reading gfx_switch_status in SVS13A15GLB
  2013-05-26 22:16 ` Mattia Dongili
@ 2013-05-26 23:37   ` Daniel Serpell
  2013-05-27 17:34   ` Arthur Wirski
  1 sibling, 0 replies; 4+ messages in thread
From: Daniel Serpell @ 2013-05-26 23:37 UTC (permalink / raw)
  To: Mattia Dongili; +Cc: Arthur Wirski, platform-driver-x86

On Mon, May 27, 2013 at 07:16:07AM +0900, Mattia Dongili wrote:
> On Sat, May 25, 2013 at 08:12:43PM -0400, Daniel Serpell wrote:
> > 
> > Attached is a patch to fix this.
> 
> oh, nice. we've been reporting the opposite for all this time... And it
> looks like we're missing the AUTO value of the enum when setting the
> buffer.
> Mind adding that and resending the patch (as inline attachment)?
> 

Ok, I'm not sure what is the preferred style, but here is the new patch.
I can't test the "AUTO" setting, as this laptop has only two positions.

Thanks,

    Daniel.

From: Daniel Serpell <daniel.serpell@gmail.com>
Date: Sun, 26 May 2013 19:16:18 -0400
Subject: [PATCH] Fix reporting of sony-laptop gfx_switch_status.

Signed-off-by: Daniel Serpell <daniel.serpell@gmail.com>
---
 drivers/platform/x86/sony-laptop.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
index a10a376..3503d9c 100644
--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
@@ -2440,7 +2440,10 @@ static ssize_t sony_nc_gfx_switch_status_show(struct device *dev,
 	if (pos < 0)
 		return pos;
 
-	return snprintf(buffer, PAGE_SIZE, "%s\n", pos ? "speed" : "stamina");
+	return snprintf(buffer, PAGE_SIZE, "%s\n",
+					pos == SPEED ? "speed" :
+					pos == STAMINA ? "stamina" :
+					pos == AUTO ? "auto" : "unknown" );
 }
 
 static int sony_nc_gfx_switch_setup(struct platform_device *pd,
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] sony-laptop: Reading gfx_switch_status in SVS13A15GLB
  2013-05-26 22:16 ` Mattia Dongili
  2013-05-26 23:37   ` Daniel Serpell
@ 2013-05-27 17:34   ` Arthur Wirski
  1 sibling, 0 replies; 4+ messages in thread
From: Arthur Wirski @ 2013-05-27 17:34 UTC (permalink / raw)
  To: Mattia Dongili; +Cc: Daniel Serpell, platform-driver-x86

On Mon, May 27, 2013 at 07:16:07AM +0900, Mattia Dongili wrote:
> On Sat, May 25, 2013 at 08:12:43PM -0400, Daniel Serpell wrote:
> > Hi,
> > 
> > Thank you for your work in the sony-laptop kernel module.
> > 
> > I have a Vaio SVS13A15GLB laptop, and today tried the module in the
> > kernel version 3.10-rc2, that allows reading back the status of the
> > "gfx" switch.
> > 
> > But in my laptop, when the switch is in the STAMINA position, the
> > driver reports "speed", and in the "SPEED" position, reports "stamina"
> > :-(
> > 
> > Reading the status produced the following log in dmesg, with "debug=1":
> > 
> > In SPEED position:
> > [30084.337256] sony_laptop: found handle 0x015b (offset: 0x05)
> > [30084.337613] sony_laptop: __call_snc_method: [SN07:0x0000000000000005]
> > [30084.337618] sony_laptop: called SN07 with 0x0005 (result: 0x0000)
> > 
> > In STAMINA position:
> > [29976.398723] sony_laptop: found handle 0x015b (offset: 0x05)
> > [29976.399087] sony_laptop: __call_snc_method: [SN07:0x0000000000000005]
> > [29976.399092] sony_laptop: called SN07 with 0x0005 (result: 0x0001)
> > 
> > Reading the code, it seems that the status shown is not ok.
> > 
> > Attached is a patch to fix this.
> 
> oh, nice. we've been reporting the opposite for all this time... And it
> looks like we're missing the AUTO value of the enum when setting the
> buffer.
> Mind adding that and resending the patch (as inline attachment)?
> 
> Arthur,
> just in case, it's unlikely that two models of the same series have an
> opposite behaviour, could you double check Daniel's comment?
> 
> Thanks!
> -- 
> mattia
> :wq!

I've double checked on Sony SVS151290S using 3.10.0-rc2
The results are the same as what Daniel has mentioned, the return string is incorrect.

Best Regards,
Arthur

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-05-27 17:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-26  0:12 [PATCH] sony-laptop: Reading gfx_switch_status in SVS13A15GLB Daniel Serpell
2013-05-26 22:16 ` Mattia Dongili
2013-05-26 23:37   ` Daniel Serpell
2013-05-27 17:34   ` Arthur Wirski

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.