Skip to content

Commit

Permalink
Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/ke…
Browse files Browse the repository at this point in the history
…rnel/git/mchehab/linux-2.6

* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6:
  [media] soc_camera: preserve const attribute
  [media] uvc_entity: initialize return value
  [media] media: Fix media device minor registration
  [media] Make nchg variable signed because the code compares this variable against negative values
  [media] omap3isp: fix compiler warning
  [media] v4l: Fix media_entity_to_video_device macro argument name
  [media] ivtv: Internally separate encoder & decoder standard setting
  [media] ivtvfb: Add sanity check to ivtvfb_pan_display()
  [media] ivtvfb: use display information in info not in var for panning
  [media] ivtv: Make two ivtv_msleep_timeout calls uninterruptable
  [media] anysee: return EOPNOTSUPP for unsupported I2C messages
  [media] gspca - ov519: Set the default frame rate to 15 fps
  [media] gspca - stv06xx: Set a lower default value of gain for hdcs sensors
  [media] gspca: Remove coarse_expo_autogain.h
  [media] gspca - ov519: Change the ovfx2 bulk transfer size
  [media] gspca - ov519: Fix a regression for ovfx2 webcams
  • Loading branch information
Linus Torvalds committed Jun 8, 2011
2 parents 18367c0 + d364ee4 commit 46671b0
Show file tree
Hide file tree
Showing 17 changed files with 131 additions and 220 deletions.
17 changes: 11 additions & 6 deletions drivers/media/dvb/dvb-usb/anysee.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ static int anysee_ctrl_msg(struct dvb_usb_device *d, u8 *sbuf, u8 slen,
int act_len, ret;
u8 buf[64];

if (slen > sizeof(buf))
slen = sizeof(buf);
memcpy(&buf[0], sbuf, slen);
buf[60] = state->seq++;

Expand Down Expand Up @@ -180,30 +178,37 @@ static int anysee_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msg,
{
struct dvb_usb_device *d = i2c_get_adapdata(adap);
int ret = 0, inc, i = 0;
u8 buf[52]; /* 4 + 48 (I2C WR USB command header + I2C WR max) */

if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
return -EAGAIN;

while (i < num) {
if (num > i + 1 && (msg[i+1].flags & I2C_M_RD)) {
u8 buf[6];
if (msg[i].len > 2 || msg[i+1].len > 60) {
ret = -EOPNOTSUPP;
break;
}
buf[0] = CMD_I2C_READ;
buf[1] = (msg[i].addr << 1) | 0x01;
buf[2] = msg[i].buf[0];
buf[3] = msg[i].buf[1];
buf[4] = msg[i].len-1;
buf[5] = msg[i+1].len;
ret = anysee_ctrl_msg(d, buf, sizeof(buf), msg[i+1].buf,
ret = anysee_ctrl_msg(d, buf, 6, msg[i+1].buf,
msg[i+1].len);
inc = 2;
} else {
u8 buf[4+msg[i].len];
if (msg[i].len > 48) {
ret = -EOPNOTSUPP;
break;
}
buf[0] = CMD_I2C_WRITE;
buf[1] = (msg[i].addr << 1);
buf[2] = msg[i].len;
buf[3] = 0x01;
memcpy(&buf[4], msg[i].buf, msg[i].len);
ret = anysee_ctrl_msg(d, buf, sizeof(buf), NULL, 0);
ret = anysee_ctrl_msg(d, buf, 4 + msg[i].len, NULL, 0);
inc = 1;
}
if (ret)
Expand Down
4 changes: 2 additions & 2 deletions drivers/media/media-devnode.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,14 +213,14 @@ int __must_check media_devnode_register(struct media_devnode *mdev)

/* Part 1: Find a free minor number */
mutex_lock(&media_devnode_lock);
minor = find_next_zero_bit(media_devnode_nums, 0, MEDIA_NUM_DEVICES);
minor = find_next_zero_bit(media_devnode_nums, MEDIA_NUM_DEVICES, 0);
if (minor == MEDIA_NUM_DEVICES) {
mutex_unlock(&media_devnode_lock);
printk(KERN_ERR "could not get a free minor\n");
return -ENFILE;
}

set_bit(mdev->minor, media_devnode_nums);
set_bit(minor, media_devnode_nums);
mutex_unlock(&media_devnode_lock);

mdev->minor = minor;
Expand Down
116 changes: 0 additions & 116 deletions drivers/media/video/gspca/coarse_expo_autogain.h

This file was deleted.

8 changes: 4 additions & 4 deletions drivers/media/video/gspca/ov519.c
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ static const struct v4l2_pix_format ovfx2_ov3610_mode[] = {
* buffers, there are some pretty strict real time constraints for
* isochronous transfer for larger frame sizes).
*/
/*jfm: this value works well for 1600x1200, but not 800x600 - see isoc_init */
/*jfm: this value does not work for 800x600 - see isoc_init */
#define OVFX2_BULK_SIZE (13 * 4096)

/* I2C registers */
Expand Down Expand Up @@ -3307,6 +3307,7 @@ static int sd_config(struct gspca_dev *gspca_dev,

gspca_dev->cam.ctrls = sd->ctrls;
sd->quality = QUALITY_DEF;
sd->frame_rate = 15;

return 0;
}
Expand Down Expand Up @@ -3469,7 +3470,6 @@ static int sd_init(struct gspca_dev *gspca_dev)
ARRAY_SIZE(init_519_ov7660));
write_i2c_regvals(sd, norm_7660, ARRAY_SIZE(norm_7660));
sd->gspca_dev.curr_mode = 1; /* 640x480 */
sd->frame_rate = 15;
ov519_set_mode(sd);
ov519_set_fr(sd);
sd->ctrls[COLORS].max = 4; /* 0..4 */
Expand Down Expand Up @@ -3511,7 +3511,7 @@ static int sd_isoc_init(struct gspca_dev *gspca_dev)

switch (sd->bridge) {
case BRIDGE_OVFX2:
if (gspca_dev->width == 1600)
if (gspca_dev->width != 800)
gspca_dev->cam.bulk_size = OVFX2_BULK_SIZE;
else
gspca_dev->cam.bulk_size = 7 * 4096;
Expand Down Expand Up @@ -4478,7 +4478,7 @@ static void ovfx2_pkt_scan(struct gspca_dev *gspca_dev,
gspca_frame_add(gspca_dev, INTER_PACKET, data, len);

/* A short read signals EOF */
if (len < OVFX2_BULK_SIZE) {
if (len < gspca_dev->cam.bulk_size) {
/* If the frame is short, and it is one of the first ones
the sensor and bridge are still syncing, so drop it. */
if (sd->first_frame) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/video/gspca/sonixj.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ struct sd {

u32 pktsz; /* (used by pkt_scan) */
u16 npkt;
u8 nchg;
s8 nchg;
s8 short_mark;

u8 quality; /* image quality */
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/video/gspca/stv06xx/stv06xx_hdcs.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
#define HDCS_SLEEP_MODE (1 << 1)

#define HDCS_DEFAULT_EXPOSURE 48
#define HDCS_DEFAULT_GAIN 128
#define HDCS_DEFAULT_GAIN 50

static int hdcs_probe_1x00(struct sd *sd);
static int hdcs_probe_1020(struct sd *sd);
Expand Down
10 changes: 5 additions & 5 deletions drivers/media/video/ivtv/ivtv-driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -1328,6 +1328,8 @@ int ivtv_init_on_first_open(struct ivtv *itv)
if (!itv->has_cx23415)
write_reg_sync(0x03, IVTV_REG_DMACONTROL);

ivtv_s_std_enc(itv, &itv->tuner_std);

/* Default interrupts enabled. For the PVR350 this includes the
decoder VSYNC interrupt, which is always on. It is not only used
during decoding but also by the OSD.
Expand All @@ -1336,12 +1338,10 @@ int ivtv_init_on_first_open(struct ivtv *itv)
if (itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT) {
ivtv_clear_irq_mask(itv, IVTV_IRQ_MASK_INIT | IVTV_IRQ_DEC_VSYNC);
ivtv_set_osd_alpha(itv);
}
else
ivtv_s_std_dec(itv, &itv->tuner_std);
} else {
ivtv_clear_irq_mask(itv, IVTV_IRQ_MASK_INIT);

/* For cards with video out, this call needs interrupts enabled */
ivtv_s_std(NULL, &fh, &itv->tuner_std);
}

/* Setup initial controls */
cx2341x_handler_setup(&itv->cxhdl);
Expand Down
11 changes: 7 additions & 4 deletions drivers/media/video/ivtv/ivtv-firmware.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,6 @@ int ivtv_firmware_restart(struct ivtv *itv)
{
int rc = 0;
v4l2_std_id std;
struct ivtv_open_id fh;
fh.itv = itv;

if (itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT)
/* Display test image during restart */
Expand All @@ -301,14 +299,19 @@ int ivtv_firmware_restart(struct ivtv *itv)
/* Allow settings to reload */
ivtv_mailbox_cache_invalidate(itv);

/* Restore video standard */
/* Restore encoder video standard */
std = itv->std;
itv->std = 0;
ivtv_s_std(NULL, &fh, &std);
ivtv_s_std_enc(itv, &std);

if (itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT) {
ivtv_init_mpeg_decoder(itv);

/* Restore decoder video standard */
std = itv->std_out;
itv->std_out = 0;
ivtv_s_std_dec(itv, &std);

/* Restore framebuffer if active */
if (itv->ivtvfb_restore)
itv->ivtvfb_restore(itv);
Expand Down
Loading

0 comments on commit 46671b0

Please sign in to comment.