summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/audio_codec.c
diff options
context:
space:
mode:
authorMark Greer2016-02-27 01:04:36 +0100
committerGreg Kroah-Hartman2016-02-29 22:37:39 +0100
commit4a8e519902e73c833fb57f69bc194c2274dcdc30 (patch)
tree75e885bc2b56ed37c6d8ca454256fa855641dbe1 /drivers/staging/greybus/audio_codec.c
parentgreybus: expose full 32 bits of vid/pid to userspace (diff)
downloadkernel-qcow2-linux-4a8e519902e73c833fb57f69bc194c2274dcdc30.tar.gz
kernel-qcow2-linux-4a8e519902e73c833fb57f69bc194c2274dcdc30.tar.xz
kernel-qcow2-linux-4a8e519902e73c833fb57f69bc194c2274dcdc30.zip
greybus: audio: Register CPorts for specific directions
Currently, it is assumed that all audio data CPorts registered on APB1 are used for transmitting audio data. That may not always be true like when a microphone is connected but no speakers. Also, the current special protocol lacks a way to tell APB1 whether the CPort being registered is for transmitting, receiving, or both. Fix by adding a 'direction' field to the register and unregister CPort requests and define bits indicating which direction (or both) audio data will go on that CPort. Signed-off-by: Mark Greer <mgreer@animalcreek.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/audio_codec.c')
-rw-r--r--drivers/staging/greybus/audio_codec.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/staging/greybus/audio_codec.c b/drivers/staging/greybus/audio_codec.c
index d820116dd196..5e29694139f7 100644
--- a/drivers/staging/greybus/audio_codec.c
+++ b/drivers/staging/greybus/audio_codec.c
@@ -60,7 +60,8 @@ static int gbcodec_startup(struct snd_pcm_substream *substream,
i2s_port = 0; /* fixed for now */
cportid = gb_dai->connection->hd_cport_id;
ret = gb_audio_apbridgea_register_cport(gb_dai->connection, i2s_port,
- cportid);
+ cportid,
+ AUDIO_APBRIDGEA_DIRECTION_TX);
dev_dbg(dai->dev, "Register %s:%d DAI, ret:%d\n", dai->name, cportid,
ret);
@@ -117,7 +118,8 @@ static void gbcodec_shutdown(struct snd_pcm_substream *substream,
/* un register cport */
i2s_port = 0; /* fixed for now */
ret = gb_audio_apbridgea_unregister_cport(gb_dai->connection, i2s_port,
- gb_dai->connection->hd_cport_id);
+ gb_dai->connection->hd_cport_id,
+ AUDIO_APBRIDGEA_DIRECTION_TX);
dev_dbg(dai->dev, "Unregister %s:%d DAI, ret:%d\n", dai->name,
gb_dai->connection->hd_cport_id, ret);
@@ -495,7 +497,8 @@ static void gb_audio_cleanup(struct gbaudio_codec_info *gb)
ret);
cportid = connection->hd_cport_id;
ret = gb_audio_apbridgea_unregister_cport(connection, 0,
- cportid);
+ cportid,
+ AUDIO_APBRIDGEA_DIRECTION_TX);
if (ret)
dev_info(dev, "%d:Failed during unregister cport\n",
ret);