fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / sound / core / pcm_misc.c
index 794372b..0019c59 100644 (file)
 #include <sound/pcm.h>
 #define SND_PCM_FORMAT_UNKNOWN (-1)
 
+/* NOTE: "signed" prefix must be given below since the default char is
+ *       unsigned on some architectures!
+ */
 struct pcm_format_data {
-       char width;     /* bit width */
-       char phys;      /* physical bit width */
-       char le;        /* 0 = big-endian, 1 = little-endian, -1 = others */
-       char signd;     /* 0 = unsigned, 1 = signed, -1 = others */
+       unsigned char width;    /* bit width */
+       unsigned char phys;     /* physical bit width */
+       signed char le; /* 0 = big-endian, 1 = little-endian, -1 = others */
+       signed char signd;      /* 0 = unsigned, 1 = signed, -1 = others */
        unsigned char silence[8];       /* silence data to fill */
 };
 
@@ -204,6 +207,8 @@ int snd_pcm_format_signed(snd_pcm_format_t format)
        return val;
 }
 
+EXPORT_SYMBOL(snd_pcm_format_signed);
+
 /**
  * snd_pcm_format_unsigned - Check the PCM format is unsigned linear
  * @format: the format to check
@@ -221,6 +226,8 @@ int snd_pcm_format_unsigned(snd_pcm_format_t format)
        return !val;
 }
 
+EXPORT_SYMBOL(snd_pcm_format_unsigned);
+
 /**
  * snd_pcm_format_linear - Check the PCM format is linear
  * @format: the format to check
@@ -232,6 +239,8 @@ int snd_pcm_format_linear(snd_pcm_format_t format)
        return snd_pcm_format_signed(format) >= 0;
 }
 
+EXPORT_SYMBOL(snd_pcm_format_linear);
+
 /**
  * snd_pcm_format_little_endian - Check the PCM format is little-endian
  * @format: the format to check
@@ -249,6 +258,8 @@ int snd_pcm_format_little_endian(snd_pcm_format_t format)
        return val;
 }
 
+EXPORT_SYMBOL(snd_pcm_format_little_endian);
+
 /**
  * snd_pcm_format_big_endian - Check the PCM format is big-endian
  * @format: the format to check
@@ -266,21 +277,7 @@ int snd_pcm_format_big_endian(snd_pcm_format_t format)
        return !val;
 }
 
-/**
- * snd_pcm_format_cpu_endian - Check the PCM format is CPU-endian
- * @format: the format to check
- *
- * Returns 1 if the given PCM format is CPU-endian, 0 if
- * opposite, or a negative error code if endian not specified.
- */
-int snd_pcm_format_cpu_endian(snd_pcm_format_t format)
-{
-#ifdef SNDRV_LITTLE_ENDIAN
-       return snd_pcm_format_little_endian(format);
-#else
-       return snd_pcm_format_big_endian(format);
-#endif
-}
+EXPORT_SYMBOL(snd_pcm_format_big_endian);
 
 /**
  * snd_pcm_format_width - return the bit-width of the format
@@ -299,6 +296,8 @@ int snd_pcm_format_width(snd_pcm_format_t format)
        return val;
 }
 
+EXPORT_SYMBOL(snd_pcm_format_width);
+
 /**
  * snd_pcm_format_physical_width - return the physical bit-width of the format
  * @format: the format to check
@@ -316,6 +315,8 @@ int snd_pcm_format_physical_width(snd_pcm_format_t format)
        return val;
 }
 
+EXPORT_SYMBOL(snd_pcm_format_physical_width);
+
 /**
  * snd_pcm_format_size - return the byte size of samples on the given format
  * @format: the format to check
@@ -331,6 +332,8 @@ ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples)
        return samples * phys_width / 8;
 }
 
+EXPORT_SYMBOL(snd_pcm_format_size);
+
 /**
  * snd_pcm_format_silence_64 - return the silent data in 8 bytes array
  * @format: the format to check
@@ -346,6 +349,8 @@ const unsigned char *snd_pcm_format_silence_64(snd_pcm_format_t format)
        return pcm_formats[format].silence;
 }
 
+EXPORT_SYMBOL(snd_pcm_format_silence_64);
+
 /**
  * snd_pcm_format_set_silence - set the silence data on the buffer
  * @format: the PCM format
@@ -415,6 +420,8 @@ int snd_pcm_format_set_silence(snd_pcm_format_t format, void *data, unsigned int
        return 0;
 }
 
+EXPORT_SYMBOL(snd_pcm_format_set_silence);
+
 /* [width][unsigned][bigendian] */
 static int linear_formats[4][2][2] = {
        {{ SNDRV_PCM_FORMAT_S8, SNDRV_PCM_FORMAT_S8},
@@ -445,6 +452,8 @@ snd_pcm_format_t snd_pcm_build_linear_format(int width, int unsignd, int big_end
        return linear_formats[width][!!unsignd][!!big_endian];
 }
 
+EXPORT_SYMBOL(snd_pcm_build_linear_format);
+
 /**
  * snd_pcm_limit_hw_rates - determine rate_min/rate_max fields
  * @runtime: the runtime instance
@@ -454,7 +463,7 @@ snd_pcm_format_t snd_pcm_build_linear_format(int width, int unsignd, int big_end
  *
  * Returns zero if successful.
  */
-int snd_pcm_limit_hw_rates(snd_pcm_runtime_t *runtime)
+int snd_pcm_limit_hw_rates(struct snd_pcm_runtime *runtime)
 {
        static unsigned rates[] = {
                /* ATTENTION: these values depend on the definition in pcm.h! */
@@ -476,3 +485,5 @@ int snd_pcm_limit_hw_rates(snd_pcm_runtime_t *runtime)
        }
        return 0;
 }
+
+EXPORT_SYMBOL(snd_pcm_limit_hw_rates);