The usb_device->dev is not the right device for dev_foo() calls.
Instead, it should use usb_interface->dev.
Tested-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
#define dprintk(fmt, arg...) do { \
if (debug) \
- dev_printk(KERN_DEBUG, &dev->udev->dev, \
+ dev_printk(KERN_DEBUG, &dev->intf->dev, \
"video: %s: " fmt, __func__, ## arg); \
} while (0)
status = usb_submit_urb(urb, GFP_ATOMIC);
if (status < 0)
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"resubmit of audio urb failed (error=%i)\n",
status);
return;
errCode = usb_submit_urb(dev->adev.urb[i], GFP_ATOMIC);
if (errCode) {
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"submit of audio urb failed (error=%i)\n",
errCode);
em28xx_deinit_isoc_audio(dev);
err:
mutex_unlock(&dev->lock);
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"Error while configuring em28xx mixer\n");
return ret;
}
intf = usb_ifnum_to_if(dev->udev, dev->ifnum);
if (intf->num_altsetting <= alt) {
- dev_err(&dev->udev->dev, "alt %d doesn't exist on interface %d\n",
+ dev_err(&dev->intf->dev, "alt %d doesn't exist on interface %d\n",
dev->ifnum, alt);
return -ENODEV;
}
}
if (!ep) {
- dev_err(&dev->udev->dev, "Couldn't find an audio endpoint");
+ dev_err(&dev->intf->dev, "Couldn't find an audio endpoint");
return -ENODEV;
}
ep_size = em28xx_audio_ep_packet_size(dev->udev, ep);
interval = 1 << (ep->bInterval - 1);
- dev_info(&dev->udev->dev,
+ dev_info(&dev->intf->dev,
"Endpoint 0x%02x %s on intf %d alt %d interval = %d, size %d\n",
EM28XX_EP_AUDIO, usb_speed_string(dev->udev->speed),
dev->ifnum, alt, interval, ep_size);
if (urb_size > ep_size * npackets)
npackets = DIV_ROUND_UP(urb_size, ep_size);
- dev_info(&dev->udev->dev,
+ dev_info(&dev->intf->dev,
"Number of URBs: %d, with %d packets and %d size\n",
num_urb, npackets, urb_size);
buf = usb_alloc_coherent(dev->udev, npackets * ep_size, GFP_ATOMIC,
&urb->transfer_dma);
if (!buf) {
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"usb_alloc_coherent failed!\n");
em28xx_audio_free_urb(dev);
return -ENOMEM;
return 0;
}
- dev_info(&dev->udev->dev, "Binding audio extension\n");
+ dev_info(&dev->intf->dev, "Binding audio extension\n");
kref_get(&dev->ref);
- dev_info(&dev->udev->dev,
+ dev_info(&dev->intf->dev,
"em28xx-audio.c: Copyright (C) 2006 Markus Rechberger\n");
- dev_info(&dev->udev->dev,
+ dev_info(&dev->intf->dev,
"em28xx-audio.c: Copyright (C) 2007-2016 Mauro Carvalho Chehab\n");
- err = snd_card_new(&dev->udev->dev, index[devnr], "Em28xx Audio",
+ err = snd_card_new(&dev->intf->dev, index[devnr], "Em28xx Audio",
THIS_MODULE, 0, &card);
if (err < 0)
return err;
if (err < 0)
goto urb_free;
- dev_info(&dev->udev->dev, "Audio extension successfully initialized\n");
+ dev_info(&dev->intf->dev, "Audio extension successfully initialized\n");
return 0;
urb_free:
return 0;
}
- dev_info(&dev->udev->dev, "Closing audio extension\n");
+ dev_info(&dev->intf->dev, "Closing audio extension\n");
if (dev->adev.sndcard) {
snd_card_disconnect(dev->adev.sndcard);
if (dev->usb_audio_type != EM28XX_USB_AUDIO_VENDOR)
return 0;
- dev_info(&dev->udev->dev, "Suspending audio extension\n");
+ dev_info(&dev->intf->dev, "Suspending audio extension\n");
em28xx_deinit_isoc_audio(dev);
atomic_set(&dev->adev.stream_started, 0);
return 0;
if (dev->usb_audio_type != EM28XX_USB_AUDIO_VENDOR)
return 0;
- dev_info(&dev->udev->dev, "Resuming audio extension\n");
+ dev_info(&dev->intf->dev, "Resuming audio extension\n");
/* Nothing to do other than schedule_work() ?? */
schedule_work(&dev->adev.wq_trigger);
return 0;
ret = i2c_master_send(&client, ®, 1);
if (ret < 0) {
if (ret != -ENXIO)
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"couldn't read from i2c device 0x%02x: error %i\n",
client.addr << 1, ret);
continue;
}
ret = i2c_master_recv(&client, (u8 *)&id_be, 2);
if (ret < 0) {
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"couldn't read from i2c device 0x%02x: error %i\n",
client.addr << 1, ret);
continue;
reg = 0xff;
ret = i2c_master_send(&client, ®, 1);
if (ret < 0) {
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"couldn't read from i2c device 0x%02x: error %i\n",
client.addr << 1, ret);
continue;
}
ret = i2c_master_recv(&client, (u8 *)&id_be, 2);
if (ret < 0) {
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"couldn't read from i2c device 0x%02x: error %i\n",
client.addr << 1, ret);
continue;
dev->em28xx_sensor = EM28XX_MT9M001;
break;
default:
- dev_info(&dev->udev->dev,
+ dev_info(&dev->intf->dev,
"unknown Micron sensor detected: 0x%04x\n", id);
return 0;
}
if (dev->em28xx_sensor == EM28XX_NOSENSOR)
- dev_info(&dev->udev->dev,
+ dev_info(&dev->intf->dev,
"unsupported sensor detected: %s\n", name);
else
- dev_info(&dev->udev->dev,
+ dev_info(&dev->intf->dev,
"sensor %s detected\n", name);
dev->i2c_client[dev->def_i2c_bus].addr = client.addr;
ret = i2c_smbus_read_byte_data(&client, reg);
if (ret < 0) {
if (ret != -ENXIO)
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"couldn't read from i2c device 0x%02x: error %i\n",
client.addr << 1, ret);
continue;
reg = 0x1d;
ret = i2c_smbus_read_byte_data(&client, reg);
if (ret < 0) {
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"couldn't read from i2c device 0x%02x: error %i\n",
client.addr << 1, ret);
continue;
reg = 0x0a;
ret = i2c_smbus_read_byte_data(&client, reg);
if (ret < 0) {
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"couldn't read from i2c device 0x%02x: error %i\n",
client.addr << 1, ret);
continue;
reg = 0x0b;
ret = i2c_smbus_read_byte_data(&client, reg);
if (ret < 0) {
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"couldn't read from i2c device 0x%02x: error %i\n",
client.addr << 1, ret);
continue;
name = "OV9655";
break;
default:
- dev_info(&dev->udev->dev,
+ dev_info(&dev->intf->dev,
"unknown OmniVision sensor detected: 0x%04x\n",
id);
return 0;
}
if (dev->em28xx_sensor == EM28XX_NOSENSOR)
- dev_info(&dev->udev->dev,
+ dev_info(&dev->intf->dev,
"unsupported sensor detected: %s\n", name);
else
- dev_info(&dev->udev->dev,
+ dev_info(&dev->intf->dev,
"sensor %s detected\n", name);
dev->i2c_client[dev->def_i2c_bus].addr = client.addr;
*/
if (dev->em28xx_sensor == EM28XX_NOSENSOR && ret < 0) {
- dev_info(&dev->udev->dev,
+ dev_info(&dev->intf->dev,
"No sensor detected\n");
return -ENODEV;
}
msleep(50);
}
- dev_warn(&dev->udev->dev, "AC97 registers access is not reliable !\n");
+ dev_warn(&dev->intf->dev, "AC97 registers access is not reliable !\n");
return -ETIMEDOUT;
}
dev->model = em28xx_eeprom_hash[i].model;
dev->tuner_type = em28xx_eeprom_hash[i].tuner;
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"Your board has no unique USB ID.\n"
"A hint were successfully done, based on eeprom hash.\n"
"This method is not 100%% failproof.\n"
if (dev->i2c_hash == em28xx_i2c_hash[i].hash) {
dev->model = em28xx_i2c_hash[i].model;
dev->tuner_type = em28xx_i2c_hash[i].tuner;
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"Your board has no unique USB ID.\n"
"A hint were successfully done, based on i2c devicelist hash.\n"
"This method is not 100%% failproof.\n"
}
}
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"Your board has no unique USB ID and thus need a hint to be detected.\n"
"You may try to use card=<n> insmod option to workaround that.\n"
"Please send an email with this log to:\n"
"Board i2c devicelist hash is 0x%08lx\n",
dev->hash, dev->i2c_hash);
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"Here is a list of valid choices for the card=<n> insmod option:\n");
for (i = 0; i < em28xx_bcount; i++) {
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
" card=%d -> %s\n", i, em28xx_boards[i].name);
}
return -1;
* hash identities which has not been determined as yet.
*/
if (em28xx_hint_board(dev) < 0)
- dev_err(&dev->udev->dev, "Board not discovered\n");
+ dev_err(&dev->intf->dev, "Board not discovered\n");
else {
em28xx_set_model(dev);
em28xx_pre_card_setup(dev);
em28xx_set_model(dev);
}
- dev_info(&dev->udev->dev, "Identified as %s (card=%d)\n",
+ dev_info(&dev->intf->dev, "Identified as %s (card=%d)\n",
dev->board.name, dev->model);
dev->tuner_type = em28xx_boards[dev->model].tuner_type;
}
if (dev->board.valid == EM28XX_BOARD_NOT_VALIDATED) {
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"\n\n"
"The support for this board weren't valid yet.\n"
"Please send a report of having this working\n"
else if (udev->manufacturer)
media_device_usb_init(mdev, udev, udev->manufacturer);
else
- media_device_usb_init(mdev, udev, dev_name(&dev->udev->dev));
+ media_device_usb_init(mdev, udev, dev_name(&dev->intf->dev));
dev->media_dev = mdev;
#endif
{
struct em28xx *dev = kref_to_dev(ref);
- dev_info(&dev->udev->dev, "Freeing device\n");
+ dev_info(&dev->intf->dev, "Freeing device\n");
if (!dev->disconnected)
em28xx_release_resources(dev);
const char *chip_name = NULL;
dev->udev = udev;
+ dev->intf = interface;
mutex_init(&dev->ctrl_urb_lock);
spin_lock_init(&dev->slock);
}
}
if (!chip_name)
- dev_info(&dev->udev->dev,
+ dev_info(&dev->intf->dev,
"unknown em28xx chip ID (%d)\n", dev->chip_id);
else
- dev_info(&dev->udev->dev, "chip ID is %s\n", chip_name);
+ dev_info(&dev->intf->dev, "chip ID is %s\n", chip_name);
em28xx_media_device_init(dev, udev);
/* Resets I2C speed */
retval = em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, dev->board.i2c_speed);
if (retval < 0) {
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"%s: em28xx_write_reg failed! retval [%d]\n",
__func__, retval);
return retval;
else
retval = em28xx_i2c_register(dev, 0, EM28XX_I2C_ALGO_EM28XX);
if (retval < 0) {
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"%s: em28xx_i2c_register bus 0 - error [%d]!\n",
__func__, retval);
return retval;
retval = em28xx_i2c_register(dev, 1,
EM28XX_I2C_ALGO_EM28XX);
if (retval < 0) {
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"%s: em28xx_i2c_register bus 1 - error [%d]!\n",
__func__, retval);
nr = find_first_zero_bit(em28xx_devused, EM28XX_MAXBOARDS);
if (nr >= EM28XX_MAXBOARDS) {
/* No free device slots */
- dev_err(&udev->dev,
+ dev_err(&interface->dev,
"Driver supports up to %i em28xx boards.\n",
EM28XX_MAXBOARDS);
retval = -ENOMEM;
/* Don't register audio interfaces */
if (interface->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) {
- dev_err(&udev->dev,
+ dev_err(&interface->dev,
"audio device (%04x:%04x): interface %i, class %i\n",
le16_to_cpu(udev->descriptor.idVendor),
le16_to_cpu(udev->descriptor.idProduct),
if (usb_endpoint_xfer_isoc(e)) {
has_vendor_audio = true;
} else {
- dev_err(&udev->dev,
+ dev_err(&interface->dev,
"error: skipping audio endpoint 0x83, because it uses bulk transfers !\n");
}
break;
speed = "unknown";
}
- dev_err(&udev->dev,
+ dev_err(&interface->dev,
"New device %s %s @ %s Mbps (%04x:%04x, interface %d, class %d)\n",
udev->manufacturer ? udev->manufacturer : "",
udev->product ? udev->product : "",
* not enough even for most Digital TV streams.
*/
if (udev->speed != USB_SPEED_HIGH && disable_usb_speed_check == 0) {
- dev_err(&udev->dev, "Device initialization failed.\n");
- dev_err(&udev->dev,
+ dev_err(&interface->dev, "Device initialization failed.\n");
+ dev_err(&interface->dev,
"Device must be connected to a high-speed USB 2.0 port.\n");
retval = -ENODEV;
goto err_free;
dev->ifnum = ifnum;
if (has_vendor_audio) {
- dev_err(&udev->dev,
+ dev_err(&interface->dev,
"Audio interface %i found (Vendor Class)\n", ifnum);
dev->usb_audio_type = EM28XX_USB_AUDIO_VENDOR;
}
if (uif->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) {
if (has_vendor_audio)
- dev_err(&udev->dev,
+ dev_err(&interface->dev,
"em28xx: device seems to have vendor AND usb audio class interfaces !\n"
"\t\tThe vendor interface will be ignored. Please contact the developers <linux-media@vger.kernel.org>\n");
dev->usb_audio_type = EM28XX_USB_AUDIO_CLASS;
}
if (has_video)
- dev_err(&udev->dev, "Video interface %i found:%s%s\n",
+ dev_err(&interface->dev, "Video interface %i found:%s%s\n",
ifnum,
dev->analog_ep_bulk ? " bulk" : "",
dev->analog_ep_isoc ? " isoc" : "");
if (has_dvb)
- dev_err(&udev->dev, "DVB interface %i found:%s%s\n",
+ dev_err(&interface->dev, "DVB interface %i found:%s%s\n",
ifnum,
dev->dvb_ep_bulk ? " bulk" : "",
dev->dvb_ep_isoc ? " isoc" : "");
/* Disable V4L2 if the device doesn't have a decoder */
if (has_video &&
dev->board.decoder == EM28XX_NODECODER && !dev->board.is_webcam) {
- dev_err(&udev->dev,
+ dev_err(&interface->dev,
"Currently, V4L2 is not supported on this model\n");
has_video = false;
dev->has_video = false;
if (has_video) {
if (!dev->analog_ep_isoc || (try_bulk && dev->analog_ep_bulk))
dev->analog_xfer_bulk = 1;
- dev_err(&udev->dev, "analog set to %s mode.\n",
+ dev_err(&interface->dev, "analog set to %s mode.\n",
dev->analog_xfer_bulk ? "bulk" : "isoc");
}
if (has_dvb) {
if (!dev->dvb_ep_isoc || (try_bulk && dev->dvb_ep_bulk))
dev->dvb_xfer_bulk = 1;
- dev_err(&udev->dev, "dvb set to %s mode.\n",
+ dev_err(&interface->dev, "dvb set to %s mode.\n",
dev->dvb_xfer_bulk ? "bulk" : "isoc");
}
dev->disconnected = 1;
- dev_err(&dev->udev->dev, "Disconnecting\n");
+ dev_err(&dev->intf->dev, "Disconnecting\n");
flush_request_modules(dev);
#define em28xx_coredbg(fmt, arg...) do { \
if (core_debug) \
- dev_printk(KERN_DEBUG, &dev->udev->dev, \
+ dev_printk(KERN_DEBUG, &dev->intf->dev, \
"core: %s: " fmt, __func__, ## arg); \
} while (0)
#define em28xx_regdbg(fmt, arg...) do { \
if (reg_debug) \
- dev_printk(KERN_DEBUG, &dev->udev->dev, \
+ dev_printk(KERN_DEBUG, &dev->intf->dev, \
"reg: %s: " fmt, __func__, ## arg); \
} while (0)
/* FIXME: don't abuse core_debug */
#define em28xx_isocdbg(fmt, arg...) do { \
if (core_debug) \
- dev_printk(KERN_DEBUG, &dev->udev->dev, \
+ dev_printk(KERN_DEBUG, &dev->intf->dev, \
"core: %s: " fmt, __func__, ## arg); \
} while (0)
msleep(5);
}
- dev_warn(&dev->udev->dev,
+ dev_warn(&dev->intf->dev,
"AC97 command still being executed: not handled properly!\n");
return -EBUSY;
}
ret = em28xx_write_ac97(dev, inputs[i].reg, 0x8000);
if (ret < 0)
- dev_warn(&dev->udev->dev,
+ dev_warn(&dev->intf->dev,
"couldn't setup AC97 register %d\n",
inputs[i].reg);
}
for (i = 0; i < ARRAY_SIZE(outputs); i++) {
ret = em28xx_write_ac97(dev, outputs[i].reg, 0x8000);
if (ret < 0)
- dev_warn(&dev->udev->dev,
+ dev_warn(&dev->intf->dev,
"couldn't setup AC97 register %d\n",
outputs[i].reg);
}
ret = em28xx_write_ac97(dev, outputs[i].reg,
vol);
if (ret < 0)
- dev_warn(&dev->udev->dev,
+ dev_warn(&dev->intf->dev,
"couldn't setup AC97 register %d\n",
outputs[i].reg);
}
/* See how this device is configured */
cfg = em28xx_read_reg(dev, EM28XX_R00_CHIPCFG);
- dev_info(&dev->udev->dev, "Config register raw data: 0x%02x\n", cfg);
+ dev_info(&dev->intf->dev, "Config register raw data: 0x%02x\n", cfg);
if (cfg < 0) { /* Register read error */
/* Be conservative */
dev->int_audio_type = EM28XX_INT_AUDIO_AC97;
i2s_samplerates = 5;
else
i2s_samplerates = 3;
- dev_info(&dev->udev->dev, "I2S Audio (%d sample rate(s))\n",
+ dev_info(&dev->intf->dev, "I2S Audio (%d sample rate(s))\n",
i2s_samplerates);
/* Skip the code that does AC97 vendor detection */
dev->audio_mode.ac97 = EM28XX_NO_AC97;
* Note: (some) em2800 devices without eeprom reports 0x91 on
* CHIPCFG register, even not having an AC97 chip
*/
- dev_warn(&dev->udev->dev,
+ dev_warn(&dev->intf->dev,
"AC97 chip type couldn't be determined\n");
dev->audio_mode.ac97 = EM28XX_NO_AC97;
if (dev->usb_audio_type == EM28XX_USB_AUDIO_VENDOR)
goto init_audio;
vid = vid1 << 16 | vid2;
- dev_warn(&dev->udev->dev, "AC97 vendor ID = 0x%08x\n", vid);
+ dev_warn(&dev->intf->dev, "AC97 vendor ID = 0x%08x\n", vid);
feat = em28xx_read_ac97(dev, AC97_RESET);
if (feat < 0)
goto init_audio;
- dev_warn(&dev->udev->dev, "AC97 features = 0x%04x\n", feat);
+ dev_warn(&dev->intf->dev, "AC97 features = 0x%04x\n", feat);
/* Try to identify what audio processor we have */
if (((vid == 0xffffffff) || (vid == 0x83847650)) && (feat == 0x6a90))
/* Reports detected AC97 processor */
switch (dev->audio_mode.ac97) {
case EM28XX_NO_AC97:
- dev_info(&dev->udev->dev, "No AC97 audio processor\n");
+ dev_info(&dev->intf->dev, "No AC97 audio processor\n");
break;
case EM28XX_AC97_EM202:
- dev_info(&dev->udev->dev,
+ dev_info(&dev->intf->dev,
"Empia 202 AC97 audio processor detected\n");
break;
case EM28XX_AC97_SIGMATEL:
- dev_info(&dev->udev->dev,
+ dev_info(&dev->intf->dev,
"Sigmatel audio processor detected (stac 97%02x)\n",
vid & 0xff);
break;
case EM28XX_AC97_OTHER:
- dev_warn(&dev->udev->dev,
+ dev_warn(&dev->intf->dev,
"Unknown AC97 audio processor detected!\n");
break;
default:
if (mode == EM28XX_DIGITAL_MODE) {
if ((xfer_bulk && !dev->dvb_ep_bulk) ||
(!xfer_bulk && !dev->dvb_ep_isoc)) {
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"no endpoint for DVB mode and transfer type %d\n",
xfer_bulk > 0);
return -EINVAL;
} else if (mode == EM28XX_ANALOG_MODE) {
if ((xfer_bulk && !dev->analog_ep_bulk) ||
(!xfer_bulk && !dev->analog_ep_isoc)) {
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"no endpoint for analog mode and transfer type %d\n",
xfer_bulk > 0);
return -EINVAL;
}
usb_bufs = &dev->usb_ctl.analog_bufs;
} else {
- dev_err(&dev->udev->dev, "invalid mode selected\n");
+ dev_err(&dev->intf->dev, "invalid mode selected\n");
return -EINVAL;
}
usb_bufs->transfer_buffer[i] = usb_alloc_coherent(dev->udev,
sb_size, GFP_KERNEL, &urb->transfer_dma);
if (!usb_bufs->transfer_buffer[i]) {
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"unable to allocate %i bytes for transfer buffer %i%s\n",
sb_size, i,
in_interrupt() ? " while in int" : "");
if (xfer_bulk) {
rc = usb_clear_halt(dev->udev, usb_bufs->urb[0]->pipe);
if (rc < 0) {
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"failed to clear USB bulk endpoint stall/halt condition (error=%i)\n",
rc);
em28xx_uninit_usb_xfer(dev, mode);
for (i = 0; i < usb_bufs->num_bufs; i++) {
rc = usb_submit_urb(usb_bufs->urb[i], GFP_ATOMIC);
if (rc) {
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"submit of urb %i failed (error=%i)\n", i, rc);
em28xx_uninit_usb_xfer(dev, mode);
return rc;
{
const struct em28xx_ops *ops = NULL;
- dev_info(&dev->udev->dev, "Suspending extensions\n");
+ dev_info(&dev->intf->dev, "Suspending extensions\n");
mutex_lock(&em28xx_devlist_mutex);
list_for_each_entry(ops, &em28xx_extension_devlist, next) {
if (ops->suspend)
{
const struct em28xx_ops *ops = NULL;
- dev_info(&dev->udev->dev, "Resuming extensions\n");
+ dev_info(&dev->intf->dev, "Resuming extensions\n");
mutex_lock(&em28xx_devlist_mutex);
list_for_each_entry(ops, &em28xx_extension_devlist, next) {
if (ops->resume)
#define dprintk(level, fmt, arg...) do { \
if (debug >= level) \
- dev_printk(KERN_DEBUG, &dev->udev->dev, \
+ dev_printk(KERN_DEBUG, &dev->intf->dev, \
"dvb: " fmt, ## arg); \
} while (0)
ret = gpio_request_one(dvb->lna_gpio, flags, NULL);
if (ret)
- dev_err(&dev->udev->dev, "gpio request failed %d\n", ret);
+ dev_err(&dev->intf->dev, "gpio request failed %d\n", ret);
else
gpio_free(dvb->lna_gpio);
return ret;
#else
- dev_warn(&dev->udev->dev, "%s: LNA control is disabled (lna=%u)\n",
+ dev_warn(&dev->intf->dev, "%s: LNA control is disabled (lna=%u)\n",
KBUILD_MODNAME, c->lna);
return 0;
#endif
cfg.ctrl = &ctl;
if (!dev->dvb->fe[0]) {
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"dvb frontend not attached. Can't attach xc3028\n");
return -EINVAL;
}
fe = dvb_attach(xc2028_attach, dev->dvb->fe[0], &cfg);
if (!fe) {
- dev_err(&dev->udev->dev, "xc3028 attach failed\n");
+ dev_err(&dev->intf->dev, "xc3028 attach failed\n");
dvb_frontend_detach(dev->dvb->fe[0]);
dev->dvb->fe[0] = NULL;
return -EINVAL;
}
- dev_info(&dev->udev->dev, "xc3028 attached\n");
+ dev_info(&dev->intf->dev, "xc3028 attached\n");
return 0;
}
/* register adapter */
result = dvb_register_adapter(&dvb->adapter,
- dev_name(&dev->udev->dev), module,
+ dev_name(&dev->intf->dev), module,
device, adapter_nr);
if (result < 0) {
- dev_warn(&dev->udev->dev,
+ dev_warn(&dev->intf->dev,
"dvb_register_adapter failed (errno = %d)\n",
result);
goto fail_adapter;
/* register frontend */
result = dvb_register_frontend(&dvb->adapter, dvb->fe[0]);
if (result < 0) {
- dev_warn(&dev->udev->dev,
+ dev_warn(&dev->intf->dev,
"dvb_register_frontend failed (errno = %d)\n",
result);
goto fail_frontend0;
if (dvb->fe[1]) {
result = dvb_register_frontend(&dvb->adapter, dvb->fe[1]);
if (result < 0) {
- dev_warn(&dev->udev->dev,
+ dev_warn(&dev->intf->dev,
"2nd dvb_register_frontend failed (errno = %d)\n",
result);
goto fail_frontend1;
result = dvb_dmx_init(&dvb->demux);
if (result < 0) {
- dev_warn(&dev->udev->dev,
+ dev_warn(&dev->intf->dev,
"dvb_dmx_init failed (errno = %d)\n",
result);
goto fail_dmx;
dvb->dmxdev.capabilities = 0;
result = dvb_dmxdev_init(&dvb->dmxdev, &dvb->adapter);
if (result < 0) {
- dev_warn(&dev->udev->dev,
+ dev_warn(&dev->intf->dev,
"dvb_dmxdev_init failed (errno = %d)\n",
result);
goto fail_dmxdev;
dvb->fe_hw.source = DMX_FRONTEND_0;
result = dvb->demux.dmx.add_frontend(&dvb->demux.dmx, &dvb->fe_hw);
if (result < 0) {
- dev_warn(&dev->udev->dev,
+ dev_warn(&dev->intf->dev,
"add_frontend failed (DMX_FRONTEND_0, errno = %d)\n",
result);
goto fail_fe_hw;
dvb->fe_mem.source = DMX_MEMORY_FE;
result = dvb->demux.dmx.add_frontend(&dvb->demux.dmx, &dvb->fe_mem);
if (result < 0) {
- dev_warn(&dev->udev->dev,
+ dev_warn(&dev->intf->dev,
"add_frontend failed (DMX_MEMORY_FE, errno = %d)\n",
result);
goto fail_fe_mem;
result = dvb->demux.dmx.connect_frontend(&dvb->demux.dmx, &dvb->fe_hw);
if (result < 0) {
- dev_warn(&dev->udev->dev,
+ dev_warn(&dev->intf->dev,
"connect_frontend failed (errno = %d)\n",
result);
goto fail_fe_conn;
return 0;
}
- dev_info(&dev->udev->dev, "Binding DVB extension\n");
+ dev_info(&dev->intf->dev, "Binding DVB extension\n");
dvb = kzalloc(sizeof(struct em28xx_dvb), GFP_KERNEL);
if (!dvb)
EM28XX_DVB_NUM_ISOC_PACKETS);
}
if (result) {
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"failed to pre-allocate USB transfer buffers for DVB.\n");
kfree(dvb);
dev->dvb = NULL;
case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2:
case EM2882_BOARD_PINNACLE_HYBRID_PRO_330E:
dvb->fe[0] = dvb_attach(drxd_attach, &em28xx_drxd, NULL,
- &dev->i2c_adap[dev->def_i2c_bus], &dev->udev->dev);
+ &dev->i2c_adap[dev->def_i2c_bus],
+ &dev->intf->dev);
if (em28xx_attach_xc3028(0x61, dev) < 0) {
result = -EINVAL;
goto out_free;
result = gpio_request_one(dvb->lna_gpio,
GPIOF_OUT_INIT_LOW, NULL);
if (result)
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"gpio request failed %d\n",
result);
else
}
break;
default:
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"The frontend of your DVB/ATSC card isn't supported yet\n");
break;
}
if (NULL == dvb->fe[0]) {
- dev_err(&dev->udev->dev, "frontend initialization failed\n");
+ dev_err(&dev->intf->dev, "frontend initialization failed\n");
result = -EINVAL;
goto out_free;
}
dvb->fe[1]->callback = em28xx_tuner_callback;
/* register everything */
- result = em28xx_register_dvb(dvb, THIS_MODULE, dev, &dev->udev->dev);
+ result = em28xx_register_dvb(dvb, THIS_MODULE, dev, &dev->intf->dev);
if (result < 0)
goto out_free;
- dev_info(&dev->udev->dev, "DVB extension successfully initialized\n");
+ dev_info(&dev->intf->dev, "DVB extension successfully initialized\n");
kref_get(&dev->ref);
if (!dev->dvb)
return 0;
- dev_info(&dev->udev->dev, "Closing DVB extension\n");
+ dev_info(&dev->intf->dev, "Closing DVB extension\n");
dvb = dev->dvb;
if (!dev->board.has_dvb)
return 0;
- dev_info(&dev->udev->dev, "Suspending DVB extension\n");
+ dev_info(&dev->intf->dev, "Suspending DVB extension\n");
if (dev->dvb) {
struct em28xx_dvb *dvb = dev->dvb;
if (dvb->fe[0]) {
ret = dvb_frontend_suspend(dvb->fe[0]);
- dev_info(&dev->udev->dev, "fe0 suspend %d\n", ret);
+ dev_info(&dev->intf->dev, "fe0 suspend %d\n", ret);
}
if (dvb->fe[1]) {
dvb_frontend_suspend(dvb->fe[1]);
- dev_info(&dev->udev->dev, "fe1 suspend %d\n", ret);
+ dev_info(&dev->intf->dev, "fe1 suspend %d\n", ret);
}
}
if (!dev->board.has_dvb)
return 0;
- dev_info(&dev->udev->dev, "Resuming DVB extension\n");
+ dev_info(&dev->intf->dev, "Resuming DVB extension\n");
if (dev->dvb) {
struct em28xx_dvb *dvb = dev->dvb;
if (dvb->fe[0]) {
ret = dvb_frontend_resume(dvb->fe[0]);
- dev_info(&dev->udev->dev, "fe0 resume %d\n", ret);
+ dev_info(&dev->intf->dev, "fe0 resume %d\n", ret);
}
if (dvb->fe[1]) {
ret = dvb_frontend_resume(dvb->fe[1]);
- dev_info(&dev->udev->dev, "fe1 resume %d\n", ret);
+ dev_info(&dev->intf->dev, "fe1 resume %d\n", ret);
}
}
#define dprintk(level, fmt, arg...) do { \
if (i2c_debug > level) \
- dev_printk(KERN_DEBUG, &dev->udev->dev, \
+ dev_printk(KERN_DEBUG, &dev->intf->dev, \
"i2c: %s: " fmt, __func__, ## arg); \
} while (0)
/* trigger write */
ret = dev->em28xx_write_regs(dev, 4 - len, &b2[4 - len], 2 + len);
if (ret != 2 + len) {
- dev_warn(&dev->udev->dev,
+ dev_warn(&dev->intf->dev,
"failed to trigger write to i2c address 0x%x (error=%i)\n",
addr, ret);
return (ret < 0) ? ret : -EIO;
return -ENXIO;
}
if (ret < 0) {
- dev_warn(&dev->udev->dev,
+ dev_warn(&dev->intf->dev,
"failed to get i2c transfer status from bridge register (error=%i)\n",
ret);
return ret;
buf2[0] = addr;
ret = dev->em28xx_write_regs(dev, 0x04, buf2, 2);
if (ret != 2) {
- dev_warn(&dev->udev->dev,
+ dev_warn(&dev->intf->dev,
"failed to trigger read from i2c address 0x%x (error=%i)\n",
addr, ret);
return (ret < 0) ? ret : -EIO;
return -ENXIO;
}
if (ret < 0) {
- dev_warn(&dev->udev->dev,
+ dev_warn(&dev->intf->dev,
"failed to get i2c transfer status from bridge register (error=%i)\n",
ret);
return ret;
/* get the received message */
ret = dev->em28xx_read_reg_req_len(dev, 0x00, 4-len, buf2, len);
if (ret != len) {
- dev_warn(&dev->udev->dev,
+ dev_warn(&dev->intf->dev,
"reading from i2c device at 0x%x failed: couldn't get the received message from the bridge (error=%i)\n",
addr, ret);
return (ret < 0) ? ret : -EIO;
ret = dev->em28xx_write_regs_req(dev, stop ? 2 : 3, addr, buf, len);
if (ret != len) {
if (ret < 0) {
- dev_warn(&dev->udev->dev,
+ dev_warn(&dev->intf->dev,
"writing to i2c device at 0x%x failed (error=%i)\n",
addr, ret);
return ret;
} else {
- dev_warn(&dev->udev->dev,
+ dev_warn(&dev->intf->dev,
"%i bytes write to i2c device at 0x%x requested, but %i bytes written\n",
len, addr, ret);
return -EIO;
return -ENXIO;
}
if (ret < 0) {
- dev_warn(&dev->udev->dev,
+ dev_warn(&dev->intf->dev,
"failed to get i2c transfer status from bridge register (error=%i)\n",
ret);
return ret;
return -ETIMEDOUT;
}
- dev_warn(&dev->udev->dev,
+ dev_warn(&dev->intf->dev,
"write to i2c device at 0x%x failed with unknown error (status=%i)\n",
addr, ret);
return -EIO;
/* Read data from i2c device */
ret = dev->em28xx_read_reg_req_len(dev, 2, addr, buf, len);
if (ret < 0) {
- dev_warn(&dev->udev->dev,
+ dev_warn(&dev->intf->dev,
"reading from i2c device at 0x%x failed (error=%i)\n",
addr, ret);
return ret;
if (ret == 0) /* success */
return len;
if (ret < 0) {
- dev_warn(&dev->udev->dev,
+ dev_warn(&dev->intf->dev,
"failed to get i2c transfer status from bridge register (error=%i)\n",
ret);
return ret;
return -ETIMEDOUT;
}
- dev_warn(&dev->udev->dev,
+ dev_warn(&dev->intf->dev,
"write to i2c device at 0x%x failed with unknown error (status=%i)\n",
addr, ret);
return -EIO;
ret = dev->em28xx_write_regs_req(dev, 0x06, addr, buf, len);
if (ret != len) {
if (ret < 0) {
- dev_warn(&dev->udev->dev,
+ dev_warn(&dev->intf->dev,
"writing to i2c device at 0x%x failed (error=%i)\n",
addr, ret);
return ret;
} else {
- dev_warn(&dev->udev->dev,
+ dev_warn(&dev->intf->dev,
"%i bytes write to i2c device at 0x%x requested, but %i bytes written\n",
len, addr, ret);
return -EIO;
/* Read value */
ret = dev->em28xx_read_reg_req_len(dev, 0x06, addr, buf, len);
if (ret < 0) {
- dev_warn(&dev->udev->dev,
+ dev_warn(&dev->intf->dev,
"reading from i2c device at 0x%x failed (error=%i)\n",
addr, ret);
return ret;
/* Check if board has eeprom */
err = i2c_master_recv(&dev->i2c_client[bus], &buf, 0);
if (err < 0) {
- dev_info(&dev->udev->dev, "board has no eeprom\n");
+ dev_info(&dev->intf->dev, "board has no eeprom\n");
return -ENODEV;
}
dev->eeprom_addrwidth_16bit,
len, data);
if (err != len) {
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"failed to read eeprom (err=%d)\n", err);
goto error;
}
16, 1, data, len, true);
if (dev->eeprom_addrwidth_16bit)
- dev_info(&dev->udev->dev,
+ dev_info(&dev->intf->dev,
"eeprom %06x: ... (skipped)\n", 256);
}
dev->hash = em28xx_hash_mem(data, len, 32);
mc_start = (data[1] << 8) + 4; /* usually 0x0004 */
- dev_info(&dev->udev->dev,
+ dev_info(&dev->intf->dev,
"EEPROM ID = %02x %02x %02x %02x, EEPROM hash = 0x%08lx\n",
data[0], data[1], data[2], data[3], dev->hash);
- dev_info(&dev->udev->dev,
+ dev_info(&dev->intf->dev,
"EEPROM info:\n");
- dev_info(&dev->udev->dev,
+ dev_info(&dev->intf->dev,
"\tmicrocode start address = 0x%04x, boot configuration = 0x%02x\n",
mc_start, data[2]);
/*
err = em28xx_i2c_read_block(dev, bus, mc_start + 46, 1, 2,
data);
if (err != 2) {
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"failed to read hardware configuration data from eeprom (err=%d)\n",
err);
goto error;
err = em28xx_i2c_read_block(dev, bus, hwconf_offset, 1, len,
data);
if (err != len) {
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"failed to read hardware configuration data from eeprom (err=%d)\n",
err);
goto error;
/* NOTE: not all devices provide this type of dataset */
if (data[0] != 0x1a || data[1] != 0xeb ||
data[2] != 0x67 || data[3] != 0x95) {
- dev_info(&dev->udev->dev,
+ dev_info(&dev->intf->dev,
"\tno hardware configuration dataset found in eeprom\n");
kfree(data);
return 0;
data[0] == 0x1a && data[1] == 0xeb &&
data[2] == 0x67 && data[3] == 0x95) {
dev->hash = em28xx_hash_mem(data, len, 32);
- dev_info(&dev->udev->dev,
+ dev_info(&dev->intf->dev,
"EEPROM ID = %02x %02x %02x %02x, EEPROM hash = 0x%08lx\n",
data[0], data[1], data[2], data[3], dev->hash);
- dev_info(&dev->udev->dev,
+ dev_info(&dev->intf->dev,
"EEPROM info:\n");
} else {
- dev_info(&dev->udev->dev,
+ dev_info(&dev->intf->dev,
"unknown eeprom format or eeprom corrupted !\n");
err = -ENODEV;
goto error;
switch (le16_to_cpu(dev_config->chip_conf) >> 4 & 0x3) {
case 0:
- dev_info(&dev->udev->dev, "\tNo audio on board.\n");
+ dev_info(&dev->intf->dev, "\tNo audio on board.\n");
break;
case 1:
- dev_info(&dev->udev->dev, "\tAC97 audio (5 sample rates)\n");
+ dev_info(&dev->intf->dev, "\tAC97 audio (5 sample rates)\n");
break;
case 2:
if (dev->chip_id < CHIP_ID_EM2860)
- dev_info(&dev->udev->dev,
+ dev_info(&dev->intf->dev,
"\tI2S audio, sample rate=32k\n");
else
- dev_info(&dev->udev->dev,
+ dev_info(&dev->intf->dev,
"\tI2S audio, 3 sample rates\n");
break;
case 3:
if (dev->chip_id < CHIP_ID_EM2860)
- dev_info(&dev->udev->dev,
+ dev_info(&dev->intf->dev,
"\tI2S audio, 3 sample rates\n");
else
- dev_info(&dev->udev->dev,
+ dev_info(&dev->intf->dev,
"\tI2S audio, 5 sample rates\n");
break;
}
if (le16_to_cpu(dev_config->chip_conf) & 1 << 3)
- dev_info(&dev->udev->dev, "\tUSB Remote wakeup capable\n");
+ dev_info(&dev->intf->dev, "\tUSB Remote wakeup capable\n");
if (le16_to_cpu(dev_config->chip_conf) & 1 << 2)
- dev_info(&dev->udev->dev, "\tUSB Self power capable\n");
+ dev_info(&dev->intf->dev, "\tUSB Self power capable\n");
switch (le16_to_cpu(dev_config->chip_conf) & 0x3) {
case 0:
- dev_info(&dev->udev->dev, "\t500mA max power\n");
+ dev_info(&dev->intf->dev, "\t500mA max power\n");
break;
case 1:
- dev_info(&dev->udev->dev, "\t400mA max power\n");
+ dev_info(&dev->intf->dev, "\t400mA max power\n");
break;
case 2:
- dev_info(&dev->udev->dev, "\t300mA max power\n");
+ dev_info(&dev->intf->dev, "\t300mA max power\n");
break;
case 3:
- dev_info(&dev->udev->dev, "\t200mA max power\n");
+ dev_info(&dev->intf->dev, "\t200mA max power\n");
break;
}
- dev_info(&dev->udev->dev,
+ dev_info(&dev->intf->dev,
"\tTable at offset 0x%02x, strings=0x%04x, 0x%04x, 0x%04x\n",
dev_config->string_idx_table,
le16_to_cpu(dev_config->string1),
if (rc < 0)
continue;
i2c_devicelist[i] = i;
- dev_info(&dev->udev->dev,
+ dev_info(&dev->intf->dev,
"found i2c device @ 0x%x on bus %d [%s]\n",
i << 1, bus, i2c_devs[i] ? i2c_devs[i] : "???");
}
return -ENODEV;
dev->i2c_adap[bus] = em28xx_adap_template;
- dev->i2c_adap[bus].dev.parent = &dev->udev->dev;
- strcpy(dev->i2c_adap[bus].name, dev_name(&dev->udev->dev));
+ dev->i2c_adap[bus].dev.parent = &dev->intf->dev;
+ strcpy(dev->i2c_adap[bus].name, dev_name(&dev->intf->dev));
dev->i2c_bus[bus].bus = bus;
dev->i2c_bus[bus].algo_type = algo_type;
retval = i2c_add_adapter(&dev->i2c_adap[bus]);
if (retval < 0) {
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"%s: i2c_add_adapter failed! retval [%d]\n",
__func__, retval);
return retval;
if (!bus) {
retval = em28xx_i2c_eeprom(dev, bus, &dev->eedata, &dev->eedata_len);
if ((retval < 0) && (retval != -ENODEV)) {
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"%s: em28xx_i2_eeprom failed! retval [%d]\n",
__func__, retval);
#define dprintk( fmt, arg...) do { \
if (ir_debug) \
- dev_printk(KERN_DEBUG, &ir->dev->udev->dev, \
+ dev_printk(KERN_DEBUG, &ir->dev->intf->dev, \
"input: %s: " fmt, __func__, ## arg); \
} while (0)
case CHIP_ID_EM28178:
return em2874_ir_change_protocol(rc_dev, rc_type);
default:
- dev_err(&ir->dev->udev->dev,
+ dev_err(&ir->dev->intf->dev,
"Unrecognized em28xx chip id 0x%02x: IR not supported\n",
dev->chip_id);
return -EINVAL;
struct input_dev *input_dev;
int err;
- dev_info(&dev->udev->dev, "Registering snapshot button...\n");
+ dev_info(&dev->intf->dev, "Registering snapshot button...\n");
input_dev = input_allocate_device();
if (!input_dev)
return -ENOMEM;
input_dev->id.vendor = le16_to_cpu(dev->udev->descriptor.idVendor);
input_dev->id.product = le16_to_cpu(dev->udev->descriptor.idProduct);
input_dev->id.version = 1;
- input_dev->dev.parent = &dev->udev->dev;
+ input_dev->dev.parent = &dev->intf->dev;
err = input_register_device(input_dev);
if (err) {
- dev_err(&dev->udev->dev, "input_register_device failed\n");
+ dev_err(&dev->intf->dev, "input_register_device failed\n");
input_free_device(input_dev);
return err;
}
} else if (button->role == EM28XX_BUTTON_ILLUMINATION) {
/* Check sanity */
if (!em28xx_find_led(dev, EM28XX_LED_ILLUMINATION)) {
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"BUG: illumination button defined, but no illumination LED.\n");
goto next_button;
}
dev->num_button_polling_addresses = 0;
/* Deregister input devices */
if (dev->sbutton_input_dev != NULL) {
- dev_info(&dev->udev->dev, "Deregistering snapshot button\n");
+ dev_info(&dev->intf->dev, "Deregistering snapshot button\n");
input_unregister_device(dev->sbutton_input_dev);
dev->sbutton_input_dev = NULL;
}
i2c_rc_dev_addr = em28xx_probe_i2c_ir(dev);
if (!i2c_rc_dev_addr) {
dev->board.has_ir_i2c = 0;
- dev_warn(&dev->udev->dev,
+ dev_warn(&dev->intf->dev,
"No i2c IR remote control device found.\n");
return -ENODEV;
}
if (dev->board.ir_codes == NULL && !dev->board.has_ir_i2c) {
/* No remote control support */
- dev_warn(&dev->udev->dev,
+ dev_warn(&dev->intf->dev,
"Remote control support is not available for this card.\n");
return 0;
}
- dev_info(&dev->udev->dev, "Registering input extension\n");
+ dev_info(&dev->intf->dev, "Registering input extension\n");
ir = kzalloc(sizeof(*ir), GFP_KERNEL);
if (!ir)
/* init input device */
snprintf(ir->name, sizeof(ir->name), "%s IR",
- dev_name(&dev->udev->dev));
+ dev_name(&dev->intf->dev));
usb_make_path(dev->udev, ir->phys, sizeof(ir->phys));
strlcat(ir->phys, "/input0", sizeof(ir->phys));
rc->input_id.version = 1;
rc->input_id.vendor = le16_to_cpu(dev->udev->descriptor.idVendor);
rc->input_id.product = le16_to_cpu(dev->udev->descriptor.idProduct);
- rc->dev.parent = &dev->udev->dev;
+ rc->dev.parent = &dev->intf->dev;
rc->driver_name = MODULE_NAME;
/* all done */
if (err)
goto error;
- dev_info(&dev->udev->dev, "Input extension successfully initalized\n");
+ dev_info(&dev->intf->dev, "Input extension successfully initalized\n");
return 0;
return 0;
}
- dev_info(&dev->udev->dev, "Closing input extension\n");
+ dev_info(&dev->intf->dev, "Closing input extension\n");
em28xx_shutdown_buttons(dev);
if (dev->is_audio_only)
return 0;
- dev_info(&dev->udev->dev, "Suspending input extension\n");
+ dev_info(&dev->intf->dev, "Suspending input extension\n");
if (ir)
cancel_delayed_work_sync(&ir->work);
cancel_delayed_work_sync(&dev->buttons_query_work);
if (dev->is_audio_only)
return 0;
- dev_info(&dev->udev->dev, "Resuming input extension\n");
+ dev_info(&dev->intf->dev, "Resuming input extension\n");
/* if suspend calls ir_raw_event_unregister(), the should call
ir_raw_event_register() */
if (ir)
size = v4l2->vbi_width * v4l2->vbi_height * 2;
if (vb2_plane_size(vb, 0) < size) {
- dev_info(&dev->udev->dev,
+ dev_info(&dev->intf->dev,
"%s data will not fit into plane (%lu < %lu)\n",
__func__, vb2_plane_size(vb, 0), size);
return -EINVAL;
#define em28xx_videodbg(fmt, arg...) do { \
if (video_debug) \
- dev_printk(KERN_DEBUG, &dev->udev->dev, \
+ dev_printk(KERN_DEBUG, &dev->intf->dev, \
"video: %s: " fmt, __func__, ## arg); \
} while (0)
#define em28xx_isocdbg(fmt, arg...) do {\
if (isoc_debug) \
- dev_printk(KERN_DEBUG, &dev->udev->dev, \
+ dev_printk(KERN_DEBUG, &dev->intf->dev, \
"isoc: %s: " fmt, __func__, ## arg); \
} while (0)
dev->alt, dev->max_pkt_size);
errCode = usb_set_interface(dev->udev, dev->ifnum, dev->alt);
if (errCode < 0) {
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"cannot change alternate number to %d (error=%i)\n",
dev->alt, errCode);
return errCode;
ret = media_entity_setup_link(link, flags);
if (ret) {
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"Couldn't change link %s->%s to %s. Error %d\n",
source->name, sink->name,
flags ? "enabled" : "disabled",
v4l2->video_pad.flags = MEDIA_PAD_FL_SINK;
ret = media_entity_pads_init(&v4l2->vdev.entity, 1, &v4l2->video_pad);
if (ret < 0)
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"failed to initialize video media entity!\n");
if (em28xx_vbi_supported(dev)) {
ret = media_entity_pads_init(&v4l2->vbi_dev.entity, 1,
&v4l2->vbi_pad);
if (ret < 0)
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"failed to initialize vbi media entity!\n");
}
ret = media_entity_pads_init(ent, 1, &dev->input_pad[i]);
if (ret < 0)
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"failed to initialize input pad[%d]!\n", i);
ret = media_device_register_entity(dev->media_dev, ent);
if (ret < 0)
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"failed to register input entity %d!\n", i);
}
#endif
ret = v4l2_fh_open(filp);
if (ret) {
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"%s: v4l2_fh_open() returned error %d\n",
__func__, ret);
mutex_unlock(&dev->lock);
if (v4l2 == NULL)
return 0;
- dev_info(&dev->udev->dev, "Closing video extension\n");
+ dev_info(&dev->intf->dev, "Closing video extension\n");
mutex_lock(&dev->lock);
em28xx_v4l2_media_release(dev);
if (video_is_registered(&v4l2->radio_dev)) {
- dev_info(&dev->udev->dev, "V4L2 device %s deregistered\n",
+ dev_info(&dev->intf->dev, "V4L2 device %s deregistered\n",
video_device_node_name(&v4l2->radio_dev));
video_unregister_device(&v4l2->radio_dev);
}
if (video_is_registered(&v4l2->vbi_dev)) {
- dev_info(&dev->udev->dev, "V4L2 device %s deregistered\n",
+ dev_info(&dev->intf->dev, "V4L2 device %s deregistered\n",
video_device_node_name(&v4l2->vbi_dev));
video_unregister_device(&v4l2->vbi_dev);
}
if (video_is_registered(&v4l2->vdev)) {
- dev_info(&dev->udev->dev, "V4L2 device %s deregistered\n",
+ dev_info(&dev->intf->dev, "V4L2 device %s deregistered\n",
video_device_node_name(&v4l2->vdev));
video_unregister_device(&v4l2->vdev);
}
if (!dev->has_video)
return 0;
- dev_info(&dev->udev->dev, "Suspending video extension\n");
+ dev_info(&dev->intf->dev, "Suspending video extension\n");
em28xx_stop_urbs(dev);
return 0;
}
if (!dev->has_video)
return 0;
- dev_info(&dev->udev->dev, "Resuming video extension\n");
+ dev_info(&dev->intf->dev, "Resuming video extension\n");
/* what do we do here */
return 0;
}
em28xx_videodbg("setting alternate 0\n");
errCode = usb_set_interface(dev->udev, 0, 0);
if (errCode < 0) {
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"cannot change alternate number to 0 (error=%i)\n",
errCode);
}
vfd->tvnorms = 0;
snprintf(vfd->name, sizeof(vfd->name), "%s %s",
- dev_name(&dev->udev->dev), type_name);
+ dev_name(&dev->intf->dev), type_name);
video_set_drvdata(vfd, dev);
}
return 0;
}
- dev_info(&dev->udev->dev, "Registering V4L2 extension\n");
+ dev_info(&dev->intf->dev, "Registering V4L2 extension\n");
mutex_lock(&dev->lock);
#ifdef CONFIG_MEDIA_CONTROLLER
v4l2->v4l2_dev.mdev = dev->media_dev;
#endif
- ret = v4l2_device_register(&dev->udev->dev, &v4l2->v4l2_dev);
+ ret = v4l2_device_register(&dev->intf->dev, &v4l2->v4l2_dev);
if (ret < 0) {
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"Call to v4l2_device_register() failed!\n");
goto err;
}
/* Configure audio */
ret = em28xx_audio_setup(dev);
if (ret < 0) {
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"%s: Error while setting audio - error [%d]!\n",
__func__, ret);
goto unregister_dev;
/* Send a reset to other chips via gpio */
ret = em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xf7);
if (ret < 0) {
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"%s: em28xx_write_reg - msp34xx(1) failed! error [%d]\n",
__func__, ret);
goto unregister_dev;
ret = em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xff);
if (ret < 0) {
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"%s: em28xx_write_reg - msp34xx(2) failed! error [%d]\n",
__func__, ret);
goto unregister_dev;
ret = video_register_device(&v4l2->vdev, VFL_TYPE_GRABBER,
video_nr[dev->devno]);
if (ret) {
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"unable to register video device (error=%i).\n", ret);
goto unregister_dev;
}
ret = video_register_device(&v4l2->vbi_dev, VFL_TYPE_VBI,
vbi_nr[dev->devno]);
if (ret < 0) {
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"unable to register vbi device\n");
goto unregister_dev;
}
ret = video_register_device(&v4l2->radio_dev, VFL_TYPE_RADIO,
radio_nr[dev->devno]);
if (ret < 0) {
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"can't register radio device\n");
goto unregister_dev;
}
- dev_info(&dev->udev->dev,
+ dev_info(&dev->intf->dev,
"Registered radio device as %s\n",
video_device_node_name(&v4l2->radio_dev));
}
#ifdef CONFIG_MEDIA_CONTROLLER
ret = v4l2_mc_create_media_graph(dev->media_dev);
if (ret) {
- dev_err(&dev->udev->dev,
+ dev_err(&dev->intf->dev,
"failed to create media graph\n");
em28xx_v4l2_media_release(dev);
goto unregister_dev;
}
#endif
- dev_info(&dev->udev->dev,
+ dev_info(&dev->intf->dev,
"V4L2 video device registered as %s\n",
video_device_node_name(&v4l2->vdev));
if (video_is_registered(&v4l2->vbi_dev))
- dev_info(&dev->udev->dev,
+ dev_info(&dev->intf->dev,
"V4L2 VBI device registered as %s\n",
video_device_node_name(&v4l2->vbi_dev));
/* initialize videobuf2 stuff */
em28xx_vb2_setup(dev);
- dev_info(&dev->udev->dev,
+ dev_info(&dev->intf->dev,
"V4L2 extension successfully initialized\n");
kref_get(&dev->ref);
unregister_dev:
if (video_is_registered(&v4l2->radio_dev)) {
- dev_info(&dev->udev->dev,
+ dev_info(&dev->intf->dev,
"V4L2 device %s deregistered\n",
video_device_node_name(&v4l2->radio_dev));
video_unregister_device(&v4l2->radio_dev);
}
if (video_is_registered(&v4l2->vbi_dev)) {
- dev_info(&dev->udev->dev,
+ dev_info(&dev->intf->dev,
"V4L2 device %s deregistered\n",
video_device_node_name(&v4l2->vbi_dev));
video_unregister_device(&v4l2->vbi_dev);
}
if (video_is_registered(&v4l2->vdev)) {
- dev_info(&dev->udev->dev,
+ dev_info(&dev->intf->dev,
"V4L2 device %s deregistered\n",
video_device_node_name(&v4l2->vdev));
video_unregister_device(&v4l2->vdev);
/* usb transfer */
struct usb_device *udev; /* the usb device */
+ struct usb_interface *intf; /* the usb interface */
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 */