ASoC: meson: axg-fifo: fix fifo threshold setup
[platform/kernel/linux-starfive.git] / sound / soc / meson / axg-toddr.c
index f602339..e711abc 100644 (file)
@@ -89,7 +89,6 @@ static int axg_toddr_dai_startup(struct snd_pcm_substream *substream,
                                 struct snd_soc_dai *dai)
 {
        struct axg_fifo *fifo = snd_soc_dai_get_drvdata(dai);
-       unsigned int fifo_threshold;
        int ret;
 
        /* Enable pclk to access registers and clock the fifo ip */
@@ -107,11 +106,6 @@ static int axg_toddr_dai_startup(struct snd_pcm_substream *substream,
        /* Apply single buffer mode to the interface */
        regmap_update_bits(fifo->map, FIFO_CTRL0, CTRL0_TODDR_PP_MODE, 0);
 
-       /* TODDR does not have a configurable fifo depth */
-       fifo_threshold = AXG_FIFO_MIN_CNT - 1;
-       regmap_update_bits(fifo->map, FIFO_CTRL1, CTRL1_THRESHOLD_MASK,
-                          CTRL1_THRESHOLD(fifo_threshold));
-
        return 0;
 }
 
@@ -190,8 +184,9 @@ static const struct snd_soc_component_driver axg_toddr_component_drv = {
 };
 
 static const struct axg_fifo_match_data axg_toddr_match_data = {
-       .component_drv  = &axg_toddr_component_drv,
-       .dai_drv        = &axg_toddr_dai_drv
+       .field_threshold        = REG_FIELD(FIFO_CTRL1, 16, 23),
+       .component_drv          = &axg_toddr_component_drv,
+       .dai_drv                = &axg_toddr_dai_drv
 };
 
 static const struct snd_soc_dai_ops g12a_toddr_ops = {
@@ -228,8 +223,9 @@ static const struct snd_soc_component_driver g12a_toddr_component_drv = {
 };
 
 static const struct axg_fifo_match_data g12a_toddr_match_data = {
-       .component_drv  = &g12a_toddr_component_drv,
-       .dai_drv        = &g12a_toddr_dai_drv
+       .field_threshold        = REG_FIELD(FIFO_CTRL1, 16, 23),
+       .component_drv          = &g12a_toddr_component_drv,
+       .dai_drv                = &g12a_toddr_dai_drv
 };
 
 static const char * const sm1_toddr_sel_texts[] = {
@@ -297,8 +293,9 @@ static const struct snd_soc_component_driver sm1_toddr_component_drv = {
 };
 
 static const struct axg_fifo_match_data sm1_toddr_match_data = {
-       .component_drv  = &sm1_toddr_component_drv,
-       .dai_drv        = &g12a_toddr_dai_drv
+       .field_threshold        = REG_FIELD(FIFO_CTRL1, 12, 23),
+       .component_drv          = &sm1_toddr_component_drv,
+       .dai_drv                = &g12a_toddr_dai_drv
 };
 
 static const struct of_device_id axg_toddr_of_match[] = {