Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7d339ae9 authored by Takashi Iwai's avatar Takashi Iwai
Browse files

Merge branch 'topic/misc' into for-linus

parents 13b137ef 000477a0
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -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;
@@ -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),
@@ -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;
@@ -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),
@@ -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),
+1 −0
Original line number Diff line number Diff line
@@ -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 */
+3 −1
Original line number Diff line number Diff line
@@ -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"
@@ -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 */
@@ -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);
+15 −30
Original line number Diff line number Diff line
@@ -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)
@@ -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;
@@ -150,12 +140,7 @@ 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)
@@ -163,8 +148,8 @@ static void snd_rawmidi_input_trigger(struct snd_rawmidi_substream *substream, i
	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)
@@ -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;
@@ -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;
	}
@@ -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);
	}
+1 −1
Original line number Diff line number Diff line
@@ -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;

Loading