root/drivers/staging/vc04_services/bcm2835-audio/vc_vchi_audioserv_defs.h

/* [<][>][^][v][top][bottom][index][help] */

INCLUDED FROM


   1 /* SPDX-License-Identifier: GPL-2.0 */
   2 /* Copyright 2011 Broadcom Corporation.  All rights reserved. */
   3 
   4 #ifndef _VC_AUDIO_DEFS_H_
   5 #define _VC_AUDIO_DEFS_H_
   6 
   7 #define VC_AUDIOSERV_MIN_VER 1
   8 #define VC_AUDIOSERV_VER 2
   9 
  10 /* FourCC codes used for VCHI communication */
  11 #define VC_AUDIO_SERVER_NAME  MAKE_FOURCC("AUDS")
  12 #define VC_AUDIO_WRITE_COOKIE1 MAKE_FOURCC("BCMA")
  13 #define VC_AUDIO_WRITE_COOKIE2 MAKE_FOURCC("DATA")
  14 
  15 /*
  16  *  List of screens that are currently supported
  17  *  All message types supported for HOST->VC direction
  18  */
  19 
  20 enum vc_audio_msg_type {
  21         VC_AUDIO_MSG_TYPE_RESULT, // Generic result
  22         VC_AUDIO_MSG_TYPE_COMPLETE, // Generic result
  23         VC_AUDIO_MSG_TYPE_CONFIG, // Configure audio
  24         VC_AUDIO_MSG_TYPE_CONTROL, // Configure audio
  25         VC_AUDIO_MSG_TYPE_OPEN, // Configure audio
  26         VC_AUDIO_MSG_TYPE_CLOSE, // Configure audio
  27         VC_AUDIO_MSG_TYPE_START, // Configure audio
  28         VC_AUDIO_MSG_TYPE_STOP, // Configure audio
  29         VC_AUDIO_MSG_TYPE_WRITE, // Configure audio
  30         VC_AUDIO_MSG_TYPE_MAX
  31 };
  32 
  33 /* configure the audio */
  34 
  35 struct vc_audio_config {
  36         u32 channels;
  37         u32 samplerate;
  38         u32 bps;
  39 };
  40 
  41 struct vc_audio_control {
  42         u32 volume;
  43         u32 dest;
  44 };
  45 
  46 struct vc_audio_open {
  47         u32 dummy;
  48 };
  49 
  50 struct vc_audio_close {
  51         u32 dummy;
  52 };
  53 
  54 struct vc_audio_start {
  55         u32 dummy;
  56 };
  57 
  58 struct vc_audio_stop {
  59         u32 draining;
  60 };
  61 
  62 /* configure the write audio samples */
  63 struct vc_audio_write {
  64         u32 count; // in bytes
  65         u32 cookie1;
  66         u32 cookie2;
  67         s16 silence;
  68         s16 max_packet;
  69 };
  70 
  71 /* Generic result for a request (VC->HOST) */
  72 struct vc_audio_result {
  73         s32 success; // Success value
  74 };
  75 
  76 /* Generic result for a request (VC->HOST) */
  77 struct vc_audio_complete {
  78         s32 count; // Success value
  79         u32 cookie1;
  80         u32 cookie2;
  81 };
  82 
  83 /* Message header for all messages in HOST->VC direction */
  84 struct vc_audio_msg {
  85         s32 type; /* Message type (VC_AUDIO_MSG_TYPE) */
  86         union {
  87                 struct vc_audio_config config;
  88                 struct vc_audio_control control;
  89                 struct vc_audio_open open;
  90                 struct vc_audio_close close;
  91                 struct vc_audio_start start;
  92                 struct vc_audio_stop stop;
  93                 struct vc_audio_write write;
  94                 struct vc_audio_result result;
  95                 struct vc_audio_complete complete;
  96         };
  97 };
  98 
  99 #endif /* _VC_AUDIO_DEFS_H_ */

/* [<][>][^][v][top][bottom][index][help] */