Skip to content

Commit a2417b6

Browse files
jbrun3tbroonie
authored andcommitted
ASoC: meson: axg-spdifin: use max width for rate detection
Use maximum width between 2 edges to setup spdifin thresholds and detect the input sample rate. This comes from Amlogic SDK and seems to be marginally more reliable than minimum width. This is done to align with a future eARC support. No issue was reported with minimum width so far, this is considered to be an update so no Fixes tag is set. Signed-off-by: Jerome Brunet <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 48bbec0 commit a2417b6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sound/soc/meson/axg-spdifin.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,9 @@ static int axg_spdifin_sample_mode_config(struct snd_soc_dai *dai,
179179
SPDIFIN_CTRL1_BASE_TIMER,
180180
FIELD_PREP(SPDIFIN_CTRL1_BASE_TIMER, rate / 1000));
181181

182-
/* Threshold based on the minimum width between two edges */
182+
/* Threshold based on the maximum width between two edges */
183183
regmap_update_bits(priv->map, SPDIFIN_CTRL0,
184-
SPDIFIN_CTRL0_WIDTH_SEL, SPDIFIN_CTRL0_WIDTH_SEL);
184+
SPDIFIN_CTRL0_WIDTH_SEL, 0);
185185

186186
/* Calculate the last timer which has no threshold */
187187
t_next = axg_spdifin_mode_timer(priv, i, rate);
@@ -199,7 +199,7 @@ static int axg_spdifin_sample_mode_config(struct snd_soc_dai *dai,
199199
axg_spdifin_write_timer(priv->map, i, t);
200200

201201
/* Set the threshold value */
202-
axg_spdifin_write_threshold(priv->map, i, t + t_next);
202+
axg_spdifin_write_threshold(priv->map, i, 3 * (t + t_next));
203203

204204
/* Save the current timer for the next threshold calculation */
205205
t_next = t;

0 commit comments

Comments
 (0)