On Fri, Jun 03, 2011 at 09:27:00PM +0200, Marco Chiappero wrote:
quoted hunk
Some Vaios come with both integrated and discrete graphics, plus a
switch for choosing one of the two. When the switch position is
changed, a notification is generated, now forwarded to userspace for
example for visual notifications, user scripts, and so on.
Signed-off-by: Marco Chiappero <redacted>
---
--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
@@ -3118,6 +3118,14 @@ static void sony_nc_notify(struct acpi_d
dprintk("sony_nc_notify, event: 0x%.2x\n", event);
+ /* events codes list
+ * 1 Hotkeys
+ * 2 RFKILL
+ * 3 ALS
+ * 4 HDD protection
+ * 5 Hybrid GFX
+ */
how about some #defines instead of a comment?
quoted hunk
/* handles related events */
if (event >= 0x90) {
unsigned int result = 0, handle = 0;@@ -3169,6 +3177,23 @@ static void sony_nc_notify(struct acpi_d
/* hdd protection event, notify userspace */
break;
+ case 0x0128:
+ case 0x0146:
+ /* Hybrid GFX switching, 1 */
+ sony_call_snc_handle(handle, 0x0000, &result);
+ dprintk("sony_nc_notify, Hybrid GFX event received "
+ "(reason: %s)\n", (result & 0x01) ?
+ "switch position change" : "unknown");
+
+ /* verify the switch state
+ (1: discrete GFX, 0: integrated GFX)*/
+ result = 0;
+ sony_call_snc_handle(handle, 0x0100, &result);
+
+ ev = 5;
+ value = result & 0xff;
+ break;
shouldn't this be reported as an input event rather than just an acpi
one?
also, I am trying to recall how the speed/stamina switch was handled in
older SZ and other models. I think we are already notifying the
switching event as an input key (PROG4? PROG5?)
I didn't see a better option in input.h, maybe time to add one?
default:
value = event;
dprintk("Unknowk event for handle: 0x%x\n", handle);
--
mattia
:wq!
Il 04/06/2011 10:48, Mattia Dongili ha scritto:
On Fri, Jun 03, 2011 at 09:27:00PM +0200, Marco Chiappero wrote:
quoted
Some Vaios come with both integrated and discrete graphics, plus a
switch for choosing one of the two. When the switch position is
changed, a notification is generated, now forwarded to userspace for
example for visual notifications, user scripts, and so on.
[...]
quoted
+ case 0x0128:
+ case 0x0146:
+ /* Hybrid GFX switching, 1 */
+ sony_call_snc_handle(handle, 0x0000,&result);
+ dprintk("sony_nc_notify, Hybrid GFX event received "
+ "(reason: %s)\n", (result& 0x01) ?
+ "switch position change" : "unknown");
+
+ /* verify the switch state
+ (1: discrete GFX, 0: integrated GFX)*/
+ result = 0;
+ sony_call_snc_handle(handle, 0x0100,&result);
+
+ ev = 5;
+ value = result& 0xff;
+ break;
shouldn't this be reported as an input event rather than just an acpi
one?
If so, please someone let me know which keys to use.
On Mon, Jun 20, 2011 at 11:12:50PM +0200, Marco Chiappero wrote:
Il 04/06/2011 10:48, Mattia Dongili ha scritto:
quoted
On Fri, Jun 03, 2011 at 09:27:00PM +0200, Marco Chiappero wrote:
quoted
Some Vaios come with both integrated and discrete graphics, plus a
switch for choosing one of the two. When the switch position is
changed, a notification is generated, now forwarded to userspace for
example for visual notifications, user scripts, and so on.
[...]
quoted
quoted
+ case 0x0128:
+ case 0x0146:
+ /* Hybrid GFX switching, 1 */
+ sony_call_snc_handle(handle, 0x0000,&result);
+ dprintk("sony_nc_notify, Hybrid GFX event received "
+ "(reason: %s)\n", (result& 0x01) ?
+ "switch position change" : "unknown");
+
+ /* verify the switch state
+ (1: discrete GFX, 0: integrated GFX)*/
+ result = 0;
+ sony_call_snc_handle(handle, 0x0100,&result);
+
+ ev = 5;
+ value = result& 0xff;
+ break;
shouldn't this be reported as an input event rather than just an acpi
one?
If so, please someone let me know which keys to use.
the speed/stamina switch is not very useful at the moment as we can't do
anything with it anyway. There is probably no need to send the event to
userspace at all for now. Else a new switch event should be defined for
this.
--
mattia
:wq!