18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */ 28c2ecf20Sopenharmony_ci#ifndef __SOUND_MIXER_OSS_H 38c2ecf20Sopenharmony_ci#define __SOUND_MIXER_OSS_H 48c2ecf20Sopenharmony_ci 58c2ecf20Sopenharmony_ci/* 68c2ecf20Sopenharmony_ci * OSS MIXER API 78c2ecf20Sopenharmony_ci * Copyright (c) by Jaroslav Kysela <perex@perex.cz> 88c2ecf20Sopenharmony_ci */ 98c2ecf20Sopenharmony_ci 108c2ecf20Sopenharmony_ci#if IS_ENABLED(CONFIG_SND_MIXER_OSS) 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ci#define SNDRV_OSS_MAX_MIXERS 32 138c2ecf20Sopenharmony_ci 148c2ecf20Sopenharmony_cistruct snd_mixer_oss_file; 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_cistruct snd_mixer_oss_slot { 178c2ecf20Sopenharmony_ci int number; 188c2ecf20Sopenharmony_ci unsigned int stereo: 1; 198c2ecf20Sopenharmony_ci int (*get_volume)(struct snd_mixer_oss_file *fmixer, 208c2ecf20Sopenharmony_ci struct snd_mixer_oss_slot *chn, 218c2ecf20Sopenharmony_ci int *left, int *right); 228c2ecf20Sopenharmony_ci int (*put_volume)(struct snd_mixer_oss_file *fmixer, 238c2ecf20Sopenharmony_ci struct snd_mixer_oss_slot *chn, 248c2ecf20Sopenharmony_ci int left, int right); 258c2ecf20Sopenharmony_ci int (*get_recsrc)(struct snd_mixer_oss_file *fmixer, 268c2ecf20Sopenharmony_ci struct snd_mixer_oss_slot *chn, 278c2ecf20Sopenharmony_ci int *active); 288c2ecf20Sopenharmony_ci int (*put_recsrc)(struct snd_mixer_oss_file *fmixer, 298c2ecf20Sopenharmony_ci struct snd_mixer_oss_slot *chn, 308c2ecf20Sopenharmony_ci int active); 318c2ecf20Sopenharmony_ci unsigned long private_value; 328c2ecf20Sopenharmony_ci void *private_data; 338c2ecf20Sopenharmony_ci void (*private_free)(struct snd_mixer_oss_slot *slot); 348c2ecf20Sopenharmony_ci int volume[2]; 358c2ecf20Sopenharmony_ci}; 368c2ecf20Sopenharmony_ci 378c2ecf20Sopenharmony_cistruct snd_mixer_oss { 388c2ecf20Sopenharmony_ci struct snd_card *card; 398c2ecf20Sopenharmony_ci char id[16]; 408c2ecf20Sopenharmony_ci char name[32]; 418c2ecf20Sopenharmony_ci struct snd_mixer_oss_slot slots[SNDRV_OSS_MAX_MIXERS]; /* OSS mixer slots */ 428c2ecf20Sopenharmony_ci unsigned int mask_recsrc; /* exclusive recsrc mask */ 438c2ecf20Sopenharmony_ci int (*get_recsrc)(struct snd_mixer_oss_file *fmixer, 448c2ecf20Sopenharmony_ci unsigned int *active_index); 458c2ecf20Sopenharmony_ci int (*put_recsrc)(struct snd_mixer_oss_file *fmixer, 468c2ecf20Sopenharmony_ci unsigned int active_index); 478c2ecf20Sopenharmony_ci void *private_data_recsrc; 488c2ecf20Sopenharmony_ci void (*private_free_recsrc)(struct snd_mixer_oss *mixer); 498c2ecf20Sopenharmony_ci struct mutex reg_mutex; 508c2ecf20Sopenharmony_ci struct snd_info_entry *proc_entry; 518c2ecf20Sopenharmony_ci int oss_dev_alloc; 528c2ecf20Sopenharmony_ci /* --- */ 538c2ecf20Sopenharmony_ci int oss_recsrc; 548c2ecf20Sopenharmony_ci}; 558c2ecf20Sopenharmony_ci 568c2ecf20Sopenharmony_cistruct snd_mixer_oss_file { 578c2ecf20Sopenharmony_ci struct snd_card *card; 588c2ecf20Sopenharmony_ci struct snd_mixer_oss *mixer; 598c2ecf20Sopenharmony_ci}; 608c2ecf20Sopenharmony_ci 618c2ecf20Sopenharmony_ciint snd_mixer_oss_ioctl_card(struct snd_card *card, 628c2ecf20Sopenharmony_ci unsigned int cmd, unsigned long arg); 638c2ecf20Sopenharmony_ci 648c2ecf20Sopenharmony_ci#endif /* CONFIG_SND_MIXER_OSS */ 658c2ecf20Sopenharmony_ci 668c2ecf20Sopenharmony_ci#endif /* __SOUND_MIXER_OSS_H */ 67