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>
static const struct ctrl sd_ctrls[] = {
{
static const struct ctrl sd_ctrls[] = {
{
+#define BRIGHTNESS_IDX 0
{
.id = V4L2_CID_BRIGHTNESS,
.type = V4L2_CTRL_TYPE_INTEGER,
{
.id = V4L2_CID_BRIGHTNESS,
.type = V4L2_CTRL_TYPE_INTEGER,
.set = sd_setbrightness,
.get = sd_getbrightness,
},
.set = sd_setbrightness,
.get = sd_getbrightness,
},
{
{
.id = V4L2_CID_CONTRAST,
{
{
.id = V4L2_CID_CONTRAST,
.set = sd_setcontrast,
.get = sd_getcontrast,
},
.set = sd_setcontrast,
.get = sd_getcontrast,
},
+#define SATURATION_IDX 2
{
{
.id = V4L2_CID_SATURATION,
{
{
.id = V4L2_CID_SATURATION,
.set = sd_setsaturation,
.get = sd_getsaturation,
},
.set = sd_setsaturation,
.get = sd_getsaturation,
},
+#define POWER_LINE_FREQUENCY_IDX 3
{
{
.id = V4L2_CID_POWER_LINE_FREQUENCY,
{
{
.id = V4L2_CID_POWER_LINE_FREQUENCY,
.set = sd_setfreq,
.get = sd_getfreq,
},
.set = sd_setfreq,
.get = sd_getfreq,
},
+#define ILLUMINATORS_1_IDX 4
{
{
.id = V4L2_CID_ILLUMINATORS_1,
{
{
.id = V4L2_CID_ILLUMINATORS_1,
.set = sd_setilluminator1,
.get = sd_getilluminator1,
},
.set = sd_setilluminator1,
.get = sd_getilluminator1,
},
+#define ILLUMINATORS_2_IDX 5
{
{
.id = V4L2_CID_ILLUMINATORS_2,
{
{
.id = V4L2_CID_ILLUMINATORS_2,
.set = sd_setilluminator2,
.get = sd_getilluminator2,
},
.set = sd_setilluminator2,
.get = sd_getilluminator2,
},
+#define COMP_TARGET_IDX 6
{
{
#define V4L2_CID_COMP_TARGET V4L2_CID_PRIVATE_BASE
{
{
#define V4L2_CID_COMP_TARGET V4L2_CID_PRIVATE_BASE
- /* 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);
if (sd->params.qx3.qx3_detected)
command_setlights(gspca_dev);
+ else
+ gspca_dev->ctrl_dis |=
+ ((1 << ILLUMINATORS_1_IDX) | (1 << ILLUMINATORS_2_IDX));