summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorNicolas Saenz Julienne <nsaenzjulienne@suse.de>2018-10-17 21:01:50 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-11-07 12:38:15 +0100
commitaa1b40c6eea8d58047d2d3f76e4ac27365df2f8d (patch)
treea276d941b219f722d943275e1b32f989e96e3bfd /drivers
parentb2a40053dc579e6d093a1356082de5ce0af44cfc (diff)
downloadlinux-stable-aa1b40c6eea8d58047d2d3f76e4ac27365df2f8d.tar.gz
linux-stable-aa1b40c6eea8d58047d2d3f76e4ac27365df2f8d.tar.bz2
linux-stable-aa1b40c6eea8d58047d2d3f76e4ac27365df2f8d.zip
staging: bcm2835-audio: unify FOURCC command definitions
The device communicates with the audio core using FOURCC codes. The driver was generating them using different macros/expressions. We now use the same macro to create them and centralize all the definitions. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Reviewed-by: Takashi Iwai <tiwai@suse.de> Acked-by: Stefan Wahren <stefan.wahren@i2se.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c13
-rw-r--r--drivers/staging/vc04_services/bcm2835-audio/vc_vchi_audioserv_defs.h4
2 files changed, 7 insertions, 10 deletions
diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c
index 781754f36da7..aca7008e1921 100644
--- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c
+++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c
@@ -89,11 +89,6 @@ static int bcm2835_audio_send_simple(struct bcm2835_audio_instance *instance,
return bcm2835_audio_send_msg(instance, &m, wait);
}
-static const u32 BCM2835_AUDIO_WRITE_COOKIE1 = ('B' << 24 | 'C' << 16 |
- 'M' << 8 | 'A');
-static const u32 BCM2835_AUDIO_WRITE_COOKIE2 = ('D' << 24 | 'A' << 16 |
- 'T' << 8 | 'A');
-
static void audio_vchi_callback(void *param,
const VCHI_CALLBACK_REASON_T reason,
void *msg_handle)
@@ -112,8 +107,8 @@ static void audio_vchi_callback(void *param,
instance->result = m.u.result.success;
complete(&instance->msg_avail_comp);
} else if (m.type == VC_AUDIO_MSG_TYPE_COMPLETE) {
- if (m.u.complete.cookie1 != BCM2835_AUDIO_WRITE_COOKIE1 ||
- m.u.complete.cookie2 != BCM2835_AUDIO_WRITE_COOKIE2)
+ if (m.u.complete.cookie1 != VC_AUDIO_WRITE_COOKIE1 ||
+ m.u.complete.cookie2 != VC_AUDIO_WRITE_COOKIE2)
dev_err(instance->dev, "invalid cookie\n");
else
bcm2835_playback_fifo(instance->alsa_stream,
@@ -329,8 +324,8 @@ int bcm2835_audio_write(struct bcm2835_alsa_stream *alsa_stream,
.type = VC_AUDIO_MSG_TYPE_WRITE,
.u.write.count = size,
.u.write.max_packet = instance->max_packet,
- .u.write.cookie1 = BCM2835_AUDIO_WRITE_COOKIE1,
- .u.write.cookie2 = BCM2835_AUDIO_WRITE_COOKIE2,
+ .u.write.cookie1 = VC_AUDIO_WRITE_COOKIE1,
+ .u.write.cookie2 = VC_AUDIO_WRITE_COOKIE2,
};
unsigned int count;
int err, status;
diff --git a/drivers/staging/vc04_services/bcm2835-audio/vc_vchi_audioserv_defs.h b/drivers/staging/vc04_services/bcm2835-audio/vc_vchi_audioserv_defs.h
index 1a7f0884ac9c..dc62875cfdca 100644
--- a/drivers/staging/vc04_services/bcm2835-audio/vc_vchi_audioserv_defs.h
+++ b/drivers/staging/vc04_services/bcm2835-audio/vc_vchi_audioserv_defs.h
@@ -7,8 +7,10 @@
#define VC_AUDIOSERV_MIN_VER 1
#define VC_AUDIOSERV_VER 2
-/* FourCC code used for VCHI connection */
+/* FourCC codes used for VCHI communication */
#define VC_AUDIO_SERVER_NAME MAKE_FOURCC("AUDS")
+#define VC_AUDIO_WRITE_COOKIE1 MAKE_FOURCC("BCMA")
+#define VC_AUDIO_WRITE_COOKIE2 MAKE_FOURCC("DATA")
/*
* List of screens that are currently supported