Lines Matching +full:camera +full:- +full:command +full:- +full:set

1 // SPDX-License-Identifier: GPL-2.0-or-later
7 * Copyright (C) 2001-2005 Stelian Pop <stelian@popies.net>
11 * Copyright (C) 2001-2002 Alcôve <www.alcove.com>
17 * Copyright (C) 2000 Takaya Kinjo <t-kinjo@tc4.so-net.ne.jp>
54 static int minor = -1;
57 "minor number of the misc device, default is -1 (automatic)");
66 "set this if your Fn keys do not generate any event");
68 static int camera; /* = 0 */ variable
69 module_param(camera, int, 0444);
70 MODULE_PARM_DESC(camera,
71 "set this if you have a MotionEye camera (PictureBook series)");
76 "set this if you want to enable backward compatibility mode");
81 "set this to the mask of event you want to enable (see doc)");
86 "set this if you would like sonypi to feed events to the input subsystem");
91 "set this to 0 if you think the automatic ioport check for sony-laptop is wrong");
141 /* The set of possible ioports */
168 /* The set of possible interrupts */
242 /* The set of possible button release events */
248 /* The set of possible jogger events */
266 /* The set of possible capture button events */
274 /* The set of possible fnkeys events */
301 /* The set of possible program key events */
310 /* The set of possible bluetooth events */
318 /* The set of possible wireless events */
325 /* The set of possible back button events */
331 /* The set of possible help button events */
338 /* The set of possible lid events */
345 /* The set of possible zoom events */
351 /* The set of possible thumbphrase events */
357 /* The set of possible motioneye camera events */
364 /* The set of possible memorystick events */
371 /* The set of possible battery events */
492 #define wait_on_command(quiet, command, iterations) { \ argument
494 while (--n && (command)) \
497 …printk(KERN_WARNING "sonypi command failed at %s : %s (line %d)\n", __FILE__, __func__, __LINE__);…
546 return -1; in ec_read16()
548 return -1; in ec_read16()
553 /* Initializes the device - this comes from the AML code in the ACPI bios */
605 /* Disables the device - this comes from the AML code in the ACPI bios */
680 while (n--) {
690 /* Set brightness, hue etc */
696 /* Tests if the camera is ready */
705 /* Turns the camera off */
717 /* Turns the camera on */
725 for (j = 5; j > 0; j--) { in sonypi_camera_on()
731 for (i = 400; i > 0; i--) { in sonypi_camera_on()
741 printk(KERN_WARNING "sonypi: failed to power on camera\n"); in sonypi_camera_on()
791 input_report_rel(jog_dev, REL_WHEEL, -1); in sonypi_report_input_event()
882 sonypi_device.open_count--; in sonypi_misc_release()
906 (file->f_flags & O_NONBLOCK)) in sonypi_misc_read()
907 return -EAGAIN; in sonypi_misc_read()
918 return -EFAULT; in sonypi_misc_read()
950 ret = -EIO; in sonypi_misc_ioctl()
954 ret = -EFAULT; in sonypi_misc_ioctl()
958 ret = -EFAULT; in sonypi_misc_ioctl()
962 ret = -EIO; in sonypi_misc_ioctl()
966 ret = -EIO; in sonypi_misc_ioctl()
970 ret = -EFAULT; in sonypi_misc_ioctl()
974 ret = -EIO; in sonypi_misc_ioctl()
978 ret = -EFAULT; in sonypi_misc_ioctl()
982 ret = -EIO; in sonypi_misc_ioctl()
986 ret = -EFAULT; in sonypi_misc_ioctl()
990 ret = -EIO; in sonypi_misc_ioctl()
994 ret = -EFAULT; in sonypi_misc_ioctl()
998 ret = -EIO; in sonypi_misc_ioctl()
1003 ret = -EFAULT; in sonypi_misc_ioctl()
1008 ret = -EFAULT; in sonypi_misc_ioctl()
1012 ret = -EFAULT; in sonypi_misc_ioctl()
1020 ret = -EIO; in sonypi_misc_ioctl()
1024 ret = -EFAULT; in sonypi_misc_ioctl()
1028 ret = -EFAULT; in sonypi_misc_ioctl()
1032 ret = -EIO; in sonypi_misc_ioctl()
1037 ret = -EIO; in sonypi_misc_ioctl()
1041 ret = -EFAULT; in sonypi_misc_ioctl()
1044 ret = -EINVAL; in sonypi_misc_ioctl()
1088 if (camera && camera_on) in sonypi_enable()
1095 if (camera) in sonypi_disable()
1156 return -ENOMEM; in sonypi_create_input_devices()
1158 jog_dev->name = "Sony Vaio Jogdial"; in sonypi_create_input_devices()
1159 jog_dev->id.bustype = BUS_ISA; in sonypi_create_input_devices()
1160 jog_dev->id.vendor = PCI_VENDOR_ID_SONY; in sonypi_create_input_devices()
1161 jog_dev->dev.parent = &pdev->dev; in sonypi_create_input_devices()
1163 jog_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL); in sonypi_create_input_devices()
1164 jog_dev->keybit[BIT_WORD(BTN_MOUSE)] = BIT_MASK(BTN_MIDDLE); in sonypi_create_input_devices()
1165 jog_dev->relbit[0] = BIT_MASK(REL_WHEEL); in sonypi_create_input_devices()
1169 error = -ENOMEM; in sonypi_create_input_devices()
1173 key_dev->name = "Sony Vaio Keys"; in sonypi_create_input_devices()
1174 key_dev->id.bustype = BUS_ISA; in sonypi_create_input_devices()
1175 key_dev->id.vendor = PCI_VENDOR_ID_SONY; in sonypi_create_input_devices()
1176 key_dev->dev.parent = &pdev->dev; in sonypi_create_input_devices()
1179 key_dev->evbit[0] = BIT_MASK(EV_KEY); in sonypi_create_input_devices()
1182 set_bit(sonypi_inputkeys[i].inputev, key_dev->keybit); in sonypi_create_input_devices()
1196 /* Set to NULL so we don't free it again below */ in sonypi_create_input_devices()
1211 /* try to detect if sony-laptop is being used and thus in sonypi_setup_ioports()
1216 * attempt to be some more user-friendly as we currently are, in sonypi_setup_ioports()
1220 while (check_ioport && check->port1) { in sonypi_setup_ioports()
1221 if (!request_region(check->port1, in sonypi_setup_ioports()
1224 printk(KERN_ERR "sonypi: ioport 0x%.4x busy, using sony-laptop? " in sonypi_setup_ioports()
1226 check->port1); in sonypi_setup_ioports()
1227 return -EBUSY; in sonypi_setup_ioports()
1229 release_region(check->port1, sonypi_device.region_size); in sonypi_setup_ioports()
1233 while (ioport_list->port1) { in sonypi_setup_ioports()
1235 if (request_region(ioport_list->port1, in sonypi_setup_ioports()
1238 dev->ioport1 = ioport_list->port1; in sonypi_setup_ioports()
1239 dev->ioport2 = ioport_list->port2; in sonypi_setup_ioports()
1245 return -EBUSY; in sonypi_setup_ioports()
1251 while (irq_list->irq) { in sonypi_setup_irq()
1253 if (!request_irq(irq_list->irq, sonypi_irq, in sonypi_setup_irq()
1255 dev->irq = irq_list->irq; in sonypi_setup_irq()
1256 dev->bits = irq_list->bits; in sonypi_setup_irq()
1262 return -EBUSY; in sonypi_setup_irq()
1268 "verbose = %d, fnkeyinit = %s, camera = %s, " in sonypi_display_info()
1273 str_on_off(camera), in sonypi_display_info()
1282 if (minor == -1) in sonypi_display_info()
1294 printk(KERN_WARNING "sonypi: please try the sony-laptop module instead " in sonypi_probe()
1307 sonypi_device.bluetooth_power = -1; in sonypi_probe()
1323 error = -EIO; in sonypi_probe()
1358 if (minor != -1) in sonypi_probe()
1482 DMI_MATCH(DMI_PRODUCT_NAME, "PCG-"),
1489 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-"),
1504 return -ENODEV; in sonypi_init()
1510 sonypi_platform_device = platform_device_alloc("sonypi", -1); in sonypi_init()
1512 error = -ENOMEM; in sonypi_init()