Commit 9e82294a authored by Jaroslav Kysela's avatar Jaroslav Kysela

Merge suse.cz:/home/perex/bk/linux-sound/linux-sound

into suse.cz:/home/perex/bk/linux-sound/work
parents 7a4b62d0 8a1f8f8e
/* include/version.h. Generated automatically by configure. */ /* include/version.h. Generated automatically by configure. */
#define CONFIG_SND_VERSION "0.9.0rc6" #define CONFIG_SND_VERSION "0.9.0rc6"
#define CONFIG_SND_DATE " (Wed Dec 11 21:24:39 2002 UTC)" #define CONFIG_SND_DATE " (Mon Dec 16 14:23:15 2002 UTC)"
...@@ -92,6 +92,56 @@ int snd_pcm_sgbuf_delete(snd_pcm_substream_t *substream) ...@@ -92,6 +92,56 @@ int snd_pcm_sgbuf_delete(snd_pcm_substream_t *substream)
return 0; return 0;
} }
/*
* snd_pci_alloc_page - allocate a page in the valid pci dma mask
*
* returns the virtual address and stores the physical address on
* addrp. this function cannot be called from interrupt handlers or
* within spinlocks.
*/
#ifdef __i386__
/*
* on ix86, we allocate a page with GFP_KERNEL to assure the
* allocation. the code is almost same with kernel/i386/pci-dma.c but
* it allocates only a single page and checkes the validity of the
* page address with the given pci dma mask.
*/
inline static void *snd_pci_alloc_page(struct pci_dev *pci, dma_addr_t *addrp)
{
void *ptr;
dma_addr_t addr;
unsigned long rmask;
if (pci)
rmask = ~(unsigned long)pci->dma_mask;
else
rmask = 0;
ptr = (void *)__get_free_page(GFP_KERNEL);
if (ptr) {
addr = virt_to_phys(ptr);
if (((unsigned long)addr + PAGE_SIZE - 1) & rmask) {
/* try to reallocate with the GFP_DMA */
free_page((unsigned long)ptr);
ptr = (void *)__get_free_page(GFP_KERNEL | GFP_DMA);
if (ptr) /* ok, the address must be within lower 16MB... */
addr = virt_to_phys(ptr);
else
addr = 0;
}
} else
addr = 0;
if (ptr)
memset(ptr, 0, PAGE_SIZE);
*addrp = addr;
return ptr;
}
#else
/* on other architectures, call snd_malloc_pci_pages() helper function
* which uses pci_alloc_consistent().
*/
#define snd_pci_alloc_page(pci, addrp) snd_malloc_pci_pages(pci, PAGE_SIZE, addrp)
#endif
/* /*
* allocate sg buffer table with the given byte size. * allocate sg buffer table with the given byte size.
* if the buffer table already exists, try to resize it. * if the buffer table already exists, try to resize it.
...@@ -128,7 +178,7 @@ int snd_pcm_sgbuf_alloc(snd_pcm_substream_t *substream, size_t size) ...@@ -128,7 +178,7 @@ int snd_pcm_sgbuf_alloc(snd_pcm_substream_t *substream, size_t size)
while (sgbuf->pages < pages) { while (sgbuf->pages < pages) {
void *ptr; void *ptr;
dma_addr_t addr; dma_addr_t addr;
ptr = snd_malloc_pci_pages(sgbuf->pci, PAGE_SIZE, &addr); ptr = snd_pci_alloc_page(sgbuf->pci, &addr);
if (! ptr) if (! ptr)
return -ENOMEM; return -ENOMEM;
sgbuf->table[sgbuf->pages].buf = ptr; sgbuf->table[sgbuf->pages].buf = ptr;
......
...@@ -205,19 +205,19 @@ static int translate_subdevice_to_hwport(mtpav_t *chip, int subdev) ...@@ -205,19 +205,19 @@ static int translate_subdevice_to_hwport(mtpav_t *chip, int subdev)
static int translate_hwport_to_subdevice(mtpav_t *chip, int hwport) static int translate_hwport_to_subdevice(mtpav_t *chip, int hwport)
{ {
int port; int p;
if (hwport <= 0x00) /* all ports */ if (hwport <= 0x00) /* all ports */
return chip->num_ports + MTPAV_PIDX_BROADCAST; return chip->num_ports + MTPAV_PIDX_BROADCAST;
else if (hwport <= 0x08) { /* single port */ else if (hwport <= 0x08) { /* single port */
port = hwport - 1; p = hwport - 1;
if (port >= chip->num_ports) if (p >= chip->num_ports)
port = 0; p = 0;
return port; return p;
} else if (hwport <= 0x10) { /* remote port */ } else if (hwport <= 0x10) { /* remote port */
port = hwport - 0x09 + chip->num_ports; p = hwport - 0x09 + chip->num_ports;
if (port >= chip->num_ports * 2) if (p >= chip->num_ports * 2)
port = chip->num_ports; p = chip->num_ports;
return port; return p;
} else if (hwport == 0x11) /* computer port */ } else if (hwport == 0x11) /* computer port */
return chip->num_ports + MTPAV_PIDX_COMPUTER; return chip->num_ports + MTPAV_PIDX_COMPUTER;
else /* ADAT */ else /* ADAT */
...@@ -335,11 +335,11 @@ static void snd_mtpav_output_write(snd_rawmidi_substream_t * substream) ...@@ -335,11 +335,11 @@ static void snd_mtpav_output_write(snd_rawmidi_substream_t * substream)
static void snd_mtpav_portscan(mtpav_t *chip) // put mtp into smart routing mode static void snd_mtpav_portscan(mtpav_t *chip) // put mtp into smart routing mode
{ {
u8 port; u8 p;
for (port = 0; port < 8; port++) { for (p = 0; p < 8; p++) {
snd_mtpav_send_byte(chip, 0xf5); snd_mtpav_send_byte(chip, 0xf5);
snd_mtpav_send_byte(chip, port); snd_mtpav_send_byte(chip, p);
snd_mtpav_send_byte(chip, 0xfe); snd_mtpav_send_byte(chip, 0xfe);
} }
} }
...@@ -350,12 +350,12 @@ static void snd_mtpav_portscan(mtpav_t *chip) // put mtp into smart routing mode ...@@ -350,12 +350,12 @@ static void snd_mtpav_portscan(mtpav_t *chip) // put mtp into smart routing mode
static int snd_mtpav_input_open(snd_rawmidi_substream_t * substream) static int snd_mtpav_input_open(snd_rawmidi_substream_t * substream)
{ {
unsigned long flags; unsigned long flags;
mtpav_port_t *port = &mtp_card->ports[substream->number]; mtpav_port_t *portp = &mtp_card->ports[substream->number];
//printk("mtpav port: %d opened\n", (int) substream->number); //printk("mtpav port: %d opened\n", (int) substream->number);
spin_lock_irqsave(&mtp_card->spinlock, flags); spin_lock_irqsave(&mtp_card->spinlock, flags);
port->mode |= MTPAV_MODE_INPUT_OPENED; portp->mode |= MTPAV_MODE_INPUT_OPENED;
port->input = substream; portp->input = substream;
if (mtp_card->share_irq++ == 0) if (mtp_card->share_irq++ == 0)
snd_mtpav_mputreg(mtp_card, CREG, (SIGC_INTEN | SIGC_WRITE)); // enable pport interrupts snd_mtpav_mputreg(mtp_card, CREG, (SIGC_INTEN | SIGC_WRITE)); // enable pport interrupts
spin_unlock_irqrestore(&mtp_card->spinlock, flags); spin_unlock_irqrestore(&mtp_card->spinlock, flags);
...@@ -368,14 +368,14 @@ static int snd_mtpav_input_open(snd_rawmidi_substream_t * substream) ...@@ -368,14 +368,14 @@ static int snd_mtpav_input_open(snd_rawmidi_substream_t * substream)
static int snd_mtpav_input_close(snd_rawmidi_substream_t *substream) static int snd_mtpav_input_close(snd_rawmidi_substream_t *substream)
{ {
unsigned long flags; unsigned long flags;
mtpav_port_t *port = &mtp_card->ports[substream->number]; mtpav_port_t *portp = &mtp_card->ports[substream->number];
//printk("mtpav port: %d closed\n", (int) port); //printk("mtpav port: %d closed\n", (int) portp);
spin_lock_irqsave(&mtp_card->spinlock, flags); spin_lock_irqsave(&mtp_card->spinlock, flags);
port->mode &= (~MTPAV_MODE_INPUT_OPENED); portp->mode &= (~MTPAV_MODE_INPUT_OPENED);
port->input = NULL; portp->input = NULL;
if (--mtp_card->share_irq == 0) if (--mtp_card->share_irq == 0)
snd_mtpav_mputreg(mtp_card, CREG, 0); // disable pport interrupts snd_mtpav_mputreg(mtp_card, CREG, 0); // disable pport interrupts
...@@ -389,13 +389,13 @@ static int snd_mtpav_input_close(snd_rawmidi_substream_t *substream) ...@@ -389,13 +389,13 @@ static int snd_mtpav_input_close(snd_rawmidi_substream_t *substream)
static void snd_mtpav_input_trigger(snd_rawmidi_substream_t * substream, int up) static void snd_mtpav_input_trigger(snd_rawmidi_substream_t * substream, int up)
{ {
unsigned long flags; unsigned long flags;
mtpav_port_t *port = &mtp_card->ports[substream->number]; mtpav_port_t *portp = &mtp_card->ports[substream->number];
spin_lock_irqsave(&mtp_card->spinlock, flags); spin_lock_irqsave(&mtp_card->spinlock, flags);
if (up) if (up)
port->mode |= MTPAV_MODE_INPUT_TRIGGERED; portp->mode |= MTPAV_MODE_INPUT_TRIGGERED;
else else
port->mode &= ~MTPAV_MODE_INPUT_TRIGGERED; portp->mode &= ~MTPAV_MODE_INPUT_TRIGGERED;
spin_unlock_irqrestore(&mtp_card->spinlock, flags); spin_unlock_irqrestore(&mtp_card->spinlock, flags);
} }
...@@ -416,9 +416,9 @@ static void snd_mtpav_output_timer(unsigned long data) ...@@ -416,9 +416,9 @@ static void snd_mtpav_output_timer(unsigned long data)
add_timer(&chip->timer); add_timer(&chip->timer);
/* process each port */ /* process each port */
for (p = 0; p <= chip->num_ports * 2 + MTPAV_PIDX_BROADCAST; p++) { for (p = 0; p <= chip->num_ports * 2 + MTPAV_PIDX_BROADCAST; p++) {
mtpav_port_t *port = &mtp_card->ports[p]; mtpav_port_t *portp = &mtp_card->ports[p];
if ((port->mode & MTPAV_MODE_OUTPUT_TRIGGERED) && port->output) if ((portp->mode & MTPAV_MODE_OUTPUT_TRIGGERED) && portp->output)
snd_mtpav_output_port_write(port, port->output); snd_mtpav_output_port_write(portp, portp->output);
} }
spin_unlock(&chip->spinlock); spin_unlock(&chip->spinlock);
} }
...@@ -445,11 +445,11 @@ static void snd_mtpav_remove_output_timer(mtpav_t *chip) ...@@ -445,11 +445,11 @@ static void snd_mtpav_remove_output_timer(mtpav_t *chip)
static int snd_mtpav_output_open(snd_rawmidi_substream_t * substream) static int snd_mtpav_output_open(snd_rawmidi_substream_t * substream)
{ {
unsigned long flags; unsigned long flags;
mtpav_port_t *port = &mtp_card->ports[substream->number]; mtpav_port_t *portp = &mtp_card->ports[substream->number];
spin_lock_irqsave(&mtp_card->spinlock, flags); spin_lock_irqsave(&mtp_card->spinlock, flags);
port->mode |= MTPAV_MODE_OUTPUT_OPENED; portp->mode |= MTPAV_MODE_OUTPUT_OPENED;
port->output = substream; portp->output = substream;
spin_unlock_irqrestore(&mtp_card->spinlock, flags); spin_unlock_irqrestore(&mtp_card->spinlock, flags);
return 0; return 0;
}; };
...@@ -460,11 +460,11 @@ static int snd_mtpav_output_open(snd_rawmidi_substream_t * substream) ...@@ -460,11 +460,11 @@ static int snd_mtpav_output_open(snd_rawmidi_substream_t * substream)
static int snd_mtpav_output_close(snd_rawmidi_substream_t * substream) static int snd_mtpav_output_close(snd_rawmidi_substream_t * substream)
{ {
unsigned long flags; unsigned long flags;
mtpav_port_t *port = &mtp_card->ports[substream->number]; mtpav_port_t *portp = &mtp_card->ports[substream->number];
spin_lock_irqsave(&mtp_card->spinlock, flags); spin_lock_irqsave(&mtp_card->spinlock, flags);
port->mode &= (~MTPAV_MODE_OUTPUT_OPENED); portp->mode &= (~MTPAV_MODE_OUTPUT_OPENED);
port->output = NULL; portp->output = NULL;
spin_unlock_irqrestore(&mtp_card->spinlock, flags); spin_unlock_irqrestore(&mtp_card->spinlock, flags);
return 0; return 0;
}; };
...@@ -475,17 +475,17 @@ static int snd_mtpav_output_close(snd_rawmidi_substream_t * substream) ...@@ -475,17 +475,17 @@ static int snd_mtpav_output_close(snd_rawmidi_substream_t * substream)
static void snd_mtpav_output_trigger(snd_rawmidi_substream_t * substream, int up) static void snd_mtpav_output_trigger(snd_rawmidi_substream_t * substream, int up)
{ {
unsigned long flags; unsigned long flags;
mtpav_port_t *port = &mtp_card->ports[substream->number]; mtpav_port_t *portp = &mtp_card->ports[substream->number];
spin_lock_irqsave(&mtp_card->spinlock, flags); spin_lock_irqsave(&mtp_card->spinlock, flags);
if (up) { if (up) {
if (! (port->mode & MTPAV_MODE_OUTPUT_TRIGGERED)) { if (! (portp->mode & MTPAV_MODE_OUTPUT_TRIGGERED)) {
if (mtp_card->istimer++ == 0) if (mtp_card->istimer++ == 0)
snd_mtpav_add_output_timer(mtp_card); snd_mtpav_add_output_timer(mtp_card);
port->mode |= MTPAV_MODE_OUTPUT_TRIGGERED; portp->mode |= MTPAV_MODE_OUTPUT_TRIGGERED;
} }
} else { } else {
port->mode &= ~MTPAV_MODE_OUTPUT_TRIGGERED; portp->mode &= ~MTPAV_MODE_OUTPUT_TRIGGERED;
if (--mtp_card->istimer == 0) if (--mtp_card->istimer == 0)
snd_mtpav_remove_output_timer(mtp_card); snd_mtpav_remove_output_timer(mtp_card);
} }
...@@ -501,15 +501,15 @@ static void snd_mtpav_output_trigger(snd_rawmidi_substream_t * substream, int up ...@@ -501,15 +501,15 @@ static void snd_mtpav_output_trigger(snd_rawmidi_substream_t * substream, int up
static void snd_mtpav_inmidi_process(mtpav_t *mcrd, u8 inbyte) static void snd_mtpav_inmidi_process(mtpav_t *mcrd, u8 inbyte)
{ {
mtpav_port_t *port; mtpav_port_t *portp;
if (mcrd->inmidiport > mcrd->num_ports * 2 + MTPAV_PIDX_BROADCAST) if (mcrd->inmidiport > mcrd->num_ports * 2 + MTPAV_PIDX_BROADCAST)
return; return;
port = &mcrd->ports[mcrd->inmidiport]; portp = &mcrd->ports[mcrd->inmidiport];
if (port->mode & MTPAV_MODE_INPUT_TRIGGERED) { if (portp->mode & MTPAV_MODE_INPUT_TRIGGERED) {
spin_unlock(&mcrd->spinlock); spin_unlock(&mcrd->spinlock);
snd_rawmidi_receive(port->input, &inbyte, 1); snd_rawmidi_receive(portp->input, &inbyte, 1);
spin_lock(&mcrd->spinlock); spin_lock(&mcrd->spinlock);
} }
} }
......
...@@ -1831,9 +1831,10 @@ static int snd_ali5451_spdif_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t ...@@ -1831,9 +1831,10 @@ static int snd_ali5451_spdif_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t
return change; return change;
} }
static snd_kcontrol_new_t snd_ali5451_mixer_spdif[] __devinit = { static snd_kcontrol_new_t snd_ali5451_mixer_spdif[] __devinitdata = {
/* spdif aplayback switch */ /* spdif aplayback switch */
ALI5451_SPDIF(SNDRV_CTL_NAME_IEC958("",PLAYBACK,SWITCH), 0, 0), /* FIXME: "IEC958 Playback Switch" may conflict with one on ac97_codec */
ALI5451_SPDIF("IEC958 Output switch", 0, 0),
/* spdif out to spdif channel */ /* spdif out to spdif channel */
ALI5451_SPDIF("IEC958 Channel Output Switch", 0, 1), ALI5451_SPDIF("IEC958 Channel Output Switch", 0, 1),
/* spdif in from spdif channel */ /* spdif in from spdif channel */
...@@ -1861,7 +1862,7 @@ static int __devinit snd_ali_mixer(ali_t * codec) ...@@ -1861,7 +1862,7 @@ static int __devinit snd_ali_mixer(ali_t * codec)
return err; return err;
} }
if (codec->revision == ALI_5451_V02) { if (codec->revision == ALI_5451_V02) {
for(idx = 0; idx < 3; idx++) { for(idx = 0; idx < ARRAY_SIZE(snd_ali5451_mixer_spdif); idx++) {
err=snd_ctl_add(codec->card, snd_ctl_new1(&snd_ali5451_mixer_spdif[idx], codec)); err=snd_ctl_add(codec->card, snd_ctl_new1(&snd_ali5451_mixer_spdif[idx], codec));
if (err < 0) return err; if (err < 0) return err;
} }
...@@ -2010,10 +2011,12 @@ static int snd_ali_chip_init(ali_t *codec) ...@@ -2010,10 +2011,12 @@ static int snd_ali_chip_init(ali_t *codec)
if (codec->revision == ALI_5451_V02) { if (codec->revision == ALI_5451_V02) {
pci_dev = codec->pci_m1533; pci_dev = codec->pci_m1533;
pci_read_config_byte(pci_dev, 0x59, &temp); pci_read_config_byte(pci_dev, 0x59, &temp);
temp |= 0x80;
pci_write_config_byte(pci_dev, 0x59, temp);
pci_dev = codec->pci_m7101; pci_dev = codec->pci_m7101;
pci_read_config_byte(pci_dev, 0xb8, &temp); pci_read_config_byte(pci_dev, 0xb8, &temp);
temp |= 1 << 6; temp |= 0x20;
pci_write_config_byte(pci_dev, 0xB8, temp); pci_write_config_byte(pci_dev, 0xB8, temp);
} }
......
...@@ -164,7 +164,7 @@ struct _snd_fm801 { ...@@ -164,7 +164,7 @@ struct _snd_fm801 {
}; };
static struct pci_device_id snd_fm801_ids[] __devinitdata = { static struct pci_device_id snd_fm801_ids[] __devinitdata = {
{ 0x1319, 0x0801, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* FM801 */ { 0x1319, 0x0801, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, 0, }, /* FM801 */
{ 0, } { 0, }
}; };
......
...@@ -24,7 +24,10 @@ ...@@ -24,7 +24,10 @@
* *
*/ */
#define HOONTECH_DEVICE_DESC "{Hoontech SoundTrack DSP 24}," #define HOONTECH_DEVICE_DESC \
"{Hoontech SoundTrack DSP 24}," \
"{Hoontech SoundTrack DSP 24 Value}," \
"{Hoontech SoundTrack DSP 24 Media 7.1}," \
#define ICE1712_SUBDEVICE_STDSP24 0x12141217 /* Hoontech SoundTrack Audio DSP 24 */ #define ICE1712_SUBDEVICE_STDSP24 0x12141217 /* Hoontech SoundTrack Audio DSP 24 */
#define ICE1712_SUBDEVICE_STDSP24_MEDIA7_1 0x16141217 /* Hoontech ST Audio DSP24 Media 7.1 */ #define ICE1712_SUBDEVICE_STDSP24_MEDIA7_1 0x16141217 /* Hoontech ST Audio DSP24 Media 7.1 */
......
...@@ -296,7 +296,7 @@ static int get_ctl_value(usb_mixer_elem_info_t *cval, int request, int validx, i ...@@ -296,7 +296,7 @@ static int get_ctl_value(usb_mixer_elem_info_t *cval, int request, int validx, i
return 0; return 0;
} }
} }
snd_printdd(KERN_ERR "cannot get ctl value: req = 0x%x, idx = 0x%x, val = 0x%x, type = %d\n", request, validx, cval->ctrlif | (cval->id << 8), cval->val_type); snd_printdd(KERN_ERR "cannot get ctl value: req = 0x%x, wValue = 0x%x, wIndex = 0x%x, type = %d\n", request, validx, cval->ctrlif | (cval->id << 8), cval->val_type);
return -EINVAL; return -EINVAL;
} }
...@@ -331,6 +331,7 @@ static int set_ctl_value(usb_mixer_elem_info_t *cval, int request, int validx, i ...@@ -331,6 +331,7 @@ static int set_ctl_value(usb_mixer_elem_info_t *cval, int request, int validx, i
validx, cval->ctrlif | (cval->id << 8), validx, cval->ctrlif | (cval->id << 8),
buf, val_len, HZ / 10) >= 0) buf, val_len, HZ / 10) >= 0)
return 0; return 0;
snd_printdd(KERN_ERR "cannot set ctl value: req = 0x%x, wValue = 0x%x, wIndex = 0x%x, type = %d, data = 0x%x/0x%x\n", request, validx, cval->ctrlif | (cval->id << 8), cval->val_type, buf[0], buf[1]);
return -EINVAL; return -EINVAL;
} }
...@@ -571,11 +572,11 @@ static void usb_mixer_elem_free(snd_kcontrol_t *kctl) ...@@ -571,11 +572,11 @@ static void usb_mixer_elem_free(snd_kcontrol_t *kctl)
/* /*
* retrieve the minimum and maximum values for the specified control * retrieve the minimum and maximum values for the specified control
*/ */
static int get_min_max(usb_mixer_elem_info_t *cval) static int get_min_max(usb_mixer_elem_info_t *cval, int default_min)
{ {
/* for failsafe */ /* for failsafe */
cval->min = 0; cval->min = default_min;
cval->max = 1; cval->max = cval->min + 1;
cval->res = 1; cval->res = 1;
if (cval->val_type == USB_MIXER_BOOLEAN || if (cval->val_type == USB_MIXER_BOOLEAN ||
...@@ -634,7 +635,7 @@ static int mixer_ctl_feature_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t ...@@ -634,7 +635,7 @@ static int mixer_ctl_feature_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t
uinfo->value.integer.max = 1; uinfo->value.integer.max = 1;
} else { } else {
if (! cval->initialized) if (! cval->initialized)
get_min_max(cval); get_min_max(cval, 0);
uinfo->value.integer.min = 0; uinfo->value.integer.min = 0;
uinfo->value.integer.max = (cval->max - cval->min) / cval->res; uinfo->value.integer.max = (cval->max - cval->min) / cval->res;
} }
...@@ -784,7 +785,7 @@ static void build_feature_ctl(mixer_build_t *state, unsigned char *desc, ...@@ -784,7 +785,7 @@ static void build_feature_ctl(mixer_build_t *state, unsigned char *desc,
} }
/* get min/max values */ /* get min/max values */
get_min_max(cval); get_min_max(cval, 0);
kctl = snd_ctl_new1(&usb_feature_unit_ctl, cval); kctl = snd_ctl_new1(&usb_feature_unit_ctl, cval);
if (! kctl) { if (! kctl) {
...@@ -952,7 +953,7 @@ static void build_mixer_unit_ctl(mixer_build_t *state, unsigned char *desc, ...@@ -952,7 +953,7 @@ static void build_mixer_unit_ctl(mixer_build_t *state, unsigned char *desc,
} }
/* get min/max values */ /* get min/max values */
get_min_max(cval); get_min_max(cval, 0);
kctl = snd_ctl_new1(&usb_feature_unit_ctl, cval); kctl = snd_ctl_new1(&usb_feature_unit_ctl, cval);
if (! kctl) { if (! kctl) {
...@@ -1060,6 +1061,7 @@ struct procunit_value_info { ...@@ -1060,6 +1061,7 @@ struct procunit_value_info {
int control; int control;
char *suffix; char *suffix;
int val_type; int val_type;
int min_value;
}; };
struct procunit_info { struct procunit_info {
...@@ -1070,12 +1072,12 @@ struct procunit_info { ...@@ -1070,12 +1072,12 @@ struct procunit_info {
static struct procunit_value_info updown_proc_info[] = { static struct procunit_value_info updown_proc_info[] = {
{ USB_PROC_UPDOWN_SWITCH, "Switch", USB_MIXER_BOOLEAN }, { USB_PROC_UPDOWN_SWITCH, "Switch", USB_MIXER_BOOLEAN },
{ USB_PROC_UPDOWN_MODE_SEL, "Mode Select", USB_MIXER_U8 }, { USB_PROC_UPDOWN_MODE_SEL, "Mode Select", USB_MIXER_U8, 1 },
{ 0 } { 0 }
}; };
static struct procunit_value_info prologic_proc_info[] = { static struct procunit_value_info prologic_proc_info[] = {
{ USB_PROC_PROLOGIC_SWITCH, "Switch", USB_MIXER_BOOLEAN }, { USB_PROC_PROLOGIC_SWITCH, "Switch", USB_MIXER_BOOLEAN },
{ USB_PROC_PROLOGIC_MODE_SEL, "Mode Select", USB_MIXER_U8 }, { USB_PROC_PROLOGIC_MODE_SEL, "Mode Select", USB_MIXER_U8, 1 },
{ 0 } { 0 }
}; };
static struct procunit_value_info threed_enh_proc_info[] = { static struct procunit_value_info threed_enh_proc_info[] = {
...@@ -1173,7 +1175,7 @@ static int build_audio_procunit(mixer_build_t *state, int unitid, unsigned char ...@@ -1173,7 +1175,7 @@ static int build_audio_procunit(mixer_build_t *state, int unitid, unsigned char
cval->channels = 1; cval->channels = 1;
/* get min/max values */ /* get min/max values */
get_min_max(cval); get_min_max(cval, valinfo->min_value);
kctl = snd_ctl_new1(&mixer_procunit_ctl, cval); kctl = snd_ctl_new1(&mixer_procunit_ctl, cval);
if (! kctl) { if (! kctl) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment