summaryrefslogtreecommitdiff
path: root/drivers/media/video/gspca/cpia1.c
diff options
context:
space:
mode:
authorAndy Walls <awalls@md.metrocast.net>2010-09-12 14:45:21 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-10-21 01:05:55 -0200
commit47399d98e79c7fd4fac0e2457db26f3842ecb990 (patch)
treefd4d0603cbe51749ba5b8083db3ee05e57c01f68 /drivers/media/video/gspca/cpia1.c
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/cpia1.c')
-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);
static const struct ctrl sd_ctrls[] = {
{
+#define BRIGHTNESS_IDX 0
{
.id = V4L2_CID_BRIGHTNESS,
.type = V4L2_CTRL_TYPE_INTEGER,
@@ -394,6 +395,7 @@ static const struct ctrl sd_ctrls[] = {
.set = sd_setbrightness,
.get = sd_getbrightness,
},
+#define CONTRAST_IDX 1
{
{
.id = V4L2_CID_CONTRAST,
@@ -408,6 +410,7 @@ static const struct ctrl sd_ctrls[] = {
.set = sd_setcontrast,
.get = sd_getcontrast,
},
+#define SATURATION_IDX 2
{
{
.id = V4L2_CID_SATURATION,
@@ -422,6 +425,7 @@ static const struct ctrl sd_ctrls[] = {
.set = sd_setsaturation,
.get = sd_getsaturation,
},
+#define POWER_LINE_FREQUENCY_IDX 3
{
{
.id = V4L2_CID_POWER_LINE_FREQUENCY,
@@ -436,6 +440,7 @@ static const struct ctrl sd_ctrls[] = {
.set = sd_setfreq,
.get = sd_getfreq,
},
+#define ILLUMINATORS_1_IDX 4
{
{
.id = V4L2_CID_ILLUMINATORS_1,
@@ -450,6 +455,7 @@ static const struct ctrl sd_ctrls[] = {
.set = sd_setilluminator1,
.get = sd_getilluminator1,
},
+#define ILLUMINATORS_2_IDX 5
{
{
.id = V4L2_CID_ILLUMINATORS_2,
@@ -464,6 +470,7 @@ static const struct ctrl sd_ctrls[] = {
.set = sd_setilluminator2,
.get = sd_getilluminator2,
},
+#define COMP_TARGET_IDX 6
{
{
#define V4L2_CID_COMP_TARGET V4L2_CID_PRIVATE_BASE
@@ -1756,9 +1763,13 @@ static int sd_init(struct gspca_dev *gspca_dev)
if (ret)
return ret;
- /* Ensure the QX3 illuminators' states are restored upon resume */
+ /* Ensure the QX3 illuminators' states are restored upon resume,
+ or disable the illuminator controls, if this isn't a QX3 */
if (sd->params.qx3.qx3_detected)
command_setlights(gspca_dev);
+ else
+ gspca_dev->ctrl_dis |=
+ ((1 << ILLUMINATORS_1_IDX) | (1 << ILLUMINATORS_2_IDX));
sd_stopN(gspca_dev);