diff options
author | Nobutaka Okabe <nob77413@gmail.com> | 2018-03-23 06:18:22 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2018-03-23 17:08:59 -0400 |
commit | 71426535f49fe6034d0e0db77608b91a0c1a022d (patch) | |
tree | 64c8396900e1d7aca50aeab58fd3b544c1df98e7 /sound/usb/quirks.c | |
parent | 3446b1e962b387b8cec53e85fdd9392da25a2737 (diff) |
ALSA: usb-audio: Add native DSD support for Luxman DA-06
Add native DSD support quirk for Luxman DA-06 DAC, by adding the
PID/VID 1852:5065.
Rename "is_marantz_denon_dac()" function to "is_itf_usb_dsd_2alts_dac()"
to cover broader device family sharing the same USB audio
implementation(*).
For the same reason, rename "is_teac_dsd_dac()" function to
"is_itf_usb_dsd_3alts_dac()".
(*)
These devices have the same USB controller "ITF-USB DSD", supplied by
INTERFACE Co., Ltd.
"ITF-USB DSD" USB controller has two patterns,
Pattern 1. (2 altsets version)
- Altset 0: for control
- Altset 1: for stream (S32)
- Altset 2: for stream (S32, DSD_U32)
Pattern 2. (3 altsets version)
- Altset 0: for control
- Altset 1: for stream (S16)
- Altset 2: for stream (S32)
- Altset 3: for stream (S32, DSD_U32)
"is_itf_usb_dsd_2alts_dac()" returns true, if the DAC has "Pattern 1"
USB controller, and "is_itf_usb_dsd_3alts_dac()" returns true, if
"Pattern2".
Signed-off-by: Nobutaka Okabe <nob77413@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/quirks.c')
-rw-r--r-- | sound/usb/quirks.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c index 6aa0ebd4a5a2..dec86df3f47a 100644 --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c | |||
@@ -1149,24 +1149,27 @@ bool snd_usb_get_sample_rate_quirk(struct snd_usb_audio *chip) | |||
1149 | return false; | 1149 | return false; |
1150 | } | 1150 | } |
1151 | 1151 | ||
1152 | /* Marantz/Denon USB DACs need a vendor cmd to switch | 1152 | /* ITF-USB DSD based DACs need a vendor cmd to switch |
1153 | * between PCM and native DSD mode | 1153 | * between PCM and native DSD mode |
1154 | * (2 altsets version) | ||
1154 | */ | 1155 | */ |
1155 | static bool is_marantz_denon_dac(unsigned int id) | 1156 | static bool is_itf_usb_dsd_2alts_dac(unsigned int id) |
1156 | { | 1157 | { |
1157 | switch (id) { | 1158 | switch (id) { |
1158 | case USB_ID(0x154e, 0x1003): /* Denon DA-300USB */ | 1159 | case USB_ID(0x154e, 0x1003): /* Denon DA-300USB */ |
1159 | case USB_ID(0x154e, 0x3005): /* Marantz HD-DAC1 */ | 1160 | case USB_ID(0x154e, 0x3005): /* Marantz HD-DAC1 */ |
1160 | case USB_ID(0x154e, 0x3006): /* Marantz SA-14S1 */ | 1161 | case USB_ID(0x154e, 0x3006): /* Marantz SA-14S1 */ |
1162 | case USB_ID(0x1852, 0x5065): /* Luxman DA-06 */ | ||
1161 | return true; | 1163 | return true; |
1162 | } | 1164 | } |
1163 | return false; | 1165 | return false; |
1164 | } | 1166 | } |
1165 | 1167 | ||
1166 | /* TEAC UD-501/UD-503/NT-503 USB DACs need a vendor cmd to switch | 1168 | /* ITF-USB DSD based DACs need a vendor cmd to switch |
1167 | * between PCM/DOP and native DSD mode | 1169 | * between PCM and native DSD mode |
1170 | * (3 altsets version) | ||
1168 | */ | 1171 | */ |
1169 | static bool is_teac_dsd_dac(unsigned int id) | 1172 | static bool is_itf_usb_dsd_3alts_dac(unsigned int id) |
1170 | { | 1173 | { |
1171 | switch (id) { | 1174 | switch (id) { |
1172 | case USB_ID(0x0644, 0x8043): /* TEAC UD-501/UD-503/NT-503 */ | 1175 | case USB_ID(0x0644, 0x8043): /* TEAC UD-501/UD-503/NT-503 */ |
@@ -1183,7 +1186,7 @@ int snd_usb_select_mode_quirk(struct snd_usb_substream *subs, | |||
1183 | struct usb_device *dev = subs->dev; | 1186 | struct usb_device *dev = subs->dev; |
1184 | int err; | 1187 | int err; |
1185 | 1188 | ||
1186 | if (is_marantz_denon_dac(subs->stream->chip->usb_id)) { | 1189 | if (is_itf_usb_dsd_2alts_dac(subs->stream->chip->usb_id)) { |
1187 | /* First switch to alt set 0, otherwise the mode switch cmd | 1190 | /* First switch to alt set 0, otherwise the mode switch cmd |
1188 | * will not be accepted by the DAC | 1191 | * will not be accepted by the DAC |
1189 | */ | 1192 | */ |
@@ -1204,7 +1207,7 @@ int snd_usb_select_mode_quirk(struct snd_usb_substream *subs, | |||
1204 | break; | 1207 | break; |
1205 | } | 1208 | } |
1206 | mdelay(20); | 1209 | mdelay(20); |
1207 | } else if (is_teac_dsd_dac(subs->stream->chip->usb_id)) { | 1210 | } else if (is_itf_usb_dsd_3alts_dac(subs->stream->chip->usb_id)) { |
1208 | /* Vendor mode switch cmd is required. */ | 1211 | /* Vendor mode switch cmd is required. */ |
1209 | switch (fmt->altsetting) { | 1212 | switch (fmt->altsetting) { |
1210 | case 3: /* DSD mode (DSD_U32) requested */ | 1213 | case 3: /* DSD mode (DSD_U32) requested */ |
@@ -1300,10 +1303,10 @@ void snd_usb_ctl_msg_quirk(struct usb_device *dev, unsigned int pipe, | |||
1300 | (requesttype & USB_TYPE_MASK) == USB_TYPE_CLASS) | 1303 | (requesttype & USB_TYPE_MASK) == USB_TYPE_CLASS) |
1301 | mdelay(20); | 1304 | mdelay(20); |
1302 | 1305 | ||
1303 | /* Marantz/Denon devices with USB DAC functionality need a delay | 1306 | /* ITF-USB DSD based DACs functionality need a delay |
1304 | * after each class compliant request | 1307 | * after each class compliant request |
1305 | */ | 1308 | */ |
1306 | if (is_marantz_denon_dac(chip->usb_id) | 1309 | if (is_itf_usb_dsd_2alts_dac(chip->usb_id) |
1307 | && (requesttype & USB_TYPE_MASK) == USB_TYPE_CLASS) | 1310 | && (requesttype & USB_TYPE_MASK) == USB_TYPE_CLASS) |
1308 | mdelay(20); | 1311 | mdelay(20); |
1309 | 1312 | ||
@@ -1390,14 +1393,14 @@ u64 snd_usb_interface_dsd_format_quirks(struct snd_usb_audio *chip, | |||
1390 | break; | 1393 | break; |
1391 | } | 1394 | } |
1392 | 1395 | ||
1393 | /* Denon/Marantz devices with USB DAC functionality */ | 1396 | /* ITF-USB DSD based DACs (2 altsets version) */ |
1394 | if (is_marantz_denon_dac(chip->usb_id)) { | 1397 | if (is_itf_usb_dsd_2alts_dac(chip->usb_id)) { |
1395 | if (fp->altsetting == 2) | 1398 | if (fp->altsetting == 2) |
1396 | return SNDRV_PCM_FMTBIT_DSD_U32_BE; | 1399 | return SNDRV_PCM_FMTBIT_DSD_U32_BE; |
1397 | } | 1400 | } |
1398 | 1401 | ||
1399 | /* TEAC devices with USB DAC functionality */ | 1402 | /* ITF-USB DSD based DACs (3 altsets version) */ |
1400 | if (is_teac_dsd_dac(chip->usb_id)) { | 1403 | if (is_itf_usb_dsd_3alts_dac(chip->usb_id)) { |
1401 | if (fp->altsetting == 3) | 1404 | if (fp->altsetting == 3) |
1402 | return SNDRV_PCM_FMTBIT_DSD_U32_BE; | 1405 | return SNDRV_PCM_FMTBIT_DSD_U32_BE; |
1403 | } | 1406 | } |