aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca
diff options
context:
space:
mode:
authorAndy Walls <awalls@md.metrocast.net>2010-09-12 13:45:21 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-10-20 23:05:55 -0400
commit47399d98e79c7fd4fac0e2457db26f3842ecb990 (patch)
treefd4d0603cbe51749ba5b8083db3ee05e57c01f68 /drivers/media/video/gspca
parentc67be3ccd7616ed828586d5d3f4b48b438c0a433 (diff)
V4L/DVB: gspca_cpia1: Disable illuminator controls if not an Intel Play QX3
The illuminator controls should only be available to the user for the Intel Play QX3 microscope. The implementation to inhibit the controls is intended to be consistent with the other gspca driver implementations. Signed-off-by: Andy Walls <awalls@md.metrocast.net> Signed-off-by: Jean-François Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca')
-rw-r--r--drivers/media/video/gspca/cpia1.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/media/video/gspca/cpia1.c b/drivers/media/video/gspca/cpia1.c
index 3dbc7a16889b..203bab9318e6 100644
--- a/drivers/media/video/gspca/cpia1.c
+++ b/drivers/media/video/gspca/cpia1.c
@@ -380,6 +380,7 @@ static int sd_getilluminator2(struct gspca_dev *gspca_dev, __s32 *val);
380 380
381static const struct ctrl sd_ctrls[] = { 381static const struct ctrl sd_ctrls[] = {
382 { 382 {
383#define BRIGHTNESS_IDX 0
383 { 384 {
384 .id = V4L2_CID_BRIGHTNESS, 385 .id = V4L2_CID_BRIGHTNESS,
385 .type = V4L2_CTRL_TYPE_INTEGER, 386 .type = V4L2_CTRL_TYPE_INTEGER,
@@ -394,6 +395,7 @@ static const struct ctrl sd_ctrls[] = {
394 .set = sd_setbrightness, 395 .set = sd_setbrightness,
395 .get = sd_getbrightness, 396 .get = sd_getbrightness,
396 }, 397 },
398#define CONTRAST_IDX 1
397 { 399 {
398 { 400 {
399 .id = V4L2_CID_CONTRAST, 401 .id = V4L2_CID_CONTRAST,
@@ -408,6 +410,7 @@ static const struct ctrl sd_ctrls[] = {
408 .set = sd_setcontrast, 410 .set = sd_setcontrast,
409 .get = sd_getcontrast, 411 .get = sd_getcontrast,
410 }, 412 },
413#define SATURATION_IDX 2
411 { 414 {
412 { 415 {
413 .id = V4L2_CID_SATURATION, 416 .id = V4L2_CID_SATURATION,
@@ -422,6 +425,7 @@ static const struct ctrl sd_ctrls[] = {
422 .set = sd_setsaturation, 425 .set = sd_setsaturation,
423 .get = sd_getsaturation, 426 .get = sd_getsaturation,
424 }, 427 },
428#define POWER_LINE_FREQUENCY_IDX 3
425 { 429 {
426 { 430 {
427 .id = V4L2_CID_POWER_LINE_FREQUENCY, 431 .id = V4L2_CID_POWER_LINE_FREQUENCY,
@@ -436,6 +440,7 @@ static const struct ctrl sd_ctrls[] = {
436 .set = sd_setfreq, 440 .set = sd_setfreq,
437 .get = sd_getfreq, 441 .get = sd_getfreq,
438 }, 442 },
443#define ILLUMINATORS_1_IDX 4
439 { 444 {
440 { 445 {
441 .id = V4L2_CID_ILLUMINATORS_1, 446 .id = V4L2_CID_ILLUMINATORS_1,
@@ -450,6 +455,7 @@ static const struct ctrl sd_ctrls[] = {
450 .set = sd_setilluminator1, 455 .set = sd_setilluminator1,
451 .get = sd_getilluminator1, 456 .get = sd_getilluminator1,
452 }, 457 },
458#define ILLUMINATORS_2_IDX 5
453 { 459 {
454 { 460 {
455 .id = V4L2_CID_ILLUMINATORS_2, 461 .id = V4L2_CID_ILLUMINATORS_2,
@@ -464,6 +470,7 @@ static const struct ctrl sd_ctrls[] = {
464 .set = sd_setilluminator2, 470 .set = sd_setilluminator2,
465 .get = sd_getilluminator2, 471 .get = sd_getilluminator2,
466 }, 472 },
473#define COMP_TARGET_IDX 6
467 { 474 {
468 { 475 {
469#define V4L2_CID_COMP_TARGET V4L2_CID_PRIVATE_BASE 476#define V4L2_CID_COMP_TARGET V4L2_CID_PRIVATE_BASE
@@ -1756,9 +1763,13 @@ static int sd_init(struct gspca_dev *gspca_dev)
1756 if (ret) 1763 if (ret)
1757 return ret; 1764 return ret;
1758 1765
1759 /* Ensure the QX3 illuminators' states are restored upon resume */ 1766 /* Ensure the QX3 illuminators' states are restored upon resume,
1767 or disable the illuminator controls, if this isn't a QX3 */
1760 if (sd->params.qx3.qx3_detected) 1768 if (sd->params.qx3.qx3_detected)
1761 command_setlights(gspca_dev); 1769 command_setlights(gspca_dev);
1770 else
1771 gspca_dev->ctrl_dis |=
1772 ((1 << ILLUMINATORS_1_IDX) | (1 << ILLUMINATORS_2_IDX));
1762 1773
1763 sd_stopN(gspca_dev); 1774 sd_stopN(gspca_dev);
1764 1775