]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - sound/soc/codecs/twl6040.c
ASoC: twl6040: Support other sample rates in constraints.
[karo-tx-linux.git] / sound / soc / codecs / twl6040.c
index a20e293b27b4e6ae142d030af182099c81f942c7..7845cdb65a4a355c6afb2f1f7ec8003c5e01a532 100644 (file)
@@ -1203,6 +1203,13 @@ static int twl6040_set_bias_level(struct snd_soc_codec *codec,
 /* set of rates for each pll: low-power and high-performance */
 
 static unsigned int lp_rates[] = {
+       8000,
+       11250,
+       16000,
+       22500,
+       32000,
+       44100,
+       48000,
        88200,
        96000,
 };
@@ -1213,6 +1220,10 @@ static struct snd_pcm_hw_constraint_list lp_constraints = {
 };
 
 static unsigned int hp_rates[] = {
+       8000,
+       16000,
+       32000,
+       48000,
        96000,
 };
 
@@ -1359,23 +1370,51 @@ static struct snd_soc_dai_ops twl6040_dai_ops = {
        .set_sysclk     = twl6040_set_dai_sysclk,
 };
 
-static struct snd_soc_dai_driver twl6040_dai = {
-       .name = "twl6040-hifi",
+static struct snd_soc_dai_driver twl6040_dai[] = {
+{
+       .name = "twl6040-ul",
+       .capture = {
+               .stream_name = "Capture",
+               .channels_min = 1,
+               .channels_max = 2,
+               .rates = TWL6040_RATES,
+               .formats = TWL6040_FORMATS,
+       },
+       .ops = &twl6040_dai_ops,
+},
+{
+       .name = "twl6040-dl1",
        .playback = {
-               .stream_name = "Playback",
+               .stream_name = "Headset Playback",
                .channels_min = 1,
-               .channels_max = 4,
+               .channels_max = 2,
                .rates = TWL6040_RATES,
                .formats = TWL6040_FORMATS,
        },
-       .capture = {
-               .stream_name = "Capture",
+       .ops = &twl6040_dai_ops,
+},
+{
+       .name = "twl6040-dl2",
+       .playback = {
+               .stream_name = "Handsfree Playback",
                .channels_min = 1,
                .channels_max = 2,
                .rates = TWL6040_RATES,
                .formats = TWL6040_FORMATS,
        },
        .ops = &twl6040_dai_ops,
+},
+{
+       .name = "twl6040-vib",
+       .playback = {
+               .stream_name = "Vibra Playback",
+               .channels_min = 2,
+               .channels_max = 2,
+               .rates = SNDRV_PCM_RATE_CONTINUOUS,
+               .formats = TWL6040_FORMATS,
+       },
+       .ops = &twl6040_dai_ops,
+},
 };
 
 #ifdef CONFIG_PM
@@ -1502,8 +1541,8 @@ static struct snd_soc_codec_driver soc_codec_dev_twl6040 = {
 
 static int __devinit twl6040_codec_probe(struct platform_device *pdev)
 {
-       return snd_soc_register_codec(&pdev->dev,
-                       &soc_codec_dev_twl6040, &twl6040_dai, 1);
+       return snd_soc_register_codec(&pdev->dev, &soc_codec_dev_twl6040,
+                                     twl6040_dai, ARRAY_SIZE(twl6040_dai));
 }
 
 static int __devexit twl6040_codec_remove(struct platform_device *pdev)