H A D | sonypi.c | 478 static struct sonypi_device { struct 500 } sonypi_device; variable in typeref:struct:sonypi_device 571 pci_read_config_dword(sonypi_device.dev, SONYPI_G10A, &v); sonypi_type1_srs() 572 v = (v & 0xFFFF0000) | ((u32) sonypi_device.ioport1); sonypi_type1_srs() 573 pci_write_config_dword(sonypi_device.dev, SONYPI_G10A, v); sonypi_type1_srs() 575 pci_read_config_dword(sonypi_device.dev, SONYPI_G10A, &v); sonypi_type1_srs() 577 (((u32) sonypi_device.ioport1 ^ sonypi_device.ioport2) << 16); sonypi_type1_srs() 578 pci_write_config_dword(sonypi_device.dev, SONYPI_G10A, v); sonypi_type1_srs() 582 v |= (((u32) sonypi_device.bits) << SONYPI_IRQ_SHIFT); sonypi_type1_srs() 585 pci_read_config_dword(sonypi_device.dev, SONYPI_G10A, &v); sonypi_type1_srs() 587 pci_write_config_dword(sonypi_device.dev, SONYPI_G10A, v); sonypi_type1_srs() 592 if (sonypi_ec_write(SONYPI_SHIB, (sonypi_device.ioport1 & 0xFF00) >> 8)) sonypi_type2_srs() 594 if (sonypi_ec_write(SONYPI_SLOB, sonypi_device.ioport1 & 0x00FF)) sonypi_type2_srs() 596 if (sonypi_ec_write(SONYPI_SIRQ, sonypi_device.bits)) sonypi_type2_srs() 611 v16 = (sonypi_device.ioport1 & 0xFFF0) | 0x01; sonypi_type3_srs() 612 pci_write_config_word(sonypi_device.dev, SONYPI_TYPE3_GID2, v16); sonypi_type3_srs() 613 pci_read_config_byte(sonypi_device.dev, SONYPI_TYPE3_MISC, &v8); sonypi_type3_srs() 615 pci_write_config_byte(sonypi_device.dev, SONYPI_TYPE3_MISC, v8); sonypi_type3_srs() 623 pci_read_config_dword(sonypi_device.dev, SONYPI_G10A, &v); sonypi_type1_dis() 625 pci_write_config_dword(sonypi_device.dev, SONYPI_G10A, v); sonypi_type1_dis() 646 pci_write_config_word(sonypi_device.dev, SONYPI_TYPE3_GID2, 0); sonypi_type3_dis() 653 wait_on_command(0, inb_p(sonypi_device.ioport2) & 2, ITERATIONS_LONG); sonypi_call1() 654 outb(dev, sonypi_device.ioport2); sonypi_call1() 655 v1 = inb_p(sonypi_device.ioport2); sonypi_call1() 656 v2 = inb_p(sonypi_device.ioport1); sonypi_call1() 664 wait_on_command(0, inb_p(sonypi_device.ioport2) & 2, ITERATIONS_LONG); sonypi_call2() 665 outb(dev, sonypi_device.ioport2); sonypi_call2() 666 wait_on_command(0, inb_p(sonypi_device.ioport2) & 2, ITERATIONS_LONG); sonypi_call2() 667 outb(fn, sonypi_device.ioport1); sonypi_call2() 668 v1 = inb_p(sonypi_device.ioport1); sonypi_call2() 676 wait_on_command(0, inb_p(sonypi_device.ioport2) & 2, ITERATIONS_LONG); sonypi_call3() 677 outb(dev, sonypi_device.ioport2); sonypi_call3() 678 wait_on_command(0, inb_p(sonypi_device.ioport2) & 2, ITERATIONS_LONG); sonypi_call3() 679 outb(fn, sonypi_device.ioport1); sonypi_call3() 680 wait_on_command(0, inb_p(sonypi_device.ioport2) & 2, ITERATIONS_LONG); sonypi_call3() 681 outb(v, sonypi_device.ioport1); sonypi_call3() 682 v1 = inb_p(sonypi_device.ioport1); sonypi_call3() 723 if (!sonypi_device.camera_power) sonypi_camera_off() 727 sonypi_device.camera_power = 0; sonypi_camera_off() 735 if (sonypi_device.camera_power) sonypi_camera_on() 759 sonypi_device.camera_power = 1; sonypi_camera_on() 767 if (sonypi_device.bluetooth_power == state) sonypi_setbluetoothpower() 772 sonypi_device.bluetooth_power = state; sonypi_setbluetoothpower() 779 while (kfifo_out_locked(&sonypi_device.input_fifo, (unsigned char *)&kp, input_keyrelease() 780 sizeof(kp), &sonypi_device.input_fifo_lock) input_keyrelease() 790 struct input_dev *jog_dev = sonypi_device.input_jog_dev; sonypi_report_input_event() 791 struct input_dev *key_dev = sonypi_device.input_key_dev; sonypi_report_input_event() 830 kfifo_in_locked(&sonypi_device.input_fifo, sonypi_report_input_event() 832 &sonypi_device.input_fifo_lock); sonypi_report_input_event() 833 schedule_work(&sonypi_device.input_work); sonypi_report_input_event() 843 v1 = inb_p(sonypi_device.ioport1); sonypi_irq() 844 v2 = inb_p(sonypi_device.ioport1 + sonypi_device.evtype_offset); sonypi_irq() 847 if (sonypi_device.model != sonypi_eventtypes[i].model) sonypi_irq() 879 kfifo_in_locked(&sonypi_device.fifo, (unsigned char *)&event, sonypi_irq() 880 sizeof(event), &sonypi_device.fifo_lock); sonypi_irq() 881 kill_fasync(&sonypi_device.fifo_async, SIGIO, POLL_IN); sonypi_irq() 882 wake_up_interruptible(&sonypi_device.fifo_proc_list); sonypi_irq() 889 return fasync_helper(fd, filp, on, &sonypi_device.fifo_async); sonypi_misc_fasync() 894 mutex_lock(&sonypi_device.lock); sonypi_misc_release() 895 sonypi_device.open_count--; sonypi_misc_release() 896 mutex_unlock(&sonypi_device.lock); sonypi_misc_release() 902 mutex_lock(&sonypi_device.lock); sonypi_misc_open() 904 if (!sonypi_device.open_count) sonypi_misc_open() 905 kfifo_reset(&sonypi_device.fifo); sonypi_misc_open() 906 sonypi_device.open_count++; sonypi_misc_open() 907 mutex_unlock(&sonypi_device.lock); sonypi_misc_open() 918 if ((kfifo_len(&sonypi_device.fifo) == 0) && sonypi_misc_read() 922 ret = wait_event_interruptible(sonypi_device.fifo_proc_list, sonypi_misc_read() 923 kfifo_len(&sonypi_device.fifo) != 0); sonypi_misc_read() 928 (kfifo_out_locked(&sonypi_device.fifo, &c, sizeof(c), sonypi_misc_read() 929 &sonypi_device.fifo_lock) == sizeof(c))) { sonypi_misc_read() 945 poll_wait(file, &sonypi_device.fifo_proc_list, wait); sonypi_misc_poll() 946 if (kfifo_len(&sonypi_device.fifo)) sonypi_misc_poll() 959 mutex_lock(&sonypi_device.lock); sonypi_misc_ioctl() 1019 val8 = sonypi_device.bluetooth_power; sonypi_misc_ioctl() 1059 mutex_unlock(&sonypi_device.lock); sonypi_misc_ioctl() 1082 switch (sonypi_device.model) { sonypi_enable() 1116 switch (sonypi_device.model) { sonypi_disable() 1169 sonypi_device.input_jog_dev = jog_dev = input_allocate_device(); sonypi_create_input_devices() 1182 sonypi_device.input_key_dev = key_dev = input_allocate_device(); sonypi_create_input_devices() 1215 sonypi_device.input_key_dev = NULL; sonypi_create_input_devices() 1218 sonypi_device.input_jog_dev = NULL; sonypi_create_input_devices() 1223 static int sonypi_setup_ioports(struct sonypi_device *dev, sonypi_setup_ioports() 1237 sonypi_device.region_size, sonypi_setup_ioports() 1244 release_region(check->port1, sonypi_device.region_size); sonypi_setup_ioports() 1251 sonypi_device.region_size, sonypi_setup_ioports() 1263 static int sonypi_setup_irq(struct sonypi_device *dev, sonypi_setup_irq() 1285 sonypi_device.model, sonypi_display_info() 1294 sonypi_device.irq, sonypi_display_info() 1295 sonypi_device.ioport1, sonypi_device.ioport2); sonypi_display_info() 1313 spin_lock_init(&sonypi_device.fifo_lock); sonypi_probe() 1314 error = kfifo_alloc(&sonypi_device.fifo, SONYPI_BUF_SIZE, GFP_KERNEL); sonypi_probe() 1320 init_waitqueue_head(&sonypi_device.fifo_proc_list); sonypi_probe() 1321 mutex_init(&sonypi_device.lock); sonypi_probe() 1322 sonypi_device.bluetooth_power = -1; sonypi_probe() 1326 sonypi_device.model = SONYPI_DEVICE_MODEL_TYPE1; sonypi_probe() 1329 sonypi_device.model = SONYPI_DEVICE_MODEL_TYPE3; sonypi_probe() 1332 sonypi_device.model = SONYPI_DEVICE_MODEL_TYPE3; sonypi_probe() 1334 sonypi_device.model = SONYPI_DEVICE_MODEL_TYPE2; sonypi_probe() 1342 sonypi_device.dev = pcidev; sonypi_probe() 1344 if (sonypi_device.model == SONYPI_DEVICE_MODEL_TYPE1) { sonypi_probe() 1346 sonypi_device.region_size = SONYPI_TYPE1_REGION_SIZE; sonypi_probe() 1347 sonypi_device.evtype_offset = SONYPI_TYPE1_EVTYPE_OFFSET; sonypi_probe() 1349 } else if (sonypi_device.model == SONYPI_DEVICE_MODEL_TYPE2) { sonypi_probe() 1351 sonypi_device.region_size = SONYPI_TYPE2_REGION_SIZE; sonypi_probe() 1352 sonypi_device.evtype_offset = SONYPI_TYPE2_EVTYPE_OFFSET; sonypi_probe() 1356 sonypi_device.region_size = SONYPI_TYPE3_REGION_SIZE; sonypi_probe() 1357 sonypi_device.evtype_offset = SONYPI_TYPE3_EVTYPE_OFFSET; sonypi_probe() 1361 error = sonypi_setup_ioports(&sonypi_device, ioport_list); sonypi_probe() 1367 error = sonypi_setup_irq(&sonypi_device, irq_list); sonypi_probe() 1392 spin_lock_init(&sonypi_device.input_fifo_lock); sonypi_probe() 1393 error = kfifo_alloc(&sonypi_device.input_fifo, SONYPI_BUF_SIZE, sonypi_probe() 1400 INIT_WORK(&sonypi_device.input_work, input_keyrelease); sonypi_probe() 1408 input_unregister_device(sonypi_device.input_key_dev); sonypi_probe() 1409 input_unregister_device(sonypi_device.input_jog_dev); sonypi_probe() 1413 free_irq(sonypi_device.irq, sonypi_irq); sonypi_probe() 1415 release_region(sonypi_device.ioport1, sonypi_device.region_size); sonypi_probe() 1421 kfifo_free(&sonypi_device.fifo); sonypi_probe() 1430 synchronize_irq(sonypi_device.irq); sonypi_remove() 1431 flush_work(&sonypi_device.input_work); sonypi_remove() 1434 input_unregister_device(sonypi_device.input_key_dev); sonypi_remove() 1435 input_unregister_device(sonypi_device.input_jog_dev); sonypi_remove() 1436 kfifo_free(&sonypi_device.input_fifo); sonypi_remove() 1441 free_irq(sonypi_device.irq, sonypi_irq); sonypi_remove() 1442 release_region(sonypi_device.ioport1, sonypi_device.region_size); sonypi_remove() 1444 if (sonypi_device.dev) { sonypi_remove() 1445 pci_disable_device(sonypi_device.dev); sonypi_remove() 1446 pci_dev_put(sonypi_device.dev); sonypi_remove() 1449 kfifo_free(&sonypi_device.fifo); sonypi_remove() 1459 old_camera_power = sonypi_device.camera_power; sonypi_suspend()
|