All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2.1 1/3] v4l: common: v4l2_get_link_freq: add printing a warning
@ 2021-02-18 17:16 Andrey Konovalov
  2021-02-21 18:56 ` Laurent Pinchart
  0 siblings, 1 reply; 2+ messages in thread
From: Andrey Konovalov @ 2021-02-18 17:16 UTC (permalink / raw)
  To: junak.pub, robert.foss, sakari.ailus
  Cc: todor.too, agross, bjorn.andersson, mchehab, laurent.pinchart,
	jacopo, linux-media, linux-arm-msm, linux-kernel,
	Andrey Konovalov

Print a warning if V4L2_CID_LINK_FREQ control is not implemented.

Signed-off-by: Andrey Konovalov <andrey.konovalov@linaro.org>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
---
 drivers/media/v4l2-core/v4l2-common.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/media/v4l2-core/v4l2-common.c b/drivers/media/v4l2-core/v4l2-common.c
index 133d20e40f82..04af03285a20 100644
--- a/drivers/media/v4l2-core/v4l2-common.c
+++ b/drivers/media/v4l2-core/v4l2-common.c
@@ -469,6 +469,11 @@ s64 v4l2_get_link_freq(struct v4l2_ctrl_handler *handler, unsigned int mul,
 			return -ENOENT;
 
 		freq = div_u64(v4l2_ctrl_g_ctrl_int64(ctrl) * mul, div);
+
+		pr_warn("%s: Link frequency estimated using pixel rate: result might be inaccurate\n",
+			__func__);
+		pr_warn("%s: Consider implementing support for V4L2_CID_LINK_FREQ in the transmitter driver\n",
+			__func__);
 	}
 
 	return freq > 0 ? freq : -EINVAL;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2.1 1/3] v4l: common: v4l2_get_link_freq: add printing a warning
  2021-02-18 17:16 [PATCH v2.1 1/3] v4l: common: v4l2_get_link_freq: add printing a warning Andrey Konovalov
@ 2021-02-21 18:56 ` Laurent Pinchart
  0 siblings, 0 replies; 2+ messages in thread
From: Laurent Pinchart @ 2021-02-21 18:56 UTC (permalink / raw)
  To: Andrey Konovalov
  Cc: junak.pub, robert.foss, sakari.ailus, todor.too, agross,
	bjorn.andersson, mchehab, jacopo, linux-media, linux-arm-msm,
	linux-kernel

Hi Andrey,

Thank you for the patch.

On Thu, Feb 18, 2021 at 08:16:40PM +0300, Andrey Konovalov wrote:
> Print a warning if V4L2_CID_LINK_FREQ control is not implemented.
> 
> Signed-off-by: Andrey Konovalov <andrey.konovalov@linaro.org>
> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/media/v4l2-core/v4l2-common.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/media/v4l2-core/v4l2-common.c b/drivers/media/v4l2-core/v4l2-common.c
> index 133d20e40f82..04af03285a20 100644
> --- a/drivers/media/v4l2-core/v4l2-common.c
> +++ b/drivers/media/v4l2-core/v4l2-common.c
> @@ -469,6 +469,11 @@ s64 v4l2_get_link_freq(struct v4l2_ctrl_handler *handler, unsigned int mul,
>  			return -ENOENT;
>  
>  		freq = div_u64(v4l2_ctrl_g_ctrl_int64(ctrl) * mul, div);
> +
> +		pr_warn("%s: Link frequency estimated using pixel rate: result might be inaccurate\n",
> +			__func__);
> +		pr_warn("%s: Consider implementing support for V4L2_CID_LINK_FREQ in the transmitter driver\n",
> +			__func__);

It would still be nice if v4l2_ctrl_handler was extended with a struct
device pointer to use dev_warn() here, and allow replacing "the
transmitter driver" with the driver name.

>  	}
>  
>  	return freq > 0 ? freq : -EINVAL;

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-02-21 18:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-18 17:16 [PATCH v2.1 1/3] v4l: common: v4l2_get_link_freq: add printing a warning Andrey Konovalov
2021-02-21 18:56 ` Laurent Pinchart

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.