ALSA: Use usb_set/get_intfdata
[linux-2.6.git] / sound / usb / caiaq / caiaq-audio.c
index 1aa9279..b3a6033 100644 (file)
@@ -39,7 +39,8 @@
 #define BYTES_PER_SAMPLE       3
 #define BYTES_PER_SAMPLE_USB   4
 #define MAX_BUFFER_SIZE                (128*1024)
-                                
+#define MAX_ENDPOINT_SIZE      512
+
 #define ENDPOINT_CAPTURE       2
 #define ENDPOINT_PLAYBACK      6
 
@@ -202,7 +203,7 @@ static int snd_usb_caiaq_pcm_prepare(struct snd_pcm_substream *substream)
        if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
                dev->audio_out_buf_pos[index] = BYTES_PER_SAMPLE + 1;
        else
-               dev->audio_in_buf_pos[index] = 0;
+               dev->audio_in_buf_pos[index] = BYTES_PER_SAMPLE;
        
        if (dev->streaming)
                return 0;
@@ -221,7 +222,10 @@ static int snd_usb_caiaq_pcm_prepare(struct snd_pcm_substream *substream)
        
        bpp = ((runtime->rate / 8000) + CLOCK_DRIFT_TOLERANCE)
                * bytes_per_sample * CHANNELS_PER_STREAM * dev->n_streams;
-       
+
+       if (bpp > MAX_ENDPOINT_SIZE)
+               bpp = MAX_ENDPOINT_SIZE;
+
        ret = snd_usb_caiaq_set_audio_params(dev, runtime->rate,
                                             runtime->sample_bits, bpp);
        if (ret)
@@ -633,6 +637,7 @@ int snd_usb_caiaq_audio_init(struct snd_usb_caiaqdev *dev)
        switch (dev->chip.usb_id) {
        case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AK1):
        case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_RIGKONTROL3):
+       case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_SESSIONIO):
                dev->samplerates |= SNDRV_PCM_RATE_88200;
                dev->samplerates |= SNDRV_PCM_RATE_192000;
                break;