Commit b55d2922 authored by Jaroslav Kysela's avatar Jaroslav Kysela

[ALSA] ALSA core: misc cleanups

HWDEP Midlevel,ALSA Core,PCM Midlevel,RawMidi Midlevel
ALSA<-OSS emulation,ALSA sequencer,ALSA<-OSS sequencer
The patch below does the following cleanups under sound/core/ :
- make needlessly global code static
- remove the following stale prototypes from pcm.h
  (the functions are not or no longer present):
  - snd_pcm_capture_ready_jiffies
  - snd_pcm_playback_ready_jiffies
- remove the following unused global functions:
  - oss/pcm_plugin.c: snd_pcm_plug_capture_channels_mask
  - seq/seq_instr.c: snd_seq_cluster_new
  - seq/seq_instr.c: snd_seq_cluster_free
- move global to static inline functions
  - pcm_lib.c: snd_pcm_playback_ready
  - pcm_lib.c: snd_pcm_capture_ready
  - pcm_lib.c: snd_pcm_playback_empty
  - pcm_lib.c: snd_pcm_capture_empty
  - pcm_lib.c: snd_pcm_playback_data
- remove the following unused EXPORT_SYMBOL's:
  - snd_create_proc_entry
  - snd_interval_ratden
  - snd_midi_channel_init
  - snd_midi_channel_init_set
  - snd_pcm_playback_empty
  - snd_pcm_capture_empty
  - snd_pcm_playback_data
  - snd_pcm_capture_poll
  - snd_pcm_playback_ready
  - snd_pcm_capture_ready
  - snd_pcm_format_size
  - snd_pcm_open
  - snd_pcm_playback_poll
  - snd_pcm_playback_ready
  - snd_pcm_release
  - snd_pcm_subformat_name
  - snd_remove_proc_entry
Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 12cc11e9
...@@ -131,11 +131,6 @@ int snd_info_card_free(snd_card_t * card); ...@@ -131,11 +131,6 @@ int snd_info_card_free(snd_card_t * card);
int snd_info_register(snd_info_entry_t * entry); int snd_info_register(snd_info_entry_t * entry);
int snd_info_unregister(snd_info_entry_t * entry); int snd_info_unregister(snd_info_entry_t * entry);
struct proc_dir_entry *snd_create_proc_entry(const char *name, mode_t mode,
struct proc_dir_entry *parent);
void snd_remove_proc_entry(struct proc_dir_entry *parent,
struct proc_dir_entry *de);
/* for card drivers */ /* for card drivers */
int snd_card_proc_new(snd_card_t *card, const char *name, snd_info_entry_t **entryp); int snd_card_proc_new(snd_card_t *card, const char *name, snd_info_entry_t **entryp);
...@@ -171,10 +166,6 @@ static inline int snd_info_card_free(snd_card_t * card) { return 0; } ...@@ -171,10 +166,6 @@ static inline int snd_info_card_free(snd_card_t * card) { return 0; }
static inline int snd_info_register(snd_info_entry_t * entry) { return 0; } static inline int snd_info_register(snd_info_entry_t * entry) { return 0; }
static inline int snd_info_unregister(snd_info_entry_t * entry) { return 0; } static inline int snd_info_unregister(snd_info_entry_t * entry) { return 0; }
static inline struct proc_dir_entry *snd_create_proc_entry(const char *name, mode_t mode, struct proc_dir_entry *parent) { return NULL; }
static inline void snd_remove_proc_entry(struct proc_dir_entry *parent,
struct proc_dir_entry *de) { ; }
#define snd_card_proc_new(card,name,entryp) 0 /* always success */ #define snd_card_proc_new(card,name,entryp) 0 /* always success */
#define snd_info_set_text_ops(entry,private_data,read_size,read) /*NOP*/ #define snd_info_set_text_ops(entry,private_data,read_size,read) /*NOP*/
......
...@@ -497,10 +497,6 @@ int snd_pcm_suspend_all(snd_pcm_t *pcm); ...@@ -497,10 +497,6 @@ int snd_pcm_suspend_all(snd_pcm_t *pcm);
int snd_pcm_kernel_playback_ioctl(snd_pcm_substream_t *substream, unsigned int cmd, void *arg); int snd_pcm_kernel_playback_ioctl(snd_pcm_substream_t *substream, unsigned int cmd, void *arg);
int snd_pcm_kernel_capture_ioctl(snd_pcm_substream_t *substream, unsigned int cmd, void *arg); int snd_pcm_kernel_capture_ioctl(snd_pcm_substream_t *substream, unsigned int cmd, void *arg);
int snd_pcm_kernel_ioctl(snd_pcm_substream_t *substream, unsigned int cmd, void *arg); int snd_pcm_kernel_ioctl(snd_pcm_substream_t *substream, unsigned int cmd, void *arg);
int snd_pcm_open(struct inode *inode, struct file *file);
int snd_pcm_release(struct inode *inode, struct file *file);
unsigned int snd_pcm_playback_poll(struct file *file, poll_table * wait);
unsigned int snd_pcm_capture_poll(struct file *file, poll_table * wait);
int snd_pcm_open_substream(snd_pcm_t *pcm, int stream, snd_pcm_substream_t **rsubstream); int snd_pcm_open_substream(snd_pcm_t *pcm, int stream, snd_pcm_substream_t **rsubstream);
void snd_pcm_release_substream(snd_pcm_substream_t *substream); void snd_pcm_release_substream(snd_pcm_substream_t *substream);
void snd_pcm_vma_notify_data(void *client, void *data); void snd_pcm_vma_notify_data(void *client, void *data);
...@@ -709,6 +705,80 @@ static inline snd_pcm_sframes_t snd_pcm_capture_hw_avail(snd_pcm_runtime_t *runt ...@@ -709,6 +705,80 @@ static inline snd_pcm_sframes_t snd_pcm_capture_hw_avail(snd_pcm_runtime_t *runt
return runtime->buffer_size - snd_pcm_capture_avail(runtime); return runtime->buffer_size - snd_pcm_capture_avail(runtime);
} }
/**
* snd_pcm_playback_ready - check whether the playback buffer is available
* @substream: the pcm substream instance
*
* Checks whether enough free space is available on the playback buffer.
*
* Returns non-zero if available, or zero if not.
*/
static inline int snd_pcm_playback_ready(snd_pcm_substream_t *substream)
{
snd_pcm_runtime_t *runtime = substream->runtime;
return snd_pcm_playback_avail(runtime) >= runtime->control->avail_min;
}
/**
* snd_pcm_capture_ready - check whether the capture buffer is available
* @substream: the pcm substream instance
*
* Checks whether enough capture data is available on the capture buffer.
*
* Returns non-zero if available, or zero if not.
*/
static inline int snd_pcm_capture_ready(snd_pcm_substream_t *substream)
{
snd_pcm_runtime_t *runtime = substream->runtime;
return snd_pcm_capture_avail(runtime) >= runtime->control->avail_min;
}
/**
* snd_pcm_playback_data - check whether any data exists on the playback buffer
* @substream: the pcm substream instance
*
* Checks whether any data exists on the playback buffer. If stop_threshold
* is bigger or equal to boundary, then this function returns always non-zero.
*
* Returns non-zero if exists, or zero if not.
*/
static inline int snd_pcm_playback_data(snd_pcm_substream_t *substream)
{
snd_pcm_runtime_t *runtime = substream->runtime;
if (runtime->stop_threshold >= runtime->boundary)
return 1;
return snd_pcm_playback_avail(runtime) < runtime->buffer_size;
}
/**
* snd_pcm_playback_empty - check whether the playback buffer is empty
* @substream: the pcm substream instance
*
* Checks whether the playback buffer is empty.
*
* Returns non-zero if empty, or zero if not.
*/
static inline int snd_pcm_playback_empty(snd_pcm_substream_t *substream)
{
snd_pcm_runtime_t *runtime = substream->runtime;
return snd_pcm_playback_avail(runtime) >= runtime->buffer_size;
}
/**
* snd_pcm_capture_empty - check whether the capture buffer is empty
* @substream: the pcm substream instance
*
* Checks whether the capture buffer is empty.
*
* Returns non-zero if empty, or zero if not.
*/
static inline int snd_pcm_capture_empty(snd_pcm_substream_t *substream)
{
snd_pcm_runtime_t *runtime = substream->runtime;
return snd_pcm_capture_avail(runtime) == 0;
}
static inline void snd_pcm_trigger_done(snd_pcm_substream_t *substream, static inline void snd_pcm_trigger_done(snd_pcm_substream_t *substream,
snd_pcm_substream_t *master) snd_pcm_substream_t *master)
{ {
...@@ -772,13 +842,9 @@ void snd_interval_muldivk(const snd_interval_t *a, const snd_interval_t *b, ...@@ -772,13 +842,9 @@ void snd_interval_muldivk(const snd_interval_t *a, const snd_interval_t *b,
void snd_interval_mulkdiv(const snd_interval_t *a, unsigned int k, void snd_interval_mulkdiv(const snd_interval_t *a, unsigned int k,
const snd_interval_t *b, snd_interval_t *c); const snd_interval_t *b, snd_interval_t *c);
int snd_interval_list(snd_interval_t *i, unsigned int count, unsigned int *list, unsigned int mask); int snd_interval_list(snd_interval_t *i, unsigned int count, unsigned int *list, unsigned int mask);
int snd_interval_step(snd_interval_t *i, unsigned int min, unsigned int step);
int snd_interval_ratnum(snd_interval_t *i, int snd_interval_ratnum(snd_interval_t *i,
unsigned int rats_count, ratnum_t *rats, unsigned int rats_count, ratnum_t *rats,
unsigned int *nump, unsigned int *denp); unsigned int *nump, unsigned int *denp);
int snd_interval_ratden(snd_interval_t *i,
unsigned int rats_count, ratden_t *rats,
unsigned int *nump, unsigned int *denp);
void _snd_pcm_hw_params_any(snd_pcm_hw_params_t *params); void _snd_pcm_hw_params_any(snd_pcm_hw_params_t *params);
void _snd_pcm_hw_param_setempty(snd_pcm_hw_params_t *params, snd_pcm_hw_param_t var); void _snd_pcm_hw_param_setempty(snd_pcm_hw_params_t *params, snd_pcm_hw_param_t var);
...@@ -861,9 +927,7 @@ int snd_pcm_format_physical_width(snd_pcm_format_t format); /* in bits */ ...@@ -861,9 +927,7 @@ int snd_pcm_format_physical_width(snd_pcm_format_t format); /* in bits */
const unsigned char *snd_pcm_format_silence_64(snd_pcm_format_t format); const unsigned char *snd_pcm_format_silence_64(snd_pcm_format_t format);
int snd_pcm_format_set_silence(snd_pcm_format_t format, void *buf, unsigned int frames); int snd_pcm_format_set_silence(snd_pcm_format_t format, void *buf, unsigned int frames);
snd_pcm_format_t snd_pcm_build_linear_format(int width, int unsignd, int big_endian); snd_pcm_format_t snd_pcm_build_linear_format(int width, int unsignd, int big_endian);
ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples);
const char *snd_pcm_format_name(snd_pcm_format_t format); const char *snd_pcm_format_name(snd_pcm_format_t format);
const char *snd_pcm_subformat_name(snd_pcm_subformat_t subformat);
void snd_pcm_set_ops(snd_pcm_t * pcm, int direction, snd_pcm_ops_t *ops); void snd_pcm_set_ops(snd_pcm_t * pcm, int direction, snd_pcm_ops_t *ops);
void snd_pcm_set_sync(snd_pcm_substream_t * substream); void snd_pcm_set_sync(snd_pcm_substream_t * substream);
...@@ -876,13 +940,6 @@ int snd_pcm_capture_xrun_check(snd_pcm_substream_t *substream); ...@@ -876,13 +940,6 @@ int snd_pcm_capture_xrun_check(snd_pcm_substream_t *substream);
int snd_pcm_playback_xrun_asap(snd_pcm_substream_t *substream); int snd_pcm_playback_xrun_asap(snd_pcm_substream_t *substream);
int snd_pcm_capture_xrun_asap(snd_pcm_substream_t *substream); int snd_pcm_capture_xrun_asap(snd_pcm_substream_t *substream);
void snd_pcm_playback_silence(snd_pcm_substream_t *substream, snd_pcm_uframes_t new_hw_ptr); void snd_pcm_playback_silence(snd_pcm_substream_t *substream, snd_pcm_uframes_t new_hw_ptr);
int snd_pcm_playback_ready(snd_pcm_substream_t *substream);
int snd_pcm_capture_ready(snd_pcm_substream_t *substream);
long snd_pcm_playback_ready_jiffies(snd_pcm_substream_t *substream);
long snd_pcm_capture_ready_jiffies(snd_pcm_substream_t *substream);
int snd_pcm_playback_data(snd_pcm_substream_t *substream);
int snd_pcm_playback_empty(snd_pcm_substream_t *substream);
int snd_pcm_capture_empty(snd_pcm_substream_t *substream);
void snd_pcm_tick_prepare(snd_pcm_substream_t *substream); void snd_pcm_tick_prepare(snd_pcm_substream_t *substream);
void snd_pcm_tick_set(snd_pcm_substream_t *substream, unsigned long ticks); void snd_pcm_tick_set(snd_pcm_substream_t *substream, unsigned long ticks);
void snd_pcm_tick_elapsed(snd_pcm_substream_t *substream); void snd_pcm_tick_elapsed(snd_pcm_substream_t *substream);
......
...@@ -152,13 +152,6 @@ int snd_rawmidi_new(snd_card_t * card, char *id, int device, ...@@ -152,13 +152,6 @@ int snd_rawmidi_new(snd_card_t * card, char *id, int device,
snd_rawmidi_t ** rmidi); snd_rawmidi_t ** rmidi);
void snd_rawmidi_set_ops(snd_rawmidi_t * rmidi, int stream, snd_rawmidi_ops_t * ops); void snd_rawmidi_set_ops(snd_rawmidi_t * rmidi, int stream, snd_rawmidi_ops_t * ops);
/* control functions */
int snd_rawmidi_control_ioctl(snd_card_t * card,
snd_ctl_file_t * control,
unsigned int cmd,
unsigned long arg);
/* callbacks */ /* callbacks */
void snd_rawmidi_receive_reset(snd_rawmidi_substream_t * substream); void snd_rawmidi_receive_reset(snd_rawmidi_substream_t * substream);
......
...@@ -189,8 +189,6 @@ enum { ...@@ -189,8 +189,6 @@ enum {
void snd_midi_process_event(snd_midi_op_t *ops, snd_seq_event_t *ev, void snd_midi_process_event(snd_midi_op_t *ops, snd_seq_event_t *ev,
snd_midi_channel_set_t *chanset); snd_midi_channel_set_t *chanset);
void snd_midi_channel_set_clear(snd_midi_channel_set_t *chset); void snd_midi_channel_set_clear(snd_midi_channel_set_t *chset);
void snd_midi_channel_init(snd_midi_channel_t *p, int n);
snd_midi_channel_t *snd_midi_channel_init_set(int n);
snd_midi_channel_set_t *snd_midi_channel_alloc_set(int n); snd_midi_channel_set_t *snd_midi_channel_alloc_set(int n);
void snd_midi_channel_free_set(snd_midi_channel_set_t *chset); void snd_midi_channel_free_set(snd_midi_channel_set_t *chset);
......
...@@ -35,7 +35,7 @@ MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>"); ...@@ -35,7 +35,7 @@ MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
MODULE_DESCRIPTION("Hardware dependent layer"); MODULE_DESCRIPTION("Hardware dependent layer");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
snd_hwdep_t *snd_hwdep_devices[SNDRV_CARDS * SNDRV_MINOR_HWDEPS]; static snd_hwdep_t *snd_hwdep_devices[SNDRV_CARDS * SNDRV_MINOR_HWDEPS];
static DECLARE_MUTEX(register_mutex); static DECLARE_MUTEX(register_mutex);
......
...@@ -125,8 +125,8 @@ static inline void snd_info_entry_prepare(struct proc_dir_entry *de) ...@@ -125,8 +125,8 @@ static inline void snd_info_entry_prepare(struct proc_dir_entry *de)
de->owner = THIS_MODULE; de->owner = THIS_MODULE;
} }
void snd_remove_proc_entry(struct proc_dir_entry *parent, static void snd_remove_proc_entry(struct proc_dir_entry *parent,
struct proc_dir_entry *de) struct proc_dir_entry *de)
{ {
if (de) if (de)
remove_proc_entry(de->name, parent); remove_proc_entry(de->name, parent);
...@@ -521,8 +521,8 @@ static struct file_operations snd_info_entry_operations = ...@@ -521,8 +521,8 @@ static struct file_operations snd_info_entry_operations =
* *
* Returns the pointer of new instance or NULL on failure. * Returns the pointer of new instance or NULL on failure.
*/ */
struct proc_dir_entry *snd_create_proc_entry(const char *name, mode_t mode, static struct proc_dir_entry *snd_create_proc_entry(const char *name, mode_t mode,
struct proc_dir_entry *parent) struct proc_dir_entry *parent)
{ {
struct proc_dir_entry *p; struct proc_dir_entry *p;
p = create_proc_entry(name, mode, parent); p = create_proc_entry(name, mode, parent);
......
...@@ -89,7 +89,7 @@ void snd_memory_done(void) ...@@ -89,7 +89,7 @@ void snd_memory_done(void)
} }
} }
void *__snd_kmalloc(size_t size, int flags, void *caller) static void *__snd_kmalloc(size_t size, int flags, void *caller)
{ {
unsigned long cpu_flags; unsigned long cpu_flags;
struct snd_alloc_track *t; struct snd_alloc_track *t;
......
...@@ -360,8 +360,8 @@ static int snd_mixer_oss_ioctl1(snd_mixer_oss_file_t *fmixer, unsigned int cmd, ...@@ -360,8 +360,8 @@ static int snd_mixer_oss_ioctl1(snd_mixer_oss_file_t *fmixer, unsigned int cmd,
} }
/* FIXME: need to unlock BKL to allow preemption */ /* FIXME: need to unlock BKL to allow preemption */
int snd_mixer_oss_ioctl(struct inode *inode, struct file *file, static int snd_mixer_oss_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg) unsigned int cmd, unsigned long arg)
{ {
int err; int err;
/* FIXME: need to unlock BKL to allow preemption */ /* FIXME: need to unlock BKL to allow preemption */
......
...@@ -77,7 +77,7 @@ static inline void snd_leave_user(mm_segment_t fs) ...@@ -77,7 +77,7 @@ static inline void snd_leave_user(mm_segment_t fs)
set_fs(fs); set_fs(fs);
} }
int snd_pcm_oss_plugin_clear(snd_pcm_substream_t *substream) static int snd_pcm_oss_plugin_clear(snd_pcm_substream_t *substream)
{ {
snd_pcm_runtime_t *runtime = substream->runtime; snd_pcm_runtime_t *runtime = substream->runtime;
snd_pcm_plugin_t *plugin, *next; snd_pcm_plugin_t *plugin, *next;
...@@ -92,7 +92,7 @@ int snd_pcm_oss_plugin_clear(snd_pcm_substream_t *substream) ...@@ -92,7 +92,7 @@ int snd_pcm_oss_plugin_clear(snd_pcm_substream_t *substream)
return 0; return 0;
} }
int snd_pcm_plugin_insert(snd_pcm_plugin_t *plugin) static int snd_pcm_plugin_insert(snd_pcm_plugin_t *plugin)
{ {
snd_pcm_runtime_t *runtime = plugin->plug->runtime; snd_pcm_runtime_t *runtime = plugin->plug->runtime;
plugin->next = runtime->oss.plugin_first; plugin->next = runtime->oss.plugin_first;
......
...@@ -651,8 +651,8 @@ snd_pcm_sframes_t snd_pcm_plug_client_channels_buf(snd_pcm_plug_t *plug, ...@@ -651,8 +651,8 @@ snd_pcm_sframes_t snd_pcm_plug_client_channels_buf(snd_pcm_plug_t *plug,
return count; return count;
} }
int snd_pcm_plug_playback_channels_mask(snd_pcm_plug_t *plug, static int snd_pcm_plug_playback_channels_mask(snd_pcm_plug_t *plug,
bitset_t *client_vmask) bitset_t *client_vmask)
{ {
snd_pcm_plugin_t *plugin = snd_pcm_plug_last(plug); snd_pcm_plugin_t *plugin = snd_pcm_plug_last(plug);
if (plugin == NULL) { if (plugin == NULL) {
...@@ -682,33 +682,6 @@ int snd_pcm_plug_playback_channels_mask(snd_pcm_plug_t *plug, ...@@ -682,33 +682,6 @@ int snd_pcm_plug_playback_channels_mask(snd_pcm_plug_t *plug,
} }
} }
int snd_pcm_plug_capture_channels_mask(snd_pcm_plug_t *plug,
bitset_t *client_vmask)
{
snd_pcm_plugin_t *plugin = snd_pcm_plug_first(plug);
if (plugin == NULL) {
return 0;
} else {
int schannels = plugin->src_format.channels;
bitset_t bs[bitset_size(schannels)];
bitset_t *srcmask = bs;
bitset_t *dstmask;
int err;
bitset_one(srcmask, schannels);
while (1) {
err = plugin->dst_channels_mask(plugin, srcmask, &dstmask);
if (err < 0)
return err;
srcmask = dstmask;
if (plugin->next == NULL)
break;
plugin = plugin->next;
}
bitset_and(client_vmask, srcmask, plugin->dst_format.channels);
return 0;
}
}
static int snd_pcm_plug_playback_disable_useless_channels(snd_pcm_plug_t *plug, static int snd_pcm_plug_playback_disable_useless_channels(snd_pcm_plug_t *plug,
snd_pcm_plugin_channel_t *src_channels) snd_pcm_plugin_channel_t *src_channels)
{ {
......
...@@ -353,9 +353,9 @@ static void route_to_channel(snd_pcm_plugin_t *plugin, ...@@ -353,9 +353,9 @@ static void route_to_channel(snd_pcm_plugin_t *plugin,
} }
} }
int route_src_channels_mask(snd_pcm_plugin_t *plugin, static int route_src_channels_mask(snd_pcm_plugin_t *plugin,
bitset_t *dst_vmask, bitset_t *dst_vmask,
bitset_t **src_vmask) bitset_t **src_vmask)
{ {
route_t *data = (route_t *)plugin->extra_data; route_t *data = (route_t *)plugin->extra_data;
int schannels = plugin->src_format.channels; int schannels = plugin->src_format.channels;
...@@ -377,9 +377,9 @@ int route_src_channels_mask(snd_pcm_plugin_t *plugin, ...@@ -377,9 +377,9 @@ int route_src_channels_mask(snd_pcm_plugin_t *plugin,
return 0; return 0;
} }
int route_dst_channels_mask(snd_pcm_plugin_t *plugin, static int route_dst_channels_mask(snd_pcm_plugin_t *plugin,
bitset_t *src_vmask, bitset_t *src_vmask,
bitset_t **dst_vmask) bitset_t **dst_vmask)
{ {
route_t *data = (route_t *)plugin->extra_data; route_t *data = (route_t *)plugin->extra_data;
int dchannels = plugin->dst_format.channels; int dchannels = plugin->dst_format.channels;
......
...@@ -126,12 +126,12 @@ static int snd_pcm_control_ioctl(snd_card_t * card, ...@@ -126,12 +126,12 @@ static int snd_pcm_control_ioctl(snd_card_t * card,
#define FORMAT(v) [SNDRV_PCM_FORMAT_##v] = #v #define FORMAT(v) [SNDRV_PCM_FORMAT_##v] = #v
#define SUBFORMAT(v) [SNDRV_PCM_SUBFORMAT_##v] = #v #define SUBFORMAT(v) [SNDRV_PCM_SUBFORMAT_##v] = #v
char *snd_pcm_stream_names[] = { static char *snd_pcm_stream_names[] = {
STREAM(PLAYBACK), STREAM(PLAYBACK),
STREAM(CAPTURE), STREAM(CAPTURE),
}; };
char *snd_pcm_state_names[] = { static char *snd_pcm_state_names[] = {
STATE(OPEN), STATE(OPEN),
STATE(SETUP), STATE(SETUP),
STATE(PREPARED), STATE(PREPARED),
...@@ -142,7 +142,7 @@ char *snd_pcm_state_names[] = { ...@@ -142,7 +142,7 @@ char *snd_pcm_state_names[] = {
STATE(SUSPENDED), STATE(SUSPENDED),
}; };
char *snd_pcm_access_names[] = { static char *snd_pcm_access_names[] = {
ACCESS(MMAP_INTERLEAVED), ACCESS(MMAP_INTERLEAVED),
ACCESS(MMAP_NONINTERLEAVED), ACCESS(MMAP_NONINTERLEAVED),
ACCESS(MMAP_COMPLEX), ACCESS(MMAP_COMPLEX),
...@@ -150,7 +150,7 @@ char *snd_pcm_access_names[] = { ...@@ -150,7 +150,7 @@ char *snd_pcm_access_names[] = {
ACCESS(RW_NONINTERLEAVED), ACCESS(RW_NONINTERLEAVED),
}; };
char *snd_pcm_format_names[] = { static char *snd_pcm_format_names[] = {
FORMAT(S8), FORMAT(S8),
FORMAT(U8), FORMAT(U8),
FORMAT(S16_LE), FORMAT(S16_LE),
...@@ -191,22 +191,22 @@ char *snd_pcm_format_names[] = { ...@@ -191,22 +191,22 @@ char *snd_pcm_format_names[] = {
FORMAT(U18_3BE), FORMAT(U18_3BE),
}; };
char *snd_pcm_subformat_names[] = { static char *snd_pcm_subformat_names[] = {
SUBFORMAT(STD), SUBFORMAT(STD),
}; };
char *snd_pcm_tstamp_mode_names[] = { static char *snd_pcm_tstamp_mode_names[] = {
TSTAMP(NONE), TSTAMP(NONE),
TSTAMP(MMAP), TSTAMP(MMAP),
}; };
const char *snd_pcm_stream_name(snd_pcm_stream_t stream) static const char *snd_pcm_stream_name(snd_pcm_stream_t stream)
{ {
snd_assert(stream <= SNDRV_PCM_STREAM_LAST, return NULL); snd_assert(stream <= SNDRV_PCM_STREAM_LAST, return NULL);
return snd_pcm_stream_names[stream]; return snd_pcm_stream_names[stream];
} }
const char *snd_pcm_access_name(snd_pcm_access_t access) static const char *snd_pcm_access_name(snd_pcm_access_t access)
{ {
snd_assert(access <= SNDRV_PCM_ACCESS_LAST, return NULL); snd_assert(access <= SNDRV_PCM_ACCESS_LAST, return NULL);
return snd_pcm_access_names[access]; return snd_pcm_access_names[access];
...@@ -218,19 +218,19 @@ const char *snd_pcm_format_name(snd_pcm_format_t format) ...@@ -218,19 +218,19 @@ const char *snd_pcm_format_name(snd_pcm_format_t format)
return snd_pcm_format_names[format]; return snd_pcm_format_names[format];
} }
const char *snd_pcm_subformat_name(snd_pcm_subformat_t subformat) static const char *snd_pcm_subformat_name(snd_pcm_subformat_t subformat)
{ {
snd_assert(subformat <= SNDRV_PCM_SUBFORMAT_LAST, return NULL); snd_assert(subformat <= SNDRV_PCM_SUBFORMAT_LAST, return NULL);
return snd_pcm_subformat_names[subformat]; return snd_pcm_subformat_names[subformat];
} }
const char *snd_pcm_tstamp_mode_name(snd_pcm_tstamp_t mode) static const char *snd_pcm_tstamp_mode_name(snd_pcm_tstamp_t mode)
{ {
snd_assert(mode <= SNDRV_PCM_TSTAMP_LAST, return NULL); snd_assert(mode <= SNDRV_PCM_TSTAMP_LAST, return NULL);
return snd_pcm_tstamp_mode_names[mode]; return snd_pcm_tstamp_mode_names[mode];
} }
const char *snd_pcm_state_name(snd_pcm_state_t state) static const char *snd_pcm_state_name(snd_pcm_state_t state)
{ {
snd_assert(state <= SNDRV_PCM_STATE_LAST, return NULL); snd_assert(state <= SNDRV_PCM_STATE_LAST, return NULL);
return snd_pcm_state_names[state]; return snd_pcm_state_names[state];
...@@ -238,7 +238,7 @@ const char *snd_pcm_state_name(snd_pcm_state_t state) ...@@ -238,7 +238,7 @@ const char *snd_pcm_state_name(snd_pcm_state_t state)
#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE)
#include <linux/soundcard.h> #include <linux/soundcard.h>
const char *snd_pcm_oss_format_name(int format) static const char *snd_pcm_oss_format_name(int format)
{ {
switch (format) { switch (format) {
case AFMT_MU_LAW: case AFMT_MU_LAW:
...@@ -1034,7 +1034,6 @@ EXPORT_SYMBOL(snd_pcm_notify); ...@@ -1034,7 +1034,6 @@ EXPORT_SYMBOL(snd_pcm_notify);
EXPORT_SYMBOL(snd_pcm_open_substream); EXPORT_SYMBOL(snd_pcm_open_substream);
EXPORT_SYMBOL(snd_pcm_release_substream); EXPORT_SYMBOL(snd_pcm_release_substream);
EXPORT_SYMBOL(snd_pcm_format_name); EXPORT_SYMBOL(snd_pcm_format_name);
EXPORT_SYMBOL(snd_pcm_subformat_name);
/* pcm_native.c */ /* pcm_native.c */
EXPORT_SYMBOL(snd_pcm_link_rwlock); EXPORT_SYMBOL(snd_pcm_link_rwlock);
EXPORT_SYMBOL(snd_pcm_start); EXPORT_SYMBOL(snd_pcm_start);
...@@ -1045,10 +1044,6 @@ EXPORT_SYMBOL(snd_pcm_suspend_all); ...@@ -1045,10 +1044,6 @@ EXPORT_SYMBOL(snd_pcm_suspend_all);
EXPORT_SYMBOL(snd_pcm_kernel_playback_ioctl); EXPORT_SYMBOL(snd_pcm_kernel_playback_ioctl);
EXPORT_SYMBOL(snd_pcm_kernel_capture_ioctl); EXPORT_SYMBOL(snd_pcm_kernel_capture_ioctl);
EXPORT_SYMBOL(snd_pcm_kernel_ioctl); EXPORT_SYMBOL(snd_pcm_kernel_ioctl);
EXPORT_SYMBOL(snd_pcm_open);
EXPORT_SYMBOL(snd_pcm_release);
EXPORT_SYMBOL(snd_pcm_playback_poll);
EXPORT_SYMBOL(snd_pcm_capture_poll);
EXPORT_SYMBOL(snd_pcm_mmap_data); EXPORT_SYMBOL(snd_pcm_mmap_data);
#if SNDRV_PCM_INFO_MMAP_IOMEM #if SNDRV_PCM_INFO_MMAP_IOMEM
EXPORT_SYMBOL(snd_pcm_lib_mmap_iomem); EXPORT_SYMBOL(snd_pcm_lib_mmap_iomem);
...@@ -1061,7 +1056,6 @@ EXPORT_SYMBOL(snd_pcm_format_little_endian); ...@@ -1061,7 +1056,6 @@ EXPORT_SYMBOL(snd_pcm_format_little_endian);
EXPORT_SYMBOL(snd_pcm_format_big_endian); EXPORT_SYMBOL(snd_pcm_format_big_endian);
EXPORT_SYMBOL(snd_pcm_format_width); EXPORT_SYMBOL(snd_pcm_format_width);
EXPORT_SYMBOL(snd_pcm_format_physical_width); EXPORT_SYMBOL(snd_pcm_format_physical_width);
EXPORT_SYMBOL(snd_pcm_format_size);
EXPORT_SYMBOL(snd_pcm_format_silence_64); EXPORT_SYMBOL(snd_pcm_format_silence_64);
EXPORT_SYMBOL(snd_pcm_format_set_silence); EXPORT_SYMBOL(snd_pcm_format_set_silence);
EXPORT_SYMBOL(snd_pcm_build_linear_format); EXPORT_SYMBOL(snd_pcm_build_linear_format);
......
...@@ -371,7 +371,7 @@ static inline unsigned int muldiv32(unsigned int a, unsigned int b, ...@@ -371,7 +371,7 @@ static inline unsigned int muldiv32(unsigned int a, unsigned int b,
return n; return n;
} }
int snd_interval_refine_min(snd_interval_t *i, unsigned int min, int openmin) static int snd_interval_refine_min(snd_interval_t *i, unsigned int min, int openmin)
{ {
int changed = 0; int changed = 0;
assert(!snd_interval_empty(i)); assert(!snd_interval_empty(i));
...@@ -396,7 +396,7 @@ int snd_interval_refine_min(snd_interval_t *i, unsigned int min, int openmin) ...@@ -396,7 +396,7 @@ int snd_interval_refine_min(snd_interval_t *i, unsigned int min, int openmin)
return changed; return changed;
} }
int snd_interval_refine_max(snd_interval_t *i, unsigned int max, int openmax) static int snd_interval_refine_max(snd_interval_t *i, unsigned int max, int openmax)
{ {
int changed = 0; int changed = 0;
assert(!snd_interval_empty(i)); assert(!snd_interval_empty(i));
...@@ -474,7 +474,7 @@ int snd_interval_refine(snd_interval_t *i, const snd_interval_t *v) ...@@ -474,7 +474,7 @@ int snd_interval_refine(snd_interval_t *i, const snd_interval_t *v)
return changed; return changed;
} }
int snd_interval_refine_first(snd_interval_t *i) static int snd_interval_refine_first(snd_interval_t *i)
{ {
assert(!snd_interval_empty(i)); assert(!snd_interval_empty(i));
if (snd_interval_single(i)) if (snd_interval_single(i))
...@@ -486,7 +486,7 @@ int snd_interval_refine_first(snd_interval_t *i) ...@@ -486,7 +486,7 @@ int snd_interval_refine_first(snd_interval_t *i)
return 1; return 1;
} }
int snd_interval_refine_last(snd_interval_t *i) static int snd_interval_refine_last(snd_interval_t *i)
{ {
assert(!snd_interval_empty(i)); assert(!snd_interval_empty(i));
if (snd_interval_single(i)) if (snd_interval_single(i))
...@@ -498,7 +498,7 @@ int snd_interval_refine_last(snd_interval_t *i) ...@@ -498,7 +498,7 @@ int snd_interval_refine_last(snd_interval_t *i)
return 1; return 1;
} }
int snd_interval_refine_set(snd_interval_t *i, unsigned int val) static int snd_interval_refine_set(snd_interval_t *i, unsigned int val)
{ {
snd_interval_t t; snd_interval_t t;
t.empty = 0; t.empty = 0;
...@@ -718,9 +718,9 @@ int snd_interval_ratnum(snd_interval_t *i, ...@@ -718,9 +718,9 @@ int snd_interval_ratnum(snd_interval_t *i,
* *
* Returns non-zero if the value is changed, zero if not changed. * Returns non-zero if the value is changed, zero if not changed.
*/ */
int snd_interval_ratden(snd_interval_t *i, static int snd_interval_ratden(snd_interval_t *i,
unsigned int rats_count, ratden_t *rats, unsigned int rats_count, ratden_t *rats,
unsigned int *nump, unsigned int *denp) unsigned int *nump, unsigned int *denp)
{ {
unsigned int best_num, best_diff, best_den; unsigned int best_num, best_diff, best_den;
unsigned int k; unsigned int k;
...@@ -858,7 +858,7 @@ int snd_interval_list(snd_interval_t *i, unsigned int count, unsigned int *list, ...@@ -858,7 +858,7 @@ int snd_interval_list(snd_interval_t *i, unsigned int count, unsigned int *list,
return changed; return changed;
} }
int snd_interval_step(snd_interval_t *i, unsigned int min, unsigned int step) static int snd_interval_step(snd_interval_t *i, unsigned int min, unsigned int step)
{ {
unsigned int n; unsigned int n;
int changed = 0; int changed = 0;
...@@ -1856,80 +1856,6 @@ int snd_pcm_lib_ioctl(snd_pcm_substream_t *substream, ...@@ -1856,80 +1856,6 @@ int snd_pcm_lib_ioctl(snd_pcm_substream_t *substream,
* Conditions * Conditions
*/ */
/**
* snd_pcm_playback_ready - check whether the playback buffer is available
* @substream: the pcm substream instance
*
* Checks whether enough free space is available on the playback buffer.
*
* Returns non-zero if available, or zero if not.
*/
int snd_pcm_playback_ready(snd_pcm_substream_t *substream)
{
snd_pcm_runtime_t *runtime = substream->runtime;
return snd_pcm_playback_avail(runtime) >= runtime->control->avail_min;
}
/**
* snd_pcm_capture_ready - check whether the capture buffer is available
* @substream: the pcm substream instance
*
* Checks whether enough capture data is available on the capture buffer.
*
* Returns non-zero if available, or zero if not.
*/
int snd_pcm_capture_ready(snd_pcm_substream_t *substream)
{
snd_pcm_runtime_t *runtime = substream->runtime;
return snd_pcm_capture_avail(runtime) >= runtime->control->avail_min;
}
/**
* snd_pcm_playback_data - check whether any data exists on the playback buffer
* @substream: the pcm substream instance
*
* Checks whether any data exists on the playback buffer. If stop_threshold
* is bigger or equal to boundary, then this function returns always non-zero.
*
* Returns non-zero if exists, or zero if not.
*/
int snd_pcm_playback_data(snd_pcm_substream_t *substream)
{
snd_pcm_runtime_t *runtime = substream->runtime;
if (runtime->stop_threshold >= runtime->boundary)
return 1;
return snd_pcm_playback_avail(runtime) < runtime->buffer_size;
}
/**
* snd_pcm_playback_empty - check whether the playback buffer is empty
* @substream: the pcm substream instance
*
* Checks whether the playback buffer is empty.
*
* Returns non-zero if empty, or zero if not.
*/
int snd_pcm_playback_empty(snd_pcm_substream_t *substream)
{
snd_pcm_runtime_t *runtime = substream->runtime;
return snd_pcm_playback_avail(runtime) >= runtime->buffer_size;
}
/**
* snd_pcm_capture_empty - check whether the capture buffer is empty
* @substream: the pcm substream instance
*
* Checks whether the capture buffer is empty.
*
* Returns non-zero if empty, or zero if not.
*/
int snd_pcm_capture_empty(snd_pcm_substream_t *substream)
{
snd_pcm_runtime_t *runtime = substream->runtime;
return snd_pcm_capture_avail(runtime) == 0;
}
static void snd_pcm_system_tick_set(snd_pcm_substream_t *substream, static void snd_pcm_system_tick_set(snd_pcm_substream_t *substream,
unsigned long ticks) unsigned long ticks)
{ {
...@@ -2643,7 +2569,6 @@ snd_pcm_sframes_t snd_pcm_lib_readv(snd_pcm_substream_t *substream, ...@@ -2643,7 +2569,6 @@ snd_pcm_sframes_t snd_pcm_lib_readv(snd_pcm_substream_t *substream,
EXPORT_SYMBOL(snd_interval_refine); EXPORT_SYMBOL(snd_interval_refine);
EXPORT_SYMBOL(snd_interval_list); EXPORT_SYMBOL(snd_interval_list);
EXPORT_SYMBOL(snd_interval_ratnum); EXPORT_SYMBOL(snd_interval_ratnum);
EXPORT_SYMBOL(snd_interval_ratden);
EXPORT_SYMBOL(snd_interval_muldivk); EXPORT_SYMBOL(snd_interval_muldivk);
EXPORT_SYMBOL(snd_interval_mulkdiv); EXPORT_SYMBOL(snd_interval_mulkdiv);
EXPORT_SYMBOL(snd_interval_div); EXPORT_SYMBOL(snd_interval_div);
...@@ -2675,10 +2600,6 @@ EXPORT_SYMBOL(snd_pcm_hw_rule_add); ...@@ -2675,10 +2600,6 @@ EXPORT_SYMBOL(snd_pcm_hw_rule_add);
EXPORT_SYMBOL(snd_pcm_set_ops); EXPORT_SYMBOL(snd_pcm_set_ops);
EXPORT_SYMBOL(snd_pcm_set_sync); EXPORT_SYMBOL(snd_pcm_set_sync);
EXPORT_SYMBOL(snd_pcm_lib_ioctl); EXPORT_SYMBOL(snd_pcm_lib_ioctl);
EXPORT_SYMBOL(snd_pcm_playback_ready);
EXPORT_SYMBOL(snd_pcm_capture_ready);
EXPORT_SYMBOL(snd_pcm_playback_data);
EXPORT_SYMBOL(snd_pcm_capture_empty);
EXPORT_SYMBOL(snd_pcm_stop); EXPORT_SYMBOL(snd_pcm_stop);
EXPORT_SYMBOL(snd_pcm_period_elapsed); EXPORT_SYMBOL(snd_pcm_period_elapsed);
EXPORT_SYMBOL(snd_pcm_lib_write); EXPORT_SYMBOL(snd_pcm_lib_write);
...@@ -2688,7 +2609,6 @@ EXPORT_SYMBOL(snd_pcm_lib_readv); ...@@ -2688,7 +2609,6 @@ EXPORT_SYMBOL(snd_pcm_lib_readv);
EXPORT_SYMBOL(snd_pcm_lib_buffer_bytes); EXPORT_SYMBOL(snd_pcm_lib_buffer_bytes);
EXPORT_SYMBOL(snd_pcm_lib_period_bytes); EXPORT_SYMBOL(snd_pcm_lib_period_bytes);
/* pcm_memory.c */ /* pcm_memory.c */
EXPORT_SYMBOL(snd_pcm_lib_preallocate_free);
EXPORT_SYMBOL(snd_pcm_lib_preallocate_free_for_all); EXPORT_SYMBOL(snd_pcm_lib_preallocate_free_for_all);
EXPORT_SYMBOL(snd_pcm_lib_preallocate_pages); EXPORT_SYMBOL(snd_pcm_lib_preallocate_pages);
EXPORT_SYMBOL(snd_pcm_lib_preallocate_pages_for_all); EXPORT_SYMBOL(snd_pcm_lib_preallocate_pages_for_all);
......
...@@ -2020,7 +2020,7 @@ static int snd_pcm_open_file(struct file *file, ...@@ -2020,7 +2020,7 @@ static int snd_pcm_open_file(struct file *file,
return 0; return 0;
} }
int snd_pcm_open(struct inode *inode, struct file *file) static int snd_pcm_open(struct inode *inode, struct file *file)
{ {
int cardnum = SNDRV_MINOR_CARD(iminor(inode)); int cardnum = SNDRV_MINOR_CARD(iminor(inode));
int device = SNDRV_MINOR_DEVICE(iminor(inode)); int device = SNDRV_MINOR_DEVICE(iminor(inode));
...@@ -2079,7 +2079,7 @@ int snd_pcm_open(struct inode *inode, struct file *file) ...@@ -2079,7 +2079,7 @@ int snd_pcm_open(struct inode *inode, struct file *file)
return err; return err;
} }
int snd_pcm_release(struct inode *inode, struct file *file) static int snd_pcm_release(struct inode *inode, struct file *file)
{ {
snd_pcm_t *pcm; snd_pcm_t *pcm;
snd_pcm_substream_t *substream; snd_pcm_substream_t *substream;
...@@ -2101,7 +2101,7 @@ int snd_pcm_release(struct inode *inode, struct file *file) ...@@ -2101,7 +2101,7 @@ int snd_pcm_release(struct inode *inode, struct file *file)
return 0; return 0;
} }
snd_pcm_sframes_t snd_pcm_playback_rewind(snd_pcm_substream_t *substream, snd_pcm_uframes_t frames) static snd_pcm_sframes_t snd_pcm_playback_rewind(snd_pcm_substream_t *substream, snd_pcm_uframes_t frames)
{ {
snd_pcm_runtime_t *runtime = substream->runtime; snd_pcm_runtime_t *runtime = substream->runtime;
snd_pcm_sframes_t appl_ptr; snd_pcm_sframes_t appl_ptr;
...@@ -2150,7 +2150,7 @@ snd_pcm_sframes_t snd_pcm_playback_rewind(snd_pcm_substream_t *substream, snd_pc ...@@ -2150,7 +2150,7 @@ snd_pcm_sframes_t snd_pcm_playback_rewind(snd_pcm_substream_t *substream, snd_pc
return ret; return ret;
} }
snd_pcm_sframes_t snd_pcm_capture_rewind(snd_pcm_substream_t *substream, snd_pcm_uframes_t frames) static snd_pcm_sframes_t snd_pcm_capture_rewind(snd_pcm_substream_t *substream, snd_pcm_uframes_t frames)
{ {
snd_pcm_runtime_t *runtime = substream->runtime; snd_pcm_runtime_t *runtime = substream->runtime;
snd_pcm_sframes_t appl_ptr; snd_pcm_sframes_t appl_ptr;
...@@ -2199,7 +2199,7 @@ snd_pcm_sframes_t snd_pcm_capture_rewind(snd_pcm_substream_t *substream, snd_pcm ...@@ -2199,7 +2199,7 @@ snd_pcm_sframes_t snd_pcm_capture_rewind(snd_pcm_substream_t *substream, snd_pcm
return ret; return ret;
} }
snd_pcm_sframes_t snd_pcm_playback_forward(snd_pcm_substream_t *substream, snd_pcm_uframes_t frames) static snd_pcm_sframes_t snd_pcm_playback_forward(snd_pcm_substream_t *substream, snd_pcm_uframes_t frames)
{ {
snd_pcm_runtime_t *runtime = substream->runtime; snd_pcm_runtime_t *runtime = substream->runtime;
snd_pcm_sframes_t appl_ptr; snd_pcm_sframes_t appl_ptr;
...@@ -2249,7 +2249,7 @@ snd_pcm_sframes_t snd_pcm_playback_forward(snd_pcm_substream_t *substream, snd_p ...@@ -2249,7 +2249,7 @@ snd_pcm_sframes_t snd_pcm_playback_forward(snd_pcm_substream_t *substream, snd_p
return ret; return ret;
} }
snd_pcm_sframes_t snd_pcm_capture_forward(snd_pcm_substream_t *substream, snd_pcm_uframes_t frames) static snd_pcm_sframes_t snd_pcm_capture_forward(snd_pcm_substream_t *substream, snd_pcm_uframes_t frames)
{ {
snd_pcm_runtime_t *runtime = substream->runtime; snd_pcm_runtime_t *runtime = substream->runtime;
snd_pcm_sframes_t appl_ptr; snd_pcm_sframes_t appl_ptr;
...@@ -2835,7 +2835,7 @@ static ssize_t snd_pcm_writev(struct file *file, const struct iovec *_vector, ...@@ -2835,7 +2835,7 @@ static ssize_t snd_pcm_writev(struct file *file, const struct iovec *_vector,
return result; return result;
} }
unsigned int snd_pcm_playback_poll(struct file *file, poll_table * wait) static unsigned int snd_pcm_playback_poll(struct file *file, poll_table * wait)
{ {
snd_pcm_file_t *pcm_file; snd_pcm_file_t *pcm_file;
snd_pcm_substream_t *substream; snd_pcm_substream_t *substream;
...@@ -2873,7 +2873,7 @@ unsigned int snd_pcm_playback_poll(struct file *file, poll_table * wait) ...@@ -2873,7 +2873,7 @@ unsigned int snd_pcm_playback_poll(struct file *file, poll_table * wait)
return mask; return mask;
} }
unsigned int snd_pcm_capture_poll(struct file *file, poll_table * wait) static unsigned int snd_pcm_capture_poll(struct file *file, poll_table * wait)
{ {
snd_pcm_file_t *pcm_file; snd_pcm_file_t *pcm_file;
snd_pcm_substream_t *substream; snd_pcm_substream_t *substream;
......
...@@ -54,7 +54,7 @@ static int snd_rawmidi_dev_register(snd_device_t *device); ...@@ -54,7 +54,7 @@ static int snd_rawmidi_dev_register(snd_device_t *device);
static int snd_rawmidi_dev_disconnect(snd_device_t *device); static int snd_rawmidi_dev_disconnect(snd_device_t *device);
static int snd_rawmidi_dev_unregister(snd_device_t *device); static int snd_rawmidi_dev_unregister(snd_device_t *device);
snd_rawmidi_t *snd_rawmidi_devices[SNDRV_CARDS * SNDRV_RAWMIDI_DEVICES]; static snd_rawmidi_t *snd_rawmidi_devices[SNDRV_CARDS * SNDRV_RAWMIDI_DEVICES];
static DECLARE_MUTEX(register_mutex); static DECLARE_MUTEX(register_mutex);
...@@ -795,8 +795,10 @@ static int snd_rawmidi_ioctl(struct inode *inode, struct file *file, ...@@ -795,8 +795,10 @@ static int snd_rawmidi_ioctl(struct inode *inode, struct file *file,
return err; return err;
} }
int snd_rawmidi_control_ioctl(snd_card_t * card, snd_ctl_file_t * control, static int snd_rawmidi_control_ioctl(snd_card_t * card,
unsigned int cmd, unsigned long arg) snd_ctl_file_t * control,
unsigned int cmd,
unsigned long arg)
{ {
void __user *argp = (void __user *)arg; void __user *argp = (void __user *)arg;
unsigned int tmp; unsigned int tmp;
......
...@@ -185,7 +185,6 @@ snd_seq_oss_fill_addr(seq_oss_devinfo_t *dp, snd_seq_event_t *ev, ...@@ -185,7 +185,6 @@ snd_seq_oss_fill_addr(seq_oss_devinfo_t *dp, snd_seq_event_t *ev,
/* misc. functions for proc interface */ /* misc. functions for proc interface */
char *enabled_str(int bool); char *enabled_str(int bool);
char *filemode_str(int fmode);
/* for debug */ /* for debug */
......
...@@ -491,6 +491,26 @@ snd_seq_oss_reset(seq_oss_devinfo_t *dp) ...@@ -491,6 +491,26 @@ snd_seq_oss_reset(seq_oss_devinfo_t *dp)
snd_seq_oss_timer_stop(dp->timer); snd_seq_oss_timer_stop(dp->timer);
} }
/*
* misc. functions for proc interface
*/
char *
enabled_str(int bool)
{
return bool ? "enabled" : "disabled";
}
static char *
filemode_str(int val)
{
static char *str[] = {
"none", "read", "write", "read/write",
};
return str[val & SNDRV_SEQ_OSS_FILE_ACMODE];
}
/* /*
* proc interface * proc interface
*/ */
...@@ -523,22 +543,3 @@ snd_seq_oss_system_info_read(snd_info_buffer_t *buf) ...@@ -523,22 +543,3 @@ snd_seq_oss_system_info_read(snd_info_buffer_t *buf)
} }
} }
/*
* misc. functions for proc interface
*/
char *
enabled_str(int bool)
{
return bool ? "enabled" : "disabled";
}
char *
filemode_str(int val)
{
static char *str[] = {
"none", "read", "write", "read/write",
};
return str[val & SNDRV_SEQ_OSS_FILE_ACMODE];
}
...@@ -751,8 +751,8 @@ static int multicast_event(client_t *client, snd_seq_event_t *event, ...@@ -751,8 +751,8 @@ static int multicast_event(client_t *client, snd_seq_event_t *event,
* n == 0 : the event was not passed to any client. * n == 0 : the event was not passed to any client.
* n < 0 : error - event was not processed. * n < 0 : error - event was not processed.
*/ */
int snd_seq_deliver_event(client_t *client, snd_seq_event_t *event, static int snd_seq_deliver_event(client_t *client, snd_seq_event_t *event,
int atomic, int hop) int atomic, int hop)
{ {
int result; int result;
......
...@@ -100,6 +100,5 @@ extern int snd_seq_kernel_client_enqueue(int client, snd_seq_event_t *ev, int at ...@@ -100,6 +100,5 @@ extern int snd_seq_kernel_client_enqueue(int client, snd_seq_event_t *ev, int at
int snd_seq_kernel_client_enqueue_blocking(int client, snd_seq_event_t * ev, struct file *file, int atomic, int hop); int snd_seq_kernel_client_enqueue_blocking(int client, snd_seq_event_t * ev, struct file *file, int atomic, int hop);
int snd_seq_kernel_client_write_poll(int clientid, struct file *file, poll_table *wait); int snd_seq_kernel_client_write_poll(int clientid, struct file *file, poll_table *wait);
int snd_seq_client_notify_subscription(int client, int port, snd_seq_port_subscribe_t *info, int evtype); int snd_seq_client_notify_subscription(int client, int port, snd_seq_port_subscribe_t *info, int evtype);
int snd_seq_deliver_event(client_t *client, snd_seq_event_t *event, int atomic, int hop);
#endif #endif
...@@ -49,17 +49,7 @@ static void snd_instr_unlock_ops(snd_seq_kinstr_list_t *list) ...@@ -49,17 +49,7 @@ static void snd_instr_unlock_ops(snd_seq_kinstr_list_t *list)
} }
} }
snd_seq_kcluster_t *snd_seq_cluster_new(int atomic) static snd_seq_kinstr_t *snd_seq_instr_new(int add_len, int atomic)
{
return kcalloc(1, sizeof(snd_seq_kcluster_t), atomic ? GFP_ATOMIC : GFP_KERNEL);
}
void snd_seq_cluster_free(snd_seq_kcluster_t *cluster, int atomic)
{
kfree(cluster);
}
snd_seq_kinstr_t *snd_seq_instr_new(int add_len, int atomic)
{ {
snd_seq_kinstr_t *instr; snd_seq_kinstr_t *instr;
...@@ -70,7 +60,7 @@ snd_seq_kinstr_t *snd_seq_instr_new(int add_len, int atomic) ...@@ -70,7 +60,7 @@ snd_seq_kinstr_t *snd_seq_instr_new(int add_len, int atomic)
return instr; return instr;
} }
int snd_seq_instr_free(snd_seq_kinstr_t *instr, int atomic) static int snd_seq_instr_free(snd_seq_kinstr_t *instr, int atomic)
{ {
int result = 0; int result = 0;
...@@ -130,7 +120,7 @@ void snd_seq_instr_list_free(snd_seq_kinstr_list_t **list_ptr) ...@@ -130,7 +120,7 @@ void snd_seq_instr_list_free(snd_seq_kinstr_list_t **list_ptr)
while ((cluster = list->chash[idx]) != NULL) { while ((cluster = list->chash[idx]) != NULL) {
list->chash[idx] = cluster->next; list->chash[idx] = cluster->next;
list->ccount--; list->ccount--;
snd_seq_cluster_free(cluster, 0); kfree(cluster);
} }
} }
kfree(list); kfree(list);
......
...@@ -215,7 +215,7 @@ void snd_seq_cell_free(snd_seq_event_cell_t * cell) ...@@ -215,7 +215,7 @@ void snd_seq_cell_free(snd_seq_event_cell_t * cell)
/* /*
* allocate an event cell. * allocate an event cell.
*/ */
int snd_seq_cell_alloc(pool_t *pool, snd_seq_event_cell_t **cellp, int nonblock, struct file *file) static int snd_seq_cell_alloc(pool_t *pool, snd_seq_event_cell_t **cellp, int nonblock, struct file *file)
{ {
snd_seq_event_cell_t *cell; snd_seq_event_cell_t *cell;
unsigned long flags; unsigned long flags;
......
...@@ -64,7 +64,6 @@ struct pool { ...@@ -64,7 +64,6 @@ struct pool {
}; };
extern void snd_seq_cell_free(snd_seq_event_cell_t* cell); extern void snd_seq_cell_free(snd_seq_event_cell_t* cell);
int snd_seq_cell_alloc(pool_t *pool, snd_seq_event_cell_t **cellp, int nonblock, struct file *file);
int snd_seq_event_dup(pool_t *pool, snd_seq_event_t *event, snd_seq_event_cell_t **cellp, int nonblock, struct file *file); int snd_seq_event_dup(pool_t *pool, snd_seq_event_t *event, snd_seq_event_cell_t **cellp, int nonblock, struct file *file);
......
...@@ -43,10 +43,10 @@ Possible options for midisynth module: ...@@ -43,10 +43,10 @@ Possible options for midisynth module:
MODULE_AUTHOR("Frank van de Pol <fvdpol@coil.demon.nl>, Jaroslav Kysela <perex@suse.cz>"); MODULE_AUTHOR("Frank van de Pol <fvdpol@coil.demon.nl>, Jaroslav Kysela <perex@suse.cz>");
MODULE_DESCRIPTION("Advanced Linux Sound Architecture sequencer MIDI synth."); MODULE_DESCRIPTION("Advanced Linux Sound Architecture sequencer MIDI synth.");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
int output_buffer_size = PAGE_SIZE; static int output_buffer_size = PAGE_SIZE;
module_param(output_buffer_size, int, 0644); module_param(output_buffer_size, int, 0644);
MODULE_PARM_DESC(output_buffer_size, "Output buffer size in bytes."); MODULE_PARM_DESC(output_buffer_size, "Output buffer size in bytes.");
int input_buffer_size = PAGE_SIZE; static int input_buffer_size = PAGE_SIZE;
module_param(input_buffer_size, int, 0644); module_param(input_buffer_size, int, 0644);
MODULE_PARM_DESC(input_buffer_size, "Input buffer size in bytes."); MODULE_PARM_DESC(input_buffer_size, "Input buffer size in bytes.");
...@@ -284,7 +284,7 @@ static int set_client_name(seq_midisynth_client_t *client, snd_card_t *card, ...@@ -284,7 +284,7 @@ static int set_client_name(seq_midisynth_client_t *client, snd_card_t *card,
} }
/* register new midi synth port */ /* register new midi synth port */
int static int
snd_seq_midisynth_register_port(snd_seq_device_t *dev) snd_seq_midisynth_register_port(snd_seq_device_t *dev)
{ {
seq_midisynth_client_t *client; seq_midisynth_client_t *client;
...@@ -423,7 +423,7 @@ snd_seq_midisynth_register_port(snd_seq_device_t *dev) ...@@ -423,7 +423,7 @@ snd_seq_midisynth_register_port(snd_seq_device_t *dev)
} }
/* release midi synth port */ /* release midi synth port */
int static int
snd_seq_midisynth_unregister_port(snd_seq_device_t *dev) snd_seq_midisynth_unregister_port(snd_seq_device_t *dev)
{ {
seq_midisynth_client_t *client; seq_midisynth_client_t *client;
......
...@@ -53,7 +53,7 @@ static void nrpn(snd_midi_op_t *ops, void *drv, snd_midi_channel_t *chan, snd_mi ...@@ -53,7 +53,7 @@ static void nrpn(snd_midi_op_t *ops, void *drv, snd_midi_channel_t *chan, snd_mi
static void sysex(snd_midi_op_t *ops, void *private, unsigned char *sysex, int len, snd_midi_channel_set_t *chset); static void sysex(snd_midi_op_t *ops, void *private, unsigned char *sysex, int len, snd_midi_channel_set_t *chset);
static void all_sounds_off(snd_midi_op_t *ops, void *private, snd_midi_channel_t *chan); static void all_sounds_off(snd_midi_op_t *ops, void *private, snd_midi_channel_t *chan);
static void all_notes_off(snd_midi_op_t *ops, void *private, snd_midi_channel_t *chan); static void all_notes_off(snd_midi_op_t *ops, void *private, snd_midi_channel_t *chan);
void snd_midi_reset_controllers(snd_midi_channel_t *chan); static void snd_midi_reset_controllers(snd_midi_channel_t *chan);
static void reset_all_channels(snd_midi_channel_set_t *chset); static void reset_all_channels(snd_midi_channel_set_t *chset);
...@@ -621,7 +621,7 @@ all_notes_off(snd_midi_op_t *ops, void *drv, snd_midi_channel_t *chan) ...@@ -621,7 +621,7 @@ all_notes_off(snd_midi_op_t *ops, void *drv, snd_midi_channel_t *chan)
/* /*
* Initialise a single midi channel control block. * Initialise a single midi channel control block.
*/ */
void snd_midi_channel_init(snd_midi_channel_t *p, int n) static void snd_midi_channel_init(snd_midi_channel_t *p, int n)
{ {
if (p == NULL) if (p == NULL)
return; return;
...@@ -642,7 +642,7 @@ void snd_midi_channel_init(snd_midi_channel_t *p, int n) ...@@ -642,7 +642,7 @@ void snd_midi_channel_init(snd_midi_channel_t *p, int n)
/* /*
* Allocate and initialise a set of midi channel control blocks. * Allocate and initialise a set of midi channel control blocks.
*/ */
snd_midi_channel_t *snd_midi_channel_init_set(int n) static snd_midi_channel_t *snd_midi_channel_init_set(int n)
{ {
snd_midi_channel_t *chan; snd_midi_channel_t *chan;
int i; int i;
...@@ -697,7 +697,7 @@ snd_midi_channel_set_t *snd_midi_channel_alloc_set(int n) ...@@ -697,7 +697,7 @@ snd_midi_channel_set_t *snd_midi_channel_alloc_set(int n)
/* /*
* Reset the midi controllers on a particular channel to default values. * Reset the midi controllers on a particular channel to default values.
*/ */
void snd_midi_reset_controllers(snd_midi_channel_t *chan) static void snd_midi_reset_controllers(snd_midi_channel_t *chan)
{ {
memset(chan->control, 0, sizeof(chan->control)); memset(chan->control, 0, sizeof(chan->control));
chan->gm_volume = 127; chan->gm_volume = 127;
...@@ -731,7 +731,5 @@ module_exit(alsa_seq_midi_emul_exit) ...@@ -731,7 +731,5 @@ module_exit(alsa_seq_midi_emul_exit)
EXPORT_SYMBOL(snd_midi_process_event); EXPORT_SYMBOL(snd_midi_process_event);
EXPORT_SYMBOL(snd_midi_channel_set_clear); EXPORT_SYMBOL(snd_midi_channel_set_clear);
EXPORT_SYMBOL(snd_midi_channel_init);
EXPORT_SYMBOL(snd_midi_channel_init_set);
EXPORT_SYMBOL(snd_midi_channel_alloc_set); EXPORT_SYMBOL(snd_midi_channel_alloc_set);
EXPORT_SYMBOL(snd_midi_channel_free_set); EXPORT_SYMBOL(snd_midi_channel_free_set);
...@@ -159,7 +159,7 @@ static int snd_open(struct inode *inode, struct file *file) ...@@ -159,7 +159,7 @@ static int snd_open(struct inode *inode, struct file *file)
return err; return err;
} }
struct file_operations snd_fops = static struct file_operations snd_fops =
{ {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = snd_open .open = snd_open
...@@ -446,8 +446,6 @@ EXPORT_SYMBOL(snd_dma_pointer); ...@@ -446,8 +446,6 @@ EXPORT_SYMBOL(snd_dma_pointer);
/* info.c */ /* info.c */
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
EXPORT_SYMBOL(snd_seq_root); EXPORT_SYMBOL(snd_seq_root);
EXPORT_SYMBOL(snd_create_proc_entry);
EXPORT_SYMBOL(snd_remove_proc_entry);
EXPORT_SYMBOL(snd_iprintf); EXPORT_SYMBOL(snd_iprintf);
EXPORT_SYMBOL(snd_info_get_line); EXPORT_SYMBOL(snd_info_get_line);
EXPORT_SYMBOL(snd_info_get_str); EXPORT_SYMBOL(snd_info_get_str);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment