summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/audio_apbridgea.c
diff options
context:
space:
mode:
authorMark Greer <mgreer@animalcreek.com>2016-02-26 17:04:36 -0700
committerGreg Kroah-Hartman <gregkh@google.com>2016-02-29 13:37:39 -0800
commit4a8e519902e73c833fb57f69bc194c2274dcdc30 (patch)
tree75e885bc2b56ed37c6d8ca454256fa855641dbe1 /drivers/staging/greybus/audio_apbridgea.c
parent611924dd72594200ac55957b4e68b0a65bab143b (diff)
downloadop-kernel-dev-4a8e519902e73c833fb57f69bc194c2274dcdc30.zip
op-kernel-dev-4a8e519902e73c833fb57f69bc194c2274dcdc30.tar.gz
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_apbridgea.c')
-rw-r--r--drivers/staging/greybus/audio_apbridgea.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/staging/greybus/audio_apbridgea.c b/drivers/staging/greybus/audio_apbridgea.c
index 75c8c3c..bed087d 100644
--- a/drivers/staging/greybus/audio_apbridgea.c
+++ b/drivers/staging/greybus/audio_apbridgea.c
@@ -29,13 +29,15 @@ int gb_audio_apbridgea_set_config(struct gb_connection *connection,
EXPORT_SYMBOL_GPL(gb_audio_apbridgea_set_config);
int gb_audio_apbridgea_register_cport(struct gb_connection *connection,
- __u16 i2s_port, __u16 cportid)
+ __u16 i2s_port, __u16 cportid,
+ __u8 direction)
{
struct audio_apbridgea_register_cport_request req;
req.hdr.type = AUDIO_APBRIDGEA_TYPE_REGISTER_CPORT;
req.hdr.i2s_port = cpu_to_le16(i2s_port);
req.cport = cpu_to_le16(cportid);
+ req.direction = direction;
return gb_hd_output(connection->hd, &req, sizeof(req),
GB_APB_REQUEST_AUDIO_CONTROL, true);
@@ -43,13 +45,15 @@ int gb_audio_apbridgea_register_cport(struct gb_connection *connection,
EXPORT_SYMBOL_GPL(gb_audio_apbridgea_register_cport);
int gb_audio_apbridgea_unregister_cport(struct gb_connection *connection,
- __u16 i2s_port, __u16 cportid)
+ __u16 i2s_port, __u16 cportid,
+ __u8 direction)
{
struct audio_apbridgea_unregister_cport_request req;
req.hdr.type = AUDIO_APBRIDGEA_TYPE_UNREGISTER_CPORT;
req.hdr.i2s_port = cpu_to_le16(i2s_port);
req.cport = cpu_to_le16(cportid);
+ req.direction = direction;
return gb_hd_output(connection->hd, &req, sizeof(req),
GB_APB_REQUEST_AUDIO_CONTROL, true);
OpenPOWER on IntegriCloud