summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sound/soc/fsl/fsl_rpmsg_i2s.c44
-rw-r--r--sound/soc/fsl/fsl_rpmsg_i2s.h6
2 files changed, 42 insertions, 8 deletions
diff --git a/sound/soc/fsl/fsl_rpmsg_i2s.c b/sound/soc/fsl/fsl_rpmsg_i2s.c
index 2d45f513ee3f..901e35c52b17 100644
--- a/sound/soc/fsl/fsl_rpmsg_i2s.c
+++ b/sound/soc/fsl/fsl_rpmsg_i2s.c
@@ -80,24 +80,50 @@ static int i2s_send_message(struct i2s_rpmsg *msg,
return 0;
}
+static const unsigned int fsl_rpmsg_rates[] = {
+ 32000, 48000, 96000, 88200, 176400, 192000,
+ 352800, 384000, 705600, 768000, 1411200, 2822400,
+};
+
+static const struct snd_pcm_hw_constraint_list fsl_rpmsg_rate_constraints = {
+ .count = ARRAY_SIZE(fsl_rpmsg_rates),
+ .list = fsl_rpmsg_rates,
+};
+
+static int fsl_rpmsg_startup(struct snd_pcm_substream *substream,
+ struct snd_soc_dai *cpu_dai)
+{
+ int ret;
+
+ ret = snd_pcm_hw_constraint_list(substream->runtime, 0,
+ SNDRV_PCM_HW_PARAM_RATE, &fsl_rpmsg_rate_constraints);
+
+ return ret;
+}
+
+static const struct snd_soc_dai_ops fsl_rpmsg_dai_ops = {
+ .startup = fsl_rpmsg_startup,
+};
+
static struct snd_soc_dai_driver fsl_rpmsg_i2s_dai = {
.playback = {
.stream_name = "CPU-Playback",
.channels_min = 2,
.channels_max = 2,
- .rates = FSL_RPMSG_I2S_RATES,
+ .rates = SNDRV_PCM_RATE_KNOT,
.formats = FSL_RPMSG_I2S_FORMATS,
},
.capture = {
.stream_name = "CPU-Capture",
.channels_min = 2,
.channels_max = 2,
- .rates = FSL_RPMSG_I2S_RATES,
+ .rates = SNDRV_PCM_RATE_KNOT,
.formats = FSL_RPMSG_I2S_FORMATS,
},
.symmetric_rates = 1,
.symmetric_channels = 1,
.symmetric_samplebits = 1,
+ .ops = &fsl_rpmsg_dai_ops,
};
static const struct snd_soc_component_driver fsl_component = {
@@ -200,15 +226,17 @@ static int fsl_rpmsg_i2s_probe(struct platform_device *pdev)
if (of_device_is_compatible(pdev->dev.of_node,
"fsl,imx8mq-rpmsg-i2s")) {
- rpmsg_i2s->codec_wm8960 = 0;
+ rpmsg_i2s->codec_dummy = 0;
+ rpmsg_i2s->codec_ak4497 = 1;
rpmsg_i2s->version = 2;
- rpmsg_i2s->rates = SNDRV_PCM_RATE_32000 |
- SNDRV_PCM_RATE_48000 |
- SNDRV_PCM_RATE_96000 |
- SNDRV_PCM_RATE_192000;
+ rpmsg_i2s->rates = SNDRV_PCM_RATE_KNOT;
rpmsg_i2s->formats = SNDRV_PCM_FMTBIT_S16_LE |
SNDRV_PCM_FMTBIT_S24_LE |
- SNDRV_PCM_FMTBIT_S32_LE;
+ SNDRV_PCM_FMTBIT_S32_LE |
+ SNDRV_PCM_FMTBIT_DSD_U8 |
+ SNDRV_PCM_FMTBIT_DSD_U16_LE |
+ SNDRV_PCM_FMTBIT_DSD_U32_LE;
+
fsl_rpmsg_i2s_dai.playback.rates = rpmsg_i2s->rates;
fsl_rpmsg_i2s_dai.playback.formats = rpmsg_i2s->formats;
fsl_rpmsg_i2s_dai.capture.rates = rpmsg_i2s->rates;
diff --git a/sound/soc/fsl/fsl_rpmsg_i2s.h b/sound/soc/fsl/fsl_rpmsg_i2s.h
index e52c861c4d43..36d6c5f51360 100644
--- a/sound/soc/fsl/fsl_rpmsg_i2s.h
+++ b/sound/soc/fsl/fsl_rpmsg_i2s.h
@@ -330,6 +330,9 @@
#define RPMSG_S16_LE 0x0
#define RPMSG_S24_LE 0x1
#define RPMSG_S32_LE 0x2
+#define RPMSG_DSD_U16_LE 0x3
+#define RPMSG_DSD_U24_LE 0x4
+#define RPMSG_DSD_U32_LE 0x5
#define RPMSG_CH_LEFT 0x0
#define RPMSG_CH_RIGHT 0x1
@@ -410,8 +413,10 @@ struct fsl_rpmsg_i2s {
struct platform_device *pdev;
struct i2s_info i2s_info;
struct pm_qos_request pm_qos_req;
+ int codec_dummy;
int codec_wm8960;
int codec_cs42888;
+ int codec_ak4497;
int force_lpa;
int version;
int rates;
@@ -421,6 +426,7 @@ struct fsl_rpmsg_i2s {
#define RPMSG_CODEC_DRV_NAME_WM8960 "rpmsg-audio-codec-wm8960"
#define RPMSG_CODEC_DRV_NAME_CS42888 "rpmsg-audio-codec-cs42888"
+#define RPMSG_CODEC_DRV_NAME_AK4497 "rpmsg-audio-codec-ak4497"
struct fsl_rpmsg_codec {
int audioindex;