Skip to content

Commit 6073c47

Browse files
brentlubroonie
authored andcommitted
ASoC: SOF: sof-audio: rename dai clock setting query function
We are going to extend the dai_get_clk() callback function to retrieve other dai-specific settings like tdm slot number, not just mclk/bclk frequencies. Revisit functions and macros related to the callback and replace the string 'clk' with 'param' to reflect the ongoing change. Reviewed-by: Bard Liao <[email protected]> Signed-off-by: Brent Lu <[email protected]> Signed-off-by: Pierre-Louis Bossart <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 91cdeca commit 6073c47

File tree

4 files changed

+21
-21
lines changed

4 files changed

+21
-21
lines changed

sound/soc/sof/ipc3-topology.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2500,7 +2500,7 @@ static int sof_ipc3_tear_down_all_pipelines(struct snd_sof_dev *sdev, bool verif
25002500
return 0;
25012501
}
25022502

2503-
static int sof_ipc3_dai_get_clk(struct snd_sof_dev *sdev, struct snd_sof_dai *dai, int clk_type)
2503+
static int sof_ipc3_dai_get_param(struct snd_sof_dev *sdev, struct snd_sof_dai *dai, int param_type)
25042504
{
25052505
struct sof_dai_private_data *private = dai->private;
25062506

@@ -2509,15 +2509,15 @@ static int sof_ipc3_dai_get_clk(struct snd_sof_dev *sdev, struct snd_sof_dai *da
25092509

25102510
switch (private->dai_config->type) {
25112511
case SOF_DAI_INTEL_SSP:
2512-
switch (clk_type) {
2513-
case SOF_DAI_CLK_INTEL_SSP_MCLK:
2512+
switch (param_type) {
2513+
case SOF_DAI_PARAM_INTEL_SSP_MCLK:
25142514
return private->dai_config->ssp.mclk_rate;
2515-
case SOF_DAI_CLK_INTEL_SSP_BCLK:
2515+
case SOF_DAI_PARAM_INTEL_SSP_BCLK:
25162516
return private->dai_config->ssp.bclk_rate;
25172517
default:
2518+
dev_err(sdev->dev, "invalid SSP param %d\n", param_type);
25182519
break;
25192520
}
2520-
dev_err(sdev->dev, "fail to get SSP clk %d rate\n", clk_type);
25212521
break;
25222522
default:
25232523
/* not yet implemented for platforms other than the above */
@@ -2692,7 +2692,7 @@ const struct sof_ipc_tplg_ops ipc3_tplg_ops = {
26922692
.widget_free = sof_ipc3_widget_free,
26932693
.widget_setup = sof_ipc3_widget_setup,
26942694
.dai_config = sof_ipc3_dai_config,
2695-
.dai_get_clk = sof_ipc3_dai_get_clk,
2695+
.dai_get_param = sof_ipc3_dai_get_param,
26962696
.set_up_all_pipelines = sof_ipc3_set_up_all_pipelines,
26972697
.tear_down_all_pipelines = sof_ipc3_tear_down_all_pipelines,
26982698
.parse_manifest = sof_ipc3_parse_manifest,

sound/soc/sof/ipc4-topology.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3130,7 +3130,7 @@ static int sof_ipc4_parse_manifest(struct snd_soc_component *scomp, int index,
31303130
return 0;
31313131
}
31323132

3133-
static int sof_ipc4_dai_get_clk(struct snd_sof_dev *sdev, struct snd_sof_dai *dai, int clk_type)
3133+
static int sof_ipc4_dai_get_param(struct snd_sof_dev *sdev, struct snd_sof_dai *dai, int param_type)
31343134
{
31353135
struct sof_ipc4_copier *ipc4_copier = dai->private;
31363136
struct snd_soc_tplg_hw_config *hw_config;
@@ -3169,13 +3169,13 @@ static int sof_ipc4_dai_get_clk(struct snd_sof_dev *sdev, struct snd_sof_dai *da
31693169

31703170
switch (ipc4_copier->dai_type) {
31713171
case SOF_DAI_INTEL_SSP:
3172-
switch (clk_type) {
3173-
case SOF_DAI_CLK_INTEL_SSP_MCLK:
3172+
switch (param_type) {
3173+
case SOF_DAI_PARAM_INTEL_SSP_MCLK:
31743174
return le32_to_cpu(hw_config->mclk_rate);
3175-
case SOF_DAI_CLK_INTEL_SSP_BCLK:
3175+
case SOF_DAI_PARAM_INTEL_SSP_BCLK:
31763176
return le32_to_cpu(hw_config->bclk_rate);
31773177
default:
3178-
dev_err(sdev->dev, "Invalid clk type for SSP %d\n", clk_type);
3178+
dev_err(sdev->dev, "invalid SSP param %d\n", param_type);
31793179
break;
31803180
}
31813181
break;
@@ -3352,7 +3352,7 @@ const struct sof_ipc_tplg_ops ipc4_tplg_ops = {
33523352
.route_free = sof_ipc4_route_free,
33533353
.dai_config = sof_ipc4_dai_config,
33543354
.parse_manifest = sof_ipc4_parse_manifest,
3355-
.dai_get_clk = sof_ipc4_dai_get_clk,
3355+
.dai_get_param = sof_ipc4_dai_get_param,
33563356
.tear_down_all_pipelines = sof_ipc4_tear_down_all_pipelines,
33573357
.link_setup = sof_ipc4_link_setup,
33583358
};

sound/soc/sof/sof-audio.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,7 @@ struct snd_sof_dai *snd_sof_find_dai(struct snd_soc_component *scomp,
978978
return NULL;
979979
}
980980

981-
static int sof_dai_get_clk(struct snd_soc_pcm_runtime *rtd, int clk_type)
981+
static int sof_dai_get_param(struct snd_soc_pcm_runtime *rtd, int param_type)
982982
{
983983
struct snd_soc_component *component =
984984
snd_soc_rtdcom_lookup(rtd, SOF_AUDIO_PCM_DRV_NAME);
@@ -991,8 +991,8 @@ static int sof_dai_get_clk(struct snd_soc_pcm_runtime *rtd, int clk_type)
991991
if (!dai)
992992
return 0;
993993

994-
if (tplg_ops && tplg_ops->dai_get_clk)
995-
return tplg_ops->dai_get_clk(sdev, dai, clk_type);
994+
if (tplg_ops && tplg_ops->dai_get_param)
995+
return tplg_ops->dai_get_param(sdev, dai, param_type);
996996

997997
return 0;
998998
}
@@ -1003,7 +1003,7 @@ static int sof_dai_get_clk(struct snd_soc_pcm_runtime *rtd, int clk_type)
10031003
*/
10041004
int sof_dai_get_mclk(struct snd_soc_pcm_runtime *rtd)
10051005
{
1006-
return sof_dai_get_clk(rtd, SOF_DAI_CLK_INTEL_SSP_MCLK);
1006+
return sof_dai_get_param(rtd, SOF_DAI_PARAM_INTEL_SSP_MCLK);
10071007
}
10081008
EXPORT_SYMBOL(sof_dai_get_mclk);
10091009

@@ -1013,6 +1013,6 @@ EXPORT_SYMBOL(sof_dai_get_mclk);
10131013
*/
10141014
int sof_dai_get_bclk(struct snd_soc_pcm_runtime *rtd)
10151015
{
1016-
return sof_dai_get_clk(rtd, SOF_DAI_CLK_INTEL_SSP_BCLK);
1016+
return sof_dai_get_param(rtd, SOF_DAI_PARAM_INTEL_SSP_BCLK);
10171017
}
10181018
EXPORT_SYMBOL(sof_dai_get_bclk);

sound/soc/sof/sof-audio.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
#define WIDGET_IS_AIF_OR_DAI(id) (WIDGET_IS_DAI(id) || WIDGET_IS_AIF(id))
4545
#define WIDGET_IS_COPIER(id) (WIDGET_IS_AIF_OR_DAI(id) || (id) == snd_soc_dapm_buffer)
4646

47-
#define SOF_DAI_CLK_INTEL_SSP_MCLK 0
48-
#define SOF_DAI_CLK_INTEL_SSP_BCLK 1
47+
#define SOF_DAI_PARAM_INTEL_SSP_MCLK 0
48+
#define SOF_DAI_PARAM_INTEL_SSP_BCLK 1
4949

5050
enum sof_widget_op {
5151
SOF_WIDGET_PREPARE,
@@ -208,7 +208,7 @@ struct sof_ipc_tplg_widget_ops {
208208
* @widget_setup: Function pointer for setting up setup in the DSP
209209
* @widget_free: Function pointer for freeing widget in the DSP
210210
* @dai_config: Function pointer for sending DAI config IPC to the DSP
211-
* @dai_get_clk: Function pointer for getting the DAI clock setting
211+
* @dai_get_param: Function pointer for getting the DAI parameter
212212
* @set_up_all_pipelines: Function pointer for setting up all topology pipelines
213213
* @tear_down_all_pipelines: Function pointer for tearing down all topology pipelines
214214
* @parse_manifest: Function pointer for ipc4 specific parsing of topology manifest
@@ -229,7 +229,7 @@ struct sof_ipc_tplg_ops {
229229
int (*widget_free)(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget);
230230
int (*dai_config)(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget,
231231
unsigned int flags, struct snd_sof_dai_config_data *data);
232-
int (*dai_get_clk)(struct snd_sof_dev *sdev, struct snd_sof_dai *dai, int clk_type);
232+
int (*dai_get_param)(struct snd_sof_dev *sdev, struct snd_sof_dai *dai, int param_type);
233233
int (*set_up_all_pipelines)(struct snd_sof_dev *sdev, bool verify);
234234
int (*tear_down_all_pipelines)(struct snd_sof_dev *sdev, bool verify);
235235
int (*parse_manifest)(struct snd_soc_component *scomp, int index,

0 commit comments

Comments
 (0)