aboutsummaryrefslogtreecommitdiffstats
path: root/include/media/v4l2-common.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/media/v4l2-common.h')
-rw-r--r--include/media/v4l2-common.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h
index 3eb202259e8c..1bdaea248089 100644
--- a/include/media/v4l2-common.h
+++ b/include/media/v4l2-common.h
@@ -175,7 +175,8 @@ struct v4l2_subdev *v4l2_i2c_new_subdev_board(struct v4l2_device *v4l2_dev,
*
* @sd: pointer to &struct v4l2_subdev
* @client: pointer to struct i2c_client
- * @devname: the name of the device; if NULL, the I²C device's name will be used
+ * @devname: the name of the device; if NULL, the I²C device drivers's name
+ * will be used
* @postfix: sub-device specific string to put right after the I²C device name;
* may be NULL
*/
@@ -540,6 +541,10 @@ int v4l2_fill_pixfmt_mp(struct v4l2_pix_format_mplane *pixfmt, u32 pixelformat,
s64 v4l2_get_link_freq(struct v4l2_ctrl_handler *handler, unsigned int mul,
unsigned int div);
+void v4l2_simplify_fraction(u32 *numerator, u32 *denominator,
+ unsigned int n_terms, unsigned int threshold);
+u32 v4l2_fraction_to_interval(u32 numerator, u32 denominator);
+
static inline u64 v4l2_buffer_get_timestamp(const struct v4l2_buffer *buf)
{
/*
@@ -563,19 +568,19 @@ static inline void v4l2_buffer_set_timestamp(struct v4l2_buffer *buf,
static inline bool v4l2_is_colorspace_valid(__u32 colorspace)
{
return colorspace > V4L2_COLORSPACE_DEFAULT &&
- colorspace <= V4L2_COLORSPACE_DCI_P3;
+ colorspace < V4L2_COLORSPACE_LAST;
}
static inline bool v4l2_is_xfer_func_valid(__u32 xfer_func)
{
return xfer_func > V4L2_XFER_FUNC_DEFAULT &&
- xfer_func <= V4L2_XFER_FUNC_SMPTE2084;
+ xfer_func < V4L2_XFER_FUNC_LAST;
}
static inline bool v4l2_is_ycbcr_enc_valid(__u8 ycbcr_enc)
{
return ycbcr_enc > V4L2_YCBCR_ENC_DEFAULT &&
- ycbcr_enc <= V4L2_YCBCR_ENC_SMPTE240M;
+ ycbcr_enc < V4L2_YCBCR_ENC_LAST;
}
static inline bool v4l2_is_hsv_enc_valid(__u8 hsv_enc)