Skip to content

Commit

Permalink
Merge branch 'topic/misc' into for-linus
Browse files Browse the repository at this point in the history
  • Loading branch information
Takashi Iwai committed Jul 22, 2011
2 parents 13b137e + 000477a commit 7d339ae
Show file tree
Hide file tree
Showing 100 changed files with 1,236 additions and 923 deletions.
10 changes: 5 additions & 5 deletions Documentation/DocBook/writing-an-alsa-driver.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -1164,7 +1164,7 @@
}
chip->port = pci_resource_start(pci, 0);
if (request_irq(pci->irq, snd_mychip_interrupt,
IRQF_SHARED, "My Chip", chip)) {
IRQF_SHARED, KBUILD_MODNAME, chip)) {
printk(KERN_ERR "cannot grab irq %d\n", pci->irq);
snd_mychip_free(chip);
return -EBUSY;
Expand Down Expand Up @@ -1197,7 +1197,7 @@
/* pci_driver definition */
static struct pci_driver driver = {
.name = "My Own Chip",
.name = KBUILD_MODNAME,
.id_table = snd_mychip_ids,
.probe = snd_mychip_probe,
.remove = __devexit_p(snd_mychip_remove),
Expand Down Expand Up @@ -1340,7 +1340,7 @@
<programlisting>
<![CDATA[
if (request_irq(pci->irq, snd_mychip_interrupt,
IRQF_SHARED, "My Chip", chip)) {
IRQF_SHARED, KBUILD_MODNAME, chip)) {
printk(KERN_ERR "cannot grab irq %d\n", pci->irq);
snd_mychip_free(chip);
return -EBUSY;
Expand Down Expand Up @@ -1616,7 +1616,7 @@
<programlisting>
<![CDATA[
static struct pci_driver driver = {
.name = "My Own Chip",
.name = KBUILD_MODNAME,
.id_table = snd_mychip_ids,
.probe = snd_mychip_probe,
.remove = __devexit_p(snd_mychip_remove),
Expand Down Expand Up @@ -5816,7 +5816,7 @@ struct _snd_pcm_runtime {
<programlisting>
<![CDATA[
static struct pci_driver driver = {
.name = "My Chip",
.name = KBUILD_MODNAME,
.id_table = snd_my_ids,
.probe = snd_my_probe,
.remove = __devexit_p(snd_my_remove),
Expand Down
1 change: 1 addition & 0 deletions include/linux/pci_ids.h
Original file line number Diff line number Diff line change
Expand Up @@ -1308,6 +1308,7 @@
#define PCI_SUBDEVICE_ID_CREATIVE_SB08801 0x0041
#define PCI_SUBDEVICE_ID_CREATIVE_SB08802 0x0042
#define PCI_SUBDEVICE_ID_CREATIVE_SB08803 0x0043
#define PCI_SUBDEVICE_ID_CREATIVE_SB1270 0x0062
#define PCI_SUBDEVICE_ID_CREATIVE_HENDRIX 0x6000

#define PCI_VENDOR_ID_ECTIVA 0x1102 /* duplicate: CREATIVE */
Expand Down
4 changes: 3 additions & 1 deletion include/sound/rawmidi.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <linux/spinlock.h>
#include <linux/wait.h>
#include <linux/mutex.h>
#include <linux/workqueue.h>

#if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE)
#include "seq_device.h"
Expand Down Expand Up @@ -63,6 +64,7 @@ struct snd_rawmidi_global_ops {
};

struct snd_rawmidi_runtime {
struct snd_rawmidi_substream *substream;
unsigned int drain: 1, /* drain stage */
oss: 1; /* OSS compatible mode */
/* midi stream buffer */
Expand All @@ -79,7 +81,7 @@ struct snd_rawmidi_runtime {
/* event handler (new bytes, input only) */
void (*event)(struct snd_rawmidi_substream *substream);
/* defers calls to event [input] or ops->trigger [output] */
struct tasklet_struct tasklet;
struct work_struct event_work;
/* private data */
void *private_data;
void (*private_free)(struct snd_rawmidi_substream *substream);
Expand Down
45 changes: 15 additions & 30 deletions sound/core/rawmidi.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,12 @@ static inline int snd_rawmidi_ready_append(struct snd_rawmidi_substream *substre
(!substream->append || runtime->avail >= count);
}

static void snd_rawmidi_input_event_tasklet(unsigned long data)
static void snd_rawmidi_input_event_work(struct work_struct *work)
{
struct snd_rawmidi_substream *substream = (struct snd_rawmidi_substream *)data;
substream->runtime->event(substream);
}

static void snd_rawmidi_output_trigger_tasklet(unsigned long data)
{
struct snd_rawmidi_substream *substream = (struct snd_rawmidi_substream *)data;
substream->ops->trigger(substream, 1);
struct snd_rawmidi_runtime *runtime =
container_of(work, struct snd_rawmidi_runtime, event_work);
if (runtime->event)
runtime->event(runtime->substream);
}

static int snd_rawmidi_runtime_create(struct snd_rawmidi_substream *substream)
Expand All @@ -110,16 +106,10 @@ static int snd_rawmidi_runtime_create(struct snd_rawmidi_substream *substream)

if ((runtime = kzalloc(sizeof(*runtime), GFP_KERNEL)) == NULL)
return -ENOMEM;
runtime->substream = substream;
spin_lock_init(&runtime->lock);
init_waitqueue_head(&runtime->sleep);
if (substream->stream == SNDRV_RAWMIDI_STREAM_INPUT)
tasklet_init(&runtime->tasklet,
snd_rawmidi_input_event_tasklet,
(unsigned long)substream);
else
tasklet_init(&runtime->tasklet,
snd_rawmidi_output_trigger_tasklet,
(unsigned long)substream);
INIT_WORK(&runtime->event_work, snd_rawmidi_input_event_work);
runtime->event = NULL;
runtime->buffer_size = PAGE_SIZE;
runtime->avail_min = 1;
Expand Down Expand Up @@ -150,21 +140,16 @@ static inline void snd_rawmidi_output_trigger(struct snd_rawmidi_substream *subs
{
if (!substream->opened)
return;
if (up) {
tasklet_schedule(&substream->runtime->tasklet);
} else {
tasklet_kill(&substream->runtime->tasklet);
substream->ops->trigger(substream, 0);
}
substream->ops->trigger(substream, up);
}

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);
if (!up)
cancel_work_sync(&substream->runtime->event_work);
}

int snd_rawmidi_drop_output(struct snd_rawmidi_substream *substream)
Expand Down Expand Up @@ -641,10 +626,10 @@ int snd_rawmidi_output_params(struct snd_rawmidi_substream *substream,
return -EINVAL;
}
if (params->buffer_size != runtime->buffer_size) {
newbuf = kmalloc(params->buffer_size, GFP_KERNEL);
newbuf = krealloc(runtime->buffer, params->buffer_size,
GFP_KERNEL);
if (!newbuf)
return -ENOMEM;
kfree(runtime->buffer);
runtime->buffer = newbuf;
runtime->buffer_size = params->buffer_size;
runtime->avail = runtime->buffer_size;
Expand All @@ -668,10 +653,10 @@ int snd_rawmidi_input_params(struct snd_rawmidi_substream *substream,
return -EINVAL;
}
if (params->buffer_size != runtime->buffer_size) {
newbuf = kmalloc(params->buffer_size, GFP_KERNEL);
newbuf = krealloc(runtime->buffer, params->buffer_size,
GFP_KERNEL);
if (!newbuf)
return -ENOMEM;
kfree(runtime->buffer);
runtime->buffer = newbuf;
runtime->buffer_size = params->buffer_size;
}
Expand Down Expand Up @@ -926,7 +911,7 @@ int snd_rawmidi_receive(struct snd_rawmidi_substream *substream,
}
if (result > 0) {
if (runtime->event)
tasklet_schedule(&runtime->tasklet);
schedule_work(&runtime->event_work);
else if (snd_rawmidi_ready(substream))
wake_up(&runtime->sleep);
}
Expand Down
2 changes: 1 addition & 1 deletion sound/firewire/speakers.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ static int fwspk_open(struct snd_pcm_substream *substream)

err = snd_pcm_hw_constraint_minmax(runtime,
SNDRV_PCM_HW_PARAM_PERIOD_TIME,
5000, 8192000);
5000, UINT_MAX);
if (err < 0)
return err;

Expand Down
4 changes: 2 additions & 2 deletions sound/pci/ad1889.c
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,7 @@ snd_ad1889_create(struct snd_card *card,
spin_lock_init(&chip->lock); /* only now can we call ad1889_free */

if (request_irq(pci->irq, snd_ad1889_interrupt,
IRQF_SHARED, card->driver, chip)) {
IRQF_SHARED, KBUILD_MODNAME, chip)) {
printk(KERN_ERR PFX "cannot obtain IRQ %d\n", pci->irq);
snd_ad1889_free(chip);
return -EBUSY;
Expand Down Expand Up @@ -1055,7 +1055,7 @@ static DEFINE_PCI_DEVICE_TABLE(snd_ad1889_ids) = {
MODULE_DEVICE_TABLE(pci, snd_ad1889_ids);

static struct pci_driver ad1889_pci_driver = {
.name = "AD1889 Audio",
.name = KBUILD_MODNAME,
.id_table = snd_ad1889_ids,
.probe = snd_ad1889_probe,
.remove = __devexit_p(snd_ad1889_remove),
Expand Down
4 changes: 2 additions & 2 deletions sound/pci/ali5451/ali5451.c
Original file line number Diff line number Diff line change
Expand Up @@ -2090,7 +2090,7 @@ static int __devinit snd_ali_resources(struct snd_ali *codec)
codec->port = pci_resource_start(codec->pci, 0);

if (request_irq(codec->pci->irq, snd_ali_card_interrupt,
IRQF_SHARED, "ALI 5451", codec)) {
IRQF_SHARED, KBUILD_MODNAME, codec)) {
snd_printk(KERN_ERR "Unable to request irq.\n");
return -EBUSY;
}
Expand Down Expand Up @@ -2295,7 +2295,7 @@ static void __devexit snd_ali_remove(struct pci_dev *pci)
}

static struct pci_driver driver = {
.name = "ALI 5451",
.name = KBUILD_MODNAME,
.id_table = snd_ali_ids,
.probe = snd_ali_probe,
.remove = __devexit_p(snd_ali_remove),
Expand Down
4 changes: 2 additions & 2 deletions sound/pci/als300.c
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ static int __devinit snd_als300_create(struct snd_card *card,
irq_handler = snd_als300_interrupt;

if (request_irq(pci->irq, irq_handler, IRQF_SHARED,
card->shortname, chip)) {
KBUILD_MODNAME, chip)) {
snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
snd_als300_free(chip);
return -EBUSY;
Expand Down Expand Up @@ -846,7 +846,7 @@ static int __devinit snd_als300_probe(struct pci_dev *pci,
}

static struct pci_driver driver = {
.name = "ALS300",
.name = KBUILD_MODNAME,
.id_table = snd_als300_ids,
.probe = snd_als300_probe,
.remove = __devexit_p(snd_als300_remove),
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/als4000.c
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,7 @@ static int snd_als4000_resume(struct pci_dev *pci)


static struct pci_driver driver = {
.name = "ALS4000",
.name = KBUILD_MODNAME,
.id_table = snd_als4000_ids,
.probe = snd_card_als4000_probe,
.remove = __devexit_p(snd_card_als4000_remove),
Expand Down
Loading

0 comments on commit 7d339ae

Please sign in to comment.