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.h31
1 files changed, 25 insertions, 6 deletions
diff --git a/drivers/media/video/em28xx/em28xx.h b/drivers/media/video/em28xx/em28xx.h
index d90fef463764..45bd513f62dc 100644
--- a/drivers/media/video/em28xx/em28xx.h
+++ b/drivers/media/video/em28xx/em28xx.h
@@ -358,10 +358,15 @@ struct em28xx_input {
358#define INPUT(nr) (&em28xx_boards[dev->model].input[nr]) 358#define INPUT(nr) (&em28xx_boards[dev->model].input[nr])
359 359
360enum em28xx_decoder { 360enum em28xx_decoder {
361 EM28XX_NODECODER, 361 EM28XX_NODECODER = 0,
362 EM28XX_TVP5150, 362 EM28XX_TVP5150,
363 EM28XX_SAA711X, 363 EM28XX_SAA711X,
364};
365
366enum em28xx_sensor {
367 EM28XX_NOSENSOR = 0,
364 EM28XX_MT9V011, 368 EM28XX_MT9V011,
369 EM28XX_MT9M001,
365}; 370};
366 371
367enum em28xx_adecoder { 372enum em28xx_adecoder {
@@ -390,7 +395,7 @@ struct em28xx_board {
390 unsigned int max_range_640_480:1; 395 unsigned int max_range_640_480:1;
391 unsigned int has_dvb:1; 396 unsigned int has_dvb:1;
392 unsigned int has_snapshot_button:1; 397 unsigned int has_snapshot_button:1;
393 unsigned int is_27xx:1; 398 unsigned int is_webcam:1;
394 unsigned int valid:1; 399 unsigned int valid:1;
395 400
396 unsigned char xclk, i2c_speed; 401 unsigned char xclk, i2c_speed;
@@ -474,6 +479,14 @@ struct em28xx {
474 struct v4l2_device v4l2_dev; 479 struct v4l2_device v4l2_dev;
475 struct em28xx_board board; 480 struct em28xx_board board;
476 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
477 unsigned int stream_on:1; /* Locks streams */ 490 unsigned int stream_on:1; /* Locks streams */
478 unsigned int has_audio_class:1; 491 unsigned int has_audio_class:1;
479 unsigned int has_alsa_audio:1; 492 unsigned int has_alsa_audio:1;
@@ -754,17 +767,23 @@ static inline int em28xx_gamma_set(struct em28xx *dev, s32 val)
754/*FIXME: maxw should be dependent of alt mode */ 767/*FIXME: maxw should be dependent of alt mode */
755static inline unsigned int norm_maxw(struct em28xx *dev) 768static inline unsigned int norm_maxw(struct em28xx *dev)
756{ 769{
770 if (dev->board.is_webcam)
771 return dev->sensor_xres;
772
757 if (dev->board.max_range_640_480) 773 if (dev->board.max_range_640_480)
758 return 640; 774 return 640;
759 else 775
760 return 720; 776 return 720;
761} 777}
762 778
763static inline unsigned int norm_maxh(struct em28xx *dev) 779static inline unsigned int norm_maxh(struct em28xx *dev)
764{ 780{
781 if (dev->board.is_webcam)
782 return dev->sensor_yres;
783
765 if (dev->board.max_range_640_480) 784 if (dev->board.max_range_640_480)
766 return 480; 785 return 480;
767 else 786
768 return (dev->norm & V4L2_STD_625_50) ? 576 : 480; 787 return (dev->norm & V4L2_STD_625_50) ? 576 : 480;
769} 788}
770#endif 789#endif