summaryrefslogtreecommitdiff
path: root/sound/soc/fsl/imx-ak5558.c
diff options
context:
space:
mode:
authorViorel Suman <viorel.suman@nxp.com>2018-06-27 13:07:35 +0300
committerDong Aisheng <aisheng.dong@nxp.com>2019-11-25 15:50:38 +0800
commit7b9d5a62771eea52a13a875019b4a06818c1d718 (patch)
treecf135990951dabacf17db89d997e688397e59c11 /sound/soc/fsl/imx-ak5558.c
parente5c4922c52e9f2254d97da0d16ac9141b185633d (diff)
MLK-18682-3: ASoC: imx-ak: enable both 8k and 11k range of rates
SAI interface now is able to change at runtime the pll parent of the master clock, so enable both 8k and 11k range of rates for AK codecs. Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Diffstat (limited to 'sound/soc/fsl/imx-ak5558.c')
-rw-r--r--sound/soc/fsl/imx-ak5558.c31
1 files changed, 10 insertions, 21 deletions
diff --git a/sound/soc/fsl/imx-ak5558.c b/sound/soc/fsl/imx-ak5558.c
index 84cd2e92a5c7..2c4e974a1b4c 100644
--- a/sound/soc/fsl/imx-ak5558.c
+++ b/sound/soc/fsl/imx-ak5558.c
@@ -28,7 +28,6 @@
struct imx_ak5558_data {
struct snd_soc_card card;
bool tdm_mode;
- unsigned long freq;
unsigned long slots;
unsigned long slot_width;
};
@@ -50,11 +49,11 @@ struct imx_ak5558_fs_mul {
*/
static const struct imx_ak5558_fs_mul fs_mul[] = {
{ .min = 8000, .max = 32000, .mul = 1024 },
- { .min = 48000, .max = 48000, .mul = 512 },
- { .min = 96000, .max = 96000, .mul = 256 },
- { .min = 192000, .max = 192000, .mul = 128 },
- { .min = 384000, .max = 384000, .mul = 2 * 64 },
- { .min = 768000, .max = 768000, .mul = 2 * 32 },
+ { .min = 44100, .max = 48000, .mul = 512 },
+ { .min = 88200, .max = 96000, .mul = 256 },
+ { .min = 176400, .max = 192000, .mul = 128 },
+ { .min = 352800, .max = 384000, .mul = 2*64 },
+ { .min = 705600, .max = 768000, .mul = 2*32 },
};
/*
@@ -73,9 +72,10 @@ static struct snd_soc_dapm_widget imx_ak5558_dapm_widgets[] = {
};
static const u32 ak5558_rates[] = {
- 8000, 16000, 32000,
- 48000, 96000, 192000,
- 384000, 768000,
+ 8000, 11025, 16000, 22050,
+ 32000, 44100, 48000, 88200,
+ 96000, 176400, 192000, 352800,
+ 384000, 705600, 768000,
};
static const u32 ak5558_tdm_rates[] = {
@@ -93,7 +93,7 @@ static unsigned long ak5558_get_mclk_rate(struct snd_pcm_substream *substream,
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct imx_ak5558_data *data = snd_soc_card_get_drvdata(rtd->card);
unsigned int rate = params_rate(params);
- unsigned int freq = data->freq;
+ unsigned int freq = 0; /* Let DAI manage clk frequency by default */
int mode;
int i;
@@ -248,10 +248,8 @@ static int imx_ak5558_probe(struct platform_device *pdev)
struct imx_ak5558_data *priv;
struct device_node *cpu_np, *codec_np = NULL;
struct platform_device *cpu_pdev;
- struct clk *mclk;
int ret;
-
priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
if (!priv)
return -ENOMEM;
@@ -292,15 +290,6 @@ static int imx_ak5558_probe(struct platform_device *pdev)
priv->card.dapm_widgets = imx_ak5558_dapm_widgets;
priv->card.num_dapm_widgets = ARRAY_SIZE(imx_ak5558_dapm_widgets);
- mclk = devm_clk_get(&cpu_pdev->dev, "mclk1");
- if (IS_ERR(mclk)) {
- ret = PTR_ERR(mclk);
- dev_err(&pdev->dev, "failed to get DAI mclk1: %d\n", ret);
- return -EINVAL;
- }
-
- priv->freq = clk_get_rate(mclk);
-
ret = snd_soc_of_parse_card_name(&priv->card, "model");
if (ret)
goto fail;