From 3d83a03e471f0439a3f0b647a0423ac9aaf34c03 Mon Sep 17 00:00:00 2001 From: Charles Keepax Date: Thu, 18 Apr 2013 11:02:38 +0100 Subject: [PATCH] --- yaml --- r: 372023 b: refs/heads/master c: daa2db59ce7e36011a6c92a0342cd0919b9fb7d3 h: refs/heads/master i: 372021: 74deaae85fae64b3326ecc3bc2d86a8b970b43eb 372019: c80a68d036b8f9c81d9236c13799ce863e1dbe0c 372015: 521e33bd0b4e6573a865f2d870e59378084acc92 v: v3 --- [refs] | 2 +- trunk/sound/soc/soc-compress.c | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 30679a7e4ec3..45bebfbfab4a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 49bb6402f1aa1effa9d9c5df39d91a86ca8fd736 +refs/heads/master: daa2db59ce7e36011a6c92a0342cd0919b9fb7d3 diff --git a/trunk/sound/soc/soc-compress.c b/trunk/sound/soc/soc-compress.c index da83e5658f62..3853f7eb3f28 100644 --- a/trunk/sound/soc/soc-compress.c +++ b/trunk/sound/soc/soc-compress.c @@ -384,7 +384,14 @@ int soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num) /* check client and interface hw capabilities */ snprintf(new_name, sizeof(new_name), "%s %s-%d", rtd->dai_link->stream_name, codec_dai->name, num); - direction = SND_COMPRESS_PLAYBACK; + + if (codec_dai->driver->playback.channels_min) + direction = SND_COMPRESS_PLAYBACK; + else if (codec_dai->driver->capture.channels_min) + direction = SND_COMPRESS_CAPTURE; + else + return -EINVAL; + compr = kzalloc(sizeof(*compr), GFP_KERNEL); if (compr == NULL) { snd_printk(KERN_ERR "Cannot allocate compr\n");