aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArthur Wirski <awirski@gmail.com>2013-03-17 15:21:35 -0400
committerMatthew Garrett <matthew.garrett@nebula.com>2013-05-08 19:59:44 -0400
commit0572b12aa23b96afacc936990539f4b67ae64bda (patch)
tree2f8ecda16a8f16bb1dacc48afaeb31e31b5f524e
parentd9e290a0ff16aaa51d968e7a0714ea5e2ca2407d (diff)
sony-laptop: SVS151290S kbd backlight and gfx switch support
SVS151290S series uses handle 0x0163 for keyboard backlight and 0x015B for the graphics switch. Signed-off-by: Arthur Wirski <awirski@gmail.com> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
-rw-r--r--drivers/platform/x86/sony-laptop.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
index d544e3aaf761..2ac045f27f10 100644
--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
@@ -1255,6 +1255,11 @@ static void sony_nc_notify(struct acpi_device *device, u32 event)
1255 real_ev = __sony_nc_gfx_switch_status_get(); 1255 real_ev = __sony_nc_gfx_switch_status_get();
1256 break; 1256 break;
1257 1257
1258 case 0x015B:
1259 /* Hybrid GFX switching SVS151290S */
1260 ev_type = GFX_SWITCH;
1261 real_ev = __sony_nc_gfx_switch_status_get();
1262 break;
1258 default: 1263 default:
1259 dprintk("Unknown event 0x%x for handle 0x%x\n", 1264 dprintk("Unknown event 0x%x for handle 0x%x\n",
1260 event, handle); 1265 event, handle);
@@ -1353,6 +1358,7 @@ static void sony_nc_function_setup(struct acpi_device *device,
1353 break; 1358 break;
1354 case 0x0128: 1359 case 0x0128:
1355 case 0x0146: 1360 case 0x0146:
1361 case 0x015B:
1356 result = sony_nc_gfx_switch_setup(pf_device, handle); 1362 result = sony_nc_gfx_switch_setup(pf_device, handle);
1357 if (result) 1363 if (result)
1358 pr_err("couldn't set up GFX Switch status (%d)\n", 1364 pr_err("couldn't set up GFX Switch status (%d)\n",
@@ -1375,6 +1381,7 @@ static void sony_nc_function_setup(struct acpi_device *device,
1375 case 0x0143: 1381 case 0x0143:
1376 case 0x014b: 1382 case 0x014b:
1377 case 0x014c: 1383 case 0x014c:
1384 case 0x0163:
1378 result = sony_nc_kbd_backlight_setup(pf_device, handle); 1385 result = sony_nc_kbd_backlight_setup(pf_device, handle);
1379 if (result) 1386 if (result)
1380 pr_err("couldn't set up keyboard backlight function (%d)\n", 1387 pr_err("couldn't set up keyboard backlight function (%d)\n",
@@ -1426,6 +1433,7 @@ static void sony_nc_function_cleanup(struct platform_device *pd)
1426 break; 1433 break;
1427 case 0x0128: 1434 case 0x0128:
1428 case 0x0146: 1435 case 0x0146:
1436 case 0x015B:
1429 sony_nc_gfx_switch_cleanup(pd); 1437 sony_nc_gfx_switch_cleanup(pd);
1430 break; 1438 break;
1431 case 0x0131: 1439 case 0x0131:
@@ -1439,6 +1447,7 @@ static void sony_nc_function_cleanup(struct platform_device *pd)
1439 case 0x0143: 1447 case 0x0143:
1440 case 0x014b: 1448 case 0x014b:
1441 case 0x014c: 1449 case 0x014c:
1450 case 0x0163:
1442 sony_nc_kbd_backlight_cleanup(pd); 1451 sony_nc_kbd_backlight_cleanup(pd);
1443 break; 1452 break;
1444 default: 1453 default:
@@ -1485,6 +1494,7 @@ static void sony_nc_function_resume(void)
1485 case 0x0143: 1494 case 0x0143:
1486 case 0x014b: 1495 case 0x014b:
1487 case 0x014c: 1496 case 0x014c:
1497 case 0x0163:
1488 sony_nc_kbd_backlight_resume(); 1498 sony_nc_kbd_backlight_resume();
1489 break; 1499 break;
1490 default: 1500 default:
@@ -2390,7 +2400,9 @@ static int __sony_nc_gfx_switch_status_get(void)
2390{ 2400{
2391 unsigned int result; 2401 unsigned int result;
2392 2402
2393 if (sony_call_snc_handle(gfxs_ctl->handle, 0x0100, &result)) 2403 if (sony_call_snc_handle(gfxs_ctl->handle,
2404 gfxs_ctl->handle == 0x015B ? 0x0000 : 0x0100,
2405 &result))
2394 return -EIO; 2406 return -EIO;
2395 2407
2396 switch (gfxs_ctl->handle) { 2408 switch (gfxs_ctl->handle) {
@@ -2400,6 +2412,12 @@ static int __sony_nc_gfx_switch_status_get(void)
2400 */ 2412 */
2401 return result & 0x1 ? SPEED : STAMINA; 2413 return result & 0x1 ? SPEED : STAMINA;
2402 break; 2414 break;
2415 case 0x015B:
2416 /* 0: discrete GFX (speed)
2417 * 1: integrated GFX (stamina)
2418 */
2419 return result & 0x1 ? STAMINA : SPEED;
2420 break;
2403 case 0x0128: 2421 case 0x0128:
2404 /* it's a more elaborated bitmask, for now: 2422 /* it's a more elaborated bitmask, for now:
2405 * 2: integrated GFX (stamina) 2423 * 2: integrated GFX (stamina)