Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 #ifndef __SOUND_HWDEP_H
0003 #define __SOUND_HWDEP_H
0004 
0005 /*
0006  *  Hardware dependent layer 
0007  *  Copyright (c) by Jaroslav Kysela <perex@perex.cz>
0008  */
0009 
0010 #include <sound/asound.h>
0011 #include <linux/poll.h>
0012 
0013 struct snd_hwdep;
0014 
0015 /* hwdep file ops; all ops can be NULL */
0016 struct snd_hwdep_ops {
0017     long long (*llseek)(struct snd_hwdep *hw, struct file *file,
0018                 long long offset, int orig);
0019     long (*read)(struct snd_hwdep *hw, char __user *buf,
0020              long count, loff_t *offset);
0021     long (*write)(struct snd_hwdep *hw, const char __user *buf,
0022               long count, loff_t *offset);
0023     int (*open)(struct snd_hwdep *hw, struct file * file);
0024     int (*release)(struct snd_hwdep *hw, struct file * file);
0025     __poll_t (*poll)(struct snd_hwdep *hw, struct file *file,
0026                  poll_table *wait);
0027     int (*ioctl)(struct snd_hwdep *hw, struct file *file,
0028              unsigned int cmd, unsigned long arg);
0029     int (*ioctl_compat)(struct snd_hwdep *hw, struct file *file,
0030                 unsigned int cmd, unsigned long arg);
0031     int (*mmap)(struct snd_hwdep *hw, struct file *file,
0032             struct vm_area_struct *vma);
0033     int (*dsp_status)(struct snd_hwdep *hw,
0034               struct snd_hwdep_dsp_status *status);
0035     int (*dsp_load)(struct snd_hwdep *hw,
0036             struct snd_hwdep_dsp_image *image);
0037 };
0038 
0039 struct snd_hwdep {
0040     struct snd_card *card;
0041     struct list_head list;
0042     int device;
0043     char id[32];
0044     char name[80];
0045     int iface;
0046 
0047 #ifdef CONFIG_SND_OSSEMUL
0048     int oss_type;
0049     int ossreg;
0050 #endif
0051 
0052     struct snd_hwdep_ops ops;
0053     wait_queue_head_t open_wait;
0054     void *private_data;
0055     void (*private_free) (struct snd_hwdep *hwdep);
0056     struct device dev;
0057 
0058     struct mutex open_mutex;
0059     int used;           /* reference counter */
0060     unsigned int dsp_loaded;    /* bit fields of loaded dsp indices */
0061     unsigned int exclusive:1;   /* exclusive access mode */
0062 };
0063 
0064 extern int snd_hwdep_new(struct snd_card *card, char *id, int device,
0065              struct snd_hwdep **rhwdep);
0066 
0067 #endif /* __SOUND_HWDEP_H */