Lines Matching refs:ms
1877 static int wrmixer(struct usb_mixerdev *ms, unsigned mixch, unsigned value) in wrmixer() argument
1879 struct usb_device *dev = ms->state->usbdev; in wrmixer()
1884 if (mixch >= ms->numch) in wrmixer()
1886 ch = &ms->ch[mixch]; in wrmixer()
1904 (ch->chnum << 8) | 1, ms->iface | (ch->unitid << 8), data, 2, HZ) < 0) in wrmixer()
1912 ms->iface | (ch->unitid << 8), data, 2, HZ) < 0) in wrmixer()
1921 (ch->selector << 8) | ch->chnum, ms->iface | (ch->unitid << 8), data, 2, HZ) < 0) in wrmixer()
1928 (ch->selector << 8) | (ch->chnum + 1), ms->iface | (ch->unitid << 8), data, 2, HZ) < 0) in wrmixer()
1937 (ch->selector << 8) | ch->chnum, ms->iface | (ch->unitid << 8), data, 1, HZ) < 0) in wrmixer()
1943 (ch->selector << 8) | (ch->chnum + 1), ms->iface | (ch->unitid << 8), data, 1, HZ) < 0) in wrmixer()
1954 dev->devnum, ms->iface, ch->unitid, ch->chnum, ch->selector); in wrmixer()
1958 static int get_rec_src(struct usb_mixerdev *ms) in get_rec_src() argument
1960 struct usb_device *dev = ms->state->usbdev; in get_rec_src()
1966 for (i = 0; i < ms->numch; i++) { in get_rec_src()
1967 if (!ms->ch[i].slctunitid || (mask & (1 << i))) in get_rec_src()
1970 0, ms->iface | (ms->ch[i].slctunitid << 8), &buf, 1, HZ) < 0) { in get_rec_src()
1973 dev->devnum, ms->iface, ms->ch[i].slctunitid & 0xff); in get_rec_src()
1976 for (j = i; j < ms->numch; j++) { in get_rec_src()
1977 if ((ms->ch[i].slctunitid ^ ms->ch[j].slctunitid) & 0xff) in get_rec_src()
1980 if (buf == (ms->ch[j].slctunitid >> 8)) in get_rec_src()
1981 retmask |= 1 << ms->ch[j].osschannel; in get_rec_src()
1989 static int set_rec_src(struct usb_mixerdev *ms, int srcmask) in set_rec_src() argument
1991 struct usb_device *dev = ms->state->usbdev; in set_rec_src()
1997 for (i = 0; i < ms->numch; i++) { in set_rec_src()
1998 if (!ms->ch[i].slctunitid || (mask & (1 << i))) in set_rec_src()
2001 0, ms->iface | (ms->ch[i].slctunitid << 8), &buf, 1, HZ) < 0) { in set_rec_src()
2004 dev->devnum, ms->iface, ms->ch[i].slctunitid & 0xff); in set_rec_src()
2009 for (j = i; j < ms->numch; j++) { in set_rec_src()
2010 if ((ms->ch[i].slctunitid ^ ms->ch[j].slctunitid) & 0xff) in set_rec_src()
2012 smask |= 1 << ms->ch[j].osschannel; in set_rec_src()
2013 if (buf == (ms->ch[j].slctunitid >> 8)) in set_rec_src()
2014 bmask |= 1 << ms->ch[j].osschannel; in set_rec_src()
2023 for (j = i; j < ms->numch; j++) { in set_rec_src()
2024 if ((ms->ch[i].slctunitid ^ ms->ch[j].slctunitid) & 0xff) in set_rec_src()
2026 if (!(srcmask & (1 << ms->ch[j].osschannel))) in set_rec_src()
2028 buf = ms->ch[j].slctunitid >> 8; in set_rec_src()
2030 0, ms->iface | (ms->ch[j].slctunitid << 8), &buf, 1, HZ) < 0) { in set_rec_src()
2033 dev->devnum, ms->iface, ms->ch[j].slctunitid & 0xff); in set_rec_src()
2051 struct usb_mixerdev *ms; in release() local
2070 ms = list_entry(s->mixerlist.next, struct usb_mixerdev, list); in release()
2071 list_del(&ms->list); in release()
2072 kfree(ms); in release()
2095 struct usb_mixerdev *ms; in usb_audio_open_mixdev() local
2102 ms = list_entry(mdevs, struct usb_mixerdev, list); in usb_audio_open_mixdev()
2103 if (ms->dev_mixer == minor) in usb_audio_open_mixdev()
2115 file->private_data = ms; in usb_audio_open_mixdev()
2124 struct usb_mixerdev *ms = (struct usb_mixerdev *)file->private_data; in usb_audio_release_mixdev() local
2128 s = ms->state; in usb_audio_release_mixdev()
2137 struct usb_mixerdev *ms = (struct usb_mixerdev *)file->private_data; in usb_audio_ioctl_mixdev() local
2140 if (!ms->state->usbdev) in usb_audio_ioctl_mixdev()
2149 info.modify_counter = ms->modcnt; in usb_audio_ioctl_mixdev()
2171 val = get_rec_src(ms); in usb_audio_ioctl_mixdev()
2177 for (val = i = 0; i < ms->numch; i++) in usb_audio_ioctl_mixdev()
2178 val |= 1 << ms->ch[i].osschannel; in usb_audio_ioctl_mixdev()
2182 for (val = i = 0; i < ms->numch; i++) in usb_audio_ioctl_mixdev()
2183 if (ms->ch[i].slctunitid) in usb_audio_ioctl_mixdev()
2184 val |= 1 << ms->ch[i].osschannel; in usb_audio_ioctl_mixdev()
2188 for (val = i = 0; i < ms->numch; i++) in usb_audio_ioctl_mixdev()
2189 if (ms->ch[i].flags & (MIXFLG_STEREOIN | MIXFLG_STEREOOUT)) in usb_audio_ioctl_mixdev()
2190 val |= 1 << ms->ch[i].osschannel; in usb_audio_ioctl_mixdev()
2200 for (j = 0; j < ms->numch; j++) { in usb_audio_ioctl_mixdev()
2201 if (ms->ch[j].osschannel == i) { in usb_audio_ioctl_mixdev()
2202 return put_user(ms->ch[j].value, (int *)arg); in usb_audio_ioctl_mixdev()
2210 ms->modcnt++; in usb_audio_ioctl_mixdev()
2215 return set_rec_src(ms, val); in usb_audio_ioctl_mixdev()
2221 for (j = 0; j < ms->numch && ms->ch[j].osschannel != i; j++); in usb_audio_ioctl_mixdev()
2222 if (j >= ms->numch) in usb_audio_ioctl_mixdev()
2226 if (wrmixer(ms, j, val)) in usb_audio_ioctl_mixdev()
2228 return put_user(ms->ch[j].value, (int *)arg); in usb_audio_ioctl_mixdev()
3787 struct usb_mixerdev *ms; in usb_audio_constructmixer() local
3805 …if (!(ms = kmalloc(sizeof(struct usb_mixerdev)+state.nrmixch*sizeof(struct mixerchannel), GFP_KERN… in usb_audio_constructmixer()
3807 memset(ms, 0, sizeof(struct usb_mixerdev)); in usb_audio_constructmixer()
3808 memcpy(&ms->ch, &state.mixch, state.nrmixch*sizeof(struct mixerchannel)); in usb_audio_constructmixer()
3809 ms->state = s; in usb_audio_constructmixer()
3810 ms->iface = ctrlif; in usb_audio_constructmixer()
3811 ms->numch = state.nrmixch; in usb_audio_constructmixer()
3812 if ((ms->dev_mixer = register_sound_mixer(&usb_mixer_fops, -1)) < 0) { in usb_audio_constructmixer()
3814 kfree(ms); in usb_audio_constructmixer()
3817 printk(KERN_INFO "usbaudio: registered mixer 14,%d\n", ms->dev_mixer); in usb_audio_constructmixer()
3818 list_add_tail(&ms->list, &s->mixerlist); in usb_audio_constructmixer()
3998 struct usb_mixerdev *ms; in usb_audio_disconnect() local
4027 ms = list_entry(list, struct usb_mixerdev, list); in usb_audio_disconnect()
4028 if (ms->dev_mixer >= 0) { in usb_audio_disconnect()
4029 unregister_sound_mixer(ms->dev_mixer); in usb_audio_disconnect()
4030 printk(KERN_INFO "usbaudio: unregister mixer 14,%d\n", ms->dev_mixer); in usb_audio_disconnect()
4032 ms->dev_mixer = -1; in usb_audio_disconnect()