Commit a3434a49 authored by Paul Cercueil's avatar Paul Cercueil Committed by Mark Brown

ASoC: jz4740-i2s: Add support for the JZ4770

Before the JZ4770, the playback and capture sampling rates had to match.
The JZ4770 supports independent sampling rates for both.
Signed-off-by: default avatarPaul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20200306222931.39664-6-paul@crapouillou.netSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent bde8ca7c
...@@ -87,6 +87,7 @@ ...@@ -87,6 +87,7 @@
enum jz47xx_i2s_version { enum jz47xx_i2s_version {
JZ_I2S_JZ4740, JZ_I2S_JZ4740,
JZ_I2S_JZ4760, JZ_I2S_JZ4760,
JZ_I2S_JZ4770,
JZ_I2S_JZ4780, JZ_I2S_JZ4780,
}; };
...@@ -286,7 +287,7 @@ static int jz4740_i2s_hw_params(struct snd_pcm_substream *substream, ...@@ -286,7 +287,7 @@ static int jz4740_i2s_hw_params(struct snd_pcm_substream *substream,
ctrl &= ~JZ_AIC_CTRL_INPUT_SAMPLE_SIZE_MASK; ctrl &= ~JZ_AIC_CTRL_INPUT_SAMPLE_SIZE_MASK;
ctrl |= sample_size << JZ_AIC_CTRL_INPUT_SAMPLE_SIZE_OFFSET; ctrl |= sample_size << JZ_AIC_CTRL_INPUT_SAMPLE_SIZE_OFFSET;
if (i2s->soc_info->version >= JZ_I2S_JZ4780) { if (i2s->soc_info->version >= JZ_I2S_JZ4770) {
div_reg &= ~I2SDIV_IDV_MASK; div_reg &= ~I2SDIV_IDV_MASK;
div_reg |= (div - 1) << I2SDIV_IDV_SHIFT; div_reg |= (div - 1) << I2SDIV_IDV_SHIFT;
} else { } else {
...@@ -469,7 +470,7 @@ static const struct i2s_soc_info jz4760_i2s_soc_info = { ...@@ -469,7 +470,7 @@ static const struct i2s_soc_info jz4760_i2s_soc_info = {
.dai = &jz4740_i2s_dai, .dai = &jz4740_i2s_dai,
}; };
static struct snd_soc_dai_driver jz4780_i2s_dai = { static struct snd_soc_dai_driver jz4770_i2s_dai = {
.probe = jz4740_i2s_dai_probe, .probe = jz4740_i2s_dai_probe,
.remove = jz4740_i2s_dai_remove, .remove = jz4740_i2s_dai_remove,
.playback = { .playback = {
...@@ -487,9 +488,14 @@ static struct snd_soc_dai_driver jz4780_i2s_dai = { ...@@ -487,9 +488,14 @@ static struct snd_soc_dai_driver jz4780_i2s_dai = {
.ops = &jz4740_i2s_dai_ops, .ops = &jz4740_i2s_dai_ops,
}; };
static const struct i2s_soc_info jz4770_i2s_soc_info = {
.version = JZ_I2S_JZ4770,
.dai = &jz4770_i2s_dai,
};
static const struct i2s_soc_info jz4780_i2s_soc_info = { static const struct i2s_soc_info jz4780_i2s_soc_info = {
.version = JZ_I2S_JZ4780, .version = JZ_I2S_JZ4780,
.dai = &jz4780_i2s_dai, .dai = &jz4770_i2s_dai,
}; };
static const struct snd_soc_component_driver jz4740_i2s_component = { static const struct snd_soc_component_driver jz4740_i2s_component = {
...@@ -502,6 +508,7 @@ static const struct snd_soc_component_driver jz4740_i2s_component = { ...@@ -502,6 +508,7 @@ static const struct snd_soc_component_driver jz4740_i2s_component = {
static const struct of_device_id jz4740_of_matches[] = { static const struct of_device_id jz4740_of_matches[] = {
{ .compatible = "ingenic,jz4740-i2s", .data = &jz4740_i2s_soc_info }, { .compatible = "ingenic,jz4740-i2s", .data = &jz4740_i2s_soc_info },
{ .compatible = "ingenic,jz4760-i2s", .data = &jz4760_i2s_soc_info }, { .compatible = "ingenic,jz4760-i2s", .data = &jz4760_i2s_soc_info },
{ .compatible = "ingenic,jz4770-i2s", .data = &jz4770_i2s_soc_info },
{ .compatible = "ingenic,jz4780-i2s", .data = &jz4780_i2s_soc_info }, { .compatible = "ingenic,jz4780-i2s", .data = &jz4780_i2s_soc_info },
{ /* sentinel */ } { /* sentinel */ }
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment