]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blame - include/sound/hwdep.h
Merge tag 'for-linus-5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw...
[mirror_ubuntu-hirsute-kernel.git] / include / sound / hwdep.h
CommitLineData
1a59d1b8 1/* SPDX-License-Identifier: GPL-2.0-or-later */
1da177e4
LT
2#ifndef __SOUND_HWDEP_H
3#define __SOUND_HWDEP_H
4
5/*
6 * Hardware dependent layer
c1017a4c 7 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
1da177e4
LT
8 */
9
10#include <sound/asound.h>
11#include <linux/poll.h>
12
d9a98de2 13struct snd_hwdep;
1da177e4 14
e0d80648 15/* hwdep file ops; all ops can be NULL */
d9a98de2 16struct snd_hwdep_ops {
e0d80648
TI
17 long long (*llseek)(struct snd_hwdep *hw, struct file *file,
18 long long offset, int orig);
19 long (*read)(struct snd_hwdep *hw, char __user *buf,
20 long count, loff_t *offset);
21 long (*write)(struct snd_hwdep *hw, const char __user *buf,
22 long count, loff_t *offset);
23 int (*open)(struct snd_hwdep *hw, struct file * file);
24 int (*release)(struct snd_hwdep *hw, struct file * file);
a3f8683b 25 __poll_t (*poll)(struct snd_hwdep *hw, struct file *file,
e0d80648
TI
26 poll_table *wait);
27 int (*ioctl)(struct snd_hwdep *hw, struct file *file,
28 unsigned int cmd, unsigned long arg);
29 int (*ioctl_compat)(struct snd_hwdep *hw, struct file *file,
30 unsigned int cmd, unsigned long arg);
31 int (*mmap)(struct snd_hwdep *hw, struct file *file,
32 struct vm_area_struct *vma);
33 int (*dsp_status)(struct snd_hwdep *hw,
34 struct snd_hwdep_dsp_status *status);
35 int (*dsp_load)(struct snd_hwdep *hw,
36 struct snd_hwdep_dsp_image *image);
d9a98de2 37};
1da177e4 38
d9a98de2
TI
39struct snd_hwdep {
40 struct snd_card *card;
f87135f5 41 struct list_head list;
1da177e4
LT
42 int device;
43 char id[32];
44 char name[80];
45 int iface;
46
47#ifdef CONFIG_SND_OSSEMUL
1da177e4
LT
48 int oss_type;
49 int ossreg;
50#endif
51
d9a98de2 52 struct snd_hwdep_ops ops;
1da177e4
LT
53 wait_queue_head_t open_wait;
54 void *private_data;
d9a98de2 55 void (*private_free) (struct snd_hwdep *hwdep);
7b461600 56 struct device dev;
1da177e4 57
1a60d4c5 58 struct mutex open_mutex;
e0d80648
TI
59 int used; /* reference counter */
60 unsigned int dsp_loaded; /* bit fields of loaded dsp indices */
61 unsigned int exclusive:1; /* exclusive access mode */
1da177e4
LT
62};
63
d9a98de2
TI
64extern int snd_hwdep_new(struct snd_card *card, char *id, int device,
65 struct snd_hwdep **rhwdep);
1da177e4
LT
66
67#endif /* __SOUND_HWDEP_H */