mirror of https://github.com/ericonr/sndio.git
sioctl_sun: Rename spkr->output, mic->input.
This commit is contained in:
parent
c64f25a5f8
commit
9edbee2bc1
|
@ -58,7 +58,7 @@ struct wskbd_vol
|
||||||
|
|
||||||
struct sioctl_sun_hdl {
|
struct sioctl_sun_hdl {
|
||||||
struct sioctl_hdl sioctl;
|
struct sioctl_hdl sioctl;
|
||||||
struct wskbd_vol spkr, mic;
|
struct wskbd_vol output, input;
|
||||||
int fd, events;
|
int fd, events;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -130,12 +130,12 @@ init(struct sioctl_sun_hdl *hdl)
|
||||||
{
|
{
|
||||||
static struct {
|
static struct {
|
||||||
char *cn, *dn;
|
char *cn, *dn;
|
||||||
} spkr_names[] = {
|
} output_names[] = {
|
||||||
{AudioCoutputs, AudioNmaster},
|
{AudioCoutputs, AudioNmaster},
|
||||||
{AudioCinputs, AudioNdac},
|
{AudioCinputs, AudioNdac},
|
||||||
{AudioCoutputs, AudioNdac},
|
{AudioCoutputs, AudioNdac},
|
||||||
{AudioCoutputs, AudioNoutput}
|
{AudioCoutputs, AudioNoutput}
|
||||||
}, mic_names[] = {
|
}, input_names[] = {
|
||||||
{AudioCrecord, AudioNrecord},
|
{AudioCrecord, AudioNrecord},
|
||||||
{AudioCrecord, AudioNvolume},
|
{AudioCrecord, AudioNvolume},
|
||||||
{AudioCinputs, AudioNrecord},
|
{AudioCinputs, AudioNrecord},
|
||||||
|
@ -144,19 +144,19 @@ init(struct sioctl_sun_hdl *hdl)
|
||||||
};
|
};
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < sizeof(spkr_names) / sizeof(spkr_names[0]); i++) {
|
for (i = 0; i < sizeof(output_names) / sizeof(output_names[0]); i++) {
|
||||||
if (initvol(hdl, &hdl->spkr,
|
if (initvol(hdl, &hdl->output,
|
||||||
spkr_names[i].cn, spkr_names[i].dn)) {
|
output_names[i].cn, output_names[i].dn)) {
|
||||||
hdl->spkr.name = "spkr";
|
hdl->output.name = "output";
|
||||||
hdl->spkr.base_addr = 0;
|
hdl->output.base_addr = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (i = 0; i < sizeof(mic_names) / sizeof(mic_names[0]); i++) {
|
for (i = 0; i < sizeof(input_names) / sizeof(input_names[0]); i++) {
|
||||||
if (initvol(hdl, &hdl->mic,
|
if (initvol(hdl, &hdl->input,
|
||||||
mic_names[i].cn, mic_names[i].dn)) {
|
input_names[i].cn, input_names[i].dn)) {
|
||||||
hdl->mic.name = "mic";
|
hdl->input.name = "input";
|
||||||
hdl->mic.base_addr = 64;
|
hdl->input.base_addr = 64;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -364,8 +364,8 @@ sioctl_sun_ondesc(struct sioctl_hdl *addr)
|
||||||
{
|
{
|
||||||
struct sioctl_sun_hdl *hdl = (struct sioctl_sun_hdl *)addr;
|
struct sioctl_sun_hdl *hdl = (struct sioctl_sun_hdl *)addr;
|
||||||
|
|
||||||
if (!scanvol(hdl, &hdl->spkr) ||
|
if (!scanvol(hdl, &hdl->output) ||
|
||||||
!scanvol(hdl, &hdl->mic)) {
|
!scanvol(hdl, &hdl->input)) {
|
||||||
hdl->sioctl.eof = 1;
|
hdl->sioctl.eof = 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -384,8 +384,8 @@ sioctl_sun_setctl(struct sioctl_hdl *arg, unsigned int addr, unsigned int val)
|
||||||
{
|
{
|
||||||
struct sioctl_sun_hdl *hdl = (struct sioctl_sun_hdl *)arg;
|
struct sioctl_sun_hdl *hdl = (struct sioctl_sun_hdl *)arg;
|
||||||
|
|
||||||
if (!setvol(hdl, &hdl->spkr, addr, val) ||
|
if (!setvol(hdl, &hdl->output, addr, val) ||
|
||||||
!setvol(hdl, &hdl->mic, addr, val)) {
|
!setvol(hdl, &hdl->input, addr, val)) {
|
||||||
hdl->sioctl.eof = 1;
|
hdl->sioctl.eof = 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue