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

Commit c2f43981 authored by Takashi Iwai's avatar Takashi Iwai
Browse files

Merge branch 'topic/hwdep-cleanup' into for-linus

parents dec14f8c 28b7e343
Loading
Loading
Loading
Loading
+24 −14
Original line number Diff line number Diff line
@@ -27,18 +27,28 @@

struct snd_hwdep;

/* hwdep file ops; all ops can be NULL */
struct snd_hwdep_ops {
	long long (*llseek) (struct snd_hwdep *hw, struct file * file, long long offset, int orig);
	long (*read) (struct snd_hwdep *hw, char __user *buf, long count, loff_t *offset);
	long (*write) (struct snd_hwdep *hw, const char __user *buf, long count, loff_t *offset);
	long long (*llseek)(struct snd_hwdep *hw, struct file *file,
			    long long offset, int orig);
	long (*read)(struct snd_hwdep *hw, char __user *buf,
		     long count, loff_t *offset);
	long (*write)(struct snd_hwdep *hw, const char __user *buf,
		      long count, loff_t *offset);
	int (*open)(struct snd_hwdep *hw, struct file * file);
	int (*release)(struct snd_hwdep *hw, struct file * file);
	unsigned int (*poll) (struct snd_hwdep *hw, struct file * file, poll_table * wait);
	int (*ioctl) (struct snd_hwdep *hw, struct file * file, unsigned int cmd, unsigned long arg);
	int (*ioctl_compat) (struct snd_hwdep *hw, struct file * file, unsigned int cmd, unsigned long arg);
	int (*mmap) (struct snd_hwdep *hw, struct file * file, struct vm_area_struct * vma);
	int (*dsp_status) (struct snd_hwdep *hw, struct snd_hwdep_dsp_status *status);
	int (*dsp_load) (struct snd_hwdep *hw, struct snd_hwdep_dsp_image *image);
	unsigned int (*poll)(struct snd_hwdep *hw, struct file *file,
			     poll_table *wait);
	int (*ioctl)(struct snd_hwdep *hw, struct file *file,
		     unsigned int cmd, unsigned long arg);
	int (*ioctl_compat)(struct snd_hwdep *hw, struct file *file,
			    unsigned int cmd, unsigned long arg);
	int (*mmap)(struct snd_hwdep *hw, struct file *file,
		    struct vm_area_struct *vma);
	int (*dsp_status)(struct snd_hwdep *hw,
			  struct snd_hwdep_dsp_status *status);
	int (*dsp_load)(struct snd_hwdep *hw,
			struct snd_hwdep_dsp_image *image);
};

struct snd_hwdep {
@@ -61,9 +71,9 @@ struct snd_hwdep {
	void (*private_free) (struct snd_hwdep *hwdep);

	struct mutex open_mutex;
	int used;
	unsigned int dsp_loaded;
	unsigned int exclusive: 1;
	int used;			/* reference counter */
	unsigned int dsp_loaded;	/* bit fields of loaded dsp indices */
	unsigned int exclusive:1;	/* exclusive access mode */
};

extern int snd_hwdep_new(struct snd_card *card, char *id, int device,
+5 −4
Original line number Diff line number Diff line
@@ -99,9 +99,6 @@ static int snd_hwdep_open(struct inode *inode, struct file * file)
	if (hw == NULL)
		return -ENODEV;

	if (!hw->ops.open)
		return -ENXIO;

	if (!try_module_get(hw->card->module))
		return -EFAULT;

@@ -113,6 +110,10 @@ static int snd_hwdep_open(struct inode *inode, struct file * file)
			err = -EBUSY;
			break;
		}
		if (!hw->ops.open) {
			err = 0;
			break;
		}
		err = hw->ops.open(hw, file);
		if (err >= 0)
			break;
@@ -151,7 +152,7 @@ static int snd_hwdep_open(struct inode *inode, struct file * file)

static int snd_hwdep_release(struct inode *inode, struct file * file)
{
	int err = -ENXIO;
	int err = 0;
	struct snd_hwdep *hw = file->private_data;
	struct module *mod = hw->card->module;

+0 −12
Original line number Diff line number Diff line
@@ -119,16 +119,6 @@ void snd_vx_free_firmware(struct vx_core *chip)

#else /* old style firmware loading */

static int vx_hwdep_open(struct snd_hwdep *hw, struct file *file)
{
	return 0;
}

static int vx_hwdep_release(struct snd_hwdep *hw, struct file *file)
{
	return 0;
}

static int vx_hwdep_dsp_status(struct snd_hwdep *hw,
			       struct snd_hwdep_dsp_status *info)
{
@@ -243,8 +233,6 @@ int snd_vx_setup_firmware(struct vx_core *chip)

	hw->iface = SNDRV_HWDEP_IFACE_VX;
	hw->private_data = chip;
	hw->ops.open = vx_hwdep_open;
	hw->ops.release = vx_hwdep_release;
	hw->ops.dsp_status = vx_hwdep_dsp_status;
	hw->ops.dsp_load = vx_hwdep_dsp_load;
	hw->exclusive = 1;
+0 −12
Original line number Diff line number Diff line
@@ -581,16 +581,6 @@ MODULE_FIRMWARE("mixart/miXart8AES.xlx");
/* miXart hwdep interface id string */
#define SND_MIXART_HWDEP_ID       "miXart Loader"

static int mixart_hwdep_open(struct snd_hwdep *hw, struct file *file)
{
	return 0;
}

static int mixart_hwdep_release(struct snd_hwdep *hw, struct file *file)
{
	return 0;
}

static int mixart_hwdep_dsp_status(struct snd_hwdep *hw,
				   struct snd_hwdep_dsp_status *info)
{
@@ -643,8 +633,6 @@ int snd_mixart_setup_firmware(struct mixart_mgr *mgr)

	hw->iface = SNDRV_HWDEP_IFACE_MIXART;
	hw->private_data = mgr;
	hw->ops.open = mixart_hwdep_open;
	hw->ops.release = mixart_hwdep_release;
	hw->ops.dsp_status = mixart_hwdep_dsp_status;
	hw->ops.dsp_load = mixart_hwdep_dsp_load;
	hw->exclusive = 1;
+0 −12
Original line number Diff line number Diff line
@@ -471,16 +471,6 @@ static int pcxhr_hwdep_dsp_load(struct snd_hwdep *hw,
	return 0;
}

static int pcxhr_hwdep_open(struct snd_hwdep *hw, struct file *file)
{
	return 0;
}

static int pcxhr_hwdep_release(struct snd_hwdep *hw, struct file *file)
{
	return 0;
}

int pcxhr_setup_firmware(struct pcxhr_mgr *mgr)
{
	int err;
@@ -495,8 +485,6 @@ int pcxhr_setup_firmware(struct pcxhr_mgr *mgr)

	hw->iface = SNDRV_HWDEP_IFACE_PCXHR;
	hw->private_data = mgr;
	hw->ops.open = pcxhr_hwdep_open;
	hw->ops.release = pcxhr_hwdep_release;
	hw->ops.dsp_status = pcxhr_hwdep_dsp_status;
	hw->ops.dsp_load = pcxhr_hwdep_dsp_load;
	hw->exclusive = 1;
Loading