make most exported headers use strict integer types
[safe/jmp/linux-2.6] / include / sound / asound.h
index 76a2040..d9beda5 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Advanced Linux Sound Architecture - ALSA - Driver
- *  Copyright (c) 1994-2003 by Jaroslav Kysela <perex@suse.cz>,
+ *  Copyright (c) 1994-2003 by Jaroslav Kysela <perex@perex.cz>,
  *                             Abramo Bagnara <abramo@alsa-project.org>
  *
  *
 #ifndef __SOUND_ASOUND_H
 #define __SOUND_ASOUND_H
 
+#include <linux/types.h>
+
 #ifdef __KERNEL__
 #include <linux/ioctl.h>
-#include <linux/types.h>
 #include <linux/time.h>
 #include <asm/byteorder.h>
 
@@ -92,9 +93,11 @@ enum {
        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 snd_hwdep_info {
@@ -137,7 +140,7 @@ enum {
  *                                                                           *
  *****************************************************************************/
 
-#define SNDRV_PCM_VERSION              SNDRV_PROTOCOL_VERSION(2, 0, 8)
+#define SNDRV_PCM_VERSION              SNDRV_PROTOCOL_VERSION(2, 0, 9)
 
 typedef unsigned long snd_pcm_uframes_t;
 typedef signed long snd_pcm_sframes_t;
@@ -295,29 +298,39 @@ struct snd_pcm_info {
        unsigned char reserved[64];     /* reserved for future... */
 };
 
-typedef int __bitwise snd_pcm_hw_param_t;
-#define        SNDRV_PCM_HW_PARAM_ACCESS       ((__force snd_pcm_hw_param_t) 0) /* Access type */
-#define        SNDRV_PCM_HW_PARAM_FORMAT       ((__force snd_pcm_hw_param_t) 1) /* Format */
-#define        SNDRV_PCM_HW_PARAM_SUBFORMAT    ((__force snd_pcm_hw_param_t) 2) /* Subformat */
+typedef int snd_pcm_hw_param_t;
+#define        SNDRV_PCM_HW_PARAM_ACCESS       0       /* Access type */
+#define        SNDRV_PCM_HW_PARAM_FORMAT       1       /* Format */
+#define        SNDRV_PCM_HW_PARAM_SUBFORMAT    2       /* Subformat */
 #define        SNDRV_PCM_HW_PARAM_FIRST_MASK   SNDRV_PCM_HW_PARAM_ACCESS
 #define        SNDRV_PCM_HW_PARAM_LAST_MASK    SNDRV_PCM_HW_PARAM_SUBFORMAT
 
-#define        SNDRV_PCM_HW_PARAM_SAMPLE_BITS  ((__force snd_pcm_hw_param_t) 8) /* Bits per sample */
-#define        SNDRV_PCM_HW_PARAM_FRAME_BITS   ((__force snd_pcm_hw_param_t) 9) /* Bits per frame */
-#define        SNDRV_PCM_HW_PARAM_CHANNELS     ((__force snd_pcm_hw_param_t) 10) /* Channels */
-#define        SNDRV_PCM_HW_PARAM_RATE         ((__force snd_pcm_hw_param_t) 11) /* Approx rate */
-#define        SNDRV_PCM_HW_PARAM_PERIOD_TIME  ((__force snd_pcm_hw_param_t) 12) /* Approx distance between interrupts in us */
-#define        SNDRV_PCM_HW_PARAM_PERIOD_SIZE  ((__force snd_pcm_hw_param_t) 13) /* Approx frames between interrupts */
-#define        SNDRV_PCM_HW_PARAM_PERIOD_BYTES ((__force snd_pcm_hw_param_t) 14) /* Approx bytes between interrupts */
-#define        SNDRV_PCM_HW_PARAM_PERIODS      ((__force snd_pcm_hw_param_t) 15) /* Approx interrupts per buffer */
-#define        SNDRV_PCM_HW_PARAM_BUFFER_TIME  ((__force snd_pcm_hw_param_t) 16) /* Approx duration of buffer in us */
-#define        SNDRV_PCM_HW_PARAM_BUFFER_SIZE  ((__force snd_pcm_hw_param_t) 17) /* Size of buffer in frames */
-#define        SNDRV_PCM_HW_PARAM_BUFFER_BYTES ((__force snd_pcm_hw_param_t) 18) /* Size of buffer in bytes */
-#define        SNDRV_PCM_HW_PARAM_TICK_TIME    ((__force snd_pcm_hw_param_t) 19) /* Approx tick duration in us */
+#define        SNDRV_PCM_HW_PARAM_SAMPLE_BITS  8       /* Bits per sample */
+#define        SNDRV_PCM_HW_PARAM_FRAME_BITS   9       /* Bits per frame */
+#define        SNDRV_PCM_HW_PARAM_CHANNELS     10      /* Channels */
+#define        SNDRV_PCM_HW_PARAM_RATE         11      /* Approx rate */
+#define        SNDRV_PCM_HW_PARAM_PERIOD_TIME  12      /* Approx distance between
+                                                * interrupts in us
+                                                */
+#define        SNDRV_PCM_HW_PARAM_PERIOD_SIZE  13      /* Approx frames between
+                                                * interrupts
+                                                */
+#define        SNDRV_PCM_HW_PARAM_PERIOD_BYTES 14      /* Approx bytes between
+                                                * interrupts
+                                                */
+#define        SNDRV_PCM_HW_PARAM_PERIODS      15      /* Approx interrupts per
+                                                * buffer
+                                                */
+#define        SNDRV_PCM_HW_PARAM_BUFFER_TIME  16      /* Approx duration of buffer
+                                                * in us
+                                                */
+#define        SNDRV_PCM_HW_PARAM_BUFFER_SIZE  17      /* Size of buffer in frames */
+#define        SNDRV_PCM_HW_PARAM_BUFFER_BYTES 18      /* Size of buffer in bytes */
+#define        SNDRV_PCM_HW_PARAM_TICK_TIME    19      /* Approx tick duration in us */
 #define        SNDRV_PCM_HW_PARAM_FIRST_INTERVAL       SNDRV_PCM_HW_PARAM_SAMPLE_BITS
 #define        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_NORESAMPLE (1<<0)  /* avoid rate resampling */
 
 struct snd_interval {
        unsigned int min, max;
@@ -330,7 +343,7 @@ struct snd_interval {
 #define SNDRV_MASK_MAX 256
 
 struct snd_mask {
-       u_int32_t bits[(SNDRV_MASK_MAX+31)/32];
+       __u32 bits[(SNDRV_MASK_MAX+31)/32];
 };
 
 struct snd_pcm_hw_params {
@@ -353,8 +366,8 @@ struct snd_pcm_hw_params {
 
 enum {
        SNDRV_PCM_TSTAMP_NONE = 0,
-       SNDRV_PCM_TSTAMP_MMAP,
-       SNDRV_PCM_TSTAMP_LAST = SNDRV_PCM_TSTAMP_MMAP,
+       SNDRV_PCM_TSTAMP_ENABLE,
+       SNDRV_PCM_TSTAMP_LAST = SNDRV_PCM_TSTAMP_ENABLE,
 };
 
 struct snd_pcm_sw_params {
@@ -362,7 +375,7 @@ struct snd_pcm_sw_params {
        unsigned int period_step;
        unsigned int sleep_min;                 /* min ticks to sleep */
        snd_pcm_uframes_t avail_min;            /* min avail frames for wakeup */
-       snd_pcm_uframes_t xfer_align;           /* xfer size need to be a multiple */
+       snd_pcm_uframes_t xfer_align;           /* obsolete: xfer size need to be a multiple */
        snd_pcm_uframes_t start_threshold;      /* min hw_avail frames for automatic start */
        snd_pcm_uframes_t stop_threshold;       /* min avail frames for automatic stop */
        snd_pcm_uframes_t silence_threshold;    /* min distance from noise for silence filling */
@@ -373,7 +386,7 @@ struct snd_pcm_sw_params {
 
 struct snd_pcm_channel_info {
        unsigned int channel;
-       off_t offset;                   /* mmap offset */
+       __kernel_off_t offset;          /* mmap offset */
        unsigned int first;             /* offset to first sample in bits */
        unsigned int step;              /* samples distance in bits */
 };
@@ -434,9 +447,16 @@ struct snd_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,
+};
+
+enum {
        SNDRV_PCM_IOCTL_PVERSION = _IOR('A', 0x00, int),
        SNDRV_PCM_IOCTL_INFO = _IOR('A', 0x01, struct snd_pcm_info),
        SNDRV_PCM_IOCTL_TSTAMP = _IOW('A', 0x02, int),
+       SNDRV_PCM_IOCTL_TTSTAMP = _IOW('A', 0x03, int),
        SNDRV_PCM_IOCTL_HW_REFINE = _IOWR('A', 0x10, struct snd_pcm_hw_params),
        SNDRV_PCM_IOCTL_HW_PARAMS = _IOWR('A', 0x11, struct snd_pcm_hw_params),
        SNDRV_PCM_IOCTL_HW_FREE = _IO('A', 0x12),
@@ -556,6 +576,7 @@ enum {
 #define SNDRV_TIMER_GLOBAL_SYSTEM      0
 #define SNDRV_TIMER_GLOBAL_RTC         1
 #define SNDRV_TIMER_GLOBAL_HPET                2
+#define SNDRV_TIMER_GLOBAL_HRTIMER     3
 
 /* info flags */
 #define SNDRV_TIMER_FLG_SLAVE          (1<<0)  /* cannot be controlled */
@@ -688,7 +709,7 @@ struct snd_timer_tread {
  *                                                                          *
  ****************************************************************************/
 
-#define SNDRV_CTL_VERSION              SNDRV_PROTOCOL_VERSION(2, 0, 4)
+#define SNDRV_CTL_VERSION              SNDRV_PROTOCOL_VERSION(2, 0, 6)
 
 struct snd_ctl_card_info {
        int card;                       /* card number */
@@ -699,8 +720,7 @@ struct snd_ctl_card_info {
        unsigned char longname[80];     /* name + info text about soundcard */
        unsigned char reserved_[16];    /* reserved for future (was ID of mixer) */
        unsigned char mixername[80];    /* visual mixer identification */
-       unsigned char components[80];   /* card components / fine identification, delimited with one space (AC97 etc..) */
-       unsigned char reserved[48];     /* reserved for future */
+       unsigned char components[128];  /* card components / fine identification, delimited with one space (AC97 etc..) */
 };
 
 typedef int __bitwise snd_ctl_elem_type_t;
@@ -727,13 +747,17 @@ typedef int __bitwise snd_ctl_elem_iface_t;
 #define SNDRV_CTL_ELEM_ACCESS_WRITE            (1<<1)
 #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<<2)  /* when was control changed */
+#define SNDRV_CTL_ELEM_ACCESS_TIMESTAMP                (1<<3)  /* when was control changed */
+#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) /* kernel use a TLV callback */ 
 #define SNDRV_CTL_ELEM_ACCESS_USER             (1<<29) /* user space element */
-#define SNDRV_CTL_ELEM_ACCESS_DINDIRECT                (1<<30) /* indirect access for matrix dimensions in the info structure */
-#define SNDRV_CTL_ELEM_ACCESS_INDIRECT         (1<<31) /* indirect access for element value in the value structure */
+/* bits 30 and 31 are obsoleted (for indirect access) */
 
 /* for further details see the ACPI and PCI power management specification */
 #define SNDRV_CTL_POWER_D0             0x0000  /* full On */
@@ -766,7 +790,7 @@ struct snd_ctl_elem_info {
        snd_ctl_elem_type_t type;       /* R: value type - SNDRV_CTL_ELEM_TYPE_* */
        unsigned int access;            /* R: value access (bitmask) - SNDRV_CTL_ELEM_ACCESS_* */
        unsigned int count;             /* count of values */
-       pid_t owner;                    /* owner's PID of this control */
+       __kernel_pid_t owner;           /* owner's PID of this control */
        union {
                struct {
                        long min;               /* R: minimum value */
@@ -787,30 +811,30 @@ struct snd_ctl_elem_info {
        } value;
        union {
                unsigned short d[4];            /* dimensions */
-               unsigned short *d_ptr;          /* indirect */
+               unsigned short *d_ptr;          /* indirect - obsoleted */
        } dimen;
        unsigned char reserved[64-4*sizeof(unsigned short)];
 };
 
 struct snd_ctl_elem_value {
        struct snd_ctl_elem_id id;      /* W: element ID */
-       unsigned int indirect: 1;       /* W: use indirect pointer (xxx_ptr member) */
+       unsigned int indirect: 1;       /* W: indirect access - obsoleted */
         union {
                union {
                        long value[128];
-                       long *value_ptr;
+                       long *value_ptr;        /* obsoleted */
                } integer;
                union {
                        long long value[64];
-                       long long *value_ptr;
+                       long long *value_ptr;   /* obsoleted */
                } integer64;
                union {
                        unsigned int item[128];
-                       unsigned int *item_ptr;
+                       unsigned int *item_ptr; /* obsoleted */
                } enumerated;
                union {
                        unsigned char data[512];
-                       unsigned char *data_ptr;
+                       unsigned char *data_ptr;        /* obsoleted */
                } bytes;
                struct snd_aes_iec958 iec958;
         } value;                /* RO */
@@ -838,6 +862,8 @@ enum {
        SNDRV_CTL_IOCTL_ELEM_REPLACE = _IOWR('U', 0x18, struct snd_ctl_elem_info),
        SNDRV_CTL_IOCTL_ELEM_REMOVE = _IOWR('U', 0x19, struct snd_ctl_elem_id),
        SNDRV_CTL_IOCTL_TLV_READ = _IOWR('U', 0x1a, struct snd_ctl_tlv),
+       SNDRV_CTL_IOCTL_TLV_WRITE = _IOWR('U', 0x1b, struct snd_ctl_tlv),
+       SNDRV_CTL_IOCTL_TLV_COMMAND = _IOWR('U', 0x1c, struct snd_ctl_tlv),
        SNDRV_CTL_IOCTL_HWDEP_NEXT_DEVICE = _IOWR('U', 0x20, int),
        SNDRV_CTL_IOCTL_HWDEP_INFO = _IOR('U', 0x21, struct snd_hwdep_info),
        SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE = _IOR('U', 0x30, int),
@@ -862,6 +888,7 @@ 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 snd_ctl_event {