summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorAdrian Alonso <aalonso@freescale.com>2012-02-17 13:38:14 -0600
committerAdrian Alonso <aalonso@freescale.com>2012-02-21 16:40:50 -0600
commitb27c221d1b945ca45c8554bc2881084a06061d8e (patch)
tree8e7d4caa5204525652cce267a07b60d1678e0a0f /sound
parenteefa605b358c0cabd9d60f5e11f2156ce47fd267 (diff)
ENGR00171079-4 cs42888 imx6q-sabreauto supportted rates
* Get audio codec platform data and overwrite supportted sample rates if defined in machine board file. * Remove machine soc specific sample rate settings. Signed-off-by: Adrian Alonso <aalonso@freescale.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/cs42888.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/sound/soc/codecs/cs42888.c b/sound/soc/codecs/cs42888.c
index bc88a719df6f..29268e535ed8 100644
--- a/sound/soc/codecs/cs42888.c
+++ b/sound/soc/codecs/cs42888.c
@@ -155,6 +155,7 @@ struct cs42888_private {
unsigned int slave_mode;
unsigned int manual_mute;
struct regulator_bulk_data supplies[CS42888_NUM_SUPPLIES];
+ struct mxc_audio_codec_platform_data pdata;
};
/**
@@ -759,28 +760,16 @@ struct snd_soc_dai_driver cs42888_dai = {
.stream_name = "Playback",
.channels_min = 1,
.channels_max = 8,
-#ifdef CONFIG_SOC_IMX53
- .rates = (SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_96000 |\
+ .rates = (SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_96000 |
SNDRV_PCM_RATE_192000),
-#endif
-#ifdef CONFIG_SOC_IMX6Q
- .rates = (SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_88200 |\
- SNDRV_PCM_RATE_176400),
-#endif
.formats = CS42888_FORMATS,
},
.capture = {
.stream_name = "Capture",
.channels_min = 1,
.channels_max = 4,
-#ifdef CONFIG_SOC_IMX53
- .rates = (SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_96000 |\
+ .rates = (SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_96000 |
SNDRV_PCM_RATE_192000),
-#endif
-#ifdef CONFIG_SOC_IMX6Q
- .rates = (SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_88200 |\
- SNDRV_PCM_RATE_176400),
-#endif
.formats = CS42888_FORMATS,
},
.ops = &cs42888_dai_ops,
@@ -940,6 +929,13 @@ static int cs42888_i2c_probe(struct i2c_client *i2c_client,
return -ENOMEM;
}
+ if (i2c_client->dev.platform_data) {
+ memcpy(&cs42888->pdata, i2c_client->dev.platform_data,
+ sizeof(cs42888->pdata));
+ cs42888_dai.playback.rates = cs42888->pdata.rates;
+ cs42888_dai.capture.rates = cs42888->pdata.rates;
+ }
+
i2c_set_clientdata(i2c_client, cs42888);
ret = snd_soc_register_codec(&i2c_client->dev,