Skip to content

Commit

Permalink
Merge branch 'master' of ssh://master.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/mchehab/v4l-dvb

* 'master' of ssh://master.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb:
  V4L/DVB (5880): wm8775/wm8739: Fix memory leak when unloading module
  V4L/DVB (5877): radio-gemtek-pci: remove unused structure member
  V4L/DVB (5871): Conexant 2388x: check for kthread_run
  V4L/DVB (5869): Add check for valid control ID to v4l2_ctrl_next.
  V4L/DVB (5867): videodev2.h: add missing <sys/time.h> for userspace
  V4L/DVB (5866): ivtv: fix DMA timeout when capturing VBI + another stream
  V4L/DVB (5865): Remove usage of HZ on ivtv driver, replacing by msecs_to_jiffies
  V4L/DVB (5861): Use msecs_to_jiffies instead of HZ on bttv, cx88 and saa7134
  V4L/DVB (5860): Use msecs_to_jiffies instead of HZ on some webcam drivers
  V4L/DVB (5859): use msecs_to_jiffies on InfraRed RC5 timeout
  V4L/DVB (5858): Use msecs_to_jiffies instead of HZ on media/video I2C drivers
  V4L/DVB (5857): Use msecs_to_jiffies instead of HZ on radio drivers
  V4L/DVB (5855): ivtv: fix Kconfig typo and refer to the driver homepage.
  V4L/DVB (5854): ivtv: cleanup of driver messages
  V4L/DVB (5853): ivtv: add support to suppress high volume i2c debug messages.
  V4L/DVB (5852): ivtv: don't recompile needlessly
  V4L/DVB (5851): ivtv: fix missing I2C_ALGOBIT config option
  V4L/DVB (5850): ivtv: improve API command debugging
  V4L/DVB (5848): Av7110: fix typo
  • Loading branch information
Linus Torvalds committed Jul 20, 2007
2 parents eaf729c + 1b2232a commit d6f410b
Show file tree
Hide file tree
Showing 31 changed files with 134 additions and 108 deletions.
4 changes: 2 additions & 2 deletions drivers/media/common/ir-functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,8 @@ void ir_rc5_timer_end(unsigned long data)
}

/* Set/reset key-up timer */
timeout = current_jiffies + (500 + ir->rc5_key_timeout
* HZ) / 1000;
timeout = current_jiffies +
msecs_to_jiffies(ir->rc5_key_timeout);
mod_timer(&ir->timer_keyup, timeout);

/* Save code for repeat test */
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/dvb/ttpci/av7110.c
Original file line number Diff line number Diff line change
Expand Up @@ -2267,7 +2267,7 @@ static int frontend_init(struct av7110 *av7110)
FE_FUNC_OVERRIDE(av7110->fe->ops.diseqc_send_master_cmd, av7110->fe_diseqc_send_master_cmd, av7110_fe_diseqc_send_master_cmd);
FE_FUNC_OVERRIDE(av7110->fe->ops.diseqc_send_burst, av7110->fe_diseqc_send_burst, av7110_fe_diseqc_send_burst);
FE_FUNC_OVERRIDE(av7110->fe->ops.set_tone, av7110->fe_set_tone, av7110_fe_set_tone);
FE_FUNC_OVERRIDE(av7110->fe->ops.set_voltage, av7110->fe_set_voltage, av7110_fe_set_voltage;)
FE_FUNC_OVERRIDE(av7110->fe->ops.set_voltage, av7110->fe_set_voltage, av7110_fe_set_voltage);
FE_FUNC_OVERRIDE(av7110->fe->ops.dishnetwork_send_legacy_command, av7110->fe_dishnetwork_send_legacy_command, av7110_fe_dishnetwork_send_legacy_command);
FE_FUNC_OVERRIDE(av7110->fe->ops.set_frontend, av7110->fe_set_frontend, av7110_fe_set_frontend);

Expand Down
2 changes: 1 addition & 1 deletion drivers/media/radio/radio-aimslab.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ struct rt_device
static void sleep_delay(long n)
{
/* Sleep nicely for 'n' uS */
int d=n/(1000000/HZ);
int d=n/msecs_to_jiffies(1000);
if(!d)
udelay(n);
else
Expand Down
4 changes: 2 additions & 2 deletions drivers/media/radio/radio-cadet.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ cadet_handler(unsigned long data)
init_timer(&readtimer);
readtimer.function=cadet_handler;
readtimer.data=(unsigned long)0;
readtimer.expires=jiffies+(HZ/20);
readtimer.expires=jiffies+msecs_to_jiffies(50);
add_timer(&readtimer);
}

Expand All @@ -349,7 +349,7 @@ cadet_read(struct file *file, char __user *data, size_t count, loff_t *ppos)
init_timer(&readtimer);
readtimer.function=cadet_handler;
readtimer.data=(unsigned long)0;
readtimer.expires=jiffies+(HZ/20);
readtimer.expires=jiffies+msecs_to_jiffies(50);
add_timer(&readtimer);
}
if(rdsin==rdsout) {
Expand Down
3 changes: 0 additions & 3 deletions drivers/media/radio/radio-gemtek-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ struct gemtek_pci_card {

u32 iobase;
u32 length;
u16 model;

u32 current_frequency;
u8 mute;
Expand Down Expand Up @@ -413,8 +412,6 @@ static int __devinit gemtek_pci_probe( struct pci_dev *pci_dev, const struct pci
goto err_pci;
}

pci_read_config_word( pci_dev, PCI_SUBSYSTEM_ID, &card->model );

pci_set_drvdata( pci_dev, card );

if ( (devradio = kmalloc( sizeof( struct video_device ), GFP_KERNEL )) == NULL ) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/video/bt866.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ static int bt866_write(struct bt866 *encoder,
printk(KERN_WARNING "%s: I/O error #%d "
"(write 0x%02x/0x%02x)\n",
encoder->i2c->name, err, encoder->addr, subaddr);
schedule_timeout_interruptible(HZ/10);
schedule_timeout_interruptible(msecs_to_jiffies(100));
}
if (err == 3) {
printk(KERN_WARNING "%s: giving up\n",
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/video/bt8xx/bttv-cards.c
Original file line number Diff line number Diff line change
Expand Up @@ -4209,7 +4209,7 @@ static int tea5757_read(struct bttv *btv)
bus_low(btv,btv->mbox_clk);

udelay(10);
timeout= jiffies + HZ;
timeout= jiffies + msecs_to_jiffies(1000);

/* wait for DATA line to go low; error if it doesn't */
while (bus_in(btv,btv->mbox_data) && time_before(jiffies, timeout))
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/video/bt8xx/bttv-input.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ static void bttv_ir_start(struct bttv *btv, struct card_ir *ir)
{
if (ir->polling) {
setup_timer(&ir->timer, bttv_input_timer, (unsigned long)btv);
ir->timer.expires = jiffies + HZ;
ir->timer.expires = jiffies + msecs_to_jiffies(1000);
add_timer(&ir->timer);
} else if (ir->rc5_gpio) {
/* set timer_end for code completion */
Expand Down
4 changes: 2 additions & 2 deletions drivers/media/video/bt8xx/bttvp.h
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,8 @@ extern int fini_bttv_i2c(struct bttv *btv);
#define d2printk if (bttv_debug >= 2) printk

#define BTTV_MAX_FBUF 0x208000
#define BTTV_TIMEOUT (HZ/2) /* 0.5 seconds */
#define BTTV_FREE_IDLE (HZ) /* one second */
#define BTTV_TIMEOUT msecs_to_jiffies(500) /* 0.5 seconds */
#define BTTV_FREE_IDLE msecs_to_jiffies(1000) /* one second */


struct bttv_pll_info {
Expand Down
4 changes: 2 additions & 2 deletions drivers/media/video/c-qcam.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ static unsigned int qcam_await_ready1(struct qcam_device *qcam,
unsigned long oldjiffies = jiffies;
unsigned int i;

for (oldjiffies = jiffies; (jiffies - oldjiffies) < (HZ/25); )
for (oldjiffies = jiffies; (jiffies - oldjiffies) < msecs_to_jiffies(40); )
if (qcam_ready1(qcam) == value)
return 0;

Expand All @@ -120,7 +120,7 @@ static unsigned int qcam_await_ready2(struct qcam_device *qcam, int value)
unsigned long oldjiffies = jiffies;
unsigned int i;

for (oldjiffies = jiffies; (jiffies - oldjiffies) < (HZ/25); )
for (oldjiffies = jiffies; (jiffies - oldjiffies) < msecs_to_jiffies(40); )
if (qcam_ready2(qcam) == value)
return 0;

Expand Down
8 changes: 7 additions & 1 deletion drivers/media/video/cx88/cx88-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1881,8 +1881,14 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
mutex_unlock(&core->lock);

/* start tvaudio thread */
if (core->tuner_type != TUNER_ABSENT)
if (core->tuner_type != TUNER_ABSENT) {
core->kthread = kthread_run(cx88_audio_thread, core, "cx88 tvaudio");
if (IS_ERR(core->kthread)) {
err = PTR_ERR(core->kthread);
printk(KERN_ERR "Failed to create cx88 audio thread, err=%d\n",
err);
}
}
return 0;

fail_unreg:
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/video/cx88/cx88.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ struct cx88_subid {
#define RESOURCE_VIDEO 2
#define RESOURCE_VBI 4

#define BUFFER_TIMEOUT (HZ/2) /* 0.5 seconds */
#define BUFFER_TIMEOUT msecs_to_jiffies(500) /* 0.5 seconds */

/* buffer for one video frame */
struct cx88_buffer {
Expand Down
5 changes: 3 additions & 2 deletions drivers/media/video/ivtv/Kconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
config VIDEO_IVTV
tristate "Conexant cx23416/cx23415 MPEG encoder/decoder support"
depends on VIDEO_V4L1 && VIDEO_V4L2 && PCI && I2C && EXPERIMENTAL
select I2C_ALGOBIT
select FW_LOADER
select VIDEO_TUNER
select VIDEO_TVEEPROM
Expand All @@ -16,11 +17,11 @@ config VIDEO_IVTV
select VIDEO_UPD64031A
select VIDEO_UPD64083
---help---
This is a video4linux driver for Conexant cx23416 or cx23416 based
This is a video4linux driver for Conexant cx23416 or cx23415 based
PCI personal video recorder devices.

This is used in devices such as the Hauppauge PVR-150/250/350/500
cards.
cards. There is a driver homepage at <http://www.ivtvdriver.org>.

To compile this driver as a module, choose M here: the
module will be called ivtv.
43 changes: 20 additions & 23 deletions drivers/media/video/ivtv/ivtv-driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
#include "ivtv-gpio.h"
#include "ivtv-yuv.h"

#include <linux/vermagic.h>
#include <media/tveeprom.h>
#include <media/v4l2-chip-ident.h>

Expand Down Expand Up @@ -276,9 +275,10 @@ int ivtv_waitq(wait_queue_head_t *waitq)
}

/* Generic utility functions */
int ivtv_sleep_timeout(int timeout, int intr)
int ivtv_msleep_timeout(unsigned int msecs, int intr)
{
int ret;
int timeout = msecs_to_jiffies(msecs);

do {
set_current_state(intr ? TASK_INTERRUPTIBLE : TASK_UNINTERRUPTIBLE);
Expand Down Expand Up @@ -427,7 +427,7 @@ static void ivtv_process_eeprom(struct ivtv *itv)
if (itv->options.newi2c == -1 && tv.has_ir != -1 && tv.has_ir != 2) {
itv->options.newi2c = (tv.has_ir & 2) ? 1 : 0;
if (itv->options.newi2c) {
IVTV_INFO("reopen i2c bus for IR-blaster support\n");
IVTV_INFO("Reopen i2c bus for IR-blaster support\n");
exit_ivtv_i2c(itv);
init_ivtv_i2c(itv);
}
Expand Down Expand Up @@ -951,7 +951,7 @@ static int __devinit ivtv_probe(struct pci_dev *dev,

/* Make sure we've got a place for this card */
if (ivtv_cards_active == IVTV_MAX_CARDS) {
printk(KERN_ERR "ivtv: Maximum number of cards detected (%d).\n",
printk(KERN_ERR "ivtv: Maximum number of cards detected (%d)\n",
ivtv_cards_active);
spin_unlock(&ivtv_cards_lock);
return -ENOMEM;
Expand All @@ -966,9 +966,7 @@ static int __devinit ivtv_probe(struct pci_dev *dev,
itv->dev = dev;
itv->num = ivtv_cards_active++;
snprintf(itv->name, sizeof(itv->name) - 1, "ivtv%d", itv->num);
if (itv->num) {
printk(KERN_INFO "ivtv: ====================== NEXT CARD ======================\n");
}
IVTV_INFO("Initializing card #%d\n", itv->num);

spin_unlock(&ivtv_cards_lock);

Expand Down Expand Up @@ -1215,7 +1213,7 @@ static int __devinit ivtv_probe(struct pci_dev *dev,
if (itv->has_cx23415)
ivtv_set_osd_alpha(itv);

IVTV_INFO("Initialized %s, card #%d\n", itv->card_name, itv->num);
IVTV_INFO("Initialized card #%d: %s\n", itv->num, itv->card_name);

return 0;

Expand Down Expand Up @@ -1248,15 +1246,15 @@ static void ivtv_remove(struct pci_dev *pci_dev)
{
struct ivtv *itv = pci_get_drvdata(pci_dev);

IVTV_DEBUG_INFO("Removing Card #%d.\n", itv->num);
IVTV_DEBUG_INFO("Removing Card #%d\n", itv->num);

/* Stop all captures */
IVTV_DEBUG_INFO(" Stopping all streams.\n");
IVTV_DEBUG_INFO("Stopping all streams\n");
if (atomic_read(&itv->capturing) > 0)
ivtv_stop_all_captures(itv);

/* Stop all decoding */
IVTV_DEBUG_INFO(" Stopping decoding.\n");
IVTV_DEBUG_INFO("Stopping decoding\n");
if (atomic_read(&itv->decoding) > 0) {
int type;

Expand All @@ -1269,30 +1267,30 @@ static void ivtv_remove(struct pci_dev *pci_dev)
}

/* Interrupts */
IVTV_DEBUG_INFO(" Disabling interrupts.\n");
IVTV_DEBUG_INFO("Disabling interrupts\n");
ivtv_set_irq_mask(itv, 0xffffffff);
del_timer_sync(&itv->dma_timer);

/* Stop all Work Queues */
IVTV_DEBUG_INFO(" Stop Work Queues.\n");
IVTV_DEBUG_INFO("Stop Work Queues\n");
flush_workqueue(itv->irq_work_queues);
destroy_workqueue(itv->irq_work_queues);

IVTV_DEBUG_INFO(" Stopping Firmware.\n");
IVTV_DEBUG_INFO("Stopping Firmware\n");
ivtv_halt_firmware(itv);

IVTV_DEBUG_INFO(" Unregistering v4l devices.\n");
IVTV_DEBUG_INFO("Unregistering v4l devices\n");
ivtv_streams_cleanup(itv);
IVTV_DEBUG_INFO(" Freeing dma resources.\n");
IVTV_DEBUG_INFO("Freeing dma resources\n");
ivtv_udma_free(itv);

exit_ivtv_i2c(itv);

IVTV_DEBUG_INFO(" Releasing irq.\n");
IVTV_DEBUG_INFO(" Releasing irq\n");
free_irq(itv->dev->irq, (void *)itv);
ivtv_iounmap(itv);

IVTV_DEBUG_INFO(" Releasing mem.\n");
IVTV_DEBUG_INFO(" Releasing mem\n");
release_mem_region(itv->base_addr, IVTV_ENCODER_SIZE);
release_mem_region(itv->base_addr + IVTV_REG_OFFSET, IVTV_REG_SIZE);
if (itv->has_cx23415)
Expand All @@ -1313,28 +1311,27 @@ static struct pci_driver ivtv_pci_driver = {

static int module_start(void)
{
printk(KERN_INFO "ivtv: ==================== START INIT IVTV ====================\n");
printk(KERN_INFO "ivtv: version %s (" VERMAGIC_STRING ") loading\n", IVTV_VERSION);
printk(KERN_INFO "ivtv: Start initialization, version %s\n", IVTV_VERSION);

memset(ivtv_cards, 0, sizeof(ivtv_cards));

/* Validate parameters */
if (ivtv_first_minor < 0 || ivtv_first_minor >= IVTV_MAX_CARDS) {
printk(KERN_ERR "ivtv: ivtv_first_minor must be between 0 and %d. Exiting...\n",
printk(KERN_ERR "ivtv: Exiting, ivtv_first_minor must be between 0 and %d\n",
IVTV_MAX_CARDS - 1);
return -1;
}

if (ivtv_debug < 0 || ivtv_debug > 1023) {
ivtv_debug = 0;
printk(KERN_INFO "ivtv: debug value must be >= 0 and <= 1023!\n");
printk(KERN_INFO "ivtv: Debug value must be >= 0 and <= 1023\n");
}

if (pci_register_driver(&ivtv_pci_driver)) {
printk(KERN_ERR "ivtv: Error detecting PCI card\n");
return -ENODEV;
}
printk(KERN_INFO "ivtv: ==================== END INIT IVTV ====================\n");
printk(KERN_INFO "ivtv: End initialization\n");
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/media/video/ivtv/ivtv-driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@ int ivtv_set_output_mode(struct ivtv *itv, int mode);
struct ivtv_stream *ivtv_get_output_stream(struct ivtv *itv);

/* Return non-zero if a signal is pending */
int ivtv_sleep_timeout(int timeout, int intr);
int ivtv_msleep_timeout(unsigned int msecs, int intr);

/* Wait on queue, returns -EINTR if interrupted */
int ivtv_waitq(wait_queue_head_t *waitq);
Expand Down
6 changes: 3 additions & 3 deletions drivers/media/video/ivtv/ivtv-fileops.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ static struct ivtv_buffer *ivtv_get_buffer(struct ivtv_stream *s, int non_block,
/* Process pending program info updates and pending VBI data */
ivtv_update_pgm_info(itv);

if (jiffies - itv->dualwatch_jiffies > HZ) {
if (jiffies - itv->dualwatch_jiffies > msecs_to_jiffies(1000)) {
itv->dualwatch_jiffies = jiffies;
ivtv_dualwatch(itv);
}
Expand Down Expand Up @@ -832,7 +832,7 @@ int ivtv_v4l2_open(struct inode *inode, struct file *filp)
if (itv == NULL) {
/* Couldn't find a device registered
on that minor, shouldn't happen! */
printk(KERN_WARNING "ivtv: no ivtv device found on minor %d\n", minor);
printk(KERN_WARNING "ivtv: No ivtv device found on minor %d\n", minor);
return -ENXIO;
}

Expand Down Expand Up @@ -924,7 +924,7 @@ void ivtv_unmute(struct ivtv *itv)
if (atomic_read(&itv->capturing) == 0)
ivtv_vapi(itv, CX2341X_ENC_INITIALIZE_INPUT, 0);

ivtv_sleep_timeout(HZ / 10, 0);
ivtv_msleep_timeout(100, 0);

if (atomic_read(&itv->capturing)) {
ivtv_vapi(itv, CX2341X_ENC_MISC, 1, 12);
Expand Down
Loading

0 comments on commit d6f410b

Please sign in to comment.