Lines Matching +full:ctrl +full:- +full:ids

1 // SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
2 // Copyright(c) 2015-17 Intel Corporation.
15 mutex_destroy(&slave->sdw_dev_lock); in sdw_slave_release()
34 return -ENOMEM; in sdw_slave_add()
37 memcpy(&slave->id, id, sizeof(*id)); in sdw_slave_add()
38 slave->dev.parent = bus->dev; in sdw_slave_add()
39 slave->dev.fwnode = fwnode; in sdw_slave_add()
41 if (id->unique_id == SDW_IGNORED_UNIQUE_ID) { in sdw_slave_add()
42 /* name shall be sdw:ctrl:link:mfg:part:class */ in sdw_slave_add()
43 dev_set_name(&slave->dev, "sdw:%01x:%01x:%04x:%04x:%02x", in sdw_slave_add()
44 bus->controller_id, bus->link_id, id->mfg_id, id->part_id, in sdw_slave_add()
45 id->class_id); in sdw_slave_add()
47 /* name shall be sdw:ctrl:link:mfg:part:class:unique */ in sdw_slave_add()
48 dev_set_name(&slave->dev, "sdw:%01x:%01x:%04x:%04x:%02x:%01x", in sdw_slave_add()
49 bus->controller_id, bus->link_id, id->mfg_id, id->part_id, in sdw_slave_add()
50 id->class_id, id->unique_id); in sdw_slave_add()
53 slave->dev.bus = &sdw_bus_type; in sdw_slave_add()
54 slave->dev.of_node = of_node_get(to_of_node(fwnode)); in sdw_slave_add()
55 slave->dev.type = &sdw_slave_type; in sdw_slave_add()
56 slave->dev.groups = sdw_slave_status_attr_groups; in sdw_slave_add()
57 slave->bus = bus; in sdw_slave_add()
58 slave->status = SDW_SLAVE_UNATTACHED; in sdw_slave_add()
59 init_completion(&slave->enumeration_complete); in sdw_slave_add()
60 init_completion(&slave->initialization_complete); in sdw_slave_add()
61 slave->dev_num = 0; in sdw_slave_add()
62 slave->probed = false; in sdw_slave_add()
63 slave->first_interrupt_done = false; in sdw_slave_add()
64 mutex_init(&slave->sdw_dev_lock); in sdw_slave_add()
67 init_completion(&slave->port_ready[i]); in sdw_slave_add()
69 mutex_lock(&bus->bus_lock); in sdw_slave_add()
70 list_add_tail(&slave->node, &bus->slaves); in sdw_slave_add()
71 mutex_unlock(&bus->bus_lock); in sdw_slave_add()
73 ret = device_register(&slave->dev); in sdw_slave_add()
75 dev_err(bus->dev, "Failed to add slave: ret %d\n", ret); in sdw_slave_add()
81 mutex_lock(&bus->bus_lock); in sdw_slave_add()
82 list_del(&slave->node); in sdw_slave_add()
83 mutex_unlock(&bus->bus_lock); in sdw_slave_add()
84 put_device(&slave->dev); in sdw_slave_add()
104 ret = acpi_get_local_u64_address(adev->handle, &addr); in find_slave()
108 if (bus->ops->override_adr) in find_slave()
109 addr = bus->ops->override_adr(bus, addr); in find_slave()
118 if (link_id != bus->link_id) in find_slave()
136 struct sdw_bus *bus = cwd->bus; in sdw_acpi_check_duplicate()
139 if (adev == cwd->adev) in sdw_acpi_check_duplicate()
145 if (cwd->id.sdw_version != id.sdw_version || cwd->id.mfg_id != id.mfg_id || in sdw_acpi_check_duplicate()
146 cwd->id.part_id != id.part_id || cwd->id.class_id != id.class_id) in sdw_acpi_check_duplicate()
149 if (cwd->id.unique_id != id.unique_id) { in sdw_acpi_check_duplicate()
150 dev_dbg(bus->dev, in sdw_acpi_check_duplicate()
151 "Valid unique IDs 0x%x 0x%x for Slave mfg_id 0x%04x, part_id 0x%04x\n", in sdw_acpi_check_duplicate()
152 cwd->id.unique_id, id.unique_id, cwd->id.mfg_id, in sdw_acpi_check_duplicate()
153 cwd->id.part_id); in sdw_acpi_check_duplicate()
154 cwd->ignore_unique_id = false; in sdw_acpi_check_duplicate()
158 dev_err(bus->dev, in sdw_acpi_check_duplicate()
159 "Invalid unique IDs 0x%x 0x%x for Slave mfg_id 0x%04x, part_id 0x%04x\n", in sdw_acpi_check_duplicate()
160 cwd->id.unique_id, id.unique_id, cwd->id.mfg_id, cwd->id.part_id); in sdw_acpi_check_duplicate()
161 return -ENODEV; in sdw_acpi_check_duplicate()
177 /* Brute-force O(N^2) search for duplicates. */ in sdw_acpi_find_one()
178 ret = acpi_dev_for_each_child(ACPI_COMPANION(bus->dev), in sdw_acpi_find_one()
192 * sdw_acpi_find_slaves() - Find Slave devices in Master ACPI node
201 parent = ACPI_COMPANION(bus->dev); in sdw_acpi_find_slaves()
203 dev_err(bus->dev, "Can't find parent for acpi bind\n"); in sdw_acpi_find_slaves()
204 return -ENODEV; in sdw_acpi_find_slaves()
213 * sdw_of_find_slaves() - Find Slave devices in master device tree node
220 struct device *dev = bus->dev; in sdw_of_find_slaves()
223 for_each_child_of_node(bus->dev->of_node, node) { in sdw_of_find_slaves()
254 if (link_id != bus->link_id) in sdw_of_find_slaves()