linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] media: vimc: implement basic v4l2-ctrls
@ 2018-08-22  1:22 Guilherme Gallo
  2018-08-22  6:30 ` Hans Verkuil
  0 siblings, 1 reply; 2+ messages in thread
From: Guilherme Gallo @ 2018-08-22  1:22 UTC (permalink / raw)
  To: lkcamp, helen.koike, mchehab, linux-media, linux-kernel, hverkuil

Implement brightness, contrast and hue controls in vimc-sensor

Signed-off-by: Guilherme Alcarde Gallo <gagallo7@gmail.com>
---
 drivers/media/platform/vimc/vimc-sensor.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/media/platform/vimc/vimc-sensor.c b/drivers/media/platform/vimc/vimc-sensor.c
index 605e2a2d5dd5..ecc82cd60900 100644
--- a/drivers/media/platform/vimc/vimc-sensor.c
+++ b/drivers/media/platform/vimc/vimc-sensor.c
@@ -316,6 +316,15 @@ static int vimc_sen_s_ctrl(struct v4l2_ctrl *ctrl)
 	case V4L2_CID_VFLIP:
 		tpg_s_vflip(&vsen->tpg, ctrl->val);
 		break;
+	case V4L2_CID_BRIGHTNESS:
+		tpg_s_brightness(&vsen->tpg, ctrl->val);
+		break;
+	case V4L2_CID_CONTRAST:
+		tpg_s_contrast(&vsen->tpg, ctrl->val);
+		break;
+	case V4L2_CID_HUE:
+		tpg_s_hue(&vsen->tpg, ctrl->val);
+		break;
 	default:
 		return -EINVAL;
 	}
@@ -377,6 +386,12 @@ static int vimc_sen_comp_bind(struct device *comp, struct device *master,
 			  V4L2_CID_VFLIP, 0, 1, 1, 0);
 	v4l2_ctrl_new_std(&vsen->hdl, &vimc_sen_ctrl_ops,
 			  V4L2_CID_HFLIP, 0, 1, 1, 0);
+	v4l2_ctrl_new_std(&vsen->hdl, &vimc_sen_ctrl_ops,
+			  V4L2_CID_BRIGHTNESS, 0, 255, 1, 128);
+	v4l2_ctrl_new_std(&vsen->hdl, &vimc_sen_ctrl_ops,
+			  V4L2_CID_CONTRAST, 0, 255, 1, 128);
+	v4l2_ctrl_new_std(&vsen->hdl, &vimc_sen_ctrl_ops,
+			  V4L2_CID_HUE, 0, 255, 1, 128);
 	vsen->sd.ctrl_handler = &vsen->hdl;
 	if (vsen->hdl.error) {
 		ret = vsen->hdl.error;
-- 
2.13.6


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

* Re: [PATCH] media: vimc: implement basic v4l2-ctrls
  2018-08-22  1:22 [PATCH] media: vimc: implement basic v4l2-ctrls Guilherme Gallo
@ 2018-08-22  6:30 ` Hans Verkuil
  0 siblings, 0 replies; 2+ messages in thread
From: Hans Verkuil @ 2018-08-22  6:30 UTC (permalink / raw)
  To: Guilherme Gallo, lkcamp, helen.koike, mchehab, linux-media, linux-kernel

Hi Guilherme,

Thank you for your patch. It looks good, but can you add support for V4L2_CID_SATURATION
as well? The TPG supports that as well, so there is no reason to leave that out.

Thank you!

	Hans

On 08/22/2018 03:22 AM, Guilherme Gallo wrote:
> Implement brightness, contrast and hue controls in vimc-sensor
> 
> Signed-off-by: Guilherme Alcarde Gallo <gagallo7@gmail.com>
> ---
>  drivers/media/platform/vimc/vimc-sensor.c | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/drivers/media/platform/vimc/vimc-sensor.c b/drivers/media/platform/vimc/vimc-sensor.c
> index 605e2a2d5dd5..ecc82cd60900 100644
> --- a/drivers/media/platform/vimc/vimc-sensor.c
> +++ b/drivers/media/platform/vimc/vimc-sensor.c
> @@ -316,6 +316,15 @@ static int vimc_sen_s_ctrl(struct v4l2_ctrl *ctrl)
>  	case V4L2_CID_VFLIP:
>  		tpg_s_vflip(&vsen->tpg, ctrl->val);
>  		break;
> +	case V4L2_CID_BRIGHTNESS:
> +		tpg_s_brightness(&vsen->tpg, ctrl->val);
> +		break;
> +	case V4L2_CID_CONTRAST:
> +		tpg_s_contrast(&vsen->tpg, ctrl->val);
> +		break;
> +	case V4L2_CID_HUE:
> +		tpg_s_hue(&vsen->tpg, ctrl->val);
> +		break;
>  	default:
>  		return -EINVAL;
>  	}
> @@ -377,6 +386,12 @@ static int vimc_sen_comp_bind(struct device *comp, struct device *master,
>  			  V4L2_CID_VFLIP, 0, 1, 1, 0);
>  	v4l2_ctrl_new_std(&vsen->hdl, &vimc_sen_ctrl_ops,
>  			  V4L2_CID_HFLIP, 0, 1, 1, 0);
> +	v4l2_ctrl_new_std(&vsen->hdl, &vimc_sen_ctrl_ops,
> +			  V4L2_CID_BRIGHTNESS, 0, 255, 1, 128);
> +	v4l2_ctrl_new_std(&vsen->hdl, &vimc_sen_ctrl_ops,
> +			  V4L2_CID_CONTRAST, 0, 255, 1, 128);
> +	v4l2_ctrl_new_std(&vsen->hdl, &vimc_sen_ctrl_ops,
> +			  V4L2_CID_HUE, 0, 255, 1, 128);
>  	vsen->sd.ctrl_handler = &vsen->hdl;
>  	if (vsen->hdl.error) {
>  		ret = vsen->hdl.error;
> 


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

end of thread, other threads:[~2018-08-22  6:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-22  1:22 [PATCH] media: vimc: implement basic v4l2-ctrls Guilherme Gallo
2018-08-22  6:30 ` Hans Verkuil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).