Skip to contentSkip to conversation

ASoC: rt1015: modify some structure to be static and add operation callback function for rt1015_dai

PATCH In review [email protected] 2 participants 2 messages Feb 26, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: rt1015: modify some structure to be static and add operation callback function for rt1015_dai

From: Jack Yu <[email protected]>

1. Add "static" for rt1015_aif_dai_ops.
2. Add "static" for rt1015_dai[].
3. Add operation callback for rt1015_dai[].

---
 sound/soc/codecs/rt1015.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
sound/soc/codecs/rt1015.c +4 -3
index d300b417dd50..bb310bc7febd 100644
@@ -664,7 +664,7 @@ static int rt1015_hw_params(struct snd_pcm_substream *substream,
 	snd_soc_component_update_bits(component, RT1015_TDM_MASTER,
 		RT1015_I2S_DL_MASK, val_len);
 	snd_soc_component_update_bits(component, RT1015_CLK2,
-		RT1015_FS_PD_MASK, pre_div);
+		RT1015_FS_PD_MASK, pre_div << RT1015_FS_PD_SFT);
 
 	return 0;
 }
@@ -841,12 +841,12 @@ static void rt1015_remove(struct snd_soc_component *component)
 #define RT1015_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \
 			SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S8)
 
-struct snd_soc_dai_ops rt1015_aif_dai_ops = {
+static struct snd_soc_dai_ops rt1015_aif_dai_ops = {
 	.hw_params = rt1015_hw_params,
 	.set_fmt = rt1015_set_dai_fmt,
 };
 
-struct snd_soc_dai_driver rt1015_dai[] = {
+static struct snd_soc_dai_driver rt1015_dai[] = {
 	{
 		.name = "rt1015-aif",
 		.id = 0,
@@ -857,6 +857,7 @@ struct snd_soc_dai_driver rt1015_dai[] = {
 			.rates = RT1015_STEREO_RATES,
 			.formats = RT1015_FORMATS,
 		},
+		.ops = &rt1015_aif_dai_ops,
 	}
 };
 
Signature · 1 line
2.25.1
maintainer
#1 lore raw
Quoted 5 lines · On Wed, Feb 26, 2020 at 10:28:27AM +0800, [email protected] wrote:

From: Jack Yu <[email protected]>

1. Add "static" for rt1015_aif_dai_ops.
2. Add "static" for rt1015_dai[].
3. Add operation callback for rt1015_dai[].

Please don't send multiple changes in a single patch, split them up into separate patches - the callback certainly seems like it needs to be in a different patch.

sound/soc/codecs/rt1015.c static int rt1015_hw_params(struct snd_pcm_substream *substream, · line 670

Quoted 9 lines
sound/soc/codecs/rt1015.c +1 -1
@@ -664,7 +664,7 @@ static int rt1015_hw_params(struct snd_pcm_substream *substream,
 	snd_soc_component_update_bits(component, RT1015_TDM_MASTER,
 		RT1015_I2S_DL_MASK, val_len);
 	snd_soc_component_update_bits(component, RT1015_CLK2,
-		RT1015_FS_PD_MASK, pre_div);
+		RT1015_FS_PD_MASK, pre_div << RT1015_FS_PD_SFT);
 
 	return 0;
 }

This doesn't seem to be mentioned in the changelog and should probably also be a separate patch?