Lines Matching refs:endp
52 struct nhlt_endpoint *endp; in nhlt_add_endpoint() local
60 endp = &nhlt->endpoints[nhlt->num_endpoints]; in nhlt_add_endpoint()
62 endp->link_type = link_type; in nhlt_add_endpoint()
63 endp->instance_id = nhlt->current_instance_id[link_type]; in nhlt_add_endpoint()
64 endp->vendor_id = vid; in nhlt_add_endpoint()
65 endp->device_id = did; in nhlt_add_endpoint()
66 endp->revision_id = NHLT_RID; in nhlt_add_endpoint()
67 endp->subsystem_id = nhlt->subsystem_id; in nhlt_add_endpoint()
68 endp->device_type = device_type; in nhlt_add_endpoint()
69 endp->direction = dir; in nhlt_add_endpoint()
70 endp->virtual_bus_id = DEFAULT_VIRTUAL_BUS_ID; in nhlt_add_endpoint()
71 endp->num_formats = 0; in nhlt_add_endpoint()
75 return endp; in nhlt_add_endpoint()
102 int nhlt_endpoint_append_config(struct nhlt_endpoint *endp, const void *config, in nhlt_endpoint_append_config() argument
105 return append_specific_config(&endp->config, config, config_sz); in nhlt_endpoint_append_config()
108 struct nhlt_format *nhlt_add_format(struct nhlt_endpoint *endp, in nhlt_add_format() argument
117 if (endp->num_formats >= MAX_FORMATS) in nhlt_add_format()
120 fmt = &endp->formats[endp->num_formats]; in nhlt_add_format()
138 endp->num_formats++; in nhlt_add_format()
149 int nhlt_endpoint_add_formats(struct nhlt_endpoint *endp, in nhlt_endpoint_add_formats() argument
165 fmt = nhlt_add_format(endp, cfg->num_channels, in nhlt_endpoint_add_formats()
225 static size_t calc_endpoint_size(struct nhlt_endpoint *endp) in calc_endpoint_size() argument
230 sz += sizeof(endp->length) + sizeof(endp->link_type); in calc_endpoint_size()
231 sz += sizeof(endp->instance_id) + sizeof(endp->vendor_id); in calc_endpoint_size()
232 sz += sizeof(endp->device_id) + sizeof(endp->revision_id); in calc_endpoint_size()
233 sz += sizeof(endp->subsystem_id) + sizeof(endp->device_type); in calc_endpoint_size()
234 sz += sizeof(endp->direction) + sizeof(endp->virtual_bus_id); in calc_endpoint_size()
235 sz += calc_specific_config_size(&endp->config); in calc_endpoint_size()
236 sz += sizeof(endp->num_formats); in calc_endpoint_size()
238 for (i = 0; i < endp->num_formats; i++) in calc_endpoint_size()
239 sz += calc_format_size(&endp->formats[i]); in calc_endpoint_size()
242 endp->length = sz; in calc_endpoint_size()
274 struct nhlt_endpoint *endp = &nhlt->endpoints[i]; in nhlt_free_resources() local
276 free(endp->config.capabilities); in nhlt_free_resources()
277 for (j = 0; j < endp->num_formats; j++) { in nhlt_free_resources()
278 struct nhlt_format *fmt = &endp->formats[j]; in nhlt_free_resources()
350 static void serialise_endpoint(struct nhlt_endpoint *endp, struct cursor *cur) in serialise_endpoint() argument
355 ser32(cur, endp->length); in serialise_endpoint()
356 ser8(cur, endp->link_type); in serialise_endpoint()
357 ser8(cur, endp->instance_id); in serialise_endpoint()
358 ser16(cur, endp->vendor_id); in serialise_endpoint()
359 ser16(cur, endp->device_id); in serialise_endpoint()
360 ser16(cur, endp->revision_id); in serialise_endpoint()
361 ser32(cur, endp->subsystem_id); in serialise_endpoint()
362 ser8(cur, endp->device_type); in serialise_endpoint()
363 ser8(cur, endp->direction); in serialise_endpoint()
364 ser8(cur, endp->virtual_bus_id); in serialise_endpoint()
365 serialise_specific_config(&endp->config, cur); in serialise_endpoint()
366 ser8(cur, endp->num_formats); in serialise_endpoint()
368 for (i = 0; i < endp->num_formats; i++) in serialise_endpoint()
369 serialise_format(&endp->formats[i], cur); in serialise_endpoint()
433 struct nhlt_endpoint *endp; in _nhlt_add_single_endpoint() local
436 endp = nhlt_add_endpoint(nhlt, epd->link, epd->device, epd->direction, in _nhlt_add_single_endpoint()
438 if (!endp) in _nhlt_add_single_endpoint()
441 endp->virtual_bus_id = virtual_bus_id; in _nhlt_add_single_endpoint()
443 ret = nhlt_endpoint_append_config(endp, epd->cfg, epd->cfg_size); in _nhlt_add_single_endpoint()
447 ret = nhlt_endpoint_add_formats(endp, epd->formats, epd->num_formats); in _nhlt_add_single_endpoint()