diff options
author | Nicolin Chen <Guangyu.Chen@freescale.com> | 2014-04-30 06:54:08 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-05-05 15:27:39 -0400 |
commit | 527cda78eb601b0ad303dc4999811731eff5560e (patch) | |
tree | 7e9cf19dae788c441b77700f57eceaed8bc4f01c /sound/soc/fsl | |
parent | 27c647bff20c6883dd0b4e3fc24c3d414a9e192a (diff) |
ASoC: fsl_spdif: Print actual sample rate for debug
People would simply know what the driver gets the best for the current
sample rate playback.
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/fsl')
-rw-r--r-- | sound/soc/fsl/fsl_spdif.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c index 1a92d7fe1a86..53e24ab952d3 100644 --- a/sound/soc/fsl/fsl_spdif.c +++ b/sound/soc/fsl/fsl_spdif.c | |||
@@ -75,6 +75,7 @@ struct fsl_spdif_priv { | |||
75 | struct platform_device *pdev; | 75 | struct platform_device *pdev; |
76 | struct regmap *regmap; | 76 | struct regmap *regmap; |
77 | bool dpll_locked; | 77 | bool dpll_locked; |
78 | u16 txrate[SPDIF_TXRATE_MAX]; | ||
78 | u8 txclk_df[SPDIF_TXRATE_MAX]; | 79 | u8 txclk_df[SPDIF_TXRATE_MAX]; |
79 | u8 sysclk_df[SPDIF_TXRATE_MAX]; | 80 | u8 sysclk_df[SPDIF_TXRATE_MAX]; |
80 | u8 txclk_src[SPDIF_TXRATE_MAX]; | 81 | u8 txclk_src[SPDIF_TXRATE_MAX]; |
@@ -418,7 +419,8 @@ clk_set_bypass: | |||
418 | regmap_update_bits(regmap, REG_SPDIF_STC, | 419 | regmap_update_bits(regmap, REG_SPDIF_STC, |
419 | STC_SYSCLK_DF_MASK, STC_SYSCLK_DF(sysclk_df)); | 420 | STC_SYSCLK_DF_MASK, STC_SYSCLK_DF(sysclk_df)); |
420 | 421 | ||
421 | dev_dbg(&pdev->dev, "set sample rate to %d\n", sample_rate); | 422 | dev_dbg(&pdev->dev, "set sample rate to %dHz for %dHz playback\n", |
423 | spdif_priv->txrate[rate], sample_rate); | ||
422 | 424 | ||
423 | return 0; | 425 | return 0; |
424 | } | 426 | } |
@@ -1049,6 +1051,7 @@ static u32 fsl_spdif_txclk_caldiv(struct fsl_spdif_priv *spdif_priv, | |||
1049 | savesub = 0; | 1051 | savesub = 0; |
1050 | spdif_priv->txclk_df[index] = txclk_df; | 1052 | spdif_priv->txclk_df[index] = txclk_df; |
1051 | spdif_priv->sysclk_df[index] = sysclk_df; | 1053 | spdif_priv->sysclk_df[index] = sysclk_df; |
1054 | spdif_priv->txrate[index] = arate; | ||
1052 | goto out; | 1055 | goto out; |
1053 | } else if (arate / rate[index] == 1) { | 1056 | } else if (arate / rate[index] == 1) { |
1054 | /* A little bigger than expect */ | 1057 | /* A little bigger than expect */ |
@@ -1059,6 +1062,7 @@ static u32 fsl_spdif_txclk_caldiv(struct fsl_spdif_priv *spdif_priv, | |||
1059 | savesub = sub; | 1062 | savesub = sub; |
1060 | spdif_priv->txclk_df[index] = txclk_df; | 1063 | spdif_priv->txclk_df[index] = txclk_df; |
1061 | spdif_priv->sysclk_df[index] = sysclk_df; | 1064 | spdif_priv->sysclk_df[index] = sysclk_df; |
1065 | spdif_priv->txrate[index] = arate; | ||
1062 | } else if (rate[index] / arate == 1) { | 1066 | } else if (rate[index] / arate == 1) { |
1063 | /* A little smaller than expect */ | 1067 | /* A little smaller than expect */ |
1064 | sub = (rate[index] - arate) * 100000; | 1068 | sub = (rate[index] - arate) * 100000; |
@@ -1068,6 +1072,7 @@ static u32 fsl_spdif_txclk_caldiv(struct fsl_spdif_priv *spdif_priv, | |||
1068 | savesub = sub; | 1072 | savesub = sub; |
1069 | spdif_priv->txclk_df[index] = txclk_df; | 1073 | spdif_priv->txclk_df[index] = txclk_df; |
1070 | spdif_priv->sysclk_df[index] = sysclk_df; | 1074 | spdif_priv->sysclk_df[index] = sysclk_df; |
1075 | spdif_priv->txrate[index] = arate; | ||
1071 | } | 1076 | } |
1072 | } | 1077 | } |
1073 | } | 1078 | } |
@@ -1118,6 +1123,8 @@ static int fsl_spdif_probe_txclk(struct fsl_spdif_priv *spdif_priv, | |||
1118 | if (spdif_priv->txclk[index] == spdif_priv->sysclk) | 1123 | if (spdif_priv->txclk[index] == spdif_priv->sysclk) |
1119 | dev_dbg(&pdev->dev, "use sysclk df %d for %dHz sample rate\n", | 1124 | dev_dbg(&pdev->dev, "use sysclk df %d for %dHz sample rate\n", |
1120 | spdif_priv->sysclk_df[index], rate[index]); | 1125 | spdif_priv->sysclk_df[index], rate[index]); |
1126 | dev_dbg(&pdev->dev, "the best rate for %dHz sample rate is %dHz\n", | ||
1127 | rate[index], spdif_priv->txrate[index]); | ||
1121 | 1128 | ||
1122 | return 0; | 1129 | return 0; |
1123 | } | 1130 | } |