From: Mark Hills <mark@xwax.org>
To: alsa-devel@alsa-project.org
Cc: Damien Zammit <damien@zamaudio.com>,
Chris J Arges <christopherarges@gmail.com>
Subject: [PATCH RFC 3/4] snd-usb-audio: Trust fields given in the quirk
Date: Sun, 3 Mar 2013 17:57:36 +0000 [thread overview]
Message-ID: <1362333457-23895-3-git-send-email-mark@xwax.org> (raw)
In-Reply-To: <1362333457-23895-1-git-send-email-mark@xwax.org>
The maxpacksize field is given in some quirks, but it gets ignored
(in favour of wMaxPacketSize from the first endpoint.) This patch
favours the one in the quirk.
Digidesign Mbox and Mbox 2 are the only affected quirks and the
devices are assumed to be working without this patch. So for safety
against the values in the quirk being incorrect, remove them.
The datainterval is also ignored but there are not currently any
quirks which choose to override this.
Cc: Damien Zammit <damien@zamaudio.com>
Cc: Chris J Arges <christopherarges@gmail.com>
---
sound/usb/quirks-table.h | 3 ---
sound/usb/quirks.c | 6 ++++--
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h
index 1c8db85..3614e9b 100644
--- a/sound/usb/quirks-table.h
+++ b/sound/usb/quirks-table.h
@@ -2965,7 +2965,6 @@ YAMAHA_DEVICE(0x7010, "UB99"),
.attributes = UAC_EP_CS_ATTR_SAMPLE_RATE,
.endpoint = 0x02,
.ep_attr = 0x01,
- .maxpacksize = 0x130,
.rates = SNDRV_PCM_RATE_44100 |
SNDRV_PCM_RATE_48000,
.rate_min = 44100,
@@ -3013,7 +3012,6 @@ YAMAHA_DEVICE(0x7010, "UB99"),
.attributes = 0x00,
.endpoint = 0x03,
.ep_attr = USB_ENDPOINT_SYNC_ASYNC,
- .maxpacksize = 0x128,
.rates = SNDRV_PCM_RATE_48000,
.rate_min = 48000,
.rate_max = 48000,
@@ -3039,7 +3037,6 @@ YAMAHA_DEVICE(0x7010, "UB99"),
.attributes = UAC_EP_CS_ATTR_SAMPLE_RATE,
.endpoint = 0x85,
.ep_attr = USB_ENDPOINT_SYNC_SYNC,
- .maxpacksize = 0x128,
.rates = SNDRV_PCM_RATE_48000,
.rate_min = 48000,
.rate_max = 48000,
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
index b0f7140..0745eea 100644
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -165,8 +165,10 @@ static int create_fixed_stream_quirk(struct snd_usb_audio *chip,
return -EINVAL;
}
alts = &iface->altsetting[fp->altset_idx];
- fp->datainterval = snd_usb_parse_datainterval(chip, alts);
- fp->maxpacksize = le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize);
+ if (fp->datainterval == 0)
+ fp->datainterval = snd_usb_parse_datainterval(chip, alts);
+ if (fp->maxpacksize == 0)
+ fp->maxpacksize = le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize);
usb_set_interface(chip->dev, fp->iface, 0);
snd_usb_init_pitch(chip, fp->iface, alts, fp);
snd_usb_init_sample_rate(chip, fp->iface, alts, fp, fp->rate_max);
--
1.7.12.1
next prev parent reply other threads:[~2013-03-03 17:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-03 17:53 usb: Endpoints sharing the same interface Mark Hills
2013-03-03 17:57 ` [PATCH RFC 1/4] snd-usb-audio: Playback and MIDI support for Novation Twitch DJ controller Mark Hills
2013-03-03 17:57 ` [PATCH RFC 2/4] usb: Allow us to distinguish between different returns of EMSGSIZE Mark Hills
2013-03-03 17:57 ` Mark Hills [this message]
2013-03-03 17:57 ` [PATCH RFC 4/4] snd-usb-audio: Prototype capture support for Novation Twitch Mark Hills
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1362333457-23895-3-git-send-email-mark@xwax.org \
--to=mark@xwax.org \
--cc=alsa-devel@alsa-project.org \
--cc=christopherarges@gmail.com \
--cc=damien@zamaudio.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).