7 #include <linux/module.h>
8 #include <linux/slab.h>
9 #include <linux/sound.h>
10 #include <linux/soundcard.h>
12 #include <asm/uaccess.h>
24 #define HOSTAUDIO_DEV_DSP "/dev/sound/dsp"
25 #define HOSTAUDIO_DEV_MIXER "/dev/sound/mixer"
36 " This is used to specify the host dsp device to the hostaudio driver.\n" \
37 " The default is \"" HOSTAUDIO_DEV_DSP "\".\n\n"
40 " This is used to specify the host mixer device to the hostaudio driver.\n"\
41 " The default is \"" HOSTAUDIO_DEV_MIXER "\".\n\n"
49 static int set_dsp(
char *
name,
int *
add)
57 static int set_mixer(
char *
name,
int *
add)
71 size_t count, loff_t *ppos)
97 static ssize_t hostaudio_write(
struct file *file,
const char __user *buffer,
98 size_t count, loff_t *ppos)
126 static unsigned int hostaudio_poll(
struct file *file,
129 unsigned int mask = 0;
138 static long hostaudio_ioctl(
struct file *file,
139 unsigned int cmd,
unsigned long arg)
142 unsigned long data = 0;
155 if (
get_user(data, (
int __user *) arg))
171 if (
put_user(data, (
int __user *) arg))
181 static int hostaudio_open(
struct inode *
inode,
struct file *file)
217 static int hostaudio_release(
struct inode *inode,
struct file *file)
232 static long hostmixer_ioctl_mixdev(
struct file *file,
233 unsigned int cmd,
unsigned long arg)
244 static int hostmixer_open_mixdev(
struct inode *inode,
struct file *file)
272 "err = %d\n",
dsp, -ret);
282 static int hostmixer_release(
struct inode *inode,
struct file *file)
301 .read = hostaudio_read,
302 .write = hostaudio_write,
303 .poll = hostaudio_poll,
304 .unlocked_ioctl = hostaudio_ioctl,
306 .open = hostaudio_open,
307 .release = hostaudio_release,
313 .unlocked_ioctl = hostmixer_ioctl_mixdev,
314 .open = hostmixer_open_mixdev,
315 .release = hostmixer_release,
327 static int __init hostaudio_init_module(
void)
329 __kernel_param_lock();
332 __kernel_param_unlock();
351 static void __exit hostaudio_cleanup_module (
void)