View | Details | Raw Unified | Return to bug 206149 | Differences between
and this patch

Collapse All | Expand All

(-)a/sound/usb/format.c (-11 / +19 lines)
Lines 151-156 static u64 parse_audio_format_i_type(struct snd_usb_audio *chip, Link Here
151
	return pcm_formats;
151
	return pcm_formats;
152
}
152
}
153
153
154
static int set_fixed_rate(struct audioformat *fp, int rate, int rate_bits)
155
{
156
	kfree(fp->rate_table);
157
	fp->rate_table = kmalloc(sizeof(int), GFP_KERNEL);
158
	if (!fp->rate_table)
159
		return -ENOMEM;
160
	fp->nr_rates = 1;
161
	fp->rate_min = rate;
162
	fp->rate_max = rate;
163
	fp->rates = rate_bits;
164
	fp->rate_table[0] = rate;
165
	return 0;
166
}
154
167
155
/*
168
/*
156
 * parse the format descriptor and stores the possible sample rates
169
 * parse the format descriptor and stores the possible sample rates
Lines 167-172 static int parse_audio_format_rates_v1(struct snd_usb_audio *chip, struct audiof Link Here
167
{
180
{
168
	int nr_rates = fmt[offset];
181
	int nr_rates = fmt[offset];
169
182
183
	switch (chip->usb_id) {
184
	case USB_ID(0x0b0e, 0x030b): /* Jabra Evolve 65 headset */
185
		return set_fixed_rate(fp, 48000, SNDRV_PCM_RATE_48000);
186
	}
187
170
	if (fmt[0] < offset + 1 + 3 * (nr_rates ? nr_rates : 2)) {
188
	if (fmt[0] < offset + 1 + 3 * (nr_rates ? nr_rates : 2)) {
171
		usb_audio_err(chip,
189
		usb_audio_err(chip,
172
			"%u:%d : invalid UAC_FORMAT_TYPE desc\n",
190
			"%u:%d : invalid UAC_FORMAT_TYPE desc\n",
Lines 296-312 static int line6_parse_audio_format_rates_quirk(struct snd_usb_audio *chip, Link Here
296
	case USB_ID(0x0e41, 0x4242): /* Line6 Helix Rack */
314
	case USB_ID(0x0e41, 0x4242): /* Line6 Helix Rack */
297
	case USB_ID(0x0e41, 0x4244): /* Line6 Helix LT */
315
	case USB_ID(0x0e41, 0x4244): /* Line6 Helix LT */
298
	case USB_ID(0x0e41, 0x4246): /* Line6 HX-Stomp */
316
	case USB_ID(0x0e41, 0x4246): /* Line6 HX-Stomp */
299
		/* supported rates: 48Khz */
317
		return set_fixed_rate(fp, 48000, SNDRV_PCM_RATE_48000);
300
		kfree(fp->rate_table);
301
		fp->rate_table = kmalloc(sizeof(int), GFP_KERNEL);
302
		if (!fp->rate_table)
303
			return -ENOMEM;
304
		fp->nr_rates = 1;
305
		fp->rate_min = 48000;
306
		fp->rate_max = 48000;
307
		fp->rates = SNDRV_PCM_RATE_48000;
308
		fp->rate_table[0] = 48000;
309
		return 0;
310
	}
318
	}
311
319
312
	return -ENODEV;
320
	return -ENODEV;

Return to bug 206149