aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb/usbmixer.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/usb/usbmixer.c')
-rw-r--r--sound/usb/usbmixer.c34
1 files changed, 28 insertions, 6 deletions
diff --git a/sound/usb/usbmixer.c b/sound/usb/usbmixer.c
index 5e329690cfb1..89c63d073cc6 100644
--- a/sound/usb/usbmixer.c
+++ b/sound/usb/usbmixer.c
@@ -26,7 +26,6 @@
26 * 26 *
27 */ 27 */
28 28
29#include <sound/driver.h>
30#include <linux/bitops.h> 29#include <linux/bitops.h>
31#include <linux/init.h> 30#include <linux/init.h>
32#include <linux/list.h> 31#include <linux/list.h>
@@ -1703,6 +1702,11 @@ static void snd_usb_mixer_memory_change(struct usb_mixer_interface *mixer,
1703 case 19: /* speaker out jacks */ 1702 case 19: /* speaker out jacks */
1704 case 20: /* headphones out jack */ 1703 case 20: /* headphones out jack */
1705 break; 1704 break;
1705 /* live24ext: 4 = line-in jack */
1706 case 3: /* hp-out jack (may actuate Mute) */
1707 if (mixer->chip->usb_id == USB_ID(0x041e, 0x3040))
1708 snd_usb_mixer_notify_id(mixer, mixer->rc_cfg->mute_mixer_id);
1709 break;
1706 default: 1710 default:
1707 snd_printd(KERN_DEBUG "memory change in unknown unit %d\n", unitid); 1711 snd_printd(KERN_DEBUG "memory change in unknown unit %d\n", unitid);
1708 break; 1712 break;
@@ -1951,6 +1955,9 @@ static int snd_audigy2nx_controls_create(struct usb_mixer_interface *mixer)
1951 int i, err; 1955 int i, err;
1952 1956
1953 for (i = 0; i < ARRAY_SIZE(snd_audigy2nx_controls); ++i) { 1957 for (i = 0; i < ARRAY_SIZE(snd_audigy2nx_controls); ++i) {
1958 if (i > 1 && /* Live24ext has 2 LEDs only */
1959 mixer->chip->usb_id == USB_ID(0x041e, 0x3040))
1960 break;
1954 err = snd_ctl_add(mixer->chip->card, 1961 err = snd_ctl_add(mixer->chip->card,
1955 snd_ctl_new1(&snd_audigy2nx_controls[i], mixer)); 1962 snd_ctl_new1(&snd_audigy2nx_controls[i], mixer));
1956 if (err < 0) 1963 if (err < 0)
@@ -1963,28 +1970,42 @@ static int snd_audigy2nx_controls_create(struct usb_mixer_interface *mixer)
1963static void snd_audigy2nx_proc_read(struct snd_info_entry *entry, 1970static void snd_audigy2nx_proc_read(struct snd_info_entry *entry,
1964 struct snd_info_buffer *buffer) 1971 struct snd_info_buffer *buffer)
1965{ 1972{
1966 static const struct { 1973 static const struct sb_jack {
1967 int unitid; 1974 int unitid;
1968 const char *name; 1975 const char *name;
1969 } jacks[] = { 1976 } jacks_audigy2nx[] = {
1970 {4, "dig in "}, 1977 {4, "dig in "},
1971 {7, "line in"}, 1978 {7, "line in"},
1972 {19, "spk out"}, 1979 {19, "spk out"},
1973 {20, "hph out"}, 1980 {20, "hph out"},
1981 {-1, NULL}
1982 }, jacks_live24ext[] = {
1983 {4, "line in"}, /* &1=Line, &2=Mic*/
1984 {3, "hph out"}, /* headphones */
1985 {0, "RC "}, /* last command, 6 bytes see rc_config above */
1986 {-1, NULL}
1974 }; 1987 };
1988 const struct sb_jack *jacks;
1975 struct usb_mixer_interface *mixer = entry->private_data; 1989 struct usb_mixer_interface *mixer = entry->private_data;
1976 int i, err; 1990 int i, err;
1977 u8 buf[3]; 1991 u8 buf[3];
1978 1992
1979 snd_iprintf(buffer, "%s jacks\n\n", mixer->chip->card->shortname); 1993 snd_iprintf(buffer, "%s jacks\n\n", mixer->chip->card->shortname);
1980 for (i = 0; i < ARRAY_SIZE(jacks); ++i) { 1994 if (mixer->chip->usb_id == USB_ID(0x041e, 0x3020))
1995 jacks = jacks_audigy2nx;
1996 else if (mixer->chip->usb_id == USB_ID(0x041e, 0x3040))
1997 jacks = jacks_live24ext;
1998 else
1999 return;
2000
2001 for (i = 0; jacks[i].name; ++i) {
1981 snd_iprintf(buffer, "%s: ", jacks[i].name); 2002 snd_iprintf(buffer, "%s: ", jacks[i].name);
1982 err = snd_usb_ctl_msg(mixer->chip->dev, 2003 err = snd_usb_ctl_msg(mixer->chip->dev,
1983 usb_rcvctrlpipe(mixer->chip->dev, 0), 2004 usb_rcvctrlpipe(mixer->chip->dev, 0),
1984 GET_MEM, USB_DIR_IN | USB_TYPE_CLASS | 2005 GET_MEM, USB_DIR_IN | USB_TYPE_CLASS |
1985 USB_RECIP_INTERFACE, 0, 2006 USB_RECIP_INTERFACE, 0,
1986 jacks[i].unitid << 8, buf, 3, 100); 2007 jacks[i].unitid << 8, buf, 3, 100);
1987 if (err == 3 && buf[0] == 3) 2008 if (err == 3 && (buf[0] == 3 || buf[0] == 6))
1988 snd_iprintf(buffer, "%02x %02x\n", buf[1], buf[2]); 2009 snd_iprintf(buffer, "%02x %02x\n", buf[1], buf[2]);
1989 else 2010 else
1990 snd_iprintf(buffer, "?\n"); 2011 snd_iprintf(buffer, "?\n");
@@ -2022,7 +2043,8 @@ int snd_usb_create_mixer(struct snd_usb_audio *chip, int ctrlif)
2022 if ((err = snd_usb_soundblaster_remote_init(mixer)) < 0) 2043 if ((err = snd_usb_soundblaster_remote_init(mixer)) < 0)
2023 goto _error; 2044 goto _error;
2024 2045
2025 if (mixer->chip->usb_id == USB_ID(0x041e, 0x3020)) { 2046 if (mixer->chip->usb_id == USB_ID(0x041e, 0x3020) ||
2047 mixer->chip->usb_id == USB_ID(0x041e, 0x3040)) {
2026 struct snd_info_entry *entry; 2048 struct snd_info_entry *entry;
2027 2049
2028 if ((err = snd_audigy2nx_controls_create(mixer)) < 0) 2050 if ((err = snd_audigy2nx_controls_create(mixer)) < 0)