aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/em28xx/em28xx.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/em28xx/em28xx.h')
-rw-r--r--drivers/media/video/em28xx/em28xx.h32
1 files changed, 27 insertions, 5 deletions
diff --git a/drivers/media/video/em28xx/em28xx.h b/drivers/media/video/em28xx/em28xx.h
index 813ce45c2f99..45bd513f62dc 100644
--- a/drivers/media/video/em28xx/em28xx.h
+++ b/drivers/media/video/em28xx/em28xx.h
@@ -107,6 +107,7 @@
107#define EM2860_BOARD_TERRATEC_AV350 68 107#define EM2860_BOARD_TERRATEC_AV350 68
108#define EM2882_BOARD_KWORLD_ATSC_315U 69 108#define EM2882_BOARD_KWORLD_ATSC_315U 69
109#define EM2882_BOARD_EVGA_INDTUBE 70 109#define EM2882_BOARD_EVGA_INDTUBE 70
110#define EM2820_BOARD_SILVERCREST_WEBCAM 71
110 111
111/* Limits minimum and default number of buffers */ 112/* Limits minimum and default number of buffers */
112#define EM28XX_MIN_BUF 4 113#define EM28XX_MIN_BUF 4
@@ -357,11 +358,17 @@ struct em28xx_input {
357#define INPUT(nr) (&em28xx_boards[dev->model].input[nr]) 358#define INPUT(nr) (&em28xx_boards[dev->model].input[nr])
358 359
359enum em28xx_decoder { 360enum em28xx_decoder {
360 EM28XX_NODECODER, 361 EM28XX_NODECODER = 0,
361 EM28XX_TVP5150, 362 EM28XX_TVP5150,
362 EM28XX_SAA711X, 363 EM28XX_SAA711X,
363}; 364};
364 365
366enum em28xx_sensor {
367 EM28XX_NOSENSOR = 0,
368 EM28XX_MT9V011,
369 EM28XX_MT9M001,
370};
371
365enum em28xx_adecoder { 372enum em28xx_adecoder {
366 EM28XX_NOADECODER = 0, 373 EM28XX_NOADECODER = 0,
367 EM28XX_TVAUDIO, 374 EM28XX_TVAUDIO,
@@ -388,6 +395,7 @@ struct em28xx_board {
388 unsigned int max_range_640_480:1; 395 unsigned int max_range_640_480:1;
389 unsigned int has_dvb:1; 396 unsigned int has_dvb:1;
390 unsigned int has_snapshot_button:1; 397 unsigned int has_snapshot_button:1;
398 unsigned int is_webcam:1;
391 unsigned int valid:1; 399 unsigned int valid:1;
392 400
393 unsigned char xclk, i2c_speed; 401 unsigned char xclk, i2c_speed;
@@ -471,6 +479,14 @@ struct em28xx {
471 struct v4l2_device v4l2_dev; 479 struct v4l2_device v4l2_dev;
472 struct em28xx_board board; 480 struct em28xx_board board;
473 481
482 /* Webcam specific fields */
483 enum em28xx_sensor em28xx_sensor;
484 int sensor_xres, sensor_yres;
485 int sensor_xtal;
486
487 /* Vinmode/Vinctl used at the driver */
488 int vinmode, vinctl;
489
474 unsigned int stream_on:1; /* Locks streams */ 490 unsigned int stream_on:1; /* Locks streams */
475 unsigned int has_audio_class:1; 491 unsigned int has_audio_class:1;
476 unsigned int has_alsa_audio:1; 492 unsigned int has_alsa_audio:1;
@@ -751,17 +767,23 @@ static inline int em28xx_gamma_set(struct em28xx *dev, s32 val)
751/*FIXME: maxw should be dependent of alt mode */ 767/*FIXME: maxw should be dependent of alt mode */
752static inline unsigned int norm_maxw(struct em28xx *dev) 768static inline unsigned int norm_maxw(struct em28xx *dev)
753{ 769{
770 if (dev->board.is_webcam)
771 return dev->sensor_xres;
772
754 if (dev->board.max_range_640_480) 773 if (dev->board.max_range_640_480)
755 return 640; 774 return 640;
756 else 775
757 return 720; 776 return 720;
758} 777}
759 778
760static inline unsigned int norm_maxh(struct em28xx *dev) 779static inline unsigned int norm_maxh(struct em28xx *dev)
761{ 780{
781 if (dev->board.is_webcam)
782 return dev->sensor_yres;
783
762 if (dev->board.max_range_640_480) 784 if (dev->board.max_range_640_480)
763 return 480; 785 return 480;
764 else 786
765 return (dev->norm & V4L2_STD_625_50) ? 576 : 480; 787 return (dev->norm & V4L2_STD_625_50) ? 576 : 480;
766} 788}
767#endif 789#endif