Lines Matching +full:deep +full:- +full:touch

1 // SPDX-License-Identifier: GPL-2.0+
82 const unsigned short addr_list[] = { info->addr, I2C_CLIENT_END }; in chromes_laptop_instantiate_i2c_device()
93 I2C_BOARD_INFO("dummy", info->addr), in chromes_laptop_instantiate_i2c_device()
103 pr_debug("%d-%02x is probed at %02x\n", in chromes_laptop_instantiate_i2c_device()
104 adapter->nr, info->addr, dummy->addr); in chromes_laptop_instantiate_i2c_device()
112 pr_debug("failed to register device %d-%02x\n", in chromes_laptop_instantiate_i2c_device()
113 adapter->nr, info->addr); in chromes_laptop_instantiate_i2c_device()
115 pr_debug("added i2c device %d-%02x\n", in chromes_laptop_instantiate_i2c_device()
116 adapter->nr, info->addr); in chromes_laptop_instantiate_i2c_device()
138 for (i = 0; i < cros_laptop->num_i2c_peripherals; i++) { in chromeos_laptop_check_adapter()
139 i2c_dev = &cros_laptop->i2c_peripherals[i]; in chromeos_laptop_check_adapter()
142 if (i2c_dev->client) in chromeos_laptop_check_adapter()
145 if (strncmp(adapter->name, i2c_adapter_names[i2c_dev->type], in chromeos_laptop_check_adapter()
146 strlen(i2c_adapter_names[i2c_dev->type]))) in chromeos_laptop_check_adapter()
149 if (i2c_dev->pci_devid && in chromeos_laptop_check_adapter()
150 !chromeos_laptop_match_adapter_devid(adapter->dev.parent, in chromeos_laptop_check_adapter()
151 i2c_dev->pci_devid)) { in chromeos_laptop_check_adapter()
155 i2c_dev->client = in chromeos_laptop_check_adapter()
157 &i2c_dev->board_info, in chromeos_laptop_check_adapter()
158 i2c_dev->alt_addr); in chromeos_laptop_check_adapter()
169 if (!has_acpi_companion(&client->dev)) in chromeos_laptop_adjust_client()
172 for (i = 0; i < cros_laptop->num_acpi_peripherals; i++) { in chromeos_laptop_adjust_client()
173 acpi_dev = &cros_laptop->acpi_peripherals[i]; in chromeos_laptop_adjust_client()
175 memcpy(acpi_ids[0].id, acpi_dev->hid, ACPI_ID_LEN); in chromeos_laptop_adjust_client()
177 if (acpi_match_device(acpi_ids, &client->dev)) { in chromeos_laptop_adjust_client()
178 error = device_add_properties(&client->dev, in chromeos_laptop_adjust_client()
179 acpi_dev->properties); in chromeos_laptop_adjust_client()
181 dev_err(&client->dev, in chromeos_laptop_adjust_client()
199 for (i = 0; i < cros_laptop->num_i2c_peripherals; i++) { in chromeos_laptop_detach_i2c_client()
200 i2c_dev = &cros_laptop->i2c_peripherals[i]; in chromeos_laptop_detach_i2c_client()
202 if (i2c_dev->client == client) in chromeos_laptop_detach_i2c_client()
203 i2c_dev->client = NULL; in chromeos_laptop_detach_i2c_client()
214 if (dev->type == &i2c_adapter_type) in chromeos_laptop_i2c_notifier_call()
216 else if (dev->type == &i2c_client_type) in chromeos_laptop_i2c_notifier_call()
221 if (dev->type == &i2c_client_type) in chromeos_laptop_i2c_notifier_call()
289 PROPERTY_ENTRY_U32_ARRAY("linux,gpio-keymap", chromebook_pixel_tp_keys),
300 /* Touch Screen. */
493 PROPERTY_ENTRY_U32_ARRAY("linux,gpio-keymap", samus_touchpad_buttons),
602 .ident = "Cr-48",
635 * Other Chromebooks with Atmel touch controllers:
636 * - Winky (touchpad)
637 * - Clapper, Expresso, Rambi, Glimmer (touchscreen)
658 if (dev->type == &i2c_adapter_type) { in chromeos_laptop_scan_peripherals()
660 } else if (dev->type == &i2c_client_type) { in chromeos_laptop_scan_peripherals()
663 * Now that we have needed properties re-trigger in chromeos_laptop_scan_peripherals()
686 return -ENOENT; in chromeos_laptop_get_irq_from_dmi()
689 dev_data = dmi_dev->device_data; in chromeos_laptop_get_irq_from_dmi()
692 return -EINVAL; in chromeos_laptop_get_irq_from_dmi()
695 return dev_data->instance; in chromeos_laptop_get_irq_from_dmi()
702 if (i2c_dev->dmi_name) { in chromeos_laptop_setup_irq()
703 irq = chromeos_laptop_get_irq_from_dmi(i2c_dev->dmi_name); in chromeos_laptop_setup_irq()
707 i2c_dev->irq_resource = (struct resource) in chromeos_laptop_setup_irq()
709 IORESOURCE_IRQ | i2c_dev->irqflags); in chromeos_laptop_setup_irq()
710 i2c_dev->board_info.resources = &i2c_dev->irq_resource; in chromeos_laptop_setup_irq()
711 i2c_dev->board_info.num_resources = 1; in chromeos_laptop_setup_irq()
726 if (!src->num_i2c_peripherals) in chromeos_laptop_prepare_i2c_peripherals()
729 cros_laptop->i2c_peripherals = kmemdup(src->i2c_peripherals, in chromeos_laptop_prepare_i2c_peripherals()
730 src->num_i2c_peripherals * in chromeos_laptop_prepare_i2c_peripherals()
731 sizeof(*src->i2c_peripherals), in chromeos_laptop_prepare_i2c_peripherals()
733 if (!cros_laptop->i2c_peripherals) in chromeos_laptop_prepare_i2c_peripherals()
734 return -ENOMEM; in chromeos_laptop_prepare_i2c_peripherals()
736 cros_laptop->num_i2c_peripherals = src->num_i2c_peripherals; in chromeos_laptop_prepare_i2c_peripherals()
738 for (i = 0; i < cros_laptop->num_i2c_peripherals; i++) { in chromeos_laptop_prepare_i2c_peripherals()
739 i2c_dev = &cros_laptop->i2c_peripherals[i]; in chromeos_laptop_prepare_i2c_peripherals()
740 info = &i2c_dev->board_info; in chromeos_laptop_prepare_i2c_peripherals()
746 /* We need to deep-copy properties */ in chromeos_laptop_prepare_i2c_peripherals()
747 if (info->properties) { in chromeos_laptop_prepare_i2c_peripherals()
748 info->properties = in chromeos_laptop_prepare_i2c_peripherals()
749 property_entries_dup(info->properties); in chromeos_laptop_prepare_i2c_peripherals()
750 if (IS_ERR(info->properties)) { in chromeos_laptop_prepare_i2c_peripherals()
751 error = PTR_ERR(info->properties); in chromeos_laptop_prepare_i2c_peripherals()
760 while (--i >= 0) { in chromeos_laptop_prepare_i2c_peripherals()
761 i2c_dev = &cros_laptop->i2c_peripherals[i]; in chromeos_laptop_prepare_i2c_peripherals()
762 info = &i2c_dev->board_info; in chromeos_laptop_prepare_i2c_peripherals()
763 if (info->properties) in chromeos_laptop_prepare_i2c_peripherals()
764 property_entries_free(info->properties); in chromeos_laptop_prepare_i2c_peripherals()
766 kfree(cros_laptop->i2c_peripherals); in chromeos_laptop_prepare_i2c_peripherals()
781 for (i = 0; i < src->num_acpi_peripherals; i++) { in chromeos_laptop_prepare_acpi_peripherals()
782 if (acpi_dev_present(src->acpi_peripherals[i].hid, NULL, -1)) in chromeos_laptop_prepare_acpi_peripherals()
790 sizeof(*src->acpi_peripherals), in chromeos_laptop_prepare_acpi_peripherals()
793 return -ENOMEM; in chromeos_laptop_prepare_acpi_peripherals()
796 for (i = 0; i < src->num_acpi_peripherals; i++) { in chromeos_laptop_prepare_acpi_peripherals()
797 src_dev = &src->acpi_peripherals[i]; in chromeos_laptop_prepare_acpi_peripherals()
798 if (!acpi_dev_present(src_dev->hid, NULL, -1)) in chromeos_laptop_prepare_acpi_peripherals()
803 /* We need to deep-copy properties */ in chromeos_laptop_prepare_acpi_peripherals()
804 if (src_dev->properties) { in chromeos_laptop_prepare_acpi_peripherals()
805 acpi_dev->properties = in chromeos_laptop_prepare_acpi_peripherals()
806 property_entries_dup(src_dev->properties); in chromeos_laptop_prepare_acpi_peripherals()
807 if (IS_ERR(acpi_dev->properties)) { in chromeos_laptop_prepare_acpi_peripherals()
808 error = PTR_ERR(acpi_dev->properties); in chromeos_laptop_prepare_acpi_peripherals()
816 cros_laptop->acpi_peripherals = acpi_peripherals; in chromeos_laptop_prepare_acpi_peripherals()
817 cros_laptop->num_acpi_peripherals = n_peripherals; in chromeos_laptop_prepare_acpi_peripherals()
822 while (--i >= 0) { in chromeos_laptop_prepare_acpi_peripherals()
824 if (acpi_dev->properties) in chromeos_laptop_prepare_acpi_peripherals()
825 property_entries_free(acpi_dev->properties); in chromeos_laptop_prepare_acpi_peripherals()
839 for (i = 0; i < cros_laptop->num_i2c_peripherals; i++) { in chromeos_laptop_destroy()
840 i2c_dev = &cros_laptop->i2c_peripherals[i]; in chromeos_laptop_destroy()
841 info = &i2c_dev->board_info; in chromeos_laptop_destroy()
843 i2c_unregister_device(i2c_dev->client); in chromeos_laptop_destroy()
844 property_entries_free(info->properties); in chromeos_laptop_destroy()
847 for (i = 0; i < cros_laptop->num_acpi_peripherals; i++) { in chromeos_laptop_destroy()
848 acpi_dev = &cros_laptop->acpi_peripherals[i]; in chromeos_laptop_destroy()
850 property_entries_free(acpi_dev->properties); in chromeos_laptop_destroy()
853 kfree(cros_laptop->i2c_peripherals); in chromeos_laptop_destroy()
854 kfree(cros_laptop->acpi_peripherals); in chromeos_laptop_destroy()
866 return ERR_PTR(-ENOMEM); in chromeos_laptop_prepare()
889 return -ENODEV; in chromeos_laptop_init()
892 pr_debug("DMI Matched %s\n", dmi_id->ident); in chromeos_laptop_init()
894 cros_laptop = chromeos_laptop_prepare((void *)dmi_id->driver_data); in chromeos_laptop_init()
898 if (!cros_laptop->num_i2c_peripherals && in chromeos_laptop_init()
899 !cros_laptop->num_acpi_peripherals) { in chromeos_laptop_init()
901 error = -ENODEV; in chromeos_laptop_init()