Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 155777
b: refs/heads/master
c: 579d315
h: refs/heads/master
i:
  155775: 46563f9
v: v3
  • Loading branch information
Mauro Carvalho Chehab committed Jul 24, 2009
1 parent cd909a5 commit 803611a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d36bb4e77257ed0df86deca3f69794f037f68c7d
refs/heads/master: 579d315218e8a3f696e375c5f6917da6488bec8a
11 changes: 11 additions & 0 deletions trunk/drivers/media/video/em28xx/em28xx-cards.c
Original file line number Diff line number Diff line change
Expand Up @@ -1735,6 +1735,11 @@ static int em28xx_hint_sensor(struct em28xx *dev)
dev->sensor_xres = 640;
dev->sensor_yres = 480;
dev->sensor_xtal = 6300000;

/* probably means GRGB 16 bit bayer */
dev->vinmode = 0x0d;
dev->vinctl = 0x00;

break;
default:
printk("Unknown Micron Sensor 0x%04x\n", be16_to_cpu(version));
Expand Down Expand Up @@ -2414,6 +2419,12 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev,
return errCode;
}

/*
* Default format, used for tvp5150 or saa711x output formats
*/
dev->vinmode = 0x10;
dev->vinctl = 0x11;

/*
* If the device can be a webcam, seek for a sensor.
* If sensor is not found, then it isn't a webcam.
Expand Down
17 changes: 3 additions & 14 deletions trunk/drivers/media/video/em28xx/em28xx-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -648,28 +648,17 @@ int em28xx_capture_start(struct em28xx *dev, int start)
int em28xx_set_outfmt(struct em28xx *dev)
{
int ret;
int vinmode, vinctl, outfmt;

outfmt = dev->format->reg;

if (dev->board.is_webcam) {
vinmode = 0x0d;
vinctl = 0x00;
} else {
vinmode = 0x10;
vinctl = 0x11;
}

ret = em28xx_write_reg_bits(dev, EM28XX_R27_OUTFMT,
outfmt | 0x20, 0xff);
dev->format->reg | 0x20, 0xff);
if (ret < 0)
return ret;

ret = em28xx_write_reg(dev, EM28XX_R10_VINMODE, vinmode);
ret = em28xx_write_reg(dev, EM28XX_R10_VINMODE, dev->vinmode);
if (ret < 0)
return ret;

return em28xx_write_reg(dev, EM28XX_R11_VINCTRL, vinctl);
return em28xx_write_reg(dev, EM28XX_R11_VINCTRL, dev->vinctl);
}

static int em28xx_accumulator_set(struct em28xx *dev, u8 xmin, u8 xmax,
Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/media/video/em28xx/em28xx.h
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,9 @@ struct em28xx {
int sensor_xres, sensor_yres;
int sensor_xtal;

/* Vinmode/Vinctl used at the driver */
int vinmode, vinctl;

unsigned int stream_on:1; /* Locks streams */
unsigned int has_audio_class:1;
unsigned int has_alsa_audio:1;
Expand Down

0 comments on commit 803611a

Please sign in to comment.