aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Chiappero <marco@absence.it>2012-06-09 00:18:09 -0400
committerMatthew Garrett <mjg@redhat.com>2012-06-26 14:43:05 -0400
commitbb384b5295323ed58260aeaff22d8bbe32988396 (patch)
treea5c0716449ec56c78f22ebf8cecdc95e4f12d8b3
parent4069d6f86bebce1a1e3456ef721511b4b81958f8 (diff)
sony-laptop: notify userspace of GFX switch position changes
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. Signed-off-by: Marco Chiappero <marco@absence.it> Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Matthew Garrett <mjg@redhat.com>
-rw-r--r--drivers/platform/x86/sony-laptop.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
index 615ab06b6cd3..4f42e5661bf5 100644
--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
@@ -1174,7 +1174,8 @@ static int sony_nc_hotkeys_decode(u32 event, unsigned int handle)
1174 */ 1174 */
1175enum event_types { 1175enum event_types {
1176 HOTKEY = 1, 1176 HOTKEY = 1,
1177 KILLSWITCH 1177 KILLSWITCH,
1178 GFX_SWITCH
1178}; 1179};
1179static void sony_nc_notify(struct acpi_device *device, u32 event) 1180static void sony_nc_notify(struct acpi_device *device, u32 event)
1180{ 1181{
@@ -1230,6 +1231,24 @@ static void sony_nc_notify(struct acpi_device *device, u32 event)
1230 1231
1231 break; 1232 break;
1232 1233
1234 case 0x0128:
1235 case 0x0146:
1236 /* Hybrid GFX switching */
1237 sony_call_snc_handle(handle, 0x0000, &result);
1238 dprintk("GFX switch event received (reason: %s)\n",
1239 (result & 0x01) ?
1240 "switch change" : "unknown");
1241
1242 /* verify the switch state
1243 * 1: discrete GFX
1244 * 0: integrated GFX
1245 */
1246 sony_call_snc_handle(handle, 0x0100, &result);
1247
1248 ev_type = GFX_SWITCH;
1249 real_ev = result & 0xff;
1250 break;
1251
1233 default: 1252 default:
1234 dprintk("Unknown event 0x%x for handle 0x%x\n", 1253 dprintk("Unknown event 0x%x for handle 0x%x\n",
1235 event, handle); 1254 event, handle);