diff options
Diffstat (limited to 'sound/usb/mixer_quirks.c')
-rw-r--r-- | sound/usb/mixer_quirks.c | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c index 56537a156580..4149543f613e 100644 --- a/sound/usb/mixer_quirks.c +++ b/sound/usb/mixer_quirks.c | |||
@@ -1172,7 +1172,7 @@ void snd_emuusb_set_samplerate(struct snd_usb_audio *chip, | |||
1172 | int unitid = 12; /* SamleRate ExtensionUnit ID */ | 1172 | int unitid = 12; /* SamleRate ExtensionUnit ID */ |
1173 | 1173 | ||
1174 | list_for_each_entry(mixer, &chip->mixer_list, list) { | 1174 | list_for_each_entry(mixer, &chip->mixer_list, list) { |
1175 | cval = (struct usb_mixer_elem_info *)mixer->id_elems[unitid]; | 1175 | cval = mixer_elem_list_to_info(mixer->id_elems[unitid]); |
1176 | if (cval) { | 1176 | if (cval) { |
1177 | snd_usb_mixer_set_ctl_value(cval, UAC_SET_CUR, | 1177 | snd_usb_mixer_set_ctl_value(cval, UAC_SET_CUR, |
1178 | cval->control << 8, | 1178 | cval->control << 8, |
@@ -1799,12 +1799,33 @@ static int snd_soundblaster_e1_switch_create(struct usb_mixer_interface *mixer) | |||
1799 | NULL); | 1799 | NULL); |
1800 | } | 1800 | } |
1801 | 1801 | ||
1802 | static void dell_dock_init_vol(struct snd_usb_audio *chip, int ch, int id) | ||
1803 | { | ||
1804 | u16 buf = 0; | ||
1805 | |||
1806 | snd_usb_ctl_msg(chip->dev, usb_sndctrlpipe(chip->dev, 0), UAC_SET_CUR, | ||
1807 | USB_RECIP_INTERFACE | USB_TYPE_CLASS | USB_DIR_OUT, | ||
1808 | ch, snd_usb_ctrl_intf(chip) | (id << 8), | ||
1809 | &buf, 2); | ||
1810 | } | ||
1811 | |||
1812 | static int dell_dock_mixer_init(struct usb_mixer_interface *mixer) | ||
1813 | { | ||
1814 | /* fix to 0dB playback volumes */ | ||
1815 | dell_dock_init_vol(mixer->chip, 1, 16); | ||
1816 | dell_dock_init_vol(mixer->chip, 2, 16); | ||
1817 | dell_dock_init_vol(mixer->chip, 1, 19); | ||
1818 | dell_dock_init_vol(mixer->chip, 2, 19); | ||
1819 | return 0; | ||
1820 | } | ||
1821 | |||
1802 | int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer) | 1822 | int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer) |
1803 | { | 1823 | { |
1804 | int err = 0; | 1824 | int err = 0; |
1805 | struct snd_info_entry *entry; | 1825 | struct snd_info_entry *entry; |
1806 | 1826 | ||
1807 | if ((err = snd_usb_soundblaster_remote_init(mixer)) < 0) | 1827 | err = snd_usb_soundblaster_remote_init(mixer); |
1828 | if (err < 0) | ||
1808 | return err; | 1829 | return err; |
1809 | 1830 | ||
1810 | switch (mixer->chip->usb_id) { | 1831 | switch (mixer->chip->usb_id) { |
@@ -1884,11 +1905,25 @@ int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer) | |||
1884 | case USB_ID(0x041e, 0x323b): /* Creative Sound Blaster E1 */ | 1905 | case USB_ID(0x041e, 0x323b): /* Creative Sound Blaster E1 */ |
1885 | err = snd_soundblaster_e1_switch_create(mixer); | 1906 | err = snd_soundblaster_e1_switch_create(mixer); |
1886 | break; | 1907 | break; |
1908 | case USB_ID(0x0bda, 0x4014): /* Dell WD15 dock */ | ||
1909 | err = dell_dock_mixer_init(mixer); | ||
1910 | break; | ||
1887 | } | 1911 | } |
1888 | 1912 | ||
1889 | return err; | 1913 | return err; |
1890 | } | 1914 | } |
1891 | 1915 | ||
1916 | #ifdef CONFIG_PM | ||
1917 | void snd_usb_mixer_resume_quirk(struct usb_mixer_interface *mixer) | ||
1918 | { | ||
1919 | switch (mixer->chip->usb_id) { | ||
1920 | case USB_ID(0x0bda, 0x4014): /* Dell WD15 dock */ | ||
1921 | dell_dock_mixer_init(mixer); | ||
1922 | break; | ||
1923 | } | ||
1924 | } | ||
1925 | #endif | ||
1926 | |||
1892 | void snd_usb_mixer_rc_memory_change(struct usb_mixer_interface *mixer, | 1927 | void snd_usb_mixer_rc_memory_change(struct usb_mixer_interface *mixer, |
1893 | int unitid) | 1928 | int unitid) |
1894 | { | 1929 | { |