summaryrefslogtreecommitdiff
path: root/drivers/staging/greybus/audio_apbridgea.h
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.h
parent611924dd72594200ac55957b4e68b0a65bab143b (diff)
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.h')
-rw-r--r--drivers/staging/greybus/audio_apbridgea.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/staging/greybus/audio_apbridgea.h b/drivers/staging/greybus/audio_apbridgea.h
index d1d56b7c1a75..c543e399ca04 100644
--- a/drivers/staging/greybus/audio_apbridgea.h
+++ b/drivers/staging/greybus/audio_apbridgea.h
@@ -75,6 +75,9 @@
#define AUDIO_APBRIDGEA_PCM_RATE_176400 BIT(11)
#define AUDIO_APBRIDGEA_PCM_RATE_192000 BIT(12)
+#define AUDIO_APBRIDGEA_DIRECTION_TX BIT(0)
+#define AUDIO_APBRIDGEA_DIRECTION_RX BIT(1)
+
/* The I2S port is passed in the 'index' parameter of the USB request */
/* The CPort is passed in the 'value' parameter of the USB request */
@@ -94,11 +97,13 @@ struct audio_apbridgea_set_config_request {
struct audio_apbridgea_register_cport_request {
struct audio_apbridgea_hdr hdr;
__le16 cport;
+ __u8 direction;
} __packed;
struct audio_apbridgea_unregister_cport_request {
struct audio_apbridgea_hdr hdr;
__le16 cport;
+ __u8 direction;
} __packed;
struct audio_apbridgea_set_tx_data_size_request {