Lines Matching +full:0 +full:x070000

64 } while (0)
79 module_param(debug, int, 0);
83 static int no_spic; /* = 0 */
88 static int compat; /* = 0 */
93 static unsigned long mask = 0xffffffff;
98 static int camera; /* = 0 */
106 module_param(minor, int, 0);
115 "set this to 0 to disable keyboard backlight, "
122 "meaningful values vary from 0 to 3 and their meaning depends "
181 static int sony_rfkill_address[N_SONY_RFKILL] = {0x300, 0x500, 0x700, 0x900};
200 .users = ATOMIC_INIT(0),
212 -1, /* 0 no event */
219 0, /* 7 SONYPI_EVENT_CAPTURE_PRESSED */
289 KEY_CAMERA, /* 0 SONYPI_EVENT_CAPTURE_PRESSED */
361 input_report_key(kp.dev, kp.key, 0); in do_sony_laptop_release_key()
366 if (kfifo_len(&sony_laptop_input.fifo) != 0) in do_sony_laptop_release_key()
448 return 0; in sony_laptop_setup_input()
460 do_sony_laptop_release_key, 0); in sony_laptop_setup_input()
478 key_dev->keycodesize = sizeof(sony_laptop_input_keycode_map[0]); in sony_laptop_setup_input()
481 for (i = 0; i < ARRAY_SIZE(sony_laptop_input_keycode_map); i++) in sony_laptop_setup_input()
512 return 0; in sony_laptop_setup_input()
549 input_report_key(kp.dev, kp.key, 0); in sony_laptop_remove_input()
567 static atomic_t sony_pf_users = ATOMIC_INIT(0);
577 int ret = 0; in sony_pf_add()
581 return 0; in sony_pf_add()
597 return 0; in sony_pf_add()
622 0-based values */
625 #define SNC_VALIDATE_IN 0
656 .devattr = __ATTR(_name, 0, sony_nc_sysfs_show, sony_nc_sysfs_store), \
696 snc_brightness_def_set, brightness_default_validate, 0),
697 SNC_HANDLE(fnkey, snc_fnkey_get, NULL, NULL, 0),
698 SNC_HANDLE(cdpower, snc_cdpower_get, snc_cdpower_set, boolean_validate, 0),
700 boolean_validate, 0),
704 boolean_validate, 0),
706 boolean_validate, 0),
708 boolean_validate, 0),
740 dprintk("__call_snc_method: [%s:0x%.8x%.8x]\n", method, in __call_snc_method()
742 (unsigned int)*value & 0xffffffff); in __call_snc_method()
763 int ret = 0; in sony_nc_buffer_call()
774 memset(buffer, 0, buflen); in sony_nc_buffer_call()
779 memset(buffer, 0, buflen); in sony_nc_buffer_call()
783 pr_warn("Unexpected acpi_object: 0x%x\n", object->type); in sony_nc_buffer_call()
809 u16 cap[0x10];
818 ssize_t len = 0; in sony_nc_handles_show()
821 for (i = 0; i < ARRAY_SIZE(handles->cap); i++) { in sony_nc_handles_show()
822 len += sysfs_emit_at(buffer, len, "0x%.4x ", handles->cap[i]); in sony_nc_handles_show()
837 for (i = 0; i < ARRAY_SIZE(handles->cap); i++) { in sony_nc_handles_setup()
838 arg = i + 0x20; in sony_nc_handles_setup()
842 dprintk("caching handle 0x%.4x (offset: 0x%.2x)\n", in sony_nc_handles_setup()
862 return 0; in sony_nc_handles_setup()
873 return 0; in sony_nc_handles_cleanup()
884 for (i = 0; i < 0x10; i++) { in sony_find_snc_handle()
886 dprintk("found handle 0x%.4x (offset: 0x%.2x)\n", in sony_find_snc_handle()
891 dprintk("handle 0x%.4x not found\n", handle); in sony_find_snc_handle()
897 int arg, ret = 0; in sony_call_snc_handle()
900 if (offset < 0) in sony_call_snc_handle()
905 dprintk("called SN07 with 0x%.4x (result: 0x%.4x)\n", arg, *result); in sony_call_snc_handle()
916 * backlight framework for which brightness values are 0-based.
924 if (value >= 0 && value < SONY_MAX_BRIGHTNESS) in brightness_default_validate()
932 * on input validate boolean values 0/1, on output just pass the
938 if (value != 0 && value != 1) in boolean_validate()
950 int value, ret = 0; in sony_nc_sysfs_show()
959 if (ret < 0) in sony_nc_sysfs_show()
973 int ret = 0; in sony_nc_sysfs_store()
989 if (value < 0) in sony_nc_sysfs_store()
994 if (ret < 0) in sony_nc_sysfs_store()
1026 return 0; in sony_backlight_get_brightness()
1027 /* brightness levels are 1-based, while backlight ones are 0-based */ in sony_backlight_get_brightness()
1037 sony_call_snc_handle(sdev->handle, sdev->cmd_base + 0x100, &result); in sony_nc_get_brightness_ng()
1039 return (result & 0xff) - sdev->offset; in sony_nc_get_brightness_ng()
1049 if (sony_call_snc_handle(sdev->handle, sdev->cmd_base | (value << 0x10), in sony_nc_update_status_ng()
1076 { 0x90, SONYPI_EVENT_PKEY_P1 },
1077 { 0x10, SONYPI_EVENT_ANYBUTTON_RELEASED },
1078 { 0x91, SONYPI_EVENT_PKEY_P2 },
1079 { 0x11, SONYPI_EVENT_ANYBUTTON_RELEASED },
1080 { 0x81, SONYPI_EVENT_FNKEY_F1 },
1081 { 0x01, SONYPI_EVENT_FNKEY_RELEASED },
1082 { 0x82, SONYPI_EVENT_FNKEY_F2 },
1083 { 0x02, SONYPI_EVENT_FNKEY_RELEASED },
1084 { 0x83, SONYPI_EVENT_FNKEY_F3 },
1085 { 0x03, SONYPI_EVENT_FNKEY_RELEASED },
1086 { 0x84, SONYPI_EVENT_FNKEY_F4 },
1087 { 0x04, SONYPI_EVENT_FNKEY_RELEASED },
1088 { 0x85, SONYPI_EVENT_FNKEY_F5 },
1089 { 0x05, SONYPI_EVENT_FNKEY_RELEASED },
1090 { 0x86, SONYPI_EVENT_FNKEY_F6 },
1091 { 0x06, SONYPI_EVENT_FNKEY_RELEASED },
1092 { 0x87, SONYPI_EVENT_FNKEY_F7 },
1093 { 0x07, SONYPI_EVENT_FNKEY_RELEASED },
1094 { 0x88, SONYPI_EVENT_FNKEY_F8 },
1095 { 0x08, SONYPI_EVENT_FNKEY_RELEASED },
1096 { 0x89, SONYPI_EVENT_FNKEY_F9 },
1097 { 0x09, SONYPI_EVENT_FNKEY_RELEASED },
1098 { 0x8A, SONYPI_EVENT_FNKEY_F10 },
1099 { 0x0A, SONYPI_EVENT_FNKEY_RELEASED },
1100 { 0x8B, SONYPI_EVENT_FNKEY_F11 },
1101 { 0x0B, SONYPI_EVENT_FNKEY_RELEASED },
1102 { 0x8C, SONYPI_EVENT_FNKEY_F12 },
1103 { 0x0C, SONYPI_EVENT_FNKEY_RELEASED },
1104 { 0x9d, SONYPI_EVENT_ZOOM_PRESSED },
1105 { 0x1d, SONYPI_EVENT_ANYBUTTON_RELEASED },
1106 { 0x9f, SONYPI_EVENT_CD_EJECT_PRESSED },
1107 { 0x1f, SONYPI_EVENT_ANYBUTTON_RELEASED },
1108 { 0xa1, SONYPI_EVENT_MEDIA_PRESSED },
1109 { 0x21, SONYPI_EVENT_ANYBUTTON_RELEASED },
1110 { 0xa4, SONYPI_EVENT_CD_EJECT_PRESSED },
1111 { 0x24, SONYPI_EVENT_ANYBUTTON_RELEASED },
1112 { 0xa5, SONYPI_EVENT_VENDOR_PRESSED },
1113 { 0x25, SONYPI_EVENT_ANYBUTTON_RELEASED },
1114 { 0xa6, SONYPI_EVENT_HELP_PRESSED },
1115 { 0x26, SONYPI_EVENT_ANYBUTTON_RELEASED },
1116 { 0xa8, SONYPI_EVENT_FNKEY_1 },
1117 { 0x28, SONYPI_EVENT_ANYBUTTON_RELEASED },
1118 { 0, 0 },
1122 { 0x81, SONYPI_EVENT_MODEKEY_PRESSED },
1123 { 0x01, SONYPI_EVENT_ANYBUTTON_RELEASED },
1124 { 0x82, SONYPI_EVENT_PKEY_P1 },
1125 { 0x02, SONYPI_EVENT_ANYBUTTON_RELEASED },
1126 { 0x83, SONYPI_EVENT_PKEY_P2 },
1127 { 0x03, SONYPI_EVENT_ANYBUTTON_RELEASED },
1128 { 0x84, SONYPI_EVENT_PKEY_P3 },
1129 { 0x04, SONYPI_EVENT_ANYBUTTON_RELEASED },
1130 { 0x85, SONYPI_EVENT_PKEY_P4 },
1131 { 0x05, SONYPI_EVENT_ANYBUTTON_RELEASED },
1132 { 0x86, SONYPI_EVENT_PKEY_P5 },
1133 { 0x06, SONYPI_EVENT_ANYBUTTON_RELEASED },
1134 { 0x87, SONYPI_EVENT_SETTINGKEY_PRESSED },
1135 { 0x07, SONYPI_EVENT_ANYBUTTON_RELEASED },
1136 { 0, 0 },
1142 unsigned int result = 0; in sony_nc_hotkeys_decode()
1145 if (sony_call_snc_handle(handle, 0x200, &result)) { in sony_nc_hotkeys_decode()
1146 dprintk("Unable to decode event 0x%.2x 0x%.2x\n", handle, in sony_nc_hotkeys_decode()
1151 result &= 0xFF; in sony_nc_hotkeys_decode()
1153 if (handle == 0x0100) in sony_nc_hotkeys_decode()
1166 pr_info("Unknown hotkey 0x%.2x/0x%.2x (handle 0x%.2x)\n", in sony_nc_hotkeys_decode()
1183 u8 ev_type = 0; in sony_nc_notify()
1186 dprintk("sony_nc_notify, event: 0x%.2x\n", event); in sony_nc_notify()
1188 if (event >= 0x90) { in sony_nc_notify()
1189 unsigned int result = 0; in sony_nc_notify()
1190 unsigned int arg = 0; in sony_nc_notify()
1191 unsigned int handle = 0; in sony_nc_notify()
1192 unsigned int offset = event - 0x90; in sony_nc_notify()
1195 pr_err("Event 0x%x outside of capabilities list\n", in sony_nc_notify()
1204 case 0x0100: in sony_nc_notify()
1205 case 0x0127: in sony_nc_notify()
1209 if (ret > 0) { in sony_nc_notify()
1217 case 0x0124: in sony_nc_notify()
1218 case 0x0135: in sony_nc_notify()
1226 sony_call_snc_handle(handle, 0x0100, &result); in sony_nc_notify()
1227 real_ev = result & 0x03; in sony_nc_notify()
1235 case 0x0128: in sony_nc_notify()
1236 case 0x0146: in sony_nc_notify()
1238 sony_call_snc_handle(handle, 0x0000, &result); in sony_nc_notify()
1240 (result == 0x1) ? "switch change" : in sony_nc_notify()
1241 (result == 0x2) ? "output switch" : in sony_nc_notify()
1242 (result == 0x3) ? "output switch" : in sony_nc_notify()
1249 case 0x015B: in sony_nc_notify()
1255 dprintk("Unknown event 0x%x for handle 0x%x\n", in sony_nc_notify()
1300 for (i = 0; i < ARRAY_SIZE(handles->cap); i++) { in sony_nc_function_setup()
1306 dprintk("setting up handle 0x%.4x\n", handle); in sony_nc_function_setup()
1309 case 0x0100: in sony_nc_function_setup()
1310 case 0x0101: in sony_nc_function_setup()
1311 case 0x0127: in sony_nc_function_setup()
1313 sony_call_snc_handle(handle, 0, &result); in sony_nc_function_setup()
1315 case 0x0102: in sony_nc_function_setup()
1317 sony_call_snc_handle(handle, 0x100, &result); in sony_nc_function_setup()
1319 case 0x0105: in sony_nc_function_setup()
1320 case 0x0148: in sony_nc_function_setup()
1327 case 0x0115: in sony_nc_function_setup()
1328 case 0x0136: in sony_nc_function_setup()
1329 case 0x013f: in sony_nc_function_setup()
1335 case 0x0119: in sony_nc_function_setup()
1336 case 0x015D: in sony_nc_function_setup()
1342 case 0x0122: in sony_nc_function_setup()
1348 case 0x0128: in sony_nc_function_setup()
1349 case 0x0146: in sony_nc_function_setup()
1350 case 0x015B: in sony_nc_function_setup()
1356 case 0x0131: in sony_nc_function_setup()
1362 case 0x0124: in sony_nc_function_setup()
1363 case 0x0135: in sony_nc_function_setup()
1369 case 0x0137: in sony_nc_function_setup()
1370 case 0x0143: in sony_nc_function_setup()
1371 case 0x014b: in sony_nc_function_setup()
1372 case 0x014c: in sony_nc_function_setup()
1373 case 0x0153: in sony_nc_function_setup()
1374 case 0x0163: in sony_nc_function_setup()
1380 case 0x0121: in sony_nc_function_setup()
1386 case 0x0149: in sony_nc_function_setup()
1392 case 0x0155: in sony_nc_function_setup()
1398 case 0x011D: in sony_nc_function_setup()
1404 case 0x0168: in sony_nc_function_setup()
1416 arg = 0x10; in sony_nc_function_setup()
1434 for (i = 0; i < ARRAY_SIZE(handles->cap); i++) { in sony_nc_function_cleanup()
1442 case 0x0105: in sony_nc_function_cleanup()
1443 case 0x0148: in sony_nc_function_cleanup()
1446 case 0x0115: in sony_nc_function_cleanup()
1447 case 0x0136: in sony_nc_function_cleanup()
1448 case 0x013f: in sony_nc_function_cleanup()
1451 case 0x0119: in sony_nc_function_cleanup()
1452 case 0x015D: in sony_nc_function_cleanup()
1455 case 0x0122: in sony_nc_function_cleanup()
1458 case 0x0128: in sony_nc_function_cleanup()
1459 case 0x0146: in sony_nc_function_cleanup()
1460 case 0x015B: in sony_nc_function_cleanup()
1463 case 0x0131: in sony_nc_function_cleanup()
1466 case 0x0124: in sony_nc_function_cleanup()
1467 case 0x0135: in sony_nc_function_cleanup()
1470 case 0x0137: in sony_nc_function_cleanup()
1471 case 0x0143: in sony_nc_function_cleanup()
1472 case 0x014b: in sony_nc_function_cleanup()
1473 case 0x014c: in sony_nc_function_cleanup()
1474 case 0x0153: in sony_nc_function_cleanup()
1475 case 0x0163: in sony_nc_function_cleanup()
1478 case 0x0121: in sony_nc_function_cleanup()
1481 case 0x0149: in sony_nc_function_cleanup()
1484 case 0x0155: in sony_nc_function_cleanup()
1487 case 0x011D: in sony_nc_function_cleanup()
1490 case 0x0168: in sony_nc_function_cleanup()
1509 for (i = 0; i < ARRAY_SIZE(handles->cap); i++) { in sony_nc_function_resume()
1516 case 0x0100: in sony_nc_function_resume()
1517 case 0x0101: in sony_nc_function_resume()
1518 case 0x0127: in sony_nc_function_resume()
1520 sony_call_snc_handle(handle, 0, &result); in sony_nc_function_resume()
1522 case 0x0102: in sony_nc_function_resume()
1524 sony_call_snc_handle(handle, 0x100, &result); in sony_nc_function_resume()
1526 case 0x0122: in sony_nc_function_resume()
1529 case 0x0124: in sony_nc_function_resume()
1530 case 0x0135: in sony_nc_function_resume()
1539 arg = 0x10; in sony_nc_function_resume()
1556 if (ret < 0) { in sony_nc_resume()
1571 return 0; in sony_nc_resume()
1581 for (i = 0; i < N_SONY_RFKILL; i++) { in sony_nc_rfkill_cleanup()
1592 int argument = sony_rfkill_address[(long) data] + 0x100; in sony_nc_rfkill_set()
1595 argument |= 0x070000; in sony_nc_rfkill_set()
1640 err = sony_call_snc_handle(sony_rfkill_handle, 0x200, &result); in sony_nc_setup_rfkill()
1641 if (err < 0) { in sony_nc_setup_rfkill()
1645 hwblock = !(result & 0x1); in sony_nc_setup_rfkill()
1650 if (err < 0) { in sony_nc_setup_rfkill()
1654 swblock = !(result & 0x2); in sony_nc_setup_rfkill()
1674 sony_call_snc_handle(sony_rfkill_handle, 0x200, &result); in sony_nc_rfkill_update()
1675 hwblock = !(result & 0x1); in sony_nc_rfkill_update()
1677 for (i = 0; i < N_SONY_RFKILL; i++) { in sony_nc_rfkill_update()
1692 !(result & 0x2), false); in sony_nc_rfkill_update()
1701 unsigned char buffer[32] = { 0 }; in sony_nc_rfkill_setup()
1708 if (i < 0) in sony_nc_rfkill_setup()
1712 * available, 0xff terminates the enumeration. in sony_nc_rfkill_setup()
1714 * 0x00 WLAN in sony_nc_rfkill_setup()
1715 * 0x10 BLUETOOTH in sony_nc_rfkill_setup()
1716 * 0x20 WWAN GPRS-EDGE in sony_nc_rfkill_setup()
1717 * 0x21 WWAN HSDPA in sony_nc_rfkill_setup()
1718 * 0x22 WWAN EV-DO in sony_nc_rfkill_setup()
1719 * 0x23 WWAN GPS in sony_nc_rfkill_setup()
1720 * 0x25 Gobi WWAN no GPS in sony_nc_rfkill_setup()
1721 * 0x26 Gobi WWAN + GPS in sony_nc_rfkill_setup()
1722 * 0x28 Gobi WWAN no GPS in sony_nc_rfkill_setup()
1723 * 0x29 Gobi WWAN + GPS in sony_nc_rfkill_setup()
1724 * 0x30 WIMAX in sony_nc_rfkill_setup()
1725 * 0x50 Gobi WWAN no GPS in sony_nc_rfkill_setup()
1726 * 0x51 Gobi WWAN + GPS in sony_nc_rfkill_setup()
1727 * 0x70 no SIM card slot in sony_nc_rfkill_setup()
1728 * 0x71 SIM card slot in sony_nc_rfkill_setup()
1730 for (i = 0; i < ARRAY_SIZE(buffer); i++) { in sony_nc_rfkill_setup()
1732 if (buffer[i] == 0xff) in sony_nc_rfkill_setup()
1735 dprintk("Radio devices, found 0x%.2x\n", buffer[i]); in sony_nc_rfkill_setup()
1737 if (buffer[i] == 0 && !sony_rfkill_devices[SONY_WIFI]) in sony_nc_rfkill_setup()
1740 if (buffer[i] == 0x10 && !sony_rfkill_devices[SONY_BLUETOOTH]) in sony_nc_rfkill_setup()
1743 if (((0xf0 & buffer[i]) == 0x20 || in sony_nc_rfkill_setup()
1744 (0xf0 & buffer[i]) == 0x50) && in sony_nc_rfkill_setup()
1748 if (buffer[i] == 0x30 && !sony_rfkill_devices[SONY_WIMAX]) in sony_nc_rfkill_setup()
1751 return 0; in sony_nc_rfkill_setup()
1775 (value << 0x10) | (kbdbl_ctl->base), &result)) in __sony_nc_kbd_backlight_mode_set()
1781 (value << 0x0f) | (kbdbl_ctl->base + 0x100), in __sony_nc_kbd_backlight_mode_set()
1786 return 0; in __sony_nc_kbd_backlight_mode_set()
1793 int ret = 0; in sony_nc_kbd_backlight_mode_store()
1803 if (ret < 0) in sony_nc_kbd_backlight_mode_store()
1822 if (sony_call_snc_handle(kbdbl_ctl->handle, (value << 0x10) | in __sony_nc_kbd_backlight_timeout_set()
1823 (kbdbl_ctl->base + 0x200), &result)) in __sony_nc_kbd_backlight_timeout_set()
1828 return 0; in __sony_nc_kbd_backlight_timeout_set()
1835 int ret = 0; in sony_nc_kbd_backlight_timeout_store()
1845 if (ret < 0) in sony_nc_kbd_backlight_timeout_store()
1861 int probe_base = 0; in sony_nc_kbd_backlight_setup()
1862 int ctl_base = 0; in sony_nc_kbd_backlight_setup()
1863 int ret = 0; in sony_nc_kbd_backlight_setup()
1866 pr_warn("handle 0x%.4x: keyboard backlight setup already done for 0x%.4x\n", in sony_nc_kbd_backlight_setup()
1875 case 0x0153: in sony_nc_kbd_backlight_setup()
1876 probe_base = 0x0; in sony_nc_kbd_backlight_setup()
1877 ctl_base = 0x0; in sony_nc_kbd_backlight_setup()
1879 case 0x0137: in sony_nc_kbd_backlight_setup()
1880 probe_base = 0x0B00; in sony_nc_kbd_backlight_setup()
1881 ctl_base = 0x0C00; in sony_nc_kbd_backlight_setup()
1884 probe_base = 0x0100; in sony_nc_kbd_backlight_setup()
1885 ctl_base = 0x4000; in sony_nc_kbd_backlight_setup()
1891 * is equivalent to __sony_nc_kbd_backlight_mode_set(0), resulting in in sony_nc_kbd_backlight_setup()
1899 if ((handle == 0x0137 && !(result & 0x02)) || in sony_nc_kbd_backlight_setup()
1900 !(result & 0x01)) { in sony_nc_kbd_backlight_setup()
1902 return 0; in sony_nc_kbd_backlight_setup()
1915 kbdbl_ctl->has_timeout = handle != 0x0153; in sony_nc_kbd_backlight_setup()
1946 return 0; in sony_nc_kbd_backlight_setup()
1993 * bit 0: 0 disable BCL, 1 enable BCL in sony_nc_battery_care_limit_store()
1999 cmd = 0; in sony_nc_battery_care_limit_store()
2001 if (value > 0) { in sony_nc_battery_care_limit_store()
2003 cmd = 0x20; in sony_nc_battery_care_limit_store()
2006 cmd = 0x10; in sony_nc_battery_care_limit_store()
2009 cmd = 0x30; in sony_nc_battery_care_limit_store()
2015 * handle 0x0115 should allow storing on battery too; in sony_nc_battery_care_limit_store()
2016 * handle 0x0136 same as 0x0115 + health status; in sony_nc_battery_care_limit_store()
2017 * handle 0x013f, same as 0x0136 but no storing on the battery in sony_nc_battery_care_limit_store()
2019 if (bcare_ctl->handle != 0x013f) in sony_nc_battery_care_limit_store()
2022 cmd = (cmd | 0x1) << 0x10; in sony_nc_battery_care_limit_store()
2025 if (sony_call_snc_handle(bcare_ctl->handle, cmd | 0x0100, &result)) in sony_nc_battery_care_limit_store()
2036 if (sony_call_snc_handle(bcare_ctl->handle, 0x0000, &result)) in sony_nc_battery_care_limit_show()
2039 status = (result & 0x01) ? ((result & 0x30) >> 0x04) : 0; in sony_nc_battery_care_limit_show()
2051 status = 0; in sony_nc_battery_care_limit_show()
2063 if (sony_call_snc_handle(bcare_ctl->handle, 0x0200, &health)) in sony_nc_battery_care_health_show()
2066 return sysfs_emit(buffer, "%d\n", health & 0xff); in sony_nc_battery_care_health_show()
2072 int ret = 0; in sony_nc_battery_care_setup()
2080 sysfs_attr_init(&bcare_ctl->attrs[0].attr); in sony_nc_battery_care_setup()
2081 bcare_ctl->attrs[0].attr.name = "battery_care_limiter"; in sony_nc_battery_care_setup()
2082 bcare_ctl->attrs[0].attr.mode = S_IRUGO | S_IWUSR; in sony_nc_battery_care_setup()
2083 bcare_ctl->attrs[0].show = sony_nc_battery_care_limit_show; in sony_nc_battery_care_setup()
2084 bcare_ctl->attrs[0].store = sony_nc_battery_care_limit_store; in sony_nc_battery_care_setup()
2086 ret = device_create_file(&pd->dev, &bcare_ctl->attrs[0]); in sony_nc_battery_care_setup()
2090 /* 0x0115 is for models with no health reporting capability */ in sony_nc_battery_care_setup()
2091 if (handle == 0x0115) in sony_nc_battery_care_setup()
2092 return 0; in sony_nc_battery_care_setup()
2103 return 0; in sony_nc_battery_care_setup()
2106 device_remove_file(&pd->dev, &bcare_ctl->attrs[0]); in sony_nc_battery_care_setup()
2118 device_remove_file(&pd->dev, &bcare_ctl->attrs[0]); in sony_nc_battery_care_cleanup()
2119 if (bcare_ctl->handle != 0x0115) in sony_nc_battery_care_cleanup()
2155 if (sony_call_snc_handle(0x0122, mode << 0x10 | 0x0200, &result)) in sony_nc_thermal_mode_set()
2160 return 0; in sony_nc_thermal_mode_set()
2167 if (sony_call_snc_handle(0x0122, 0x0100, &result)) in sony_nc_thermal_mode_get()
2170 return result & 0xff; in sony_nc_thermal_mode_get()
2177 size_t idx = 0; in sony_nc_thermal_profiles_show()
2179 for (cnt = 0; cnt < THM_PROFILE_MAX; cnt++) { in sony_nc_thermal_profiles_show()
2195 if (count == 0) in sony_nc_thermal_mode_store()
2202 for (cmd = 0; cmd < THM_PROFILE_MAX; cmd++) in sony_nc_thermal_mode_store()
2203 if (strncmp(buffer, snc_thermal_profiles[cmd], len) == 0) in sony_nc_thermal_mode_store()
2217 if (mode < 0) in sony_nc_thermal_mode_show()
2225 int ret = 0; in sony_nc_thermal_setup()
2230 ret = sony_call_snc_handle(0x0122, 0x0000, &th_handle->profiles); in sony_nc_thermal_setup()
2237 if (ret < 0) { in sony_nc_thermal_setup()
2262 return 0; in sony_nc_thermal_setup()
2298 #define LID_RESUME_S5 0
2326 * 2 1 0 in sony_nc_lid_resume_store()
2341 if (sony_call_snc_handle(lid_ctl->handle, value << 0x10 | 0x0100, in sony_nc_lid_resume_store()
2359 (lid_ctl->status >> pos) & 0x01); in sony_nc_lid_resume_show()
2371 if (sony_call_snc_handle(handle, 0x0000, &result)) in sony_nc_lid_resume_setup()
2378 lid_ctl->status = result & 0x7; in sony_nc_lid_resume_setup()
2381 sysfs_attr_init(&lid_ctl->attrs[0].attr); in sony_nc_lid_resume_setup()
2387 if (handle == 0x0119) { in sony_nc_lid_resume_setup()
2400 for (i = 0; i < LID_RESUME_MAX && in sony_nc_lid_resume_setup()
2407 return 0; in sony_nc_lid_resume_setup()
2410 for (i--; i >= 0; i--) in sony_nc_lid_resume_setup()
2424 for (i = 0; i < LID_RESUME_MAX; i++) { in sony_nc_lid_resume_cleanup()
2448 /* returns 0 for speed, 1 for stamina */
2454 gfxs_ctl->handle == 0x015B ? 0x0000 : 0x0100, in __sony_nc_gfx_switch_status_get()
2459 case 0x0146: in __sony_nc_gfx_switch_status_get()
2461 * 0: integrated GFX (stamina) in __sony_nc_gfx_switch_status_get()
2463 return result & 0x1 ? SPEED : STAMINA; in __sony_nc_gfx_switch_status_get()
2464 case 0x015B: in __sony_nc_gfx_switch_status_get()
2465 /* 0: discrete GFX (speed) in __sony_nc_gfx_switch_status_get()
2468 return result & 0x1 ? STAMINA : SPEED; in __sony_nc_gfx_switch_status_get()
2469 case 0x0128: in __sony_nc_gfx_switch_status_get()
2472 * 0: discrete GFX (speed) in __sony_nc_gfx_switch_status_get()
2474 dprintk("GFX Status: 0x%x\n", result); in __sony_nc_gfx_switch_status_get()
2475 return result & 0x80 ? AUTO : in __sony_nc_gfx_switch_status_get()
2476 result & 0x02 ? STAMINA : SPEED; in __sony_nc_gfx_switch_status_get()
2487 if (pos < 0) in sony_nc_gfx_switch_status_show()
2516 return 0; in sony_nc_gfx_switch_setup()
2551 if (sony_call_snc_handle(0x0131, value << 0x10 | 0x0200, &result)) in sony_nc_highspeed_charging_store()
2562 if (sony_call_snc_handle(0x0131, 0x0100, &result)) in sony_nc_highspeed_charging_show()
2565 return sysfs_emit(buffer, "%d\n", result & 0x01); in sony_nc_highspeed_charging_show()
2572 if (sony_call_snc_handle(0x0131, 0x0000, &result) || !(result & 0x01)) { in sony_nc_highspeed_charging_setup()
2577 return 0; in sony_nc_highspeed_charging_setup()
2597 return 0; in sony_nc_highspeed_charging_setup()
2625 if (sony_call_snc_handle(0x0121, value << 8, &result)) in sony_nc_lowbatt_store()
2636 if (sony_call_snc_handle(0x0121, 0x0200, &result)) in sony_nc_lowbatt_show()
2663 return 0; in sony_nc_lowbatt_setup()
2691 if (sony_call_snc_handle(0x0149, value << 0x10 | 0x0200, &result)) in sony_nc_hsfan_store()
2702 if (sony_call_snc_handle(0x0149, 0x0100, &result)) in sony_nc_hsfan_show()
2705 return sysfs_emit(buffer, "%d\n", result & 0x01); in sony_nc_hsfan_show()
2713 if (sony_call_snc_handle(0x0149, 0x0300, &result)) in sony_nc_fanspeed_show()
2716 return sysfs_emit(buffer, "%d\n", result & 0xff); in sony_nc_fanspeed_show()
2753 return 0; in sony_nc_fanspeed_setup()
2798 if (sony_call_snc_handle(0x0155, value << 0x10 | 0x0100, &result)) in sony_nc_usb_charge_store()
2809 if (sony_call_snc_handle(0x0155, 0x0000, &result)) in sony_nc_usb_charge_show()
2812 return sysfs_emit(buffer, "%d\n", result & 0x01); in sony_nc_usb_charge_show()
2819 if (sony_call_snc_handle(0x0155, 0x0000, &result) || !(result & 0x01)) { in sony_nc_usb_charge_setup()
2824 return 0; in sony_nc_usb_charge_setup()
2844 return 0; in sony_nc_usb_charge_setup()
2864 if (sony_call_snc_handle(0x011D, 0x0000, &result)) in sony_nc_panelid_show()
2891 return 0; in sony_nc_panelid_setup()
2919 if (sony_call_snc_handle(0x0168, value << 0x10, &result)) in sony_nc_smart_conn_store()
2946 return 0; in sony_nc_smart_conn_setup()
2977 /* sysfs: 0 disabled, 1 enabled in sony_nc_touchpad_store()
2978 * EC: 0 enabled, 1 disabled in sony_nc_touchpad_store()
2981 (!value << 0x10) | 0x100, &result)) in sony_nc_touchpad_store()
2992 if (sony_call_snc_handle(tp_ctl->handle, 0x000, &result)) in sony_nc_touchpad_show()
2995 return sysfs_emit(buffer, "%d\n", !(result & 0x01)); in sony_nc_touchpad_show()
3001 int ret = 0; in sony_nc_touchpad_setup()
3038 int lvl_table_len = 0; in sony_nc_backlight_ng_read_limits()
3039 u8 min = 0xff, max = 0x00; in sony_nc_backlight_ng_read_limits()
3040 unsigned char buffer[32] = { 0 }; in sony_nc_backlight_ng_read_limits()
3043 props->offset = 0; in sony_nc_backlight_ng_read_limits()
3044 props->maxlvl = 0xff; in sony_nc_backlight_ng_read_limits()
3053 if (i < 0) in sony_nc_backlight_ng_read_limits()
3057 case 0x012f: in sony_nc_backlight_ng_read_limits()
3058 case 0x0137: in sony_nc_backlight_ng_read_limits()
3061 case 0x143: in sony_nc_backlight_ng_read_limits()
3062 case 0x14b: in sony_nc_backlight_ng_read_limits()
3063 case 0x14c: in sony_nc_backlight_ng_read_limits()
3069 * from position 0 to 8 in the array, other values are used by ALS in sony_nc_backlight_ng_read_limits()
3072 for (i = 0; i < lvl_table_len && i < ARRAY_SIZE(buffer); i++) { in sony_nc_backlight_ng_read_limits()
3092 int max_brightness = 0; in sony_nc_backlight_setup()
3096 if (sony_find_snc_handle(0x12f) >= 0) { in sony_nc_backlight_setup()
3098 sony_bl_props.cmd_base = 0x0100; in sony_nc_backlight_setup()
3099 sony_nc_backlight_ng_read_limits(0x12f, &sony_bl_props); in sony_nc_backlight_setup()
3102 } else if (sony_find_snc_handle(0x137) >= 0) { in sony_nc_backlight_setup()
3104 sony_bl_props.cmd_base = 0x0100; in sony_nc_backlight_setup()
3105 sony_nc_backlight_ng_read_limits(0x137, &sony_bl_props); in sony_nc_backlight_setup()
3108 } else if (sony_find_snc_handle(0x143) >= 0) { in sony_nc_backlight_setup()
3110 sony_bl_props.cmd_base = 0x3000; in sony_nc_backlight_setup()
3111 sony_nc_backlight_ng_read_limits(0x143, &sony_bl_props); in sony_nc_backlight_setup()
3114 } else if (sony_find_snc_handle(0x14b) >= 0) { in sony_nc_backlight_setup()
3116 sony_bl_props.cmd_base = 0x3000; in sony_nc_backlight_setup()
3117 sony_nc_backlight_ng_read_limits(0x14b, &sony_bl_props); in sony_nc_backlight_setup()
3120 } else if (sony_find_snc_handle(0x14c) >= 0) { in sony_nc_backlight_setup()
3122 sony_bl_props.cmd_base = 0x3000; in sony_nc_backlight_setup()
3123 sony_nc_backlight_ng_read_limits(0x14c, &sony_bl_props); in sony_nc_backlight_setup()
3133 memset(&props, 0, sizeof(struct backlight_properties)); in sony_nc_backlight_setup()
3156 int result = 0; in sony_nc_add()
3239 if (item->devattr.attr.mode != 0) { in sony_nc_add()
3249 return 0; in sony_nc_add()
3290 {SONY_NC_HID, 0},
3291 {SONY_PIC_HID, 0},
3292 {"", 0},
3297 {SONY_NC_HID, 0},
3298 {"", 0},
3315 #define SONYPI_DEVICE_TYPE1 0x00000001
3316 #define SONYPI_DEVICE_TYPE2 0x00000002
3317 #define SONYPI_DEVICE_TYPE3 0x00000004
3319 #define SONYPI_TYPE1_OFFSET 0x04
3320 #define SONYPI_TYPE2_OFFSET 0x12
3321 #define SONYPI_TYPE3_OFFSET 0x12
3364 #define SONYPI_JOGGER_MASK 0x00000001
3365 #define SONYPI_CAPTURE_MASK 0x00000002
3366 #define SONYPI_FNKEY_MASK 0x00000004
3367 #define SONYPI_BLUETOOTH_MASK 0x00000008
3368 #define SONYPI_PKEY_MASK 0x00000010
3369 #define SONYPI_BACK_MASK 0x00000020
3370 #define SONYPI_HELP_MASK 0x00000040
3371 #define SONYPI_LID_MASK 0x00000080
3372 #define SONYPI_ZOOM_MASK 0x00000100
3373 #define SONYPI_THUMBPHRASE_MASK 0x00000200
3374 #define SONYPI_MEYE_MASK 0x00000400
3375 #define SONYPI_MEMORYSTICK_MASK 0x00000800
3376 #define SONYPI_BATTERY_MASK 0x00001000
3377 #define SONYPI_WIRELESS_MASK 0x00002000
3386 { 0x00, SONYPI_EVENT_ANYBUTTON_RELEASED },
3387 { 0, 0 }
3392 { 0x1f, SONYPI_EVENT_JOGDIAL_UP },
3393 { 0x01, SONYPI_EVENT_JOGDIAL_DOWN },
3394 { 0x5f, SONYPI_EVENT_JOGDIAL_UP_PRESSED },
3395 { 0x41, SONYPI_EVENT_JOGDIAL_DOWN_PRESSED },
3396 { 0x1e, SONYPI_EVENT_JOGDIAL_FAST_UP },
3397 { 0x02, SONYPI_EVENT_JOGDIAL_FAST_DOWN },
3398 { 0x5e, SONYPI_EVENT_JOGDIAL_FAST_UP_PRESSED },
3399 { 0x42, SONYPI_EVENT_JOGDIAL_FAST_DOWN_PRESSED },
3400 { 0x1d, SONYPI_EVENT_JOGDIAL_VFAST_UP },
3401 { 0x03, SONYPI_EVENT_JOGDIAL_VFAST_DOWN },
3402 { 0x5d, SONYPI_EVENT_JOGDIAL_VFAST_UP_PRESSED },
3403 { 0x43, SONYPI_EVENT_JOGDIAL_VFAST_DOWN_PRESSED },
3404 { 0x40, SONYPI_EVENT_JOGDIAL_PRESSED },
3405 { 0, 0 }
3410 { 0x05, SONYPI_EVENT_CAPTURE_PARTIALPRESSED },
3411 { 0x07, SONYPI_EVENT_CAPTURE_PRESSED },
3412 { 0x40, SONYPI_EVENT_CAPTURE_PRESSED },
3413 { 0x01, SONYPI_EVENT_CAPTURE_PARTIALRELEASED },
3414 { 0, 0 }
3419 { 0x10, SONYPI_EVENT_FNKEY_ESC },
3420 { 0x11, SONYPI_EVENT_FNKEY_F1 },
3421 { 0x12, SONYPI_EVENT_FNKEY_F2 },
3422 { 0x13, SONYPI_EVENT_FNKEY_F3 },
3423 { 0x14, SONYPI_EVENT_FNKEY_F4 },
3424 { 0x15, SONYPI_EVENT_FNKEY_F5 },
3425 { 0x16, SONYPI_EVENT_FNKEY_F6 },
3426 { 0x17, SONYPI_EVENT_FNKEY_F7 },
3427 { 0x18, SONYPI_EVENT_FNKEY_F8 },
3428 { 0x19, SONYPI_EVENT_FNKEY_F9 },
3429 { 0x1a, SONYPI_EVENT_FNKEY_F10 },
3430 { 0x1b, SONYPI_EVENT_FNKEY_F11 },
3431 { 0x1c, SONYPI_EVENT_FNKEY_F12 },
3432 { 0x1f, SONYPI_EVENT_FNKEY_RELEASED },
3433 { 0x21, SONYPI_EVENT_FNKEY_1 },
3434 { 0x22, SONYPI_EVENT_FNKEY_2 },
3435 { 0x31, SONYPI_EVENT_FNKEY_D },
3436 { 0x32, SONYPI_EVENT_FNKEY_E },
3437 { 0x33, SONYPI_EVENT_FNKEY_F },
3438 { 0x34, SONYPI_EVENT_FNKEY_S },
3439 { 0x35, SONYPI_EVENT_FNKEY_B },
3440 { 0x36, SONYPI_EVENT_FNKEY_ONLY },
3441 { 0, 0 }
3446 { 0x01, SONYPI_EVENT_PKEY_P1 },
3447 { 0x02, SONYPI_EVENT_PKEY_P2 },
3448 { 0x04, SONYPI_EVENT_PKEY_P3 },
3449 { 0x20, SONYPI_EVENT_PKEY_P1 },
3450 { 0, 0 }
3455 { 0x55, SONYPI_EVENT_BLUETOOTH_PRESSED },
3456 { 0x59, SONYPI_EVENT_BLUETOOTH_ON },
3457 { 0x5a, SONYPI_EVENT_BLUETOOTH_OFF },
3458 { 0, 0 }
3463 { 0x59, SONYPI_EVENT_IGNORE },
3464 { 0x5a, SONYPI_EVENT_IGNORE },
3465 { 0, 0 }
3470 { 0x20, SONYPI_EVENT_BACK_PRESSED },
3471 { 0, 0 }
3476 { 0x3b, SONYPI_EVENT_HELP_PRESSED },
3477 { 0, 0 }
3483 { 0x51, SONYPI_EVENT_LID_CLOSED },
3484 { 0x50, SONYPI_EVENT_LID_OPENED },
3485 { 0, 0 }
3490 { 0x39, SONYPI_EVENT_ZOOM_PRESSED },
3491 { 0x10, SONYPI_EVENT_ZOOM_IN_PRESSED },
3492 { 0x20, SONYPI_EVENT_ZOOM_OUT_PRESSED },
3493 { 0x04, SONYPI_EVENT_ZOOM_PRESSED },
3494 { 0, 0 }
3499 { 0x3a, SONYPI_EVENT_THUMBPHRASE_PRESSED },
3500 { 0, 0 }
3505 { 0x00, SONYPI_EVENT_MEYE_FACE },
3506 { 0x01, SONYPI_EVENT_MEYE_OPPOSITE },
3507 { 0, 0 }
3512 { 0x53, SONYPI_EVENT_MEMORYSTICK_INSERT },
3513 { 0x54, SONYPI_EVENT_MEMORYSTICK_EJECT },
3514 { 0, 0 }
3519 { 0x20, SONYPI_EVENT_BATTERY_INSERT },
3520 { 0x30, SONYPI_EVENT_BATTERY_REMOVE },
3521 { 0, 0 }
3526 { 0x01, SONYPI_EVENT_VOLUME_INC_PRESSED },
3527 { 0x02, SONYPI_EVENT_VOLUME_DEC_PRESSED },
3528 { 0, 0 }
3533 { 0x80, SONYPI_EVENT_BRIGHTNESS_PRESSED },
3534 { 0, 0 }
3538 { 0, 0xffffffff, sonypi_releaseev },
3539 { 0x70, SONYPI_MEYE_MASK, sonypi_meyeev },
3540 { 0x30, SONYPI_LID_MASK, sonypi_lidev },
3541 { 0x60, SONYPI_CAPTURE_MASK, sonypi_captureev },
3542 { 0x10, SONYPI_JOGGER_MASK, sonypi_joggerev },
3543 { 0x20, SONYPI_FNKEY_MASK, sonypi_fnkeyev },
3544 { 0x30, SONYPI_BLUETOOTH_MASK, sonypi_blueev },
3545 { 0x40, SONYPI_PKEY_MASK, sonypi_pkeyev },
3546 { 0x30, SONYPI_MEMORYSTICK_MASK, sonypi_memorystickev },
3547 { 0x40, SONYPI_BATTERY_MASK, sonypi_batteryev },
3548 { 0 },
3551 { 0, 0xffffffff, sonypi_releaseev },
3552 { 0x38, SONYPI_LID_MASK, sonypi_lidev },
3553 { 0x11, SONYPI_JOGGER_MASK, sonypi_joggerev },
3554 { 0x61, SONYPI_CAPTURE_MASK, sonypi_captureev },
3555 { 0x21, SONYPI_FNKEY_MASK, sonypi_fnkeyev },
3556 { 0x31, SONYPI_BLUETOOTH_MASK, sonypi_blueev },
3557 { 0x08, SONYPI_PKEY_MASK, sonypi_pkeyev },
3558 { 0x11, SONYPI_BACK_MASK, sonypi_backev },
3559 { 0x21, SONYPI_HELP_MASK, sonypi_helpev },
3560 { 0x21, SONYPI_ZOOM_MASK, sonypi_zoomev },
3561 { 0x20, SONYPI_THUMBPHRASE_MASK, sonypi_thumbphraseev },
3562 { 0x31, SONYPI_MEMORYSTICK_MASK, sonypi_memorystickev },
3563 { 0x41, SONYPI_BATTERY_MASK, sonypi_batteryev },
3564 { 0x31, SONYPI_PKEY_MASK, sonypi_pkeyev },
3565 { 0 },
3568 { 0, 0xffffffff, sonypi_releaseev },
3569 { 0x21, SONYPI_FNKEY_MASK, sonypi_fnkeyev },
3570 { 0x31, SONYPI_WIRELESS_MASK, sonypi_wlessev },
3571 { 0x31, SONYPI_MEMORYSTICK_MASK, sonypi_memorystickev },
3572 { 0x41, SONYPI_BATTERY_MASK, sonypi_batteryev },
3573 { 0x31, SONYPI_PKEY_MASK, sonypi_pkeyev },
3574 { 0x05, SONYPI_PKEY_MASK, sonypi_pkeyev },
3575 { 0x05, SONYPI_ZOOM_MASK, sonypi_zoomev },
3576 { 0x05, SONYPI_CAPTURE_MASK, sonypi_captureev },
3577 { 0x05, SONYPI_PKEY_MASK, sonypi_volumeev },
3578 { 0x05, SONYPI_PKEY_MASK, sonypi_brightnessev },
3579 { 0 },
3603 dprintk("sony_pic_call1(0x%.2x): 0x%.4x\n", dev, (v2 << 8) | v1); in sony_pic_call1()
3618 dprintk("sony_pic_call2(0x%.2x - 0x%.2x): 0x%.4x\n", dev, fn, v1); in sony_pic_call2()
3633 dprintk("sony_pic_call3(0x%.2x - 0x%.2x - 0x%.2x): 0x%.4x\n", in sony_pic_call3()
3644 * 0x31 could mean we have to take some extra action and wait for in type3_handle_irq()
3647 * - 0x5c and 0x5f requires 0xA0 in type3_handle_irq()
3648 * - 0x61 requires 0xB3 in type3_handle_irq()
3650 if (data_mask == 0x31) { in type3_handle_irq()
3651 if (ev == 0x5c || ev == 0x5f) in type3_handle_irq()
3652 sony_pic_call1(0xA0); in type3_handle_irq()
3653 else if (ev == 0x61) in type3_handle_irq()
3654 sony_pic_call1(0xB3); in type3_handle_irq()
3655 return 0; in type3_handle_irq()
3727 #define SONYPI_CAMERA_CONTROL 0x10
3729 #define SONYPI_CAMERA_BRIGHTNESS 0
3735 #define SONYPI_CAMERA_EXPOSURE_MASK 0xC
3736 #define SONYPI_CAMERA_WHITE_BALANCE_MASK 0x3
3737 #define SONYPI_CAMERA_PICTURE_MODE_MASK 0x30
3738 #define SONYPI_CAMERA_MUTE_MASK 0x40
3740 /* the rest don't need a loop until not 0xff */
3742 #define SONYPI_CAMERA_AGC_MASK 0x30
3743 #define SONYPI_CAMERA_SHUTTER_MASK 0x7
3746 #define SONYPI_CAMERA_CONTROL 0x10
3749 #define SONYPI_CAMERA_STATUS_READY 0x2
3750 #define SONYPI_CAMERA_STATUS_POSITION 0x4
3752 #define SONYPI_DIRECTION_BACKWARDS 0x4
3761 v = sony_pic_call2(0x8f, SONYPI_CAMERA_STATUS); in __sony_pic_camera_ready()
3762 return (v != 0xff && (v & SONYPI_CAMERA_STATUS_READY)); in __sony_pic_camera_ready()
3772 wait_on_command(sony_pic_call3(0x90, SONYPI_CAMERA_PICTURE, in __sony_pic_camera_off()
3777 sony_pic_call2(0x91, 0); in __sony_pic_camera_off()
3778 spic_dev.camera_power = 0; in __sony_pic_camera_off()
3780 return 0; in __sony_pic_camera_off()
3793 return 0; in __sony_pic_camera_on()
3795 for (j = 5; j > 0; j--) { in __sony_pic_camera_on()
3797 for (x = 0; x < 100 && sony_pic_call2(0x91, 0x1); x++) in __sony_pic_camera_on()
3799 sony_pic_call1(0x93); in __sony_pic_camera_on()
3801 for (i = 400; i > 0; i--) { in __sony_pic_camera_on()
3810 if (j == 0) { in __sony_pic_camera_on()
3815 wait_on_command(sony_pic_call3(0x90, SONYPI_CAMERA_CONTROL, in __sony_pic_camera_on()
3816 0x5a), in __sony_pic_camera_on()
3820 return 0; in __sony_pic_camera_on()
3839 wait_on_command(sony_pic_call3(0x90, SONYPI_CAMERA_BRIGHTNESS, value), in sony_pic_camera_command()
3843 wait_on_command(sony_pic_call3(0x90, SONYPI_CAMERA_CONTRAST, value), in sony_pic_camera_command()
3847 wait_on_command(sony_pic_call3(0x90, SONYPI_CAMERA_HUE, value), in sony_pic_camera_command()
3851 wait_on_command(sony_pic_call3(0x90, SONYPI_CAMERA_COLOR, value), in sony_pic_camera_command()
3855 wait_on_command(sony_pic_call3(0x90, SONYPI_CAMERA_SHARPNESS, value), in sony_pic_camera_command()
3859 wait_on_command(sony_pic_call3(0x90, SONYPI_CAMERA_PICTURE, value), in sony_pic_camera_command()
3863 wait_on_command(sony_pic_call3(0x90, SONYPI_CAMERA_AGC, value), in sony_pic_camera_command()
3871 return 0; in sony_pic_camera_command()
3881 sony_pic_call2(0xB0, state); in __sony_pic_set_wwanpower()
3882 sony_pic_call1(0x82); in __sony_pic_set_wwanpower()
3920 sony_pic_call2(0x96, state); in __sony_pic_set_bluetoothpower()
3921 sony_pic_call1(0x82); in __sony_pic_set_bluetoothpower()
3946 ssize_t count = 0; in sony_pic_bluetoothpower_show()
3955 #define SONY_PIC_FAN0_STATUS 0x93
3986 u8 value = 0; in sony_pic_fanspeed_show()
4017 #define SONYPI_BAT_FLAGS 0x81
4018 #define SONYPI_LCD_LIGHT 0x96
4019 #define SONYPI_BAT1_PCTRM 0xa0
4020 #define SONYPI_BAT1_LEFT 0xa2
4021 #define SONYPI_BAT1_MAXRT 0xa4
4022 #define SONYPI_BAT2_PCTRM 0xa8
4023 #define SONYPI_BAT2_LEFT 0xaa
4024 #define SONYPI_BAT2_MAXRT 0xac
4025 #define SONYPI_BAT1_MAXTK 0xb0
4026 #define SONYPI_BAT1_FULL 0xb2
4027 #define SONYPI_BAT2_MAXTK 0xb8
4028 #define SONYPI_BAT2_FULL 0xba
4029 #define SONYPI_TEMP_STATUS 0xC1
4039 .open_count = ATOMIC_INIT(0),
4050 return 0; in sonypi_misc_release()
4065 return 0; in sonypi_misc_open()
4074 if ((kfifo_len(&sonypi_compat.fifo) == 0) && in sonypi_misc_read()
4079 kfifo_len(&sonypi_compat.fifo) != 0); in sonypi_misc_read()
4091 if (ret > 0) { in sonypi_misc_read()
4104 return 0; in sonypi_misc_poll()
4115 return 0; in ec_read16()
4121 int ret = 0; in sonypi_misc_ioctl()
4139 val8 = ((value & 0xff) - 1) << 5; in sonypi_misc_ioctl()
4199 val8 &= 0x07; in sonypi_misc_ioctl()
4298 return 0; in sonypi_compat_init()
4311 static int sonypi_compat_init(void) { return 0; } in sonypi_compat_init()
4353 for (i = 0; i < p->interrupt_count; i++) { in sony_pic_read_possible_resource()
4369 interrupt->irq.interrupts[0] = p->interrupts[i]; in sony_pic_read_possible_resource()
4380 dprintk("IO1 at 0x%.4x (0x%.2x)\n", ioport->io1.minimum, in sony_pic_read_possible_resource()
4385 dprintk("IO2 at 0x%.4x (0x%.2x)\n", ioport->io2.minimum, in sony_pic_read_possible_resource()
4408 int result = 0; in sony_pic_possible_resources()
4454 return 0; in sony_pic_disable()
4467 int result = 0; in sony_pic_enable()
4485 struct acpi_buffer buffer = { 0, NULL }; in sony_pic_enable()
4555 sony_pic_call1(0x82); in sony_pic_enable()
4556 sony_pic_call2(0x81, 0xff); in sony_pic_enable()
4557 sony_pic_call1(compat ? 0x92 : 0x82); in sony_pic_enable()
4572 u8 ev = 0; in sony_pic_irq()
4573 u8 data_mask = 0; in sony_pic_irq()
4574 u8 device_event = 0; in sony_pic_irq()
4585 dprintk("event ([%.2x] [%.2x]) at port 0x%.4x(+0x%.2x)\n", in sony_pic_irq()
4589 if (ev == 0x00 || ev == 0xff) in sony_pic_irq()
4592 for (i = 0; dev->event_types[i].mask; i++) { in sony_pic_irq()
4601 for (j = 0; dev->event_types[i].events[j].event; j++) { in sony_pic_irq()
4615 if (dev->handle_irq && dev->handle_irq(data_mask, ev) == 0) in sony_pic_irq()
4618 dprintk("unknown event ([%.2x] [%.2x]) at port 0x%.4x(+0x%.2x)\n", in sony_pic_irq()
4644 free_irq(spic_dev.cur_irq->irq.interrupts[0], &spic_dev); in sony_pic_remove()
4706 dprintk("I/O port1: 0x%.4x (0x%.4x) + 0x%.2x\n", in sony_pic_add()
4714 dprintk("I/O port2: 0x%.4x (0x%.4x) + 0x%.2x\n", in sony_pic_add()
4722 "0x%.4x (0x%.4x) + 0x%.2x\n", in sony_pic_add()
4743 if (!request_irq(irq->irq.interrupts[0], sony_pic_irq, in sony_pic_add()
4744 0, "sony-laptop", &spic_dev)) { in sony_pic_add()
4747 irq->irq.interrupts[0], in sony_pic_add()
4779 return 0; in sony_pic_add()
4788 free_irq(spic_dev.cur_irq->irq.interrupts[0], &spic_dev); in sony_pic_add()
4823 return 0; in sony_pic_suspend()
4830 return 0; in sony_pic_resume()
4837 {SONY_PIC_HID, 0},
4838 {"", 0},
4889 return 0; in sony_laptop_init()