Commit 9297285e authored by Frank Schaefer's avatar Frank Schaefer Committed by Mauro Carvalho Chehab

[media] em28xx: move vinmode and vinctrl data from struct em28xx to struct v4l2

The video input mode and control data also belong only to the
analog side. move them to struct em28xx_v4l.
Signed-off-by: default avatarFrank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent 753aee77
...@@ -372,8 +372,8 @@ int em28xx_init_camera(struct em28xx *dev) ...@@ -372,8 +372,8 @@ int em28xx_init_camera(struct em28xx *dev)
break; break;
} }
/* probably means GRGB 16 bit bayer */ /* probably means GRGB 16 bit bayer */
dev->vinmode = 0x0d; v4l2->vinmode = 0x0d;
dev->vinctl = 0x00; v4l2->vinctl = 0x00;
break; break;
} }
...@@ -384,8 +384,8 @@ int em28xx_init_camera(struct em28xx *dev) ...@@ -384,8 +384,8 @@ int em28xx_init_camera(struct em28xx *dev)
em28xx_initialize_mt9m001(dev); em28xx_initialize_mt9m001(dev);
/* probably means BGGR 16 bit bayer */ /* probably means BGGR 16 bit bayer */
dev->vinmode = 0x0c; v4l2->vinmode = 0x0c;
dev->vinctl = 0x00; v4l2->vinctl = 0x00;
break; break;
case EM28XX_MT9M111: case EM28XX_MT9M111:
...@@ -396,8 +396,8 @@ int em28xx_init_camera(struct em28xx *dev) ...@@ -396,8 +396,8 @@ int em28xx_init_camera(struct em28xx *dev)
em28xx_write_reg(dev, EM28XX_R0F_XCLK, dev->board.xclk); em28xx_write_reg(dev, EM28XX_R0F_XCLK, dev->board.xclk);
em28xx_initialize_mt9m111(dev); em28xx_initialize_mt9m111(dev);
dev->vinmode = 0x0a; v4l2->vinmode = 0x0a;
dev->vinctl = 0x00; v4l2->vinctl = 0x00;
break; break;
case EM28XX_OV2640: case EM28XX_OV2640:
...@@ -438,8 +438,8 @@ int em28xx_init_camera(struct em28xx *dev) ...@@ -438,8 +438,8 @@ int em28xx_init_camera(struct em28xx *dev)
/* NOTE: for UXGA=1600x1200 switch to 12MHz */ /* NOTE: for UXGA=1600x1200 switch to 12MHz */
dev->board.xclk = EM28XX_XCLK_FREQUENCY_24MHZ; dev->board.xclk = EM28XX_XCLK_FREQUENCY_24MHZ;
em28xx_write_reg(dev, EM28XX_R0F_XCLK, dev->board.xclk); em28xx_write_reg(dev, EM28XX_R0F_XCLK, dev->board.xclk);
dev->vinmode = 0x08; v4l2->vinmode = 0x08;
dev->vinctl = 0x00; v4l2->vinctl = 0x00;
break; break;
} }
......
...@@ -236,11 +236,11 @@ static int em28xx_set_outfmt(struct em28xx *dev) ...@@ -236,11 +236,11 @@ static int em28xx_set_outfmt(struct em28xx *dev)
if (ret < 0) if (ret < 0)
return ret; return ret;
ret = em28xx_write_reg(dev, EM28XX_R10_VINMODE, dev->vinmode); ret = em28xx_write_reg(dev, EM28XX_R10_VINMODE, v4l2->vinmode);
if (ret < 0) if (ret < 0)
return ret; return ret;
vinctrl = dev->vinctl; vinctrl = v4l2->vinctl;
if (em28xx_vbi_supported(dev) == 1) { if (em28xx_vbi_supported(dev) == 1) {
vinctrl |= EM28XX_VINCTRL_VBI_RAW; vinctrl |= EM28XX_VINCTRL_VBI_RAW;
em28xx_write_reg(dev, EM28XX_R34_VBI_START_H, 0x00); em28xx_write_reg(dev, EM28XX_R34_VBI_START_H, 0x00);
...@@ -2312,9 +2312,9 @@ static int em28xx_v4l2_init(struct em28xx *dev) ...@@ -2312,9 +2312,9 @@ static int em28xx_v4l2_init(struct em28xx *dev)
/* /*
* Default format, used for tvp5150 or saa711x output formats * Default format, used for tvp5150 or saa711x output formats
*/ */
dev->vinmode = 0x10; v4l2->vinmode = 0x10;
dev->vinctl = EM28XX_VINCTRL_INTERLACED | v4l2->vinctl = EM28XX_VINCTRL_INTERLACED |
EM28XX_VINCTRL_CCIR656_ENABLE; EM28XX_VINCTRL_CCIR656_ENABLE;
/* request some modules */ /* request some modules */
......
...@@ -516,6 +516,9 @@ struct em28xx_v4l2 { ...@@ -516,6 +516,9 @@ struct em28xx_v4l2 {
struct mutex vb_queue_lock; struct mutex vb_queue_lock;
struct mutex vb_vbi_queue_lock; struct mutex vb_vbi_queue_lock;
u8 vinmode;
u8 vinctl;
/* Frame properties */ /* Frame properties */
int width; /* current frame width */ int width; /* current frame width */
int height; /* current frame height */ int height; /* current frame height */
...@@ -598,9 +601,6 @@ struct em28xx { ...@@ -598,9 +601,6 @@ struct em28xx {
/* Progressive (non-interlaced) mode */ /* Progressive (non-interlaced) mode */
int progressive; int progressive;
/* Vinmode/Vinctl used at the driver */
int vinmode, vinctl;
/* Controls audio streaming */ /* Controls audio streaming */
struct work_struct wq_trigger; /* Trigger to start/stop audio for alsa module */ struct work_struct wq_trigger; /* Trigger to start/stop audio for alsa module */
atomic_t stream_started; /* stream should be running if true */ atomic_t stream_started; /* stream should be running if true */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment