Lines Matching +full:0 +full:x10a0
54 module_param(minor, int, 0);
58 static int verbose; /* = 0 */
60 MODULE_PARM_DESC(verbose, "be verbose, default is 0 (no)");
62 static int fnkeyinit; /* = 0 */
67 static int camera; /* = 0 */
72 static int compat; /* = 0 */
77 static unsigned long mask = 0xffffffff;
90 "set this to 0 if you think the automatic ioport check for sony-laptop is wrong");
97 #define SONYPI_IRQ_PORT 0x8034
99 #define SONYPI_TYPE1_BASE 0x50
100 #define SONYPI_G10A (SONYPI_TYPE1_BASE+0x14)
101 #define SONYPI_TYPE1_REGION_SIZE 0x08
102 #define SONYPI_TYPE1_EVTYPE_OFFSET 0x04
105 #define SONYPI_SIRQ 0x9b
106 #define SONYPI_SLOB 0x9c
107 #define SONYPI_SHIB 0x9d
108 #define SONYPI_TYPE2_REGION_SIZE 0x20
109 #define SONYPI_TYPE2_EVTYPE_OFFSET 0x12
112 #define SONYPI_TYPE3_BASE 0x40
113 #define SONYPI_TYPE3_GID2 (SONYPI_TYPE3_BASE+0x48) /* 16 bits */
114 #define SONYPI_TYPE3_MISC (SONYPI_TYPE3_BASE+0x6d) /* 8 bits */
115 #define SONYPI_TYPE3_REGION_SIZE 0x20
116 #define SONYPI_TYPE3_EVTYPE_OFFSET 0x12
119 #define SONYPI_BAT_FLAGS 0x81
120 #define SONYPI_LCD_LIGHT 0x96
121 #define SONYPI_BAT1_PCTRM 0xa0
122 #define SONYPI_BAT1_LEFT 0xa2
123 #define SONYPI_BAT1_MAXRT 0xa4
124 #define SONYPI_BAT2_PCTRM 0xa8
125 #define SONYPI_BAT2_LEFT 0xaa
126 #define SONYPI_BAT2_MAXRT 0xac
127 #define SONYPI_BAT1_MAXTK 0xb0
128 #define SONYPI_BAT1_FULL 0xb2
129 #define SONYPI_BAT2_MAXTK 0xb8
130 #define SONYPI_BAT2_FULL 0xba
133 #define SONYPI_FAN0_STATUS 0x93
134 #define SONYPI_TEMP_STATUS 0xC1
137 #define SONYPI_DATA_IOPORT 0x62
138 #define SONYPI_CST_IOPORT 0x66
147 { 0x10c0, 0x10c4 }, /* looks like the default on C1Vx */
148 { 0x1080, 0x1084 },
149 { 0x1090, 0x1094 },
150 { 0x10a0, 0x10a4 },
151 { 0x10b0, 0x10b4 },
152 { 0x0, 0x0 }
156 { 0x1080, 0x1084 },
157 { 0x10a0, 0x10a4 },
158 { 0x10c0, 0x10c4 },
159 { 0x10e0, 0x10e4 },
160 { 0x0, 0x0 }
174 { 11, 0x2 }, /* IRQ 11, GO22=0,GO23=1 in AML */
175 { 10, 0x1 }, /* IRQ 10, GO22=1,GO23=0 in AML */
176 { 5, 0x0 }, /* IRQ 5, GO22=0,GO23=0 in AML */
177 { 0, 0x3 } /* no IRQ, GO22=1,GO23=1 in AML */
181 { 11, 0x80 }, /* IRQ 11, 0x80 in SIRQ in AML */
182 { 10, 0x40 }, /* IRQ 10, 0x40 in SIRQ in AML */
183 { 9, 0x20 }, /* IRQ 9, 0x20 in SIRQ in AML */
184 { 6, 0x10 }, /* IRQ 6, 0x10 in SIRQ in AML */
185 { 0, 0x00 } /* no IRQ, 0x00 in SIRQ in AML */
191 #define SONYPI_CAMERA_BRIGHTNESS 0
198 #define SONYPI_CAMERA_EXPOSURE_MASK 0xC
199 #define SONYPI_CAMERA_WHITE_BALANCE_MASK 0x3
200 #define SONYPI_CAMERA_PICTURE_MODE_MASK 0x30
201 #define SONYPI_CAMERA_MUTE_MASK 0x40
203 /* the rest don't need a loop until not 0xff */
205 #define SONYPI_CAMERA_AGC_MASK 0x30
206 #define SONYPI_CAMERA_SHUTTER_MASK 0x7
209 #define SONYPI_CAMERA_CONTROL 0x10
212 #define SONYPI_CAMERA_STATUS_READY 0x2
213 #define SONYPI_CAMERA_STATUS_POSITION 0x4
215 #define SONYPI_DIRECTION_BACKWARDS 0x4
221 #define SONYPI_JOGGER_MASK 0x00000001
222 #define SONYPI_CAPTURE_MASK 0x00000002
223 #define SONYPI_FNKEY_MASK 0x00000004
224 #define SONYPI_BLUETOOTH_MASK 0x00000008
225 #define SONYPI_PKEY_MASK 0x00000010
226 #define SONYPI_BACK_MASK 0x00000020
227 #define SONYPI_HELP_MASK 0x00000040
228 #define SONYPI_LID_MASK 0x00000080
229 #define SONYPI_ZOOM_MASK 0x00000100
230 #define SONYPI_THUMBPHRASE_MASK 0x00000200
231 #define SONYPI_MEYE_MASK 0x00000400
232 #define SONYPI_MEMORYSTICK_MASK 0x00000800
233 #define SONYPI_BATTERY_MASK 0x00001000
234 #define SONYPI_WIRELESS_MASK 0x00002000
243 { 0x00, SONYPI_EVENT_ANYBUTTON_RELEASED },
244 { 0, 0 }
249 { 0x1f, SONYPI_EVENT_JOGDIAL_UP },
250 { 0x01, SONYPI_EVENT_JOGDIAL_DOWN },
251 { 0x5f, SONYPI_EVENT_JOGDIAL_UP_PRESSED },
252 { 0x41, SONYPI_EVENT_JOGDIAL_DOWN_PRESSED },
253 { 0x1e, SONYPI_EVENT_JOGDIAL_FAST_UP },
254 { 0x02, SONYPI_EVENT_JOGDIAL_FAST_DOWN },
255 { 0x5e, SONYPI_EVENT_JOGDIAL_FAST_UP_PRESSED },
256 { 0x42, SONYPI_EVENT_JOGDIAL_FAST_DOWN_PRESSED },
257 { 0x1d, SONYPI_EVENT_JOGDIAL_VFAST_UP },
258 { 0x03, SONYPI_EVENT_JOGDIAL_VFAST_DOWN },
259 { 0x5d, SONYPI_EVENT_JOGDIAL_VFAST_UP_PRESSED },
260 { 0x43, SONYPI_EVENT_JOGDIAL_VFAST_DOWN_PRESSED },
261 { 0x40, SONYPI_EVENT_JOGDIAL_PRESSED },
262 { 0, 0 }
267 { 0x05, SONYPI_EVENT_CAPTURE_PARTIALPRESSED },
268 { 0x07, SONYPI_EVENT_CAPTURE_PRESSED },
269 { 0x01, SONYPI_EVENT_CAPTURE_PARTIALRELEASED },
270 { 0, 0 }
275 { 0x10, SONYPI_EVENT_FNKEY_ESC },
276 { 0x11, SONYPI_EVENT_FNKEY_F1 },
277 { 0x12, SONYPI_EVENT_FNKEY_F2 },
278 { 0x13, SONYPI_EVENT_FNKEY_F3 },
279 { 0x14, SONYPI_EVENT_FNKEY_F4 },
280 { 0x15, SONYPI_EVENT_FNKEY_F5 },
281 { 0x16, SONYPI_EVENT_FNKEY_F6 },
282 { 0x17, SONYPI_EVENT_FNKEY_F7 },
283 { 0x18, SONYPI_EVENT_FNKEY_F8 },
284 { 0x19, SONYPI_EVENT_FNKEY_F9 },
285 { 0x1a, SONYPI_EVENT_FNKEY_F10 },
286 { 0x1b, SONYPI_EVENT_FNKEY_F11 },
287 { 0x1c, SONYPI_EVENT_FNKEY_F12 },
288 { 0x1f, SONYPI_EVENT_FNKEY_RELEASED },
289 { 0x21, SONYPI_EVENT_FNKEY_1 },
290 { 0x22, SONYPI_EVENT_FNKEY_2 },
291 { 0x31, SONYPI_EVENT_FNKEY_D },
292 { 0x32, SONYPI_EVENT_FNKEY_E },
293 { 0x33, SONYPI_EVENT_FNKEY_F },
294 { 0x34, SONYPI_EVENT_FNKEY_S },
295 { 0x35, SONYPI_EVENT_FNKEY_B },
296 { 0x36, SONYPI_EVENT_FNKEY_ONLY },
297 { 0, 0 }
302 { 0x01, SONYPI_EVENT_PKEY_P1 },
303 { 0x02, SONYPI_EVENT_PKEY_P2 },
304 { 0x04, SONYPI_EVENT_PKEY_P3 },
305 { 0x5c, SONYPI_EVENT_PKEY_P1 },
306 { 0, 0 }
311 { 0x55, SONYPI_EVENT_BLUETOOTH_PRESSED },
312 { 0x59, SONYPI_EVENT_BLUETOOTH_ON },
313 { 0x5a, SONYPI_EVENT_BLUETOOTH_OFF },
314 { 0, 0 }
319 { 0x59, SONYPI_EVENT_WIRELESS_ON },
320 { 0x5a, SONYPI_EVENT_WIRELESS_OFF },
321 { 0, 0 }
326 { 0x20, SONYPI_EVENT_BACK_PRESSED },
327 { 0, 0 }
332 { 0x3b, SONYPI_EVENT_HELP_PRESSED },
333 { 0, 0 }
339 { 0x51, SONYPI_EVENT_LID_CLOSED },
340 { 0x50, SONYPI_EVENT_LID_OPENED },
341 { 0, 0 }
346 { 0x39, SONYPI_EVENT_ZOOM_PRESSED },
347 { 0, 0 }
352 { 0x3a, SONYPI_EVENT_THUMBPHRASE_PRESSED },
353 { 0, 0 }
358 { 0x00, SONYPI_EVENT_MEYE_FACE },
359 { 0x01, SONYPI_EVENT_MEYE_OPPOSITE },
360 { 0, 0 }
365 { 0x53, SONYPI_EVENT_MEMORYSTICK_INSERT },
366 { 0x54, SONYPI_EVENT_MEMORYSTICK_EJECT },
367 { 0, 0 }
372 { 0x20, SONYPI_EVENT_BATTERY_INSERT },
373 { 0x30, SONYPI_EVENT_BATTERY_REMOVE },
374 { 0, 0 }
383 { SONYPI_DEVICE_MODEL_TYPE1, 0, 0xffffffff, sonypi_releaseev },
384 { SONYPI_DEVICE_MODEL_TYPE1, 0x70, SONYPI_MEYE_MASK, sonypi_meyeev },
385 { SONYPI_DEVICE_MODEL_TYPE1, 0x30, SONYPI_LID_MASK, sonypi_lidev },
386 { SONYPI_DEVICE_MODEL_TYPE1, 0x60, SONYPI_CAPTURE_MASK, sonypi_captureev },
387 { SONYPI_DEVICE_MODEL_TYPE1, 0x10, SONYPI_JOGGER_MASK, sonypi_joggerev },
388 { SONYPI_DEVICE_MODEL_TYPE1, 0x20, SONYPI_FNKEY_MASK, sonypi_fnkeyev },
389 { SONYPI_DEVICE_MODEL_TYPE1, 0x30, SONYPI_BLUETOOTH_MASK, sonypi_blueev },
390 { SONYPI_DEVICE_MODEL_TYPE1, 0x40, SONYPI_PKEY_MASK, sonypi_pkeyev },
391 { SONYPI_DEVICE_MODEL_TYPE1, 0x30, SONYPI_MEMORYSTICK_MASK, sonypi_memorystickev },
392 { SONYPI_DEVICE_MODEL_TYPE1, 0x40, SONYPI_BATTERY_MASK, sonypi_batteryev },
394 { SONYPI_DEVICE_MODEL_TYPE2, 0, 0xffffffff, sonypi_releaseev },
395 { SONYPI_DEVICE_MODEL_TYPE2, 0x38, SONYPI_LID_MASK, sonypi_lidev },
396 { SONYPI_DEVICE_MODEL_TYPE2, 0x11, SONYPI_JOGGER_MASK, sonypi_joggerev },
397 { SONYPI_DEVICE_MODEL_TYPE2, 0x61, SONYPI_CAPTURE_MASK, sonypi_captureev },
398 { SONYPI_DEVICE_MODEL_TYPE2, 0x21, SONYPI_FNKEY_MASK, sonypi_fnkeyev },
399 { SONYPI_DEVICE_MODEL_TYPE2, 0x31, SONYPI_BLUETOOTH_MASK, sonypi_blueev },
400 { SONYPI_DEVICE_MODEL_TYPE2, 0x08, SONYPI_PKEY_MASK, sonypi_pkeyev },
401 { SONYPI_DEVICE_MODEL_TYPE2, 0x11, SONYPI_BACK_MASK, sonypi_backev },
402 { SONYPI_DEVICE_MODEL_TYPE2, 0x21, SONYPI_HELP_MASK, sonypi_helpev },
403 { SONYPI_DEVICE_MODEL_TYPE2, 0x21, SONYPI_ZOOM_MASK, sonypi_zoomev },
404 { SONYPI_DEVICE_MODEL_TYPE2, 0x20, SONYPI_THUMBPHRASE_MASK, sonypi_thumbphraseev },
405 { SONYPI_DEVICE_MODEL_TYPE2, 0x31, SONYPI_MEMORYSTICK_MASK, sonypi_memorystickev },
406 { SONYPI_DEVICE_MODEL_TYPE2, 0x41, SONYPI_BATTERY_MASK, sonypi_batteryev },
407 { SONYPI_DEVICE_MODEL_TYPE2, 0x31, SONYPI_PKEY_MASK, sonypi_pkeyev },
409 { SONYPI_DEVICE_MODEL_TYPE3, 0, 0xffffffff, sonypi_releaseev },
410 { SONYPI_DEVICE_MODEL_TYPE3, 0x21, SONYPI_FNKEY_MASK, sonypi_fnkeyev },
411 { SONYPI_DEVICE_MODEL_TYPE3, 0x31, SONYPI_WIRELESS_MASK, sonypi_wlessev },
412 { SONYPI_DEVICE_MODEL_TYPE3, 0x31, SONYPI_MEMORYSTICK_MASK, sonypi_memorystickev },
413 { SONYPI_DEVICE_MODEL_TYPE3, 0x41, SONYPI_BATTERY_MASK, sonypi_batteryev },
414 { SONYPI_DEVICE_MODEL_TYPE3, 0x31, SONYPI_PKEY_MASK, sonypi_pkeyev },
415 { 0 }
456 { 0, 0 },
502 #define SONYPI_ACPI_ACTIVE 0
517 outb_p(0x81, SONYPI_CST_IOPORT); in sonypi_ec_write()
518 wait_on_command(0, inb_p(SONYPI_CST_IOPORT) & 2, ITERATIONS_LONG); in sonypi_ec_write()
520 wait_on_command(0, inb_p(SONYPI_CST_IOPORT) & 2, ITERATIONS_LONG); in sonypi_ec_write()
522 wait_on_command(0, inb_p(SONYPI_CST_IOPORT) & 2, ITERATIONS_LONG); in sonypi_ec_write()
523 return 0; in sonypi_ec_write()
533 outb_p(0x80, SONYPI_CST_IOPORT); in sonypi_ec_read()
534 wait_on_command(0, inb_p(SONYPI_CST_IOPORT) & 2, ITERATIONS_LONG); in sonypi_ec_read()
536 wait_on_command(0, inb_p(SONYPI_CST_IOPORT) & 2, ITERATIONS_LONG); in sonypi_ec_read()
538 return 0; in sonypi_ec_read()
549 return 0; in ec_read16()
558 v = (v & 0xFFFF0000) | ((u32) sonypi_device.ioport1); in sonypi_type1_srs()
562 v = (v & 0xFFF0FFFF) | in sonypi_type1_srs()
567 v &= ~(((u32) 0x3) << SONYPI_IRQ_SHIFT); in sonypi_type1_srs()
572 v = (v & 0xFF1FFFFF) | 0x00C00000; in sonypi_type1_srs()
578 if (sonypi_ec_write(SONYPI_SHIB, (sonypi_device.ioport1 & 0xFF00) >> 8)) in sonypi_type2_srs()
580 if (sonypi_ec_write(SONYPI_SLOB, sonypi_device.ioport1 & 0x00FF)) in sonypi_type2_srs()
597 v16 = (sonypi_device.ioport1 & 0xFFF0) | 0x01; in sonypi_type3_srs()
600 v8 = (v8 & 0xCF) | 0x10; in sonypi_type3_srs()
610 v = v & 0xFF3FFFFF; in sonypi_type1_dis()
614 v |= (0x3 << SONYPI_IRQ_SHIFT); in sonypi_type1_dis()
620 if (sonypi_ec_write(SONYPI_SHIB, 0)) in sonypi_type2_dis()
622 if (sonypi_ec_write(SONYPI_SLOB, 0)) in sonypi_type2_dis()
624 if (sonypi_ec_write(SONYPI_SIRQ, 0)) in sonypi_type2_dis()
632 pci_write_config_word(sonypi_device.dev, SONYPI_TYPE3_GID2, 0); in sonypi_type3_dis()
639 wait_on_command(0, inb_p(sonypi_device.ioport2) & 2, ITERATIONS_LONG); in sonypi_call1()
650 wait_on_command(0, inb_p(sonypi_device.ioport2) & 2, ITERATIONS_LONG); in sonypi_call2()
652 wait_on_command(0, inb_p(sonypi_device.ioport2) & 2, ITERATIONS_LONG); in sonypi_call2()
662 wait_on_command(0, inb_p(sonypi_device.ioport2) & 2, ITERATIONS_LONG); in sonypi_call3()
664 wait_on_command(0, inb_p(sonypi_device.ioport2) & 2, ITERATIONS_LONG); in sonypi_call3()
666 wait_on_command(0, inb_p(sonypi_device.ioport2) & 2, ITERATIONS_LONG); in sonypi_call3()
672 #if 0
680 v1 = sonypi_call2(0x8f, fn);
681 v2 = sonypi_call2(0x8f, fn);
682 if (v1 == v2 && v1 != 0xff)
685 return 0xff;
692 wait_on_command(0, sonypi_call3(0x90, fn, v), ITERATIONS_SHORT); in sonypi_set()
700 v = sonypi_call2(0x8f, SONYPI_CAMERA_STATUS); in sonypi_camera_ready()
701 return (v != 0xff && (v & SONYPI_CAMERA_STATUS_READY)); in sonypi_camera_ready()
712 sonypi_call2(0x91, 0); in sonypi_camera_off()
713 sonypi_device.camera_power = 0; in sonypi_camera_off()
724 for (j = 5; j > 0; j--) { in sonypi_camera_on()
726 while (sonypi_call2(0x91, 0x1)) in sonypi_camera_on()
728 sonypi_call1(0x93); in sonypi_camera_on()
730 for (i = 400; i > 0; i--) { in sonypi_camera_on()
739 if (j == 0) { in sonypi_camera_on()
744 sonypi_set(0x10, 0x5a); in sonypi_camera_on()
756 sonypi_call2(0x96, state); in sonypi_setbluetoothpower()
757 sonypi_call1(0x82); in sonypi_setbluetoothpower()
769 input_report_key(kp.dev, kp.key, 0); in input_keyrelease()
804 for (i = 0; sonypi_inputkeys[i].sonypiev; i++) in sonypi_report_input_event()
826 u8 v1, v2, event = 0; in sonypi_irq()
832 for (i = 0; sonypi_eventtypes[i].model; i++) { in sonypi_irq()
840 for (j = 0; sonypi_eventtypes[i].events[j].event; j++) { in sonypi_irq()
850 "sonypi: unknown event port1=0x%02x,port2=0x%02x\n", in sonypi_irq()
860 "sonypi: event port1=0x%02x,port2=0x%02x\n", v1, v2); in sonypi_irq()
883 return 0; in sonypi_misc_release()
895 return 0; in sonypi_misc_open()
904 if ((kfifo_len(&sonypi_device.fifo) == 0) && in sonypi_misc_read()
909 kfifo_len(&sonypi_device.fifo) != 0); in sonypi_misc_read()
921 if (ret > 0) { in sonypi_misc_read()
934 return 0; in sonypi_misc_poll()
940 long ret = 0; in sonypi_misc_ioctl()
1000 val8 &= 0x07; in sonypi_misc_ioctl()
1079 sonypi_call1(0x82); in sonypi_enable()
1080 sonypi_call2(0x81, 0xff); in sonypi_enable()
1081 sonypi_call1(compat ? 0x92 : 0x82); in sonypi_enable()
1085 outb(0xf0, 0xb2); in sonypi_enable()
1093 sonypi_call2(0x81, 0); /* make sure we don't get any more events */ in sonypi_disable()
1099 outb(0xf1, 0xb2); in sonypi_disable()
1113 return 0; in sonypi_disable()
1122 return 0; in sonypi_acpi_add()
1131 {"SNY6001", 0},
1132 {"", 0},
1162 jog_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL); in sonypi_create_input_devices()
1164 jog_dev->relbit[0] = BIT_MASK(REL_WHEEL); in sonypi_create_input_devices()
1178 key_dev->evbit[0] = BIT_MASK(EV_KEY); in sonypi_create_input_devices()
1179 for (i = 0; sonypi_inputkeys[i].sonypiev; i++) in sonypi_create_input_devices()
1191 return 0; in sonypi_create_input_devices()
1223 printk(KERN_ERR "sonypi: ioport 0x%.4x busy, using sony-laptop? " in sonypi_setup_ioports()
1224 "if not use check_ioport=0\n", in sonypi_setup_ioports()
1239 return 0; in sonypi_setup_ioports()
1256 return 0; in sonypi_setup_irq()
1268 "compat = %s, mask = 0x%08lx, useinput = %s, acpi = %s\n", in sonypi_display_info()
1277 printk(KERN_INFO "sonypi: enabled at irq=%d, port1=0x%x, port2=0x%x\n", in sonypi_display_info()
1387 sonypi_enable(0); in sonypi_probe()
1389 return 0; in sonypi_probe()
1444 return 0; in sonypi_suspend()
1450 return 0; in sonypi_resume()
1520 if (acpi_bus_register_driver(&sonypi_acpi_driver) >= 0) in sonypi_init()
1524 return 0; in sonypi_init()