Merge tag 'mm-hotfixes-stable-2023-05-03-16-27' of git://git.kernel.org/pub/scm/linux...
[linux-block.git] / include / sound / pcm_oss.h
CommitLineData
1a59d1b8 1/* SPDX-License-Identifier: GPL-2.0-or-later */
1da177e4
LT
2#ifndef __SOUND_PCM_OSS_H
3#define __SOUND_PCM_OSS_H
4
5/*
6 * Digital Audio (PCM) - OSS compatibility abstract layer
c1017a4c 7 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
1da177e4
LT
8 */
9
6ac77bc1 10struct snd_pcm_oss_setup {
1da177e4
LT
11 char *task_name;
12 unsigned int disable:1,
13 direct:1,
14 block:1,
15 nonblock:1,
16 partialfrag:1,
10f69f9e
TI
17 nosilence:1,
18 buggyptr:1;
1da177e4
LT
19 unsigned int periods;
20 unsigned int period_size;
6ac77bc1 21 struct snd_pcm_oss_setup *next;
1da177e4
LT
22};
23
6ac77bc1 24struct snd_pcm_oss_runtime {
1da177e4
LT
25 unsigned params: 1, /* format/parameter change */
26 prepare: 1, /* need to prepare the operation */
27 trigger: 1, /* trigger flag */
28 sync_trigger: 1; /* sync trigger flag */
29 int rate; /* requested rate */
30 int format; /* requested OSS format */
31 unsigned int channels; /* requested channels */
32 unsigned int fragshift;
33 unsigned int maxfrags;
34 unsigned int subdivision; /* requested subdivision */
35 size_t period_bytes; /* requested period size */
36 size_t period_frames; /* period frames for poll */
37 size_t period_ptr; /* actual write pointer to period */
38 unsigned int periods;
39 size_t buffer_bytes; /* requested buffer size */
40 size_t bytes; /* total # bytes processed */
41 size_t mmap_bytes;
42 char *buffer; /* vmallocated period */
43 size_t buffer_used; /* used length from period buffer */
e3a5d59a 44 struct mutex params_lock;
40cab6e8 45 atomic_t rw_ref; /* concurrent read/write accesses */
21a3479a 46#ifdef CONFIG_SND_PCM_OSS_PLUGINS
6ac77bc1
TI
47 struct snd_pcm_plugin *plugin_first;
48 struct snd_pcm_plugin *plugin_last;
21a3479a 49#endif
f240406b 50 unsigned int prev_hw_ptr_period;
6ac77bc1 51};
1da177e4 52
6ac77bc1
TI
53struct snd_pcm_oss_file {
54 struct snd_pcm_substream *streams[2];
55};
1da177e4 56
6ac77bc1 57struct snd_pcm_oss_substream {
1da177e4 58 unsigned oss: 1; /* oss mode */
060d77b9 59 struct snd_pcm_oss_setup setup; /* active setup */
6ac77bc1 60};
1da177e4 61
6ac77bc1
TI
62struct snd_pcm_oss_stream {
63 struct snd_pcm_oss_setup *setup_list; /* setup list */
1a60d4c5 64 struct mutex setup_mutex;
b7d90a35 65#ifdef CONFIG_SND_VERBOSE_PROCFS
6ac77bc1 66 struct snd_info_entry *proc_entry;
b7d90a35 67#endif
6ac77bc1 68};
1da177e4 69
6ac77bc1 70struct snd_pcm_oss {
1da177e4
LT
71 int reg;
72 unsigned int reg_mask;
6ac77bc1 73};
1da177e4
LT
74
75#endif /* __SOUND_PCM_OSS_H */