tizen 2.3.1 release
[external/alsa-lib.git] / include / sound / asound.h
index 17dfe8f..07c03fa 100644 (file)
 #if defined(LINUX) || defined(__LINUX__) || defined(__linux__)
 
 #include <linux/ioctl.h>
+#include <linux/types.h>
 
 #ifdef __KERNEL__
 
-#include <linux/types.h>
 #include <linux/time.h>
 #include <asm/byteorder.h>
 
@@ -113,9 +113,11 @@ enum sndrv_hwdep_iface {
        SNDRV_HWDEP_IFACE_USX2Y_PCM,    /* Tascam US122, US224 & US428 rawusb pcm */
        SNDRV_HWDEP_IFACE_PCXHR,        /* Digigram PCXHR */
        SNDRV_HWDEP_IFACE_SB_RC,        /* SB Extigy/Audigy2NX remote control */
+       SNDRV_HWDEP_IFACE_HDA,          /* HD-audio */
+       SNDRV_HWDEP_IFACE_USB_STREAM,   /* direct access to usb stream */
 
        /* Don't forget to change the following: */
-       SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_SB_RC
+       SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_USB_STREAM
 };
 
 struct sndrv_hwdep_info {
@@ -158,7 +160,7 @@ enum {
  *                                                                           *
  *****************************************************************************/
 
-#define SNDRV_PCM_VERSION              SNDRV_PROTOCOL_VERSION(2, 0, 9)
+#define SNDRV_PCM_VERSION              SNDRV_PROTOCOL_VERSION(2, 0, 10)
 
 typedef unsigned long sndrv_pcm_uframes_t;
 typedef long sndrv_pcm_sframes_t;
@@ -233,7 +235,11 @@ enum sndrv_pcm_format {
        SNDRV_PCM_FORMAT_S18_3BE,       /* in three bytes */
        SNDRV_PCM_FORMAT_U18_3LE,       /* in three bytes */
        SNDRV_PCM_FORMAT_U18_3BE,       /* in three bytes */
-       SNDRV_PCM_FORMAT_LAST = SNDRV_PCM_FORMAT_U18_3BE,
+       SNDRV_PCM_FORMAT_G723_24,       /* 8 samples in 3 bytes */
+       SNDRV_PCM_FORMAT_G723_24_1B,    /* 1 sample in 1 byte */
+       SNDRV_PCM_FORMAT_G723_40,       /* 8 Samples in 5 bytes */
+       SNDRV_PCM_FORMAT_G723_40_1B,    /* 1 sample in 1 byte */
+       SNDRV_PCM_FORMAT_LAST = SNDRV_PCM_FORMAT_G723_40_1B,
 
 #ifdef SNDRV_LITTLE_ENDIAN
        SNDRV_PCM_FORMAT_S16 = SNDRV_PCM_FORMAT_S16_LE,
@@ -308,7 +314,7 @@ union sndrv_pcm_sync_id {
 struct sndrv_pcm_info {
        unsigned int device;            /* RO/WR (control): device number */
        unsigned int subdevice;         /* RO/WR (control): subdevice number */
-       int stream;                     /* RO/WR (control): stream number */
+       int stream;                     /* RO/WR (control): stream direction */
        int card;                       /* R: card number */
        unsigned char id[64];           /* ID (user selectable) */
        unsigned char name[80];         /* name of this device */
@@ -345,8 +351,8 @@ enum sndrv_pcm_hw_param {
        SNDRV_PCM_HW_PARAM_LAST_INTERVAL = SNDRV_PCM_HW_PARAM_TICK_TIME
 };
 
-#define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1<<0)  /* avoid rate resampling */
-#define SNDRV_PCM_HW_PARAMS_EXPORT_BUFFER      (1<<1)  /* export buffer */
+#define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1<<0)  /* avoid rate resampling */
+#define SNDRV_PCM_HW_PARAMS_EXPORT_BUFFER      (1<<1)  /* export buffer */
 #define SNDRV_PCM_HW_PARAMS_NO_PERIOD_WAKEUP   (1<<2)  /* disable period wakeups */
 
 struct sndrv_interval {
@@ -466,9 +472,9 @@ struct sndrv_xfern {
 
 
 enum {
-        SNDRV_PCM_TSTAMP_TYPE_GETTIMEOFDAY = 0, /* gettimeofday equivalent */
-        SNDRV_PCM_TSTAMP_TYPE_MONOTONIC,        /* posix_clock_monotonic equivalent */
-        SNDRV_PCM_TSTAMP_TYPE_LAST = SNDRV_PCM_TSTAMP_TYPE_MONOTONIC,
+       SNDRV_PCM_TSTAMP_TYPE_GETTIMEOFDAY = 0, /* gettimeofday equivalent */
+       SNDRV_PCM_TSTAMP_TYPE_MONOTONIC,        /* posix_clock_monotonic equivalent */
+       SNDRV_PCM_TSTAMP_TYPE_LAST = SNDRV_PCM_TSTAMP_TYPE_MONOTONIC,
 };
 
 enum {
@@ -571,7 +577,7 @@ enum {
  *  Timer section - /dev/snd/timer
  */
 
-#define SNDRV_TIMER_VERSION            SNDRV_PROTOCOL_VERSION(2, 0, 5)
+#define SNDRV_TIMER_VERSION            SNDRV_PROTOCOL_VERSION(2, 0, 6)
 
 enum sndrv_timer_class {
        SNDRV_TIMER_CLASS_NONE = -1,
@@ -728,7 +734,7 @@ struct sndrv_timer_tread {
  *                                                                          *
  ****************************************************************************/
 
-#define SNDRV_CTL_VERSION              SNDRV_PROTOCOL_VERSION(2, 0, 6)
+#define SNDRV_CTL_VERSION              SNDRV_PROTOCOL_VERSION(2, 0, 7)
 
 struct sndrv_ctl_card_info {
        int card;                       /* card number */
@@ -769,14 +775,14 @@ enum sndrv_ctl_elem_iface {
 #define SNDRV_CTL_ELEM_ACCESS_READWRITE                (SNDRV_CTL_ELEM_ACCESS_READ|SNDRV_CTL_ELEM_ACCESS_WRITE)
 #define SNDRV_CTL_ELEM_ACCESS_VOLATILE         (1<<2)  /* control value may be changed without a notification */
 #define SNDRV_CTL_ELEM_ACCESS_TIMESTAMP                (1<<3)  /* when was control changed */
-#define SNDRV_CTL_ELEM_ACCESS_TLV_READ         (1<<4)  /* TLV read is supported */
-#define SNDRV_CTL_ELEM_ACCESS_TLV_WRITE                (1<<5)  /* TLV write is supported */
+#define SNDRV_CTL_ELEM_ACCESS_TLV_READ         (1<<4)  /* TLV read is possible */
+#define SNDRV_CTL_ELEM_ACCESS_TLV_WRITE                (1<<5)  /* TLV write is possible */
 #define SNDRV_CTL_ELEM_ACCESS_TLV_READWRITE    (SNDRV_CTL_ELEM_ACCESS_TLV_READ|SNDRV_CTL_ELEM_ACCESS_TLV_WRITE)
 #define SNDRV_CTL_ELEM_ACCESS_TLV_COMMAND      (1<<6)  /* TLV command is possible */
 #define SNDRV_CTL_ELEM_ACCESS_INACTIVE         (1<<8)  /* control does actually nothing, but may be updated */
 #define SNDRV_CTL_ELEM_ACCESS_LOCK             (1<<9)  /* write lock */
 #define SNDRV_CTL_ELEM_ACCESS_OWNER            (1<<10) /* write lock owner */
-#define SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK     (1<<28) /* flag only for kernel */
+#define SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK     (1<<28) /* kernel use a TLV callback */ 
 #define SNDRV_CTL_ELEM_ACCESS_USER             (1<<29) /* user space element */
 /* bits 30 and 31 are obsoleted (for indirect access) */
 
@@ -793,7 +799,7 @@ struct sndrv_ctl_elem_id {
        int iface;                      /* interface identifier */
        unsigned int device;            /* device/client number */
        unsigned int subdevice;         /* subdevice (substream) number */
-        unsigned char name[44];                /* ASCII name of item */
+       unsigned char name[44];         /* ASCII name of item */
        unsigned int index;             /* index of item */
 };
 
@@ -827,46 +833,48 @@ struct sndrv_ctl_elem_info {
                        unsigned int items;     /* R: number of items */
                        unsigned int item;      /* W: item number */
                        char name[64];          /* R: value name */
+                       __u64 names_ptr;        /* W: names list (ELEM_ADD only) */
+                       unsigned int names_length;
                } enumerated;
                unsigned char reserved[128];
        } value;
        union {
                unsigned short d[4];            /* dimensions */
-               unsigned short *d_ptr;          /* (obsolete) indirect */
+               unsigned short *d_ptr;          /* indirect - obsoleted */
        } dimen;
        unsigned char reserved[64-4*sizeof(unsigned short)];
 };
 
 struct sndrv_ctl_elem_value {
        struct sndrv_ctl_elem_id id;    /* W: element ID */
-       unsigned int indirect: 1;       /* (obsolete) W: use indirect pointer (xxx_ptr member) */
-        union {
+       unsigned int indirect: 1;       /* W: indirect access - obsoleted */
+       union {
                union {
                        long value[128];
-                       long *value_ptr;        /* obsolete */
+                       long *value_ptr;        /* obsoleted */
                } integer;
                union {
                        long long value[64];
-                       long long *value_ptr;   /* obsolete */
+                       long long *value_ptr;   /* obsoleted */
                } integer64;
                union {
                        unsigned int item[128];
-                       unsigned int *item_ptr; /* obsolete */
+                       unsigned int *item_ptr; /* obsoleted */
                } enumerated;
                union {
                        unsigned char data[512];
-                       unsigned char *data_ptr;        /* obsolete */
+                       unsigned char *data_ptr;        /* obsoleted */
                } bytes;
                struct sndrv_aes_iec958 iec958;
-        } value;                /* RO */
+       } value;                /* RO */
        struct timespec tstamp;
-        unsigned char reserved[128-sizeof(struct timespec)];
+       unsigned char reserved[128-sizeof(struct timespec)];
 };
 
 struct sndrv_ctl_tlv {
-       unsigned int numid;     /* control element numeric identification */
-        unsigned int length;    /* in bytes aligned to 4 */
-        unsigned int tlv[0];    /* first TLV */
+       unsigned int numid;     /* control element numeric identification */
+       unsigned int length;    /* in bytes aligned to 4 */
+       unsigned int tlv[0];    /* first TLV */
 };
 
 enum {
@@ -909,17 +917,18 @@ enum sndrv_ctl_event_type {
 #define SNDRV_CTL_EVENT_MASK_VALUE     (1<<0)  /* element value was changed */
 #define SNDRV_CTL_EVENT_MASK_INFO      (1<<1)  /* element info was changed */
 #define SNDRV_CTL_EVENT_MASK_ADD       (1<<2)  /* element was added */
+#define SNDRV_CTL_EVENT_MASK_TLV       (1<<3)  /* element TLV tree was changed */
 #define SNDRV_CTL_EVENT_MASK_REMOVE    (~0U)   /* element was removed */
 
 struct sndrv_ctl_event {
-       int type;                               /* event type - SNDRV_CTL_EVENT_* */
+       int type;       /* event type - SNDRV_CTL_EVENT_* */
        union {
                struct {
                        unsigned int mask;
                        struct sndrv_ctl_elem_id id;
                } elem;
-                unsigned char data8[60];
-        } data;
+               unsigned char data8[60];
+       } data;
 };
 
 /*
@@ -940,18 +949,4 @@ struct sndrv_ctl_event {
 #define SNDRV_CTL_NAME_IEC958_PCM_STREAM               "PCM Stream"
 #define SNDRV_CTL_NAME_IEC958(expl,direction,what)     "IEC958 " expl SNDRV_CTL_NAME_##direction SNDRV_CTL_NAME_IEC958_##what
 
-/*
- *
- */
-
-struct sndrv_xferv {
-       const struct iovec *vector;
-       unsigned long count;
-};
-
-enum {
-       SNDRV_IOCTL_READV = _IOW('K', 0x00, struct sndrv_xferv),
-       SNDRV_IOCTL_WRITEV = _IOW('K', 0x01, struct sndrv_xferv),
-};
-
 #endif /* __SOUND_ASOUND_H */