format.c (69f7876b2ab61e8114675d6092ad0b482e233612) format.c (ee95cb6121dae17bc199cd566503dff1b2dd243b)
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of

--- 16 unchanged lines hidden (view full) ---

25#include <sound/pcm.h>
26
27#include "usbaudio.h"
28#include "card.h"
29#include "quirks.h"
30#include "helper.h"
31#include "debug.h"
32#include "clock.h"
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of

--- 16 unchanged lines hidden (view full) ---

25#include <sound/pcm.h>
26
27#include "usbaudio.h"
28#include "card.h"
29#include "quirks.h"
30#include "helper.h"
31#include "debug.h"
32#include "clock.h"
33#include "format.h"
33
34/*
35 * parse the audio format type I descriptor
36 * and returns the corresponding pcm format
37 *
38 * @dev: usb device
39 * @fp: audioformat record
40 * @format: the format tag (wFormatTag)

--- 130 unchanged lines hidden (view full) ---

171
172 fp->nr_rates = 0;
173 fp->rate_min = fp->rate_max = 0;
174 for (r = 0, idx = offset + 1; r < nr_rates; r++, idx += 3) {
175 unsigned int rate = combine_triple(&fmt[idx]);
176 if (!rate)
177 continue;
178 /* C-Media CM6501 mislabels its 96 kHz altsetting */
34
35/*
36 * parse the audio format type I descriptor
37 * and returns the corresponding pcm format
38 *
39 * @dev: usb device
40 * @fp: audioformat record
41 * @format: the format tag (wFormatTag)

--- 130 unchanged lines hidden (view full) ---

172
173 fp->nr_rates = 0;
174 fp->rate_min = fp->rate_max = 0;
175 for (r = 0, idx = offset + 1; r < nr_rates; r++, idx += 3) {
176 unsigned int rate = combine_triple(&fmt[idx]);
177 if (!rate)
178 continue;
179 /* C-Media CM6501 mislabels its 96 kHz altsetting */
179 /* Terratec Aureon 7.1 USB C-Media 6206, too */
180 if (rate == 48000 && nr_rates == 1 &&
181 (chip->usb_id == USB_ID(0x0d8c, 0x0201) ||
180 if (rate == 48000 && nr_rates == 1 &&
181 (chip->usb_id == USB_ID(0x0d8c, 0x0201) ||
182 chip->usb_id == USB_ID(0x0d8c, 0x0102) ||
183 chip->usb_id == USB_ID(0x0ccd, 0x00b1)) &&
182 chip->usb_id == USB_ID(0x0d8c, 0x0102)) &&
184 fp->altsetting == 5 && fp->maxpacksize == 392)
185 rate = 96000;
186 /* Creative VF0470 Live Cam reports 16 kHz instead of 8kHz */
187 if (rate == 16000 && chip->usb_id == USB_ID(0x041e, 0x4068))
188 rate = 8000;
189
190 fp->rate_table[fp->nr_rates] = rate;
191 if (!fp->rate_min || rate < fp->rate_min)

--- 319 unchanged lines hidden ---
183 fp->altsetting == 5 && fp->maxpacksize == 392)
184 rate = 96000;
185 /* Creative VF0470 Live Cam reports 16 kHz instead of 8kHz */
186 if (rate == 16000 && chip->usb_id == USB_ID(0x041e, 0x4068))
187 rate = 8000;
188
189 fp->rate_table[fp->nr_rates] = rate;
190 if (!fp->rate_min || rate < fp->rate_min)

--- 319 unchanged lines hidden ---