Lines Matching defs:sdev
333 struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp);
335 swidget->module_info = sof_ipc4_find_module_by_uuid(sdev, &swidget->uuid);
340 dev_err(sdev->dev, "failed to find module info for widget %s with UUID %pUL\n",
373 struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp);
378 list_for_each_entry(scontrol, &sdev->kcontrol_list, list) {
544 struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp);
570 list_for_each_entry(w, &sdev->widget_list, list) {
961 sof_ipc4_update_resource_usage(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget,
995 sof_ipc4_update_cpc_from_manifest(sdev, fw_module, base_config);
998 dev_dbg(sdev->dev, "%s: ibs / obs: %u / %u, forcing cpc to 0 from %u\n",
1003 dev_dbg(sdev->dev, "%s: ibs / obs / cpc: %u / %u / %u\n",
1009 static int sof_ipc4_widget_assign_instance_id(struct snd_sof_dev *sdev,
1017 dev_err(sdev->dev, "failed to assign instance id for widget %s",
1026 static int sof_ipc4_update_hw_params(struct snd_sof_dev *sdev, struct snd_pcm_hw_params *params,
1046 dev_err(sdev->dev, "invalid PCM valid_bits %d\n", valid_bits);
1067 static bool sof_ipc4_is_single_format(struct snd_sof_dev *sdev,
1095 static int sof_ipc4_init_output_audio_fmt(struct snd_sof_dev *sdev,
1108 single_format = sof_ipc4_is_single_format(sdev, available_fmt->output_pin_fmts,
1139 static int sof_ipc4_get_valid_bits(struct snd_sof_dev *sdev, struct snd_pcm_hw_params *params)
1149 dev_err(sdev->dev, "invalid pcm frame format %d\n", params_format(params));
1154 static int sof_ipc4_init_input_audio_fmt(struct snd_sof_dev *sdev,
1170 dev_err(sdev->dev, "no input formats for %s\n", swidget->widget->name);
1174 single_format = sof_ipc4_is_single_format(sdev, available_fmt->input_pin_fmts,
1179 sample_valid_bits = sof_ipc4_get_valid_bits(sdev, params);
1198 dev_dbg(sdev->dev, "matched audio format index for %uHz, %ubit, %u channels: %d\n",
1205 dev_err(sdev->dev, "%s: Unsupported audio format: %uHz, %ubit, %u channels\n",
1219 dev_dbg(sdev->dev, "Init input audio formats for %s\n", swidget->widget->name);
1220 sof_ipc4_dbg_audio_format(sdev->dev, &available_fmt->input_pin_fmts[i], 1);
1278 static int snd_sof_get_hw_config_params(struct snd_sof_dev *sdev, struct snd_sof_dai *dai,
1288 list_for_each_entry(slink, &sdev->dai_link_list, list) {
1296 dev_err(sdev->dev, "%s: no DAI link found for DAI %s\n", __func__, dai->name);
1309 dev_err(sdev->dev, "%s: no matching hw_config found for DAI %s\n", __func__,
1318 dev_dbg(sdev->dev, "sample rate: %d sample width: %d channels: %d\n",
1324 static int snd_sof_get_nhlt_endpoint_data(struct snd_sof_dev *sdev, struct snd_sof_dai *dai,
1328 struct sof_ipc4_fw_data *ipc4_data = sdev->private;
1344 ret = snd_sof_get_hw_config_params(sdev, dai, &sample_rate, &channel_count,
1353 dev_dbg(sdev->dev, "dai index %d nhlt type %d direction %d\n",
1357 cfg = intel_nhlt_get_endpoint_blob(sdev->dev, ipc4_data->nhlt, dai_index, nhlt_type,
1362 dev_err(sdev->dev,
1375 static int snd_sof_get_nhlt_endpoint_data(struct snd_sof_dev *sdev, struct snd_sof_dai *dai,
1383 static bool sof_ipc4_copier_is_single_format(struct snd_sof_dev *sdev,
1416 struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp);
1432 dev_dbg(sdev->dev, "copier %s, type %d", swidget->widget->name, swidget->id);
1533 ret = snd_sof_get_nhlt_endpoint_data(sdev, dai, fe_params, ipc4_copier->dai_index,
1552 dev_err(sdev->dev, "unsupported type %d for copier %s",
1558 ret = sof_ipc4_init_input_audio_fmt(sdev, swidget, &copier_data->base_config, ref_params,
1564 single_output_format = sof_ipc4_copier_is_single_format(sdev,
1588 out_ref_valid_bits = sof_ipc4_get_valid_bits(sdev, fe_params);
1613 dev_dbg(sdev->dev, "copier %s: reference output rate %d, channels %d valid_bits %d\n",
1616 output_fmt_index = sof_ipc4_init_output_audio_fmt(sdev, &copier_data->base_config,
1620 dev_err(sdev->dev, "Failed to initialize output format for %s",
1635 dev_dbg(sdev->dev, "Output audio format for %s\n", swidget->widget->name);
1636 sof_ipc4_dbg_audio_format(sdev->dev, &available_fmt->output_pin_fmts[output_fmt_index], 1);
1679 list_for_each_entry(w, &sdev->widget_list, list) {
1725 ret = sof_ipc4_update_hw_params(sdev, pipeline_params, &copier_data->out_format);
1769 dev_err(sdev->dev, "Invalid configuration, TLV size %d length %d\n",
1780 dev_dbg(sdev->dev, "copier %s, IPC size is %d", swidget->widget->name, ipc_size);
1789 sof_ipc4_update_resource_usage(sdev, swidget, &copier_data->base_config);
1818 struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp);
1825 ret = sof_ipc4_init_input_audio_fmt(sdev, swidget, &gain->data.base_config,
1835 ret = sof_ipc4_init_output_audio_fmt(sdev, &gain->data.base_config, available_fmt,
1838 dev_err(sdev->dev, "Failed to initialize output format for %s",
1844 sof_ipc4_update_resource_usage(sdev, swidget, &gain->data.base_config);
1855 struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp);
1862 ret = sof_ipc4_init_input_audio_fmt(sdev, swidget, &mixer->base_config,
1872 ret = sof_ipc4_init_output_audio_fmt(sdev, &mixer->base_config, available_fmt,
1875 dev_err(sdev->dev, "Failed to initialize output format for %s",
1881 sof_ipc4_update_resource_usage(sdev, swidget, &mixer->base_config);
1892 struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp);
1900 input_format_index = sof_ipc4_init_input_audio_fmt(sdev, swidget, &src->data.base_config,
1910 dev_err(sdev->dev, "Invalid number of output formats: %d for SRC %s\n",
1930 output_format_index = sof_ipc4_init_output_audio_fmt(sdev, &src->data.base_config,
1934 dev_err(sdev->dev, "Failed to initialize output format for %s",
1940 sof_ipc4_update_resource_usage(sdev, swidget, &src->data.base_config);
1946 return sof_ipc4_update_hw_params(sdev, pipeline_params, out_audio_fmt);
2033 struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp);
2042 ret = sof_ipc4_init_input_audio_fmt(sdev, swidget, &process->base_config,
2052 output_fmt_index = sof_ipc4_init_output_audio_fmt(sdev, &process->base_config,
2056 dev_err(sdev->dev, "Failed to initialize output format for %s",
2070 ret = sof_ipc4_update_hw_params(sdev, pipeline_params, &process->output_format);
2076 sof_ipc4_update_resource_usage(sdev, swidget, &process->base_config);
2095 static int sof_ipc4_control_load_volume(struct snd_sof_dev *sdev, struct snd_sof_control *scontrol)
2127 static int sof_ipc4_control_load_bytes(struct snd_sof_dev *sdev, struct snd_sof_control *scontrol)
2134 dev_err(sdev->dev, "insufficient size for a bytes control %s: %zu.\n",
2140 dev_err(sdev->dev, "scontrol %s bytes data size %zu exceeds max %zu.\n",
2160 dev_err(sdev->dev, "Wrong ABI magic (%#x) for control: %s\n",
2170 dev_err(sdev->dev, "Control %s conflict in bytes %zu vs. priv size %zu.\n",
2192 static int sof_ipc4_control_setup(struct snd_sof_dev *sdev, struct snd_sof_control *scontrol)
2198 return sof_ipc4_control_load_volume(sdev, scontrol);
2200 return sof_ipc4_control_load_bytes(sdev, scontrol);
2208 static int sof_ipc4_widget_setup(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget)
2211 struct sof_ipc4_fw_data *ipc4_data = sdev->private;
2223 dev_warn(sdev->dev, "use_chain_dma set for scheduler %s",
2228 dev_dbg(sdev->dev, "pipeline: %d memory pages: %d\n", swidget->pipeline_id,
2237 dev_err(sdev->dev, "failed to assign pipeline id for %s: %d\n",
2311 dev_err(sdev->dev, "module %s has no config data!\n",
2323 dev_err(sdev->dev, "widget type %d not supported", swidget->id);
2328 ret = sof_ipc4_widget_assign_instance_id(sdev, swidget);
2330 dev_err(sdev->dev, "failed to assign instance id for %s\n",
2344 dev_dbg(sdev->dev, "Create widget %s instance %d - pipe %d - core %d\n",
2350 ret = sof_ipc_tx_message_no_reply(sdev->ipc, msg, ipc_size);
2352 dev_err(sdev->dev, "failed to create module %s\n", swidget->widget->name);
2366 static int sof_ipc4_widget_free(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget)
2369 struct sof_ipc4_fw_data *ipc4_data = sdev->private;
2381 dev_warn(sdev->dev, "use_chain_dma set for scheduler %s",
2394 ret = sof_ipc_tx_message_no_reply(sdev->ipc, &msg, 0);
2396 dev_err(sdev->dev, "failed to free pipeline widget %s\n",
2498 static int sof_ipc4_set_copier_sink_format(struct snd_sof_dev *sdev,
2504 const struct sof_ipc_ops *iops = sdev->ipc->ops;
2510 dev_dbg(sdev->dev, "%s set copier sink %d format\n",
2528 dev_err(sdev->dev, "Unable to get pin %d format for %s",
2546 return iops->set_get_data(sdev, &msg, msg.data_size, true);
2549 static int sof_ipc4_route_setup(struct snd_sof_dev *sdev, struct snd_sof_route *sroute)
2566 dev_err(sdev->dev,
2575 dev_err(sdev->dev,
2587 dev_err(sdev->dev, "failed to get queue ID for source widget: %s\n",
2595 dev_err(sdev->dev, "failed to get queue ID for sink widget: %s\n",
2604 ret = sof_ipc4_set_copier_sink_format(sdev, src_widget, sink_widget,
2607 dev_err(sdev->dev, "failed to set sink format for %s source queue ID %d\n",
2613 dev_dbg(sdev->dev, "bind %s:%d -> %s:%d\n",
2631 ret = sof_ipc_tx_message_no_reply(sdev->ipc, &msg, 0);
2633 dev_err(sdev->dev, "failed to bind modules %s:%d -> %s:%d\n",
2647 static int sof_ipc4_route_free(struct snd_sof_dev *sdev, struct snd_sof_route *sroute)
2665 dev_dbg(sdev->dev, "unbind modules %s:%d -> %s:%d\n",
2690 ret = sof_ipc_tx_message_no_reply(sdev->ipc, &msg, 0);
2692 dev_err(sdev->dev, "failed to unbind modules %s:%d -> %s:%d\n",
2702 static int sof_ipc4_dai_config(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget,
2713 dev_err(sdev->dev, "Invalid DAI or DAI private data for %s\n",
2750 dev_err(sdev->dev, "%s: unsupported dai type %d\n", __func__,
2761 struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp);
2762 struct sof_ipc4_fw_data *ipc4_data = sdev->private;
2802 ipc4_data->nhlt = devm_kmemdup(sdev->dev, manifest_tlv->data,
2819 static int sof_ipc4_dai_get_clk(struct snd_sof_dev *sdev, struct snd_sof_dai *dai, int clk_type)
2831 list_for_each_entry(slink, &sdev->dai_link_list, list) {
2839 dev_err(sdev->dev, "no DAI link found for DAI %s\n", dai->name);
2852 dev_err(sdev->dev, "no matching hw_config found for DAI %s\n", dai->name);
2864 dev_err(sdev->dev, "Invalid clk type for SSP %d\n", clk_type);
2869 dev_err(sdev->dev, "DAI type %d not supported yet!\n", ipc4_copier->dai_type);
2876 static int sof_ipc4_tear_down_all_pipelines(struct snd_sof_dev *sdev, bool verify)
2892 list_for_each_entry(spcm, &sdev->pcm_list, list) {
2900 ret = sof_pcm_stream_free(sdev, substream, spcm, dir, true);
2909 static int sof_ipc4_link_setup(struct snd_sof_dev *sdev, struct snd_soc_dai_link *link)