Lines Matching +full:deep +full:- +full:touch
1 // SPDX-License-Identifier: GPL-2.0+
85 const unsigned short addr_list[] = { info->addr, I2C_CLIENT_END }; in chromes_laptop_instantiate_i2c_device()
96 I2C_BOARD_INFO("dummy", info->addr), in chromes_laptop_instantiate_i2c_device()
106 pr_debug("%d-%02x is probed at %02x\n", in chromes_laptop_instantiate_i2c_device()
107 adapter->nr, info->addr, dummy->addr); in chromes_laptop_instantiate_i2c_device()
115 pr_debug("failed to register device %d-%02x\n", in chromes_laptop_instantiate_i2c_device()
116 adapter->nr, info->addr); in chromes_laptop_instantiate_i2c_device()
118 pr_debug("added i2c device %d-%02x\n", in chromes_laptop_instantiate_i2c_device()
119 adapter->nr, info->addr); in chromes_laptop_instantiate_i2c_device()
141 for (i = 0; i < cros_laptop->num_i2c_peripherals; i++) { in chromeos_laptop_check_adapter()
142 i2c_dev = &cros_laptop->i2c_peripherals[i]; in chromeos_laptop_check_adapter()
145 if (i2c_dev->client) in chromeos_laptop_check_adapter()
148 if (strncmp(adapter->name, i2c_adapter_names[i2c_dev->type], in chromeos_laptop_check_adapter()
149 strlen(i2c_adapter_names[i2c_dev->type]))) in chromeos_laptop_check_adapter()
152 if (i2c_dev->pci_devid && in chromeos_laptop_check_adapter()
153 !chromeos_laptop_match_adapter_devid(adapter->dev.parent, in chromeos_laptop_check_adapter()
154 i2c_dev->pci_devid)) { in chromeos_laptop_check_adapter()
158 i2c_dev->client = in chromeos_laptop_check_adapter()
160 &i2c_dev->board_info, in chromeos_laptop_check_adapter()
161 i2c_dev->alt_addr); in chromeos_laptop_check_adapter()
172 if (!has_acpi_companion(&client->dev)) in chromeos_laptop_adjust_client()
175 for (i = 0; i < cros_laptop->num_acpi_peripherals; i++) { in chromeos_laptop_adjust_client()
176 acpi_dev = &cros_laptop->acpi_peripherals[i]; in chromeos_laptop_adjust_client()
178 memcpy(acpi_ids[0].id, acpi_dev->hid, ACPI_ID_LEN); in chromeos_laptop_adjust_client()
180 if (acpi_match_device(acpi_ids, &client->dev)) { in chromeos_laptop_adjust_client()
181 error = device_add_software_node(&client->dev, &acpi_dev->swnode); in chromeos_laptop_adjust_client()
183 dev_err(&client->dev, in chromeos_laptop_adjust_client()
189 acpi_dev->client = client; in chromeos_laptop_adjust_client()
204 if (has_acpi_companion(&client->dev)) in chromeos_laptop_detach_i2c_client()
205 for (i = 0; i < cros_laptop->num_acpi_peripherals; i++) { in chromeos_laptop_detach_i2c_client()
206 acpi_dev = &cros_laptop->acpi_peripherals[i]; in chromeos_laptop_detach_i2c_client()
208 if (acpi_dev->client == client) { in chromeos_laptop_detach_i2c_client()
209 acpi_dev->client = NULL; in chromeos_laptop_detach_i2c_client()
214 for (i = 0; i < cros_laptop->num_i2c_peripherals; i++) { in chromeos_laptop_detach_i2c_client()
215 i2c_dev = &cros_laptop->i2c_peripherals[i]; in chromeos_laptop_detach_i2c_client()
217 if (i2c_dev->client == client) { in chromeos_laptop_detach_i2c_client()
218 i2c_dev->client = NULL; in chromeos_laptop_detach_i2c_client()
231 if (dev->type == &i2c_adapter_type) in chromeos_laptop_i2c_notifier_call()
233 else if (dev->type == &i2c_client_type) in chromeos_laptop_i2c_notifier_call()
238 if (dev->type == &i2c_client_type) in chromeos_laptop_i2c_notifier_call()
306 PROPERTY_ENTRY_U32_ARRAY("linux,gpio-keymap", chromebook_pixel_tp_keys),
317 /* Touch Screen. */
507 PROPERTY_ENTRY_U32_ARRAY("linux,gpio-keymap", samus_touchpad_buttons),
624 .ident = "Cr-48",
657 * Other Chromebooks with Atmel touch controllers:
658 * - Winky (touchpad)
659 * - Clapper, Expresso, Rambi, Glimmer (touchscreen)
680 if (dev->type == &i2c_adapter_type) { in chromeos_laptop_scan_peripherals()
682 } else if (dev->type == &i2c_client_type) { in chromeos_laptop_scan_peripherals()
685 * Now that we have needed properties re-trigger in chromeos_laptop_scan_peripherals()
708 return -ENOENT; in chromeos_laptop_get_irq_from_dmi()
711 dev_data = dmi_dev->device_data; in chromeos_laptop_get_irq_from_dmi()
714 return -EINVAL; in chromeos_laptop_get_irq_from_dmi()
717 return dev_data->instance; in chromeos_laptop_get_irq_from_dmi()
724 if (i2c_dev->dmi_name) { in chromeos_laptop_setup_irq()
725 irq = chromeos_laptop_get_irq_from_dmi(i2c_dev->dmi_name); in chromeos_laptop_setup_irq()
729 i2c_dev->irq_resource = (struct resource) in chromeos_laptop_setup_irq()
731 IORESOURCE_IRQ | i2c_dev->irqflags); in chromeos_laptop_setup_irq()
732 i2c_dev->board_info.resources = &i2c_dev->irq_resource; in chromeos_laptop_setup_irq()
733 i2c_dev->board_info.num_resources = 1; in chromeos_laptop_setup_irq()
749 if (!src->num_i2c_peripherals) in chromeos_laptop_prepare_i2c_peripherals()
752 i2c_peripherals = kmemdup_array(src->i2c_peripherals, in chromeos_laptop_prepare_i2c_peripherals()
753 src->num_i2c_peripherals, in chromeos_laptop_prepare_i2c_peripherals()
756 return -ENOMEM; in chromeos_laptop_prepare_i2c_peripherals()
758 for (i = 0; i < src->num_i2c_peripherals; i++) { in chromeos_laptop_prepare_i2c_peripherals()
760 info = &i2c_dev->board_info; in chromeos_laptop_prepare_i2c_peripherals()
766 /* Create primary fwnode for the device - copies everything */ in chromeos_laptop_prepare_i2c_peripherals()
767 if (i2c_dev->properties) { in chromeos_laptop_prepare_i2c_peripherals()
768 info->fwnode = fwnode_create_software_node(i2c_dev->properties, NULL); in chromeos_laptop_prepare_i2c_peripherals()
769 if (IS_ERR(info->fwnode)) { in chromeos_laptop_prepare_i2c_peripherals()
770 error = PTR_ERR(info->fwnode); in chromeos_laptop_prepare_i2c_peripherals()
776 cros_laptop->i2c_peripherals = i2c_peripherals; in chromeos_laptop_prepare_i2c_peripherals()
777 cros_laptop->num_i2c_peripherals = src->num_i2c_peripherals; in chromeos_laptop_prepare_i2c_peripherals()
782 while (--i >= 0) { in chromeos_laptop_prepare_i2c_peripherals()
784 info = &i2c_dev->board_info; in chromeos_laptop_prepare_i2c_peripherals()
785 if (!IS_ERR_OR_NULL(info->fwnode)) in chromeos_laptop_prepare_i2c_peripherals()
786 fwnode_remove_software_node(info->fwnode); in chromeos_laptop_prepare_i2c_peripherals()
803 for (i = 0; i < src->num_acpi_peripherals; i++) { in chromeos_laptop_prepare_acpi_peripherals()
804 if (acpi_dev_present(src->acpi_peripherals[i].hid, NULL, -1)) in chromeos_laptop_prepare_acpi_peripherals()
812 sizeof(*src->acpi_peripherals), in chromeos_laptop_prepare_acpi_peripherals()
815 return -ENOMEM; in chromeos_laptop_prepare_acpi_peripherals()
818 for (i = 0; i < src->num_acpi_peripherals; i++) { in chromeos_laptop_prepare_acpi_peripherals()
819 src_dev = &src->acpi_peripherals[i]; in chromeos_laptop_prepare_acpi_peripherals()
820 if (!acpi_dev_present(src_dev->hid, NULL, -1)) in chromeos_laptop_prepare_acpi_peripherals()
825 /* We need to deep-copy properties */ in chromeos_laptop_prepare_acpi_peripherals()
826 if (src_dev->swnode.properties) { in chromeos_laptop_prepare_acpi_peripherals()
827 acpi_dev->swnode.properties = in chromeos_laptop_prepare_acpi_peripherals()
828 property_entries_dup(src_dev->swnode.properties); in chromeos_laptop_prepare_acpi_peripherals()
829 if (IS_ERR(acpi_dev->swnode.properties)) { in chromeos_laptop_prepare_acpi_peripherals()
830 error = PTR_ERR(acpi_dev->swnode.properties); in chromeos_laptop_prepare_acpi_peripherals()
838 cros_laptop->acpi_peripherals = acpi_peripherals; in chromeos_laptop_prepare_acpi_peripherals()
839 cros_laptop->num_acpi_peripherals = n_peripherals; in chromeos_laptop_prepare_acpi_peripherals()
844 while (--i >= 0) { in chromeos_laptop_prepare_acpi_peripherals()
846 if (!IS_ERR_OR_NULL(acpi_dev->swnode.properties)) in chromeos_laptop_prepare_acpi_peripherals()
847 property_entries_free(acpi_dev->swnode.properties); in chromeos_laptop_prepare_acpi_peripherals()
860 for (i = 0; i < cros_laptop->num_i2c_peripherals; i++) { in chromeos_laptop_destroy()
861 i2c_dev = &cros_laptop->i2c_peripherals[i]; in chromeos_laptop_destroy()
862 i2c_unregister_device(i2c_dev->client); in chromeos_laptop_destroy()
865 for (i = 0; i < cros_laptop->num_acpi_peripherals; i++) { in chromeos_laptop_destroy()
866 acpi_dev = &cros_laptop->acpi_peripherals[i]; in chromeos_laptop_destroy()
868 if (acpi_dev->client) in chromeos_laptop_destroy()
869 device_remove_software_node(&acpi_dev->client->dev); in chromeos_laptop_destroy()
871 property_entries_free(acpi_dev->swnode.properties); in chromeos_laptop_destroy()
874 kfree(cros_laptop->i2c_peripherals); in chromeos_laptop_destroy()
875 kfree(cros_laptop->acpi_peripherals); in chromeos_laptop_destroy()
887 return ERR_PTR(-ENOMEM); in chromeos_laptop_prepare()
910 return -ENODEV; in chromeos_laptop_init()
913 pr_debug("DMI Matched %s\n", dmi_id->ident); in chromeos_laptop_init()
915 cros_laptop = chromeos_laptop_prepare((void *)dmi_id->driver_data); in chromeos_laptop_init()
919 if (!cros_laptop->num_i2c_peripherals && in chromeos_laptop_init()
920 !cros_laptop->num_acpi_peripherals) { in chromeos_laptop_init()
922 error = -ENODEV; in chromeos_laptop_init()