[media] v4l: add control for RF tuner PLL lock flag
authorAntti Palosaari <crope@iki.fi>
Fri, 7 Feb 2014 05:46:16 +0000 (02:46 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Thu, 13 Mar 2014 13:26:49 +0000 (10:26 -0300)
Add volatile boolean control to indicate if tuner frequency synthesizer
is locked to requested frequency. That means tuner is able to receive
given frequency. Control is named as "PLL lock", since frequency
synthesizers are based of phase-locked-loop. Maybe more general name
could be wise still?

Cc: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/v4l2-core/v4l2-ctrls.c
include/uapi/linux/v4l2-controls.h

index 48550b0eca2ee3d047d0291593a62e159fabd2af..55c68325410205c68b7f54c3353bc143625814de 100644 (file)
@@ -869,6 +869,7 @@ const char *v4l2_ctrl_get_name(u32 id)
        case V4L2_CID_RF_TUNER_IF_GAIN:         return "IF Gain";
        case V4L2_CID_RF_TUNER_BANDWIDTH_AUTO:  return "Bandwidth, Auto";
        case V4L2_CID_RF_TUNER_BANDWIDTH:       return "Bandwidth";
+       case V4L2_CID_RF_TUNER_PLL_LOCK:        return "PLL Lock";
        default:
                return NULL;
        }
@@ -922,6 +923,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,
        case V4L2_CID_RF_TUNER_MIXER_GAIN_AUTO:
        case V4L2_CID_RF_TUNER_IF_GAIN_AUTO:
        case V4L2_CID_RF_TUNER_BANDWIDTH_AUTO:
+       case V4L2_CID_RF_TUNER_PLL_LOCK:
                *type = V4L2_CTRL_TYPE_BOOLEAN;
                *min = 0;
                *max = *step = 1;
@@ -1106,6 +1108,9 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,
        case V4L2_CID_DV_RX_POWER_PRESENT:
                *flags |= V4L2_CTRL_FLAG_READ_ONLY;
                break;
+       case V4L2_CID_RF_TUNER_PLL_LOCK:
+               *flags |= V4L2_CTRL_FLAG_VOLATILE;
+               break;
        }
 }
 EXPORT_SYMBOL(v4l2_ctrl_fill);
index 405279f3c32681baec1eca158069abcdb8163628..2ac5597f3ee145c9660b850b4664a86fd37b5ff1 100644 (file)
@@ -912,5 +912,6 @@ enum v4l2_deemphasis {
 #define V4L2_CID_RF_TUNER_MIXER_GAIN           (V4L2_CID_RF_TUNER_CLASS_BASE + 52)
 #define V4L2_CID_RF_TUNER_IF_GAIN_AUTO         (V4L2_CID_RF_TUNER_CLASS_BASE + 61)
 #define V4L2_CID_RF_TUNER_IF_GAIN              (V4L2_CID_RF_TUNER_CLASS_BASE + 62)
+#define V4L2_CID_RF_TUNER_PLL_LOCK                     (V4L2_CID_RF_TUNER_CLASS_BASE + 91)
 
 #endif