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);
int snd_info_register(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 */
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; }
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 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_info_set_text_ops(entry,private_data,read_size,read) /*NOP*/
......
......@@ -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_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_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);
void snd_pcm_release_substream(snd_pcm_substream_t *substream);
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
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,
snd_pcm_substream_t *master)
{
......@@ -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,
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_step(snd_interval_t *i, unsigned int min, unsigned int step);
int snd_interval_ratnum(snd_interval_t *i,
unsigned int rats_count, ratnum_t *rats,
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_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 */
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);
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_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_sync(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_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);
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_set(snd_pcm_substream_t *substream, unsigned long ticks);
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,
snd_rawmidi_t ** rmidi);
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 */
void snd_rawmidi_receive_reset(snd_rawmidi_substream_t * substream);
......
......@@ -189,8 +189,6 @@ enum {
void snd_midi_process_event(snd_midi_op_t *ops, snd_seq_event_t *ev,
snd_midi_channel_set_t *chanset);
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);
void snd_midi_channel_free_set(snd_midi_channel_set_t *chset);
......
......@@ -35,7 +35,7 @@ MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
MODULE_DESCRIPTION("Hardware dependent layer");
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);
......
......@@ -125,8 +125,8 @@ static inline void snd_info_entry_prepare(struct proc_dir_entry *de)
de->owner = THIS_MODULE;
}
void snd_remove_proc_entry(struct proc_dir_entry *parent,
struct proc_dir_entry *de)
static void snd_remove_proc_entry(struct proc_dir_entry *parent,
struct proc_dir_entry *de)
{
if (de)
remove_proc_entry(de->name, parent);
......@@ -521,8 +521,8 @@ static struct file_operations snd_info_entry_operations =
*
* Returns the pointer of new instance or NULL on failure.
*/
struct proc_dir_entry *snd_create_proc_entry(const char *name, mode_t mode,
struct proc_dir_entry *parent)
static struct proc_dir_entry *snd_create_proc_entry(const char *name, mode_t mode,
struct proc_dir_entry *parent)
{
struct proc_dir_entry *p;
p = create_proc_entry(name, mode, parent);
......
......@@ -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;
struct snd_alloc_track *t;
......
......@@ -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 */
int snd_mixer_oss_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg)
static int snd_mixer_oss_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg)
{
int err;
/* FIXME: need to unlock BKL to allow preemption */
......
......@@ -77,7 +77,7 @@ static inline void snd_leave_user(mm_segment_t 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_plugin_t *plugin, *next;
......@@ -92,7 +92,7 @@ int snd_pcm_oss_plugin_clear(snd_pcm_substream_t *substream)
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;
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,
return count;
}
int snd_pcm_plug_playback_channels_mask(snd_pcm_plug_t *plug,
bitset_t *client_vmask)
static int snd_pcm_plug_playback_channels_mask(snd_pcm_plug_t *plug,
bitset_t *client_vmask)
{
snd_pcm_plugin_t *plugin = snd_pcm_plug_last(plug);
if (plugin == NULL) {
......@@ -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,
snd_pcm_plugin_channel_t *src_channels)
{
......
......@@ -353,9 +353,9 @@ static void route_to_channel(snd_pcm_plugin_t *plugin,
}
}
int route_src_channels_mask(snd_pcm_plugin_t *plugin,
bitset_t *dst_vmask,
bitset_t **src_vmask)
static int route_src_channels_mask(snd_pcm_plugin_t *plugin,
bitset_t *dst_vmask,
bitset_t **src_vmask)
{
route_t *data = (route_t *)plugin->extra_data;
int schannels = plugin->src_format.channels;
......@@ -377,9 +377,9 @@ int route_src_channels_mask(snd_pcm_plugin_t *plugin,
return 0;
}
int route_dst_channels_mask(snd_pcm_plugin_t *plugin,
bitset_t *src_vmask,
bitset_t **dst_vmask)
static int route_dst_channels_mask(snd_pcm_plugin_t *plugin,
bitset_t *src_vmask,
bitset_t **dst_vmask)
{
route_t *data = (route_t *)plugin->extra_data;
int dchannels = plugin->dst_format.channels;
......
......@@ -126,12 +126,12 @@ static int snd_pcm_control_ioctl(snd_card_t * card,
#define FORMAT(v) [SNDRV_PCM_FORMAT_##v] = #v
#define SUBFORMAT(v) [SNDRV_PCM_SUBFORMAT_##v] = #v
char *snd_pcm_stream_names[] = {
static char *snd_pcm_stream_names[] = {
STREAM(PLAYBACK),
STREAM(CAPTURE),
};
char *snd_pcm_state_names[] = {
static char *snd_pcm_state_names[] = {
STATE(OPEN),
STATE(SETUP),
STATE(PREPARED),
......@@ -142,7 +142,7 @@ char *snd_pcm_state_names[] = {
STATE(SUSPENDED),
};
char *snd_pcm_access_names[] = {
static char *snd_pcm_access_names[] = {
ACCESS(MMAP_INTERLEAVED),
ACCESS(MMAP_NONINTERLEAVED),
ACCESS(MMAP_COMPLEX),
......@@ -150,7 +150,7 @@ char *snd_pcm_access_names[] = {
ACCESS(RW_NONINTERLEAVED),
};
char *snd_pcm_format_names[] = {
static char *snd_pcm_format_names[] = {
FORMAT(S8),
FORMAT(U8),
FORMAT(S16_LE),
......@@ -191,22 +191,22 @@ char *snd_pcm_format_names[] = {
FORMAT(U18_3BE),
};
char *snd_pcm_subformat_names[] = {
static char *snd_pcm_subformat_names[] = {
SUBFORMAT(STD),
};
char *snd_pcm_tstamp_mode_names[] = {
static char *snd_pcm_tstamp_mode_names[] = {
TSTAMP(NONE),
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);
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);
return snd_pcm_access_names[access];
......@@ -218,19 +218,19 @@ const char *snd_pcm_format_name(snd_pcm_format_t 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);
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);
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);
return snd_pcm_state_names[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)
#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) {
case AFMT_MU_LAW:
......@@ -1034,7 +1034,6 @@ EXPORT_SYMBOL(snd_pcm_notify);
EXPORT_SYMBOL(snd_pcm_open_substream);
EXPORT_SYMBOL(snd_pcm_release_substream);
EXPORT_SYMBOL(snd_pcm_format_name);
EXPORT_SYMBOL(snd_pcm_subformat_name);
/* pcm_native.c */
EXPORT_SYMBOL(snd_pcm_link_rwlock);
EXPORT_SYMBOL(snd_pcm_start);
......@@ -1045,10 +1044,6 @@ EXPORT_SYMBOL(snd_pcm_suspend_all);
EXPORT_SYMBOL(snd_pcm_kernel_playback_ioctl);
EXPORT_SYMBOL(snd_pcm_kernel_capture_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);
#if SNDRV_PCM_INFO_MMAP_IOMEM
EXPORT_SYMBOL(snd_pcm_lib_mmap_iomem);
......@@ -1061,7 +1056,6 @@ EXPORT_SYMBOL(snd_pcm_format_little_endian);
EXPORT_SYMBOL(snd_pcm_format_big_endian);
EXPORT_SYMBOL(snd_pcm_format_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_set_silence);
EXPORT_SYMBOL(snd_pcm_build_linear_format);
......
......@@ -371,7 +371,7 @@ static inline unsigned int muldiv32(unsigned int a, unsigned int b,
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;
assert(!snd_interval_empty(i));
......@@ -396,7 +396,7 @@ int snd_interval_refine_min(snd_interval_t *i, unsigned int min, int openmin)
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;
assert(!snd_interval_empty(i));
......@@ -474,7 +474,7 @@ int snd_interval_refine(snd_interval_t *i, const snd_interval_t *v)
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));
if (snd_interval_single(i))
......@@ -486,7 +486,7 @@ int snd_interval_refine_first(snd_interval_t *i)
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));
if (snd_interval_single(i))
......@@ -498,7 +498,7 @@ int snd_interval_refine_last(snd_interval_t *i)
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;
t.empty = 0;
......@@ -718,9 +718,9 @@ int snd_interval_ratnum(snd_interval_t *i,
*
* Returns non-zero if the value is changed, zero if not changed.
*/
int snd_interval_ratden(snd_interval_t *i,
unsigned int rats_count, ratden_t *rats,
unsigned int *nump, unsigned int *denp)
static int snd_interval_ratden(snd_interval_t *i,
unsigned int rats_count, ratden_t *rats,
unsigned int *nump, unsigned int *denp)
{
unsigned int best_num, best_diff, best_den;
unsigned int k;
......@@ -858,7 +858,7 @@ int snd_interval_list(snd_interval_t *i, unsigned int count, unsigned int *list,
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;
int changed = 0;
......@@ -1856,80 +1856,6 @@ int snd_pcm_lib_ioctl(snd_pcm_substream_t *substream,
* 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,
unsigned long ticks)
{
......@@ -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_list);
EXPORT_SYMBOL(snd_interval_ratnum);
EXPORT_SYMBOL(snd_interval_ratden);
EXPORT_SYMBOL(snd_interval_muldivk);
EXPORT_SYMBOL(snd_interval_mulkdiv);
EXPORT_SYMBOL(snd_interval_div);
......@@ -2675,10 +2600,6 @@ EXPORT_SYMBOL(snd_pcm_hw_rule_add);
EXPORT_SYMBOL(snd_pcm_set_ops);
EXPORT_SYMBOL(snd_pcm_set_sync);
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_period_elapsed);
EXPORT_SYMBOL(snd_pcm_lib_write);
......@@ -2688,7 +2609,6 @@ EXPORT_SYMBOL(snd_pcm_lib_readv);
EXPORT_SYMBOL(snd_pcm_lib_buffer_bytes);
EXPORT_SYMBOL(snd_pcm_lib_period_bytes);
/* 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_pages);
EXPORT_SYMBOL(snd_pcm_lib_preallocate_pages_for_all);
......
......@@ -2020,7 +2020,7 @@ static int snd_pcm_open_file(struct file *file,
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 device = SNDRV_MINOR_DEVICE(iminor(inode));
......@@ -2079,7 +2079,7 @@ int snd_pcm_open(struct inode *inode, struct file *file)
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_substream_t *substream;
......@@ -2101,7 +2101,7 @@ int snd_pcm_release(struct inode *inode, struct file *file)
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_sframes_t appl_ptr;
......@@ -2150,7 +2150,7 @@ snd_pcm_sframes_t snd_pcm_playback_rewind(snd_pcm_substream_t *substream, snd_pc
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_sframes_t appl_ptr;
......@@ -2199,7 +2199,7 @@ snd_pcm_sframes_t snd_pcm_capture_rewind(snd_pcm_substream_t *substream, snd_pcm
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_sframes_t appl_ptr;
......@@ -2249,7 +2249,7 @@ snd_pcm_sframes_t snd_pcm_playback_forward(snd_pcm_substream_t *substream, snd_p
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_sframes_t appl_ptr;
......@@ -2835,7 +2835,7 @@ static ssize_t snd_pcm_writev(struct file *file, const struct iovec *_vector,
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_substream_t *substream;
......@@ -2873,7 +2873,7 @@ unsigned int snd_pcm_playback_poll(struct file *file, poll_table * wait)
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_substream_t *substream;
......
......@@ -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_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);
......@@ -795,8 +795,10 @@ static int snd_rawmidi_ioctl(struct inode *inode, struct file *file,
return err;
}
int snd_rawmidi_control_ioctl(snd_card_t * card, snd_ctl_file_t * control,
unsigned int cmd, unsigned long arg)
static int snd_rawmidi_control_ioctl(snd_card_t * card,
snd_ctl_file_t * control,
unsigned int cmd,
unsigned long arg)
{
void __user *argp = (void __user *)arg;
unsigned int tmp;
......
......@@ -185,7 +185,6 @@ snd_seq_oss_fill_addr(seq_oss_devinfo_t *dp, snd_seq_event_t *ev,
/* misc. functions for proc interface */
char *enabled_str(int bool);
char *filemode_str(int fmode);
/* for debug */
......
......@@ -491,6 +491,26 @@ snd_seq_oss_reset(seq_oss_devinfo_t *dp)
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
*/
......@@ -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,
* n == 0 : the event was not passed to any client.
* n < 0 : error - event was not processed.
*/
int snd_seq_deliver_event(client_t *client, snd_seq_event_t *event,
int atomic, int hop)
static int snd_seq_deliver_event(client_t *client, snd_seq_event_t *event,
int atomic, int hop)
{
int result;
......
......@@ -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_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_deliver_event(client_t *client, snd_seq_event_t *event, int atomic, int hop);
#endif
......@@ -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)
{
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)
static snd_seq_kinstr_t *snd_seq_instr_new(int add_len, int atomic)
{
snd_seq_kinstr_t *instr;
......@@ -70,7 +60,7 @@ snd_seq_kinstr_t *snd_seq_instr_new(int add_len, int atomic)
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;
......@@ -130,7 +120,7 @@ void snd_seq_instr_list_free(snd_seq_kinstr_list_t **list_ptr)
while ((cluster = list->chash[idx]) != NULL) {
list->chash[idx] = cluster->next;
list->ccount--;
snd_seq_cluster_free(cluster, 0);
kfree(cluster);
}
}
kfree(list);
......
......@@ -215,7 +215,7 @@ void snd_seq_cell_free(snd_seq_event_cell_t * 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;
unsigned long flags;
......
......@@ -64,7 +64,6 @@ struct pool {
};
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);
......
......@@ -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_DESCRIPTION("Advanced Linux Sound Architecture sequencer MIDI synth.");
MODULE_LICENSE("GPL");
int output_buffer_size = PAGE_SIZE;
static int output_buffer_size = PAGE_SIZE;
module_param(output_buffer_size, int, 0644);
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_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,
}
/* register new midi synth port */
int
static int
snd_seq_midisynth_register_port(snd_seq_device_t *dev)
{
seq_midisynth_client_t *client;
......@@ -423,7 +423,7 @@ snd_seq_midisynth_register_port(snd_seq_device_t *dev)
}
/* release midi synth port */
int
static int
snd_seq_midisynth_unregister_port(snd_seq_device_t *dev)
{
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
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_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);
......@@ -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.
*/
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)
return;
......@@ -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.
*/
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;
int i;
......@@ -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.
*/
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));
chan->gm_volume = 127;
......@@ -731,7 +731,5 @@ module_exit(alsa_seq_midi_emul_exit)
EXPORT_SYMBOL(snd_midi_process_event);
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_free_set);
......@@ -159,7 +159,7 @@ static int snd_open(struct inode *inode, struct file *file)
return err;
}
struct file_operations snd_fops =
static struct file_operations snd_fops =
{
.owner = THIS_MODULE,
.open = snd_open
......@@ -446,8 +446,6 @@ EXPORT_SYMBOL(snd_dma_pointer);
/* info.c */
#ifdef CONFIG_PROC_FS
EXPORT_SYMBOL(snd_seq_root);
EXPORT_SYMBOL(snd_create_proc_entry);
EXPORT_SYMBOL(snd_remove_proc_entry);
EXPORT_SYMBOL(snd_iprintf);
EXPORT_SYMBOL(snd_info_get_line);
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