diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-07-12 10:04:15 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-07-24 13:03:23 -0400 |
commit | 527f09a981e398331c2f8d8f7af83cd46e6a06cc (patch) | |
tree | fedf67d56ebe88b4a7ecb8c6fa67cfa10c444182 /drivers/media | |
parent | 8b220793d6fd309176438721088515be893630cd (diff) |
V4L/DVB (12236): em28xx: stop abusing of board->decoder for sensor information
Instead of using em28xx board decoder field for storing sensor information,
let's use instead a separate field for it.
Also, as sensors are currently autodetected, there's no need of having
it at the boards description. So, move it to the main em28xx struct.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/em28xx/em28xx-cards.c | 4 | ||||
-rw-r--r-- | drivers/media/video/em28xx/em28xx.h | 8 |
2 files changed, 9 insertions, 3 deletions
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c index e64e1242a1ba..530170ae0167 100644 --- a/drivers/media/video/em28xx/em28xx-cards.c +++ b/drivers/media/video/em28xx/em28xx-cards.c | |||
@@ -454,7 +454,6 @@ struct em28xx_board em28xx_boards[] = { | |||
454 | .name = "Silvercrest Webcam 1.3mpix", | 454 | .name = "Silvercrest Webcam 1.3mpix", |
455 | .tuner_type = TUNER_ABSENT, | 455 | .tuner_type = TUNER_ABSENT, |
456 | .is_webcam = 1, | 456 | .is_webcam = 1, |
457 | .decoder = EM28XX_MT9V011, | ||
458 | .input = { { | 457 | .input = { { |
459 | .type = EM28XX_VMUX_COMPOSITE1, | 458 | .type = EM28XX_VMUX_COMPOSITE1, |
460 | .vmux = 0, | 459 | .vmux = 0, |
@@ -1737,6 +1736,7 @@ static int em28xx_hint_sensor(struct em28xx *dev) | |||
1737 | case MT9V011_VERSION: | 1736 | case MT9V011_VERSION: |
1738 | dev->model = EM2820_BOARD_SILVERCREST_WEBCAM; | 1737 | dev->model = EM2820_BOARD_SILVERCREST_WEBCAM; |
1739 | sensor_name = "mt9v011"; | 1738 | sensor_name = "mt9v011"; |
1739 | dev->em28xx_sensor = EM28XX_MT9V011; | ||
1740 | break; | 1740 | break; |
1741 | default: | 1741 | default: |
1742 | printk("Unknown Micron Sensor 0x%04x\n", be16_to_cpu(version)); | 1742 | printk("Unknown Micron Sensor 0x%04x\n", be16_to_cpu(version)); |
@@ -2267,7 +2267,7 @@ void em28xx_card_setup(struct em28xx *dev) | |||
2267 | v4l2_i2c_new_probed_subdev(&dev->v4l2_dev, &dev->i2c_adap, | 2267 | v4l2_i2c_new_probed_subdev(&dev->v4l2_dev, &dev->i2c_adap, |
2268 | "tvp5150", "tvp5150", tvp5150_addrs); | 2268 | "tvp5150", "tvp5150", tvp5150_addrs); |
2269 | 2269 | ||
2270 | if (dev->board.decoder == EM28XX_MT9V011) | 2270 | if (dev->em28xx_sensor == EM28XX_MT9V011) |
2271 | v4l2_i2c_new_probed_subdev(&dev->v4l2_dev, &dev->i2c_adap, | 2271 | v4l2_i2c_new_probed_subdev(&dev->v4l2_dev, &dev->i2c_adap, |
2272 | "mt9v011", "mt9v011", mt9v011_addrs); | 2272 | "mt9v011", "mt9v011", mt9v011_addrs); |
2273 | 2273 | ||
diff --git a/drivers/media/video/em28xx/em28xx.h b/drivers/media/video/em28xx/em28xx.h index dc92e9ef85a4..655dd78cc07b 100644 --- a/drivers/media/video/em28xx/em28xx.h +++ b/drivers/media/video/em28xx/em28xx.h | |||
@@ -358,9 +358,13 @@ 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 | ||
360 | enum em28xx_decoder { | 360 | enum em28xx_decoder { |
361 | EM28XX_NODECODER, | 361 | EM28XX_NODECODER = 0, |
362 | EM28XX_TVP5150, | 362 | EM28XX_TVP5150, |
363 | EM28XX_SAA711X, | 363 | EM28XX_SAA711X, |
364 | }; | ||
365 | |||
366 | enum em28xx_sensor { | ||
367 | EM28XX_NOSENSOR = 0, | ||
364 | EM28XX_MT9V011, | 368 | EM28XX_MT9V011, |
365 | }; | 369 | }; |
366 | 370 | ||
@@ -474,6 +478,8 @@ struct em28xx { | |||
474 | struct v4l2_device v4l2_dev; | 478 | struct v4l2_device v4l2_dev; |
475 | struct em28xx_board board; | 479 | struct em28xx_board board; |
476 | 480 | ||
481 | enum em28xx_sensor em28xx_sensor; | ||
482 | |||
477 | unsigned int stream_on:1; /* Locks streams */ | 483 | unsigned int stream_on:1; /* Locks streams */ |
478 | unsigned int has_audio_class:1; | 484 | unsigned int has_audio_class:1; |
479 | unsigned int has_alsa_audio:1; | 485 | unsigned int has_alsa_audio:1; |