* between PCM and native DSD mode
* (2 altsets version)
*/
-static bool is_itf_usb_dsd_2alts_dac(unsigned int id)
+static bool is_itf_usb_dsd_2alts_dac(struct snd_usb_audio *chip)
{
- switch (id) {
+ char *product = chip->dev->product; /* DAC product name */
+
+ switch (chip->usb_id) {
case USB_ID(0x154e, 0x1003): /* Denon DA-300USB */
case USB_ID(0x154e, 0x3005): /* Marantz HD-DAC1 */
case USB_ID(0x154e, 0x3006): /* Marantz SA-14S1 */
case USB_ID(0x1852, 0x5065): /* Luxman DA-06 */
return true;
+ case USB_ID(0x0644, 0x8043):
+ /* TEAC UD-501 */
+ if (product && strcmp("UD-501", product)) {
+ return true;
+ } else {
+ return false;
+ }
}
return false;
}
* between PCM and native DSD mode
* (3 altsets version)
*/
-static bool is_itf_usb_dsd_3alts_dac(unsigned int id)
+static bool is_itf_usb_dsd_3alts_dac(struct snd_usb_audio *chip)
{
- switch (id) {
- case USB_ID(0x0644, 0x8043): /* TEAC UD-501/UD-503/NT-503 */
+ char *product = chip->dev->product; /* DAC product name */
+
+ switch (chip->usb_id) {
case USB_ID(0x0644, 0x8044): /* Esoteric D-05X */
case USB_ID(0x0644, 0x804a): /* TEAC UD-301 */
return true;
+ case USB_ID(0x0644, 0x8043):
+ /* TEAC UD-501V2/UD-503/NT-503 */
+ if (product && !strcmp("UD-501", product)) {
+ return true;
+ } else {
+ return false;
+ }
}
return false;
}
struct usb_device *dev = subs->dev;
int err;
- if (is_itf_usb_dsd_2alts_dac(subs->stream->chip->usb_id)) {
+ if (is_itf_usb_dsd_2alts_dac(subs->stream->chip)) {
/* First switch to alt set 0, otherwise the mode switch cmd
* will not be accepted by the DAC
*/
break;
}
mdelay(20);
- } else if (is_itf_usb_dsd_3alts_dac(subs->stream->chip->usb_id)) {
+ } else if (is_itf_usb_dsd_3alts_dac(subs->stream->chip)) {
/* Vendor mode switch cmd is required. */
switch (fmt->altsetting) {
case 3: /* DSD mode (DSD_U32) requested */
/* ITF-USB DSD based DACs functionality need a delay
* after each class compliant request
*/
- if (is_itf_usb_dsd_2alts_dac(chip->usb_id)
+ if (is_itf_usb_dsd_2alts_dac(chip)
&& (requesttype & USB_TYPE_MASK) == USB_TYPE_CLASS)
mdelay(20);
}
/* ITF-USB DSD based DACs (2 altsets version) */
- if (is_itf_usb_dsd_2alts_dac(chip->usb_id)) {
+ if (is_itf_usb_dsd_2alts_dac(chip)) {
if (fp->altsetting == 2)
return SNDRV_PCM_FMTBIT_DSD_U32_BE;
}
/* ITF-USB DSD based DACs (3 altsets version) */
- if (is_itf_usb_dsd_3alts_dac(chip->usb_id)) {
+ if (is_itf_usb_dsd_3alts_dac(chip)) {
if (fp->altsetting == 3)
return SNDRV_PCM_FMTBIT_DSD_U32_BE;
}