Lines Matching +full:mipi +full:- +full:mode

1 // SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
5 * The MIPI SDCA specification is available for public downloads at
6 * https://www.mipi.org/mipi-sdca-v1-0-download
25 * Should be long enough to encompass all the MIPI DisCo properties.
56 return -EINVAL; in patch_sdca_function_type()
94 struct device *dev = &adev->dev; in find_sdca_function()
102 if (sdca_data->num_functions >= SDCA_MAX_FUNCTION_COUNT) { in find_sdca_function()
104 return -EINVAL; in find_sdca_function()
107 ret = acpi_get_local_u64_address(adev->handle, &addr); in find_sdca_function()
113 return -ENODEV; in find_sdca_function()
121 * but the SDCA/DisCo specs defined the notion of "DC value" - a constant in find_sdca_function()
127 "mipi-sdca-control-0x5-subproperties"); in find_sdca_function()
129 return -ENODEV; in find_sdca_function()
131 ret = fwnode_property_read_u32(control5, "mipi-sdca-control-dc-value", in find_sdca_function()
142 ret = patch_sdca_function_type(sdca_data->interface_revision, &function_type); in find_sdca_function()
145 sdca_data->interface_revision, function_type); in find_sdca_function()
153 return -EINVAL; in find_sdca_function()
160 function_index = sdca_data->num_functions; in find_sdca_function()
161 sdca_data->function[function_index].adr = addr; in find_sdca_function()
162 sdca_data->function[function_index].type = function_type; in find_sdca_function()
163 sdca_data->function[function_index].name = function_name; in find_sdca_function()
164 sdca_data->function[function_index].node = function_node; in find_sdca_function()
165 sdca_data->num_functions++; in find_sdca_function()
171 * sdca_lookup_functions - Parse sdca_device_desc for each Function
182 struct device *dev = &slave->dev; in sdca_lookup_functions()
183 struct acpi_device *adev = to_acpi_device_node(dev->fwnode); in sdca_lookup_functions()
190 acpi_dev_for_each_child(adev, find_sdca_function, &slave->sdca_data); in sdca_lookup_functions()
208 "mipi-sdca-function-initialization-table"); in find_sdca_init_table()
209 if (!num_init_writes || num_init_writes == -EINVAL) { in find_sdca_init_table()
217 return -EINVAL; in find_sdca_init_table()
220 return -EINVAL; in find_sdca_init_table()
225 return -ENOMEM; in find_sdca_init_table()
228 "mipi-sdca-function-initialization-table", in find_sdca_init_table()
235 return -ENOMEM; in find_sdca_init_table()
242 function->num_init_table = num_init_writes; in find_sdca_init_table()
243 function->init_table = init_write; in find_sdca_init_table()
252 switch (SDCA_CTL_TYPE(entity->type, control->sel)) { in find_sdca_control_label()
538 return devm_kasprintf(dev, GFP_KERNEL, "Imp-Def %#x", control->sel); in find_sdca_control_label()
545 switch (SDCA_CTL_TYPE(entity->type, control->sel)) { in find_sdca_control_bits()
614 switch (SDCA_CTL_TYPE(entity->type, control->sel)) { in find_sdca_control_datatype()
791 num_range = fwnode_property_count_u8(control_node, "mipi-sdca-control-range"); in find_sdca_control_range()
792 if (!num_range || num_range == -EINVAL) in find_sdca_control_range()
799 return -ENOMEM; in find_sdca_control_range()
801 fwnode_property_read_u8_array(control_node, "mipi-sdca-control-range", in find_sdca_control_range()
806 range->cols = le16_to_cpu(limits[0]); in find_sdca_control_range()
807 range->rows = le16_to_cpu(limits[1]); in find_sdca_control_range()
808 range->data = (u32 *)&limits[2]; in find_sdca_control_range()
810 num_range = (num_range - (2 * sizeof(*limits))) / sizeof(*range->data); in find_sdca_control_range()
811 if (num_range != range->cols * range->rows) in find_sdca_control_range()
812 return -EINVAL; in find_sdca_control_range()
815 range->data[i] = le32_to_cpu(range->data[i]); in find_sdca_control_range()
830 snprintf(property, sizeof(property), "mipi-sdca-control-%s", label); in find_sdca_control_value()
833 if (ret == -EINVAL) in find_sdca_control_value()
839 for_each_set_bit(cn, (unsigned long *)&control->cn_list, in find_sdca_control_value()
840 BITS_PER_TYPE(control->cn_list)) { in find_sdca_control_value()
843 "mipi-sdca-control-cn-%d-%s", cn, label); in find_sdca_control_value()
850 control->values[i] = tmp; in find_sdca_control_value()
858 * TODO: Add support for -cn- properties, allowing different channels to have
868 ret = fwnode_property_read_u32(control_node, "mipi-sdca-control-access-mode", &tmp); in find_sdca_entity_control()
870 dev_err(dev, "%s: control %#x: access mode missing: %d\n", in find_sdca_entity_control()
871 entity->label, control->sel, ret); in find_sdca_entity_control()
875 control->mode = tmp; in find_sdca_entity_control()
877 ret = fwnode_property_read_u32(control_node, "mipi-sdca-control-access-layer", &tmp); in find_sdca_entity_control()
880 entity->label, control->sel, ret); in find_sdca_entity_control()
884 control->layers = tmp; in find_sdca_entity_control()
886 ret = fwnode_property_read_u64(control_node, "mipi-sdca-control-cn-list", in find_sdca_entity_control()
887 &control->cn_list); in find_sdca_entity_control()
888 if (ret == -EINVAL) { in find_sdca_entity_control()
889 /* Spec allows not specifying cn-list if only the first number is used */ in find_sdca_entity_control()
890 control->cn_list = 0x1; in find_sdca_entity_control()
891 } else if (ret || !control->cn_list) { in find_sdca_entity_control()
893 entity->label, control->sel, ret); in find_sdca_entity_control()
897 control->values = devm_kzalloc(dev, hweight64(control->cn_list), GFP_KERNEL); in find_sdca_entity_control()
898 if (!control->values) in find_sdca_entity_control()
899 return -ENOMEM; in find_sdca_entity_control()
901 switch (control->mode) { in find_sdca_entity_control()
904 "dc-value"); in find_sdca_entity_control()
907 entity->label, control->sel, ret); in find_sdca_entity_control()
911 control->has_fixed = true; in find_sdca_entity_control()
916 "default-value"); in find_sdca_entity_control()
918 control->has_default = true; in find_sdca_entity_control()
921 "fixed-value"); in find_sdca_entity_control()
923 control->has_fixed = true; in find_sdca_entity_control()
926 control->deferrable = fwnode_property_read_bool(control_node, in find_sdca_entity_control()
927 "mipi-sdca-control-deferrable"); in find_sdca_entity_control()
933 ret = find_sdca_control_range(dev, control_node, &control->range); in find_sdca_entity_control()
936 entity->label, control->sel, ret); in find_sdca_entity_control()
941 "mipi-sdca-control-interrupt-position", in find_sdca_entity_control()
944 control->interrupt_position = tmp; in find_sdca_entity_control()
946 control->interrupt_position = SDCA_NO_INTERRUPT; in find_sdca_entity_control()
948 control->label = find_sdca_control_label(dev, entity, control); in find_sdca_entity_control()
949 if (!control->label) in find_sdca_entity_control()
950 return -ENOMEM; in find_sdca_entity_control()
952 control->type = find_sdca_control_datatype(entity, control); in find_sdca_entity_control()
953 control->nbits = find_sdca_control_bits(entity, control); in find_sdca_entity_control()
955 dev_info(dev, "%s: %s: control %#x mode %#x layers %#x cn %#llx int %d %s\n", in find_sdca_entity_control()
956 entity->label, control->label, control->sel, in find_sdca_entity_control()
957 control->mode, control->layers, control->cn_list, in find_sdca_entity_control()
958 control->interrupt_position, control->deferrable ? "deferrable" : ""); in find_sdca_entity_control()
973 ret = fwnode_property_read_u64(entity_node, "mipi-sdca-control-list", &control_list); in find_sdca_entity_controls()
974 if (ret == -EINVAL) { in find_sdca_entity_controls()
976 dev_warn(dev, "%s: missing control list\n", entity->label); in find_sdca_entity_controls()
979 dev_err(dev, "%s: failed to read control list: %d\n", entity->label, ret); in find_sdca_entity_controls()
988 return -ENOMEM; in find_sdca_entity_controls()
996 /* DisCo uses upper-case for hex numbers */ in find_sdca_entity_controls()
998 "mipi-sdca-control-0x%X-subproperties", control_sel); in find_sdca_entity_controls()
1003 entity->label, control_property); in find_sdca_entity_controls()
1004 return -EINVAL; in find_sdca_entity_controls()
1017 entity->num_controls = num_controls; in find_sdca_entity_controls()
1018 entity->controls = controls; in find_sdca_entity_controls()
1025 switch (terminal->type) { in find_sdca_iot_dataport()
1051 struct sdca_entity_iot *terminal = &entity->iot; in find_sdca_entity_iot()
1055 ret = fwnode_property_read_u32(entity_node, "mipi-sdca-terminal-type", &tmp); in find_sdca_entity_iot()
1057 dev_err(dev, "%s: terminal type missing: %d\n", entity->label, ret); in find_sdca_entity_iot()
1061 terminal->type = tmp; in find_sdca_entity_iot()
1062 terminal->is_dataport = find_sdca_iot_dataport(terminal); in find_sdca_entity_iot()
1065 "mipi-sdca-terminal-reference-number", &tmp); in find_sdca_entity_iot()
1067 terminal->reference = tmp; in find_sdca_entity_iot()
1070 "mipi-sdca-terminal-connector-type", &tmp); in find_sdca_entity_iot()
1072 terminal->connector = tmp; in find_sdca_entity_iot()
1075 "mipi-sdca-terminal-transducer-count", &tmp); in find_sdca_entity_iot()
1077 terminal->num_transducer = tmp; in find_sdca_entity_iot()
1080 entity->label, terminal->type, terminal->reference, in find_sdca_entity_iot()
1081 terminal->connector, terminal->num_transducer); in find_sdca_entity_iot()
1090 struct sdca_entity_cs *clock = &entity->cs; in find_sdca_entity_cs()
1094 ret = fwnode_property_read_u32(entity_node, "mipi-sdca-cs-type", &tmp); in find_sdca_entity_cs()
1096 dev_err(dev, "%s: clock type missing: %d\n", entity->label, ret); in find_sdca_entity_cs()
1100 clock->type = tmp; in find_sdca_entity_cs()
1103 "mipi-sdca-clock-valid-max-delay", &tmp); in find_sdca_entity_cs()
1105 clock->max_delay = tmp; in find_sdca_entity_cs()
1107 dev_info(dev, "%s: clock type %#x delay %d\n", entity->label, in find_sdca_entity_cs()
1108 clock->type, clock->max_delay); in find_sdca_entity_cs()
1118 struct sdca_entity_pde *power = &entity->pde; in find_sdca_entity_pde()
1125 "mipi-sdca-powerdomain-transition-max-delay"); in find_sdca_entity_pde()
1128 entity->label, num_delays); in find_sdca_entity_pde()
1129 return -EINVAL; in find_sdca_entity_pde()
1132 entity->label, mult_delay); in find_sdca_entity_pde()
1133 return -EINVAL; in find_sdca_entity_pde()
1136 entity->label); in find_sdca_entity_pde()
1137 return -EINVAL; in find_sdca_entity_pde()
1142 return -ENOMEM; in find_sdca_entity_pde()
1145 "mipi-sdca-powerdomain-transition-max-delay", in find_sdca_entity_pde()
1152 return -ENOMEM; in find_sdca_entity_pde()
1159 dev_info(dev, "%s: from %#x to %#x delay %dus\n", entity->label, in find_sdca_entity_pde()
1163 power->num_max_delay = num_delays; in find_sdca_entity_pde()
1164 power->max_delay = delays; in find_sdca_entity_pde()
1184 struct sdca_entity_ge *group = &entity->ge; in find_sdca_entity_ge()
1191 "mipi-sdca-ge-selectedmode-controls-affected"); in find_sdca_entity_ge()
1196 entity->label, num_affected); in find_sdca_entity_ge()
1200 entity->label); in find_sdca_entity_ge()
1201 return -EINVAL; in find_sdca_entity_ge()
1206 return -ENOMEM; in find_sdca_entity_ge()
1209 "mipi-sdca-ge-selectedmode-controls-affected", in find_sdca_entity_ge()
1212 group->num_modes = *affected_list; in find_sdca_entity_ge()
1215 group->modes = devm_kcalloc(dev, group->num_modes, sizeof(*group->modes), in find_sdca_entity_ge()
1217 if (!group->modes) in find_sdca_entity_ge()
1218 return -ENOMEM; in find_sdca_entity_ge()
1220 for (i = 0; i < group->num_modes; i++) { in find_sdca_entity_ge()
1222 struct sdca_ge_mode *mode = &group->modes[i]; in find_sdca_entity_ge() local
1228 mode->val = raw->val; in find_sdca_entity_ge()
1229 mode->num_controls = raw->num_controls; in find_sdca_entity_ge()
1231 affected_iter += mode->num_controls * sizeof(raw->controls[0]); in find_sdca_entity_ge()
1235 mode->controls = devm_kcalloc(dev, mode->num_controls, in find_sdca_entity_ge()
1236 sizeof(*mode->controls), GFP_KERNEL); in find_sdca_entity_ge()
1237 if (!mode->controls) in find_sdca_entity_ge()
1238 return -ENOMEM; in find_sdca_entity_ge()
1240 for (j = 0; j < mode->num_controls; j++) { in find_sdca_entity_ge()
1241 mode->controls[j].id = raw->controls[j].id; in find_sdca_entity_ge()
1242 mode->controls[j].sel = raw->controls[j].sel; in find_sdca_entity_ge()
1243 mode->controls[j].cn = raw->controls[j].cn; in find_sdca_entity_ge()
1244 mode->controls[j].val = le32_to_cpu(raw->controls[j].val); in find_sdca_entity_ge()
1251 dev_err(dev, "%s: malformed affected controls list\n", entity->label); in find_sdca_entity_ge()
1252 return -EINVAL; in find_sdca_entity_ge()
1259 struct sdca_entity_hide *hide = &entity->hide; in find_sdca_entity_hide()
1260 unsigned int delay, *af_list = hide->af_number_list; in find_sdca_entity_hide()
1265 "mipi-sdca-RxUMP-ownership-transition-maxdelay", &delay); in find_sdca_entity_hide()
1267 hide->max_delay = delay; in find_sdca_entity_hide()
1269 nval = fwnode_property_count_u32(entity_node, "mipi-sdca-HIDTx-supported-report-ids"); in find_sdca_entity_hide()
1271 hide->num_hidtx_ids = nval; in find_sdca_entity_hide()
1272 hide->hidtx_ids = devm_kcalloc(dev, hide->num_hidtx_ids, in find_sdca_entity_hide()
1273 sizeof(*hide->hidtx_ids), GFP_KERNEL); in find_sdca_entity_hide()
1274 if (!hide->hidtx_ids) in find_sdca_entity_hide()
1275 return -ENOMEM; in find_sdca_entity_hide()
1278 "mipi-sdca-HIDTx-supported-report-ids", in find_sdca_entity_hide()
1279 hide->hidtx_ids, in find_sdca_entity_hide()
1280 hide->num_hidtx_ids); in find_sdca_entity_hide()
1285 nval = fwnode_property_count_u32(entity_node, "mipi-sdca-HIDRx-supported-report-ids"); in find_sdca_entity_hide()
1287 hide->num_hidrx_ids = nval; in find_sdca_entity_hide()
1288 hide->hidrx_ids = devm_kcalloc(dev, hide->num_hidrx_ids, in find_sdca_entity_hide()
1289 sizeof(*hide->hidrx_ids), GFP_KERNEL); in find_sdca_entity_hide()
1290 if (!hide->hidrx_ids) in find_sdca_entity_hide()
1291 return -ENOMEM; in find_sdca_entity_hide()
1294 "mipi-sdca-HIDRx-supported-report-ids", in find_sdca_entity_hide()
1295 hide->hidrx_ids, in find_sdca_entity_hide()
1296 hide->num_hidrx_ids); in find_sdca_entity_hide()
1301 nval = fwnode_property_count_u32(entity_node, "mipi-sdca-hide-related-audio-function-list"); in find_sdca_entity_hide()
1305 return -EINVAL; in find_sdca_entity_hide()
1308 return -EINVAL; in find_sdca_entity_hide()
1311 hide->hide_reside_function_num = nval; in find_sdca_entity_hide()
1313 "mipi-sdca-hide-related-audio-function-list", af_list, nval); in find_sdca_entity_hide()
1315 nval = fwnode_property_count_u8(function_node, "mipi-sdca-hid-descriptor"); in find_sdca_entity_hide()
1317 fwnode_property_read_u8_array(function_node, "mipi-sdca-hid-descriptor", in find_sdca_entity_hide()
1318 (u8 *)&hide->hid_desc, nval); in find_sdca_entity_hide()
1320 if (hide->hid_desc.bNumDescriptors) { in find_sdca_entity_hide()
1321 nval = fwnode_property_count_u8(function_node, "mipi-sdca-report-descriptor"); in find_sdca_entity_hide()
1325 return -ENOMEM; in find_sdca_entity_hide()
1326 hide->hid_report_desc = report_desc; in find_sdca_entity_hide()
1327 fwnode_property_read_u8_array(function_node, "mipi-sdca-report-descriptor", in find_sdca_entity_hide()
1350 ret = fwnode_property_read_string(entity_node, "mipi-sdca-entity-label", in find_sdca_entity()
1351 &entity->label); in find_sdca_entity()
1354 function_node, entity->id, ret); in find_sdca_entity()
1358 ret = fwnode_property_read_u32(entity_node, "mipi-sdca-entity-type", &tmp); in find_sdca_entity()
1360 dev_err(dev, "%s: type missing: %d\n", entity->label, ret); in find_sdca_entity()
1364 entity->type = tmp; in find_sdca_entity()
1367 entity->label, entity->id, entity->type); in find_sdca_entity()
1369 switch (entity->type) { in find_sdca_entity()
1409 "mipi-sdca-entity-id-list"); in find_sdca_entities()
1413 return -EINVAL; in find_sdca_entities()
1417 return -EINVAL; in find_sdca_entities()
1423 return -ENOMEM; in find_sdca_entities()
1427 return -ENOMEM; in find_sdca_entities()
1429 fwnode_property_read_u32_array(function_node, "mipi-sdca-entity-id-list", in find_sdca_entities()
1440 /* DisCo uses upper-case for hex numbers */ in find_sdca_entities()
1442 "mipi-sdca-entity-id-0x%X-subproperties", entities[i].id); in find_sdca_entities()
1448 return -EINVAL; in find_sdca_entities()
1467 function->num_entities = num_entities + 1; in find_sdca_entities()
1468 function->entities = entities; in find_sdca_entities()
1478 for (i = 0; i < function->num_entities; i++) { in find_sdca_entity_by_label()
1479 struct sdca_entity *entity = &function->entities[i]; in find_sdca_entity_by_label()
1481 if (!strcmp(entity->label, entity_label)) in find_sdca_entity_by_label()
1493 for (i = 0; i < function->num_entities; i++) { in find_sdca_entity_by_id()
1494 struct sdca_entity *entity = &function->entities[i]; in find_sdca_entity_by_id()
1496 if (entity->id == id) in find_sdca_entity_by_id()
1508 struct sdca_entity_iot *terminal = &entity->iot; in find_sdca_entity_connection_iot()
1515 "mipi-sdca-terminal-clock-connection"); in find_sdca_entity_connection_iot()
1519 ret = fwnode_property_read_string(clock_node, "mipi-sdca-entity-label", in find_sdca_entity_connection_iot()
1522 dev_err(dev, "%s: clock label missing: %d\n", entity->label, ret); in find_sdca_entity_connection_iot()
1530 entity->label, clock_label); in find_sdca_entity_connection_iot()
1532 return -EINVAL; in find_sdca_entity_connection_iot()
1535 terminal->clock = clock_entity; in find_sdca_entity_connection_iot()
1537 dev_info(dev, "%s -> %s\n", clock_entity->label, entity->label); in find_sdca_entity_connection_iot()
1548 struct sdca_entity_pde *power = &entity->pde; in find_sdca_entity_connection_pde()
1555 "mipi-sdca-powerdomain-managed-list"); in find_sdca_entity_connection_pde()
1559 dev_err(dev, "%s: managed list missing: %d\n", entity->label, num_managed); in find_sdca_entity_connection_pde()
1563 entity->label); in find_sdca_entity_connection_pde()
1564 return -EINVAL; in find_sdca_entity_connection_pde()
1569 return -ENOMEM; in find_sdca_entity_connection_pde()
1573 return -ENOMEM; in find_sdca_entity_connection_pde()
1576 "mipi-sdca-powerdomain-managed-list", in find_sdca_entity_connection_pde()
1583 entity->label, managed_list[i]); in find_sdca_entity_connection_pde()
1584 return -EINVAL; in find_sdca_entity_connection_pde()
1587 dev_info(dev, "%s -> %s\n", managed[i]->label, entity->label); in find_sdca_entity_connection_pde()
1590 power->num_managed = num_managed; in find_sdca_entity_connection_pde()
1591 power->managed = managed; in find_sdca_entity_connection_pde()
1603 for (i = 0; i < entity->ge.num_modes; i++) { in find_sdca_entity_connection_ge()
1604 struct sdca_ge_mode *mode = &entity->ge.modes[i]; in find_sdca_entity_connection_ge() local
1606 for (j = 0; j < mode->num_controls; j++) { in find_sdca_entity_connection_ge()
1607 struct sdca_ge_control *affected = &mode->controls[j]; in find_sdca_entity_connection_ge()
1610 managed = find_sdca_entity_by_id(function, affected->id); in find_sdca_entity_connection_ge()
1613 entity->label, affected->id); in find_sdca_entity_connection_ge()
1614 return -EINVAL; in find_sdca_entity_connection_ge()
1617 if (managed->group && managed->group != entity) { in find_sdca_entity_connection_ge()
1620 managed->label, managed->group->label, in find_sdca_entity_connection_ge()
1621 entity->label); in find_sdca_entity_connection_ge()
1622 return -EINVAL; in find_sdca_entity_connection_ge()
1625 managed->group = entity; in find_sdca_entity_connection_ge()
1642 switch (entity->type) { in find_sdca_entity_connection()
1663 ret = fwnode_property_read_u64(entity_node, "mipi-sdca-input-pin-list", &pin_list); in find_sdca_entity_connection()
1664 if (ret == -EINVAL) { in find_sdca_entity_connection()
1668 dev_err(dev, "%s: failed to read pin list: %d\n", entity->label, ret); in find_sdca_entity_connection()
1672 * Each bit set in the pin-list refers to an entity_id in this in find_sdca_entity_connection()
1674 * for Function-level configurations. in find_sdca_entity_connection()
1676 dev_err(dev, "%s: pin 0 used as input\n", entity->label); in find_sdca_entity_connection()
1677 return -EINVAL; in find_sdca_entity_connection()
1685 return -ENOMEM; in find_sdca_entity_connection()
1694 snprintf(pin_property, sizeof(pin_property), "mipi-sdca-input-pin-%d", pin); in find_sdca_entity_connection()
1699 entity->label, pin_property); in find_sdca_entity_connection()
1700 return -EINVAL; in find_sdca_entity_connection()
1703 ret = fwnode_property_read_string(connected_node, "mipi-sdca-entity-label", in find_sdca_entity_connection()
1707 entity->label, pin, ret); in find_sdca_entity_connection()
1715 entity->label, connected_label); in find_sdca_entity_connection()
1717 return -EINVAL; in find_sdca_entity_connection()
1722 dev_info(dev, "%s -> %s\n", connected_entity->label, entity->label); in find_sdca_entity_connection()
1728 entity->num_sources = num_pins; in find_sdca_entity_connection()
1729 entity->sources = pins; in find_sdca_entity_connection()
1741 for (i = 0; i < function->num_entities - 1; i++) { in find_sdca_connections()
1742 struct sdca_entity *entity = &function->entities[i]; in find_sdca_connections()
1747 /* DisCo uses upper-case for hex numbers */ in find_sdca_connections()
1749 "mipi-sdca-entity-id-0x%X-subproperties", in find_sdca_connections()
1750 entity->id); in find_sdca_connections()
1756 return -EINVAL; in find_sdca_connections()
1776 ret = fwnode_property_read_u32(channel_node, "mipi-sdca-cluster-channel-id", &tmp); in find_sdca_cluster_channel()
1779 cluster->id, ret); in find_sdca_cluster_channel()
1783 channel->id = tmp; in find_sdca_cluster_channel()
1786 "mipi-sdca-cluster-channel-purpose", in find_sdca_cluster_channel()
1790 cluster->id, channel->id, ret); in find_sdca_cluster_channel()
1794 channel->purpose = tmp; in find_sdca_cluster_channel()
1797 "mipi-sdca-cluster-channel-relationship", in find_sdca_cluster_channel()
1801 cluster->id, channel->id, ret); in find_sdca_cluster_channel()
1805 channel->relationship = tmp; in find_sdca_cluster_channel()
1808 cluster->id, channel->id, channel->purpose, channel->relationship); in find_sdca_cluster_channel()
1821 ret = fwnode_property_read_u32(cluster_node, "mipi-sdca-channel-count", in find_sdca_cluster_channels()
1825 cluster->id, ret); in find_sdca_cluster_channels()
1829 cluster->id); in find_sdca_cluster_channels()
1830 return -EINVAL; in find_sdca_cluster_channels()
1835 return -ENOMEM; in find_sdca_cluster_channels()
1841 /* DisCo uses upper-case for hex numbers */ in find_sdca_cluster_channels()
1843 "mipi-sdca-channel-%d-subproperties", i + 1); in find_sdca_cluster_channels()
1848 cluster->id, channel_property); in find_sdca_cluster_channels()
1849 return -EINVAL; in find_sdca_cluster_channels()
1858 cluster->num_channels = num_channels; in find_sdca_cluster_channels()
1859 cluster->channels = channels; in find_sdca_cluster_channels()
1873 num_clusters = fwnode_property_count_u32(function_node, "mipi-sdca-cluster-id-list"); in find_sdca_clusters()
1874 if (!num_clusters || num_clusters == -EINVAL) { in find_sdca_clusters()
1882 return -EINVAL; in find_sdca_clusters()
1887 return -ENOMEM; in find_sdca_clusters()
1891 return -ENOMEM; in find_sdca_clusters()
1893 fwnode_property_read_u32_array(function_node, "mipi-sdca-cluster-id-list", in find_sdca_clusters()
1904 /* DisCo uses upper-case for hex numbers */ in find_sdca_clusters()
1906 "mipi-sdca-cluster-id-0x%X-subproperties", clusters[i].id); in find_sdca_clusters()
1912 return -EINVAL; in find_sdca_clusters()
1921 function->num_clusters = num_clusters; in find_sdca_clusters()
1922 function->clusters = clusters; in find_sdca_clusters()
1928 * sdca_parse_function - parse ACPI DisCo for a Function
1942 function->desc = function_desc; in sdca_parse_function()
1944 ret = fwnode_property_read_u32(function_desc->node, in sdca_parse_function()
1945 "mipi-sdca-function-busy-max-delay", &tmp); in sdca_parse_function()
1947 function->busy_max_delay = tmp; in sdca_parse_function()
1949 dev_info(dev, "%pfwP: name %s delay %dus\n", function->desc->node, in sdca_parse_function()
1950 function->desc->name, function->busy_max_delay); in sdca_parse_function()
1952 ret = find_sdca_init_table(dev, function_desc->node, function); in sdca_parse_function()
1956 ret = find_sdca_entities(dev, function_desc->node, function); in sdca_parse_function()
1960 ret = find_sdca_connections(dev, function_desc->node, function); in sdca_parse_function()
1964 ret = find_sdca_clusters(dev, function_desc->node, function); in sdca_parse_function()
1978 for (i = 0; i < entity->num_controls; i++) { in sdca_selector_find_control()
1979 struct sdca_control *control = &entity->controls[i]; in sdca_selector_find_control()
1981 if (control->sel == sel) in sdca_selector_find_control()
1985 dev_err(dev, "%s: control %#x: missing\n", entity->label, sel); in sdca_selector_find_control()
1995 struct sdca_control_range *range = &control->range; in sdca_control_find_range()
1997 if ((cols && range->cols != cols) || (rows && range->rows != rows) || in sdca_control_find_range()
1998 !range->data) { in sdca_control_find_range()
2000 entity->label, control->sel, range->cols, range->rows); in sdca_control_find_range()
2028 for (i = 0; i < function->num_clusters; i++) { in sdca_id_find_cluster()
2029 struct sdca_cluster *cluster = &function->clusters[i]; in sdca_id_find_cluster()
2031 if (cluster->id == id) in sdca_id_find_cluster()
2035 dev_err(dev, "%s: cluster %#x: missing\n", function->desc->name, id); in sdca_id_find_cluster()