dprintk("opening device and trying to acquire exclusive lock\n");
runtime->hw = snd_em28xx_hw_capture;
- if ((dev->alt == 0 || dev->audio_ifnum) && dev->adev.users == 0) {
+ if ((dev->alt == 0 || dev->ifnum) && dev->adev.users == 0) {
int nonblock = !!(substream->f_flags & O_NONBLOCK);
if (nonblock) {
return -EAGAIN;
} else
mutex_lock(&dev->lock);
- if (dev->audio_ifnum)
+ if (dev->ifnum)
dev->alt = 1;
else
dev->alt = 7;
dprintk("changing alternate number on interface %d to %d\n",
- dev->audio_ifnum, dev->alt);
- usb_set_interface(dev->udev, dev->audio_ifnum, dev->alt);
+ dev->ifnum, dev->alt);
+ usb_set_interface(dev->udev, dev->ifnum, dev->alt);
/* Sets volume, mute, etc */
dev->mute = 0;
int urb_size, bytes_per_transfer;
u8 alt;
- if (dev->audio_ifnum)
+ if (dev->ifnum)
alt = 1;
else
alt = 7;
- intf = usb_ifnum_to_if(dev->udev, dev->audio_ifnum);
+ intf = usb_ifnum_to_if(dev->udev, dev->ifnum);
if (intf->num_altsetting <= alt) {
em28xx_errdev("alt %d doesn't exist on interface %d\n",
- dev->audio_ifnum, alt);
+ dev->ifnum, alt);
return -ENODEV;
}
em28xx_info("Endpoint 0x%02x %s on intf %d alt %d interval = %d, size %d\n",
EM28XX_EP_AUDIO, usb_speed_string(dev->udev->speed),
- dev->audio_ifnum, alt,
+ dev->ifnum, alt,
interval,
ep_size);
static int devnr;
int err;
- if (!dev->has_alsa_audio || dev->audio_ifnum < 0) {
+ if (!dev->has_alsa_audio) {
/* This device does not support the extension (in this case
the device is expecting the snd-usb-audio module or
doesn't have analog audio support at all) */
}
em28xx_videodbg("setting alternate %d with wMaxPacketSize=%u\n",
dev->alt, dev->max_pkt_size);
- errCode = usb_set_interface(dev->udev, 0, dev->alt);
+ errCode = usb_set_interface(dev->udev, dev->ifnum, dev->alt);
if (errCode < 0) {
em28xx_errdev("cannot change alternate number to %d (error=%i)\n",
dev->alt, errCode);
unsigned int has_alsa_audio:1;
unsigned int is_audio_only:1;
- int audio_ifnum;
-
struct v4l2_device v4l2_dev;
struct v4l2_ctrl_handler ctrl_handler;
struct v4l2_clk *clk;
/* usb transfer */
struct usb_device *udev; /* the usb device */
+ u8 ifnum; /* number of the assigned usb interface */
u8 analog_ep_isoc; /* address of isoc endpoint for analog */
u8 analog_ep_bulk; /* address of bulk endpoint for analog */
u8 dvb_ep_isoc; /* address of isoc endpoint for DVB */