2 * Copyright (C) 2002 Steve Schmidtke
3 * Licensed under the GPL
12 #include "hostaudio.h"
13 #include "user_util.h"
14 #include "kern_util.h"
18 /* /dev/dsp file operations */
20 ssize_t hostaudio_read_user(struct hostaudio_state *state, char *buffer,
21 size_t count, loff_t *ppos)
26 printk("hostaudio: read_user called, count = %d\n", count);
29 ret = read(state->fd, buffer, count);
31 if(ret < 0) return(-errno);
35 ssize_t hostaudio_write_user(struct hostaudio_state *state, const char *buffer,
36 size_t count, loff_t *ppos)
41 printk("hostaudio: write_user called, count = %d\n", count);
44 ret = write(state->fd, buffer, count);
46 if(ret < 0) return(-errno);
50 int hostaudio_ioctl_user(struct hostaudio_state *state, unsigned int cmd,
55 printk("hostaudio: ioctl_user called, cmd = %u\n", cmd);
58 ret = ioctl(state->fd, cmd, arg);
60 if(ret < 0) return(-errno);
64 int hostaudio_open_user(struct hostaudio_state *state, int r, int w, char *dsp)
67 printk("hostaudio: open_user called\n");
70 state->fd = os_open_file(dsp, of_set_rw(OPENFLAGS(), r, w), 0);
72 if(state->fd >= 0) return(0);
74 printk("hostaudio_open_user failed to open '%s', errno = %d\n",
80 int hostaudio_release_user(struct hostaudio_state *state)
83 printk("hostaudio: release called\n");
93 /* /dev/mixer file operations */
95 int hostmixer_ioctl_mixdev_user(struct hostmixer_state *state,
96 unsigned int cmd, unsigned long arg)
100 printk("hostmixer: ioctl_user called cmd = %u\n",cmd);
103 ret = ioctl(state->fd, cmd, arg);
109 int hostmixer_open_mixdev_user(struct hostmixer_state *state, int r, int w,
113 printk("hostmixer: open_user called\n");
116 state->fd = os_open_file(mixer, of_set_rw(OPENFLAGS(), r, w), 0);
118 if(state->fd >= 0) return(0);
120 printk("hostaudio_open_mixdev_user failed to open '%s', errno = %d\n",
126 int hostmixer_release_mixdev_user(struct hostmixer_state *state)
129 printk("hostmixer: release_user called\n");
141 * Overrides for Emacs so that we follow Linus's tabbing style.
142 * Emacs will notice this stuff at the end of the file and automatically
143 * adjust the settings for this buffer only. This must remain at the end
145 * ---------------------------------------------------------------------------
147 * c-file-style: "linux"