Commit 63cf123b authored by Takashi Iwai's avatar Takashi Iwai

Merge branch 'topic/fix/misc' into topic/misc

parents 6834d7ce fcef7836
......@@ -388,9 +388,13 @@ void snd_verbose_printd(const char *file, int line, const char *format, ...)
#else /* !CONFIG_SND_DEBUG */
#define snd_printd(fmt, args...) /* nothing */
#define snd_BUG() /* nothing */
#define snd_BUG_ON(cond) ({/*(void)(cond);*/ 0;}) /* always false */
#define snd_printd(fmt, args...) do { } while (0)
#define snd_BUG() do { } while (0)
static inline int __snd_bug_on(void)
{
return 0;
}
#define snd_BUG_ON(cond) __snd_bug_on() /* always false */
#endif /* CONFIG_SND_DEBUG */
......
......@@ -176,7 +176,7 @@ int soundbus_add_one(struct soundbus_dev *dev)
return -EINVAL;
}
snprintf(dev->ofdev.dev.bus_id, BUS_ID_SIZE, "soundbus:%x", ++devcount);
dev_set_name(&dev->ofdev.dev, "soundbus:%x", ++devcount);
dev->ofdev.dev.bus = &soundbus_bus_type;
return of_device_register(&dev->ofdev);
}
......
......@@ -225,8 +225,13 @@ struct snd_kcontrol *snd_ctl_new1(const struct snd_kcontrol_new *ncontrol,
kctl.id.iface = ncontrol->iface;
kctl.id.device = ncontrol->device;
kctl.id.subdevice = ncontrol->subdevice;
if (ncontrol->name)
if (ncontrol->name) {
strlcpy(kctl.id.name, ncontrol->name, sizeof(kctl.id.name));
if (strcmp(ncontrol->name, kctl.id.name) != 0)
snd_printk(KERN_WARNING
"Control name '%s' truncated to '%s'\n",
ncontrol->name, kctl.id.name);
}
kctl.id.index = ncontrol->index;
kctl.count = ncontrol->count ? ncontrol->count : 1;
access = ncontrol->access == 0 ? SNDRV_CTL_ELEM_ACCESS_READWRITE :
......
......@@ -148,6 +148,8 @@ static int snd_rawmidi_runtime_free(struct snd_rawmidi_substream *substream)
static inline void snd_rawmidi_output_trigger(struct snd_rawmidi_substream *substream,int up)
{
if (!substream->opened)
return;
if (up) {
tasklet_hi_schedule(&substream->runtime->tasklet);
} else {
......@@ -158,6 +160,8 @@ static inline void snd_rawmidi_output_trigger(struct snd_rawmidi_substream *subs
static void snd_rawmidi_input_trigger(struct snd_rawmidi_substream *substream, int up)
{
if (!substream->opened)
return;
substream->ops->trigger(substream, up);
if (!up && substream->runtime->event)
tasklet_kill(&substream->runtime->tasklet);
......@@ -857,6 +861,8 @@ int snd_rawmidi_receive(struct snd_rawmidi_substream *substream,
int result = 0, count1;
struct snd_rawmidi_runtime *runtime = substream->runtime;
if (!substream->opened)
return -EBADFD;
if (runtime->buffer == NULL) {
snd_printd("snd_rawmidi_receive: input is not active!!!\n");
return -EINVAL;
......@@ -1126,6 +1132,8 @@ int snd_rawmidi_transmit_ack(struct snd_rawmidi_substream *substream, int count)
int snd_rawmidi_transmit(struct snd_rawmidi_substream *substream,
unsigned char *buffer, int count)
{
if (!substream->opened)
return -EBADFD;
count = snd_rawmidi_transmit_peek(substream, buffer, count);
if (count < 0)
return count;
......
......@@ -1153,7 +1153,7 @@ snd_ml403_ac97cr_create(struct snd_card *card, struct platform_device *pfdev,
/* get irq */
irq = platform_get_irq(pfdev, 0);
if (request_irq(irq, snd_ml403_ac97cr_irq, IRQF_DISABLED,
pfdev->dev.bus_id, (void *)ml403_ac97cr)) {
dev_name(&pfdev->dev), (void *)ml403_ac97cr)) {
snd_printk(KERN_ERR SND_ML403_AC97CR_DRIVER ": "
"unable to grab IRQ %d\n",
irq);
......@@ -1166,7 +1166,7 @@ snd_ml403_ac97cr_create(struct snd_card *card, struct platform_device *pfdev,
ml403_ac97cr->irq);
irq = platform_get_irq(pfdev, 1);
if (request_irq(irq, snd_ml403_ac97cr_irq, IRQF_DISABLED,
pfdev->dev.bus_id, (void *)ml403_ac97cr)) {
dev_name(&pfdev->dev), (void *)ml403_ac97cr)) {
snd_printk(KERN_ERR SND_ML403_AC97CR_DRIVER ": "
"unable to grab IRQ %d\n",
irq);
......
......@@ -24,13 +24,13 @@ static void pcspkr_do_sound(unsigned int count)
spin_lock_irqsave(&i8253_lock, flags);
if (count) {
/* enable counter 2 */
outb_p(inb_p(0x61) | 3, 0x61);
/* set command for counter 2, 2 byte write */
outb_p(0xB6, 0x43);
/* select desired HZ */
outb_p(count & 0xff, 0x42);
outb((count >> 8) & 0xff, 0x42);
/* enable counter 2 */
outb_p(inb_p(0x61) | 3, 0x61);
} else {
/* disable counter 2 */
outb(inb_p(0x61) & 0xFC, 0x61);
......
......@@ -70,15 +70,15 @@ static int __devinit snd_ad1848_match(struct device *dev, unsigned int n)
return 0;
if (port[n] == SNDRV_AUTO_PORT) {
snd_printk(KERN_ERR "%s: please specify port\n", dev->bus_id);
dev_err(dev, "please specify port\n");
return 0;
}
if (irq[n] == SNDRV_AUTO_IRQ) {
snd_printk(KERN_ERR "%s: please specify irq\n", dev->bus_id);
dev_err(dev, "please specify irq\n");
return 0;
}
if (dma1[n] == SNDRV_AUTO_DMA) {
snd_printk(KERN_ERR "%s: please specify dma1\n", dev->bus_id);
dev_err(dev, "please specify dma1\n");
return 0;
}
return 1;
......
......@@ -36,7 +36,7 @@ static int __devinit snd_adlib_match(struct device *dev, unsigned int n)
return 0;
if (port[n] == SNDRV_AUTO_PORT) {
snd_printk(KERN_ERR "%s: please specify port\n", dev->bus_id);
dev_err(dev, "please specify port\n");
return 0;
}
return 1;
......@@ -55,13 +55,13 @@ static int __devinit snd_adlib_probe(struct device *dev, unsigned int n)
card = snd_card_new(index[n], id[n], THIS_MODULE, 0);
if (!card) {
snd_printk(KERN_ERR "%s: could not create card\n", dev->bus_id);
dev_err(dev, "could not create card\n");
return -EINVAL;
}
card->private_data = request_region(port[n], 4, CRD_NAME);
if (!card->private_data) {
snd_printk(KERN_ERR "%s: could not grab ports\n", dev->bus_id);
dev_err(dev, "could not grab ports\n");
error = -EBUSY;
goto out;
}
......@@ -73,13 +73,13 @@ static int __devinit snd_adlib_probe(struct device *dev, unsigned int n)
error = snd_opl3_create(card, port[n], port[n] + 2, OPL3_HW_AUTO, 1, &opl3);
if (error < 0) {
snd_printk(KERN_ERR "%s: could not create OPL\n", dev->bus_id);
dev_err(dev, "could not create OPL\n");
goto out;
}
error = snd_opl3_hwdep_new(opl3, 0, 0, NULL);
if (error < 0) {
snd_printk(KERN_ERR "%s: could not create FM\n", dev->bus_id);
dev_err(dev, "could not create FM\n");
goto out;
}
......@@ -87,7 +87,7 @@ static int __devinit snd_adlib_probe(struct device *dev, unsigned int n)
error = snd_card_register(card);
if (error < 0) {
snd_printk(KERN_ERR "%s: could not register card\n", dev->bus_id);
dev_err(dev, "could not register card\n");
goto out;
}
......
......@@ -74,15 +74,15 @@ static int __devinit snd_cs4231_match(struct device *dev, unsigned int n)
return 0;
if (port[n] == SNDRV_AUTO_PORT) {
snd_printk(KERN_ERR "%s: please specify port\n", dev->bus_id);
dev_err(dev, "please specify port\n");
return 0;
}
if (irq[n] == SNDRV_AUTO_IRQ) {
snd_printk(KERN_ERR "%s: please specify irq\n", dev->bus_id);
dev_err(dev, "please specify irq\n");
return 0;
}
if (dma1[n] == SNDRV_AUTO_DMA) {
snd_printk(KERN_ERR "%s: please specify dma1\n", dev->bus_id);
dev_err(dev, "please specify dma1\n");
return 0;
}
return 1;
......@@ -133,7 +133,7 @@ static int __devinit snd_cs4231_probe(struct device *dev, unsigned int n)
mpu_port[n], 0, mpu_irq[n],
mpu_irq[n] >= 0 ? IRQF_DISABLED : 0,
NULL) < 0)
printk(KERN_WARNING "%s: MPU401 not detected\n", dev->bus_id);
dev_warn(dev, "MPU401 not detected\n");
}
snd_card_set_dev(card, dev);
......
......@@ -488,19 +488,19 @@ static int __devinit snd_cs423x_isa_match(struct device *pdev,
return 0;
if (port[dev] == SNDRV_AUTO_PORT) {
snd_printk(KERN_ERR "%s: please specify port\n", pdev->bus_id);
dev_err(pdev, "please specify port\n");
return 0;
}
if (cport[dev] == SNDRV_AUTO_PORT) {
snd_printk(KERN_ERR "%s: please specify cport\n", pdev->bus_id);
dev_err(pdev, "please specify cport\n");
return 0;
}
if (irq[dev] == SNDRV_AUTO_IRQ) {
snd_printk(KERN_ERR "%s: please specify irq\n", pdev->bus_id);
dev_err(pdev, "please specify irq\n");
return 0;
}
if (dma1[dev] == SNDRV_AUTO_DMA) {
snd_printk(KERN_ERR "%s: please specify dma1\n", pdev->bus_id);
dev_err(pdev, "please specify dma1\n");
return 0;
}
return 1;
......
......@@ -88,16 +88,14 @@ static int __devinit snd_es1688_legacy_create(struct snd_card *card,
if (irq[n] == SNDRV_AUTO_IRQ) {
irq[n] = snd_legacy_find_free_irq(possible_irqs);
if (irq[n] < 0) {
snd_printk(KERN_ERR "%s: unable to find a free IRQ\n",
dev->bus_id);
dev_err(dev, "unable to find a free IRQ\n");
return -EBUSY;
}
}
if (dma8[n] == SNDRV_AUTO_DMA) {
dma8[n] = snd_legacy_find_free_dma(possible_dmas);
if (dma8[n] < 0) {
snd_printk(KERN_ERR "%s: unable to find a free DMA\n",
dev->bus_id);
dev_err(dev, "unable to find a free DMA\n");
return -EBUSY;
}
}
......@@ -147,8 +145,7 @@ static int __devinit snd_es1688_probe(struct device *dev, unsigned int n)
if (snd_opl3_create(card, chip->port, chip->port + 2,
OPL3_HW_OPL3, 0, &opl3) < 0)
printk(KERN_WARNING "%s: opl3 not detected at 0x%lx\n",
dev->bus_id, chip->port);
dev_warn(dev, "opl3 not detected at 0x%lx\n", chip->port);
else {
error = snd_opl3_hwdep_new(opl3, 0, 1, NULL);
if (error < 0)
......
......@@ -90,24 +90,21 @@ static int __devinit snd_gusclassic_create(struct snd_card *card,
if (irq[n] == SNDRV_AUTO_IRQ) {
irq[n] = snd_legacy_find_free_irq(possible_irqs);
if (irq[n] < 0) {
snd_printk(KERN_ERR "%s: unable to find a free IRQ\n",
dev->bus_id);
dev_err(dev, "unable to find a free IRQ\n");
return -EBUSY;
}
}
if (dma1[n] == SNDRV_AUTO_DMA) {
dma1[n] = snd_legacy_find_free_dma(possible_dmas);
if (dma1[n] < 0) {
snd_printk(KERN_ERR "%s: unable to find a free DMA1\n",
dev->bus_id);
dev_err(dev, "unable to find a free DMA1\n");
return -EBUSY;
}
}
if (dma2[n] == SNDRV_AUTO_DMA) {
dma2[n] = snd_legacy_find_free_dma(possible_dmas);
if (dma2[n] < 0) {
snd_printk(KERN_ERR "%s: unable to find a free DMA2\n",
dev->bus_id);
dev_err(dev, "unable to find a free DMA2\n");
return -EBUSY;
}
}
......@@ -174,8 +171,8 @@ static int __devinit snd_gusclassic_probe(struct device *dev, unsigned int n)
error = -ENODEV;
if (gus->max_flag || gus->ess_flag) {
snd_printk(KERN_ERR "%s: GUS Classic or ACE soundcard was "
"not detected at 0x%lx\n", dev->bus_id, gus->gf1.port);
dev_err(dev, "GUS Classic or ACE soundcard was "
"not detected at 0x%lx\n", gus->gf1.port);
goto out;
}
......
......@@ -106,16 +106,14 @@ static int __devinit snd_gusextreme_es1688_create(struct snd_card *card,
if (irq[n] == SNDRV_AUTO_IRQ) {
irq[n] = snd_legacy_find_free_irq(possible_irqs);
if (irq[n] < 0) {
snd_printk(KERN_ERR "%s: unable to find a free IRQ "
"for ES1688\n", dev->bus_id);
dev_err(dev, "unable to find a free IRQ for ES1688\n");
return -EBUSY;
}
}
if (dma8[n] == SNDRV_AUTO_DMA) {
dma8[n] = snd_legacy_find_free_dma(possible_dmas);
if (dma8[n] < 0) {
snd_printk(KERN_ERR "%s: unable to find a free DMA "
"for ES1688\n", dev->bus_id);
dev_err(dev, "unable to find a free DMA for ES1688\n");
return -EBUSY;
}
}
......@@ -143,16 +141,14 @@ static int __devinit snd_gusextreme_gus_card_create(struct snd_card *card,
if (gf1_irq[n] == SNDRV_AUTO_IRQ) {
gf1_irq[n] = snd_legacy_find_free_irq(possible_irqs);
if (gf1_irq[n] < 0) {
snd_printk(KERN_ERR "%s: unable to find a free IRQ "
"for GF1\n", dev->bus_id);
dev_err(dev, "unable to find a free IRQ for GF1\n");
return -EBUSY;
}
}
if (dma1[n] == SNDRV_AUTO_DMA) {
dma1[n] = snd_legacy_find_free_dma(possible_dmas);
if (dma1[n] < 0) {
snd_printk(KERN_ERR "%s: unable to find a free DMA "
"for GF1\n", dev->bus_id);
dev_err(dev, "unable to find a free DMA for GF1\n");
return -EBUSY;
}
}
......@@ -278,8 +274,8 @@ static int __devinit snd_gusextreme_probe(struct device *dev, unsigned int n)
error = -ENODEV;
if (!gus->ess_flag) {
snd_printk(KERN_ERR "%s: GUS Extreme soundcard was not "
"detected at 0x%lx\n", dev->bus_id, gus->gf1.port);
dev_err(dev, "GUS Extreme soundcard was not "
"detected at 0x%lx\n", gus->gf1.port);
goto out;
}
gus->codec_flag = 1;
......@@ -310,8 +306,7 @@ static int __devinit snd_gusextreme_probe(struct device *dev, unsigned int n)
if (snd_opl3_create(card, es1688->port, es1688->port + 2,
OPL3_HW_OPL3, 0, &opl3) < 0)
printk(KERN_ERR "%s: opl3 not detected at 0x%lx\n",
dev->bus_id, es1688->port);
dev_warn(dev, "opl3 not detected at 0x%lx\n", es1688->port);
else {
error = snd_opl3_hwdep_new(opl3, 0, 2, NULL);
if (error < 0)
......
......@@ -85,11 +85,11 @@ static int __devinit snd_sb8_match(struct device *pdev, unsigned int dev)
if (!enable[dev])
return 0;
if (irq[dev] == SNDRV_AUTO_IRQ) {
snd_printk(KERN_ERR "%s: please specify irq\n", pdev->bus_id);
dev_err(pdev, "please specify irq\n");
return 0;
}
if (dma8[dev] == SNDRV_AUTO_DMA) {
snd_printk(KERN_ERR "%s: please specify dma8\n", pdev->bus_id);
dev_err(pdev, "please specify dma8\n");
return 0;
}
return 1;
......
/*
* Initialisation code for Cyrix/NatSemi VSA1 softaudio
*
* (C) Copyright 2003 Red Hat Inc <alan@redhat.com>
* (C) Copyright 2003 Red Hat Inc <alan@lxorguk.ukuu.org.uk>
*
* XpressAudio(tm) is used on the Cyrix MediaGX (now NatSemi Geode) systems.
* The older version (VSA1) provides fairly good soundblaster emulation
......
......@@ -1927,7 +1927,7 @@ static int snd_ac97_dev_register(struct snd_device *device)
ac97->dev.bus = &ac97_bus_type;
ac97->dev.parent = ac97->bus->card->dev;
ac97->dev.release = ac97_device_release;
snprintf(ac97->dev.bus_id, BUS_ID_SIZE, "%d-%d:%s",
dev_set_name(&ac97->dev, "%d-%d:%s",
ac97->bus->card->number, ac97->num,
snd_ac97_get_short_name(ac97));
if ((err = device_register(&ac97->dev)) < 0) {
......
......@@ -2,7 +2,7 @@
* cs5530.c - Initialisation code for Cyrix/NatSemi VSA1 softaudio
*
* (C) Copyright 2007 Ash Willis <ashwillis@programmer.net>
* (C) Copyright 2003 Red Hat Inc <alan@redhat.com>
* (C) Copyright 2003 Red Hat Inc <alan@lxorguk.ukuu.org.uk>
*
* This driver was ported (shamelessly ripped ;) from oss/kahlua.c but I did
* mess with it a bit. The chip seems to have to have trouble with full duplex
......
......@@ -1470,6 +1470,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
.ca0151_chip = 1,
.spk71 = 1,
.spdif_bug = 1,
.invert_shared_spdif = 1, /* digital/analog switch swapped */
.ac97_chip = 1} ,
{.vendor = 0x1102, .device = 0x0004, .subsystem = 0x20021102,
.driver = "Audigy2", .name = "SB Audigy 2 ZS [SB0350]",
......@@ -1479,6 +1480,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
.ca0151_chip = 1,
.spk71 = 1,
.spdif_bug = 1,
.invert_shared_spdif = 1, /* digital/analog switch swapped */
.ac97_chip = 1} ,
{.vendor = 0x1102, .device = 0x0004, .subsystem = 0x20011102,
.driver = "Audigy2", .name = "SB Audigy 2 ZS [SB0360]",
......@@ -1488,6 +1490,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
.ca0151_chip = 1,
.spk71 = 1,
.spdif_bug = 1,
.invert_shared_spdif = 1, /* digital/analog switch swapped */
.ac97_chip = 1} ,
/* Audigy 2 */
/* Tested by James@superbug.co.uk 3rd July 2005 */
......
......@@ -2688,12 +2688,13 @@ static int __devinit snd_ice1712_probe(struct pci_dev *pci,
return err;
}
if (ice_has_con_ac97(ice))
if (ice_has_con_ac97(ice)) {
err = snd_ice1712_pcm(ice, pcm_dev++, NULL);
if (err < 0) {
snd_card_free(card);
return err;
}
}
err = snd_ice1712_ac97_mixer(ice);
if (err < 0) {
......@@ -2715,12 +2716,13 @@ static int __devinit snd_ice1712_probe(struct pci_dev *pci,
}
}
if (ice_has_con_ac97(ice))
if (ice_has_con_ac97(ice)) {
err = snd_ice1712_pcm_ds(ice, pcm_dev++, NULL);
if (err < 0) {
snd_card_free(card);
return err;
}
}
if (!c->no_mpu401) {
err = snd_mpu401_uart_new(card, 0, MPU401_HW_ICE1712,
......
......@@ -2702,6 +2702,7 @@ static struct snd_pci_quirk intel8x0_clock_list[] __devinitdata = {
SND_PCI_QUIRK(0x0e11, 0x008a, "AD1885", 41000),
SND_PCI_QUIRK(0x1028, 0x00be, "AD1885", 44100),
SND_PCI_QUIRK(0x1028, 0x0177, "AD1980", 48000),
SND_PCI_QUIRK(0x1028, 0x01ad, "AD1981B", 48000),
SND_PCI_QUIRK(0x1043, 0x80f3, "AD1985", 48000),
{ } /* terminator */
};
......
......@@ -95,7 +95,7 @@ static int soc_ac97_dev_register(struct snd_soc_codec *codec)
codec->ac97->dev.parent = NULL;
codec->ac97->dev.release = soc_ac97_device_release;
snprintf(codec->ac97->dev.bus_id, BUS_ID_SIZE, "%d-%d:%s",
dev_set_name(&codec->ac97->dev, "%d-%d:%s",
codec->card->number, 0, codec->name);
err = device_register(&codec->ac97->dev);
if (err < 0) {
......
......@@ -57,7 +57,7 @@ module_exit(cleanup_soundcore);
/*
* OSS sound core handling. Breaks out sound functions to submodules
*
* Author: Alan Cox <alan.cox@linux.org>
* Author: Alan Cox <alan@lxorguk.ukuu.org.uk>
*
* Fixes:
*
......
......@@ -1480,6 +1480,36 @@ YAMAHA_DEVICE(0x7010, "UB99"),
}
}
},
{
/* Advanced modes of the Edirol UA-25EX.
* For the standard mode, UA-25EX has ID 0582:00e7, which
* offers only 16-bit PCM at 44.1 kHz and no MIDI.
*/
USB_DEVICE_VENDOR_SPEC(0x0582, 0x00e6),
.driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
.vendor_name = "EDIROL",
.product_name = "UA-25EX",
.ifnum = QUIRK_ANY_INTERFACE,
.type = QUIRK_COMPOSITE,
.data = (const struct snd_usb_audio_quirk[]) {
{
.ifnum = 0,
.type = QUIRK_AUDIO_EDIROL_UAXX
},
{
.ifnum = 1,
.type = QUIRK_AUDIO_EDIROL_UAXX
},
{
.ifnum = 2,
.type = QUIRK_AUDIO_EDIROL_UAXX
},
{
.ifnum = -1
}
}
}
},
/* Guillemot devices */
{
......
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