linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bob Veringa <bob.veringa@topic.nl>
To: leonl@leopardimaging.com
Cc: mchehab@kernel.org, linux-media@vger.kernel.org,
	bob.veringa@topic.nl, mike.looijmans@topic.nl
Subject: [PATCH 2/2] media: imx274: remove imx274_load_default
Date: Sat, 24 Apr 2021 13:14:59 +0200	[thread overview]
Message-ID: <20210424111459.20730-2-bob.veringa@topic.nl> (raw)
In-Reply-To: <20210424111459.20730-1-bob.veringa@topic.nl>

The function imx274_load_default no longer serves a purpose as it
does not configure the values since
commit ad97bc37426c1eec1464 ("media: i2c: imx274: Add IMX274
power on and off sequence')

All the values set in this function match the default value set when
registering the controls, except for exposure. The default value
of this is set to the minimal value for this field. The result of this 
is that the output video is black when exposure is not explicitly 
set by the user. By setting the default value when registering 
the control to the same value originally used in the function, 
this issue is avoided.

Signed-off-by: Bob Veringa <bob.veringa@topic.nl>
Acked-by: Mike Looijmans <mike.looijmans@topic.nl>
---
 drivers/media/i2c/imx274.c | 24 ++----------------------
 1 file changed, 2 insertions(+), 22 deletions(-)

diff --git a/drivers/media/i2c/imx274.c b/drivers/media/i2c/imx274.c
index 942407ed931b..9dc0bcb1e0df 100644
--- a/drivers/media/i2c/imx274.c
+++ b/drivers/media/i2c/imx274.c
@@ -1455,23 +1455,6 @@ static int imx274_s_frame_interval(struct v4l2_subdev *sd,
 	return ret;
 }
 
-/**
- * imx274_load_default - load default control values
- * @priv: Pointer to device structure
- *
- * Return: 0 on success, errors otherwise
- */
-static void imx274_load_default(struct stimx274 *priv)
-{
-	/* load default control values */
-	priv->frame_interval.numerator = 1;
-	priv->frame_interval.denominator = IMX274_DEF_FRAME_RATE;
-	priv->ctrls.exposure->val = 1000000 / IMX274_DEF_FRAME_RATE;
-	priv->ctrls.gain->val = IMX274_DEF_GAIN;
-	priv->ctrls.vflip->val = 0;
-	priv->ctrls.test_pattern->val = TEST_PATTERN_DISABLED;
-}
-
 /**
  * imx274_s_stream - It is used to start/stop the streaming.
  * @sd: V4L2 Sub device
@@ -2094,7 +2077,7 @@ static int imx274_probe(struct i2c_client *client)
 	imx274->ctrls.test_pattern = v4l2_ctrl_new_std_menu_items(
 		&imx274->ctrls.handler, &imx274_ctrl_ops,
 		V4L2_CID_TEST_PATTERN,
-		ARRAY_SIZE(tp_qmenu) - 1, 0, 0, tp_qmenu);
+		ARRAY_SIZE(tp_qmenu) - 1, 0, TEST_PATTERN_DISABLED, tp_qmenu);
 
 	imx274->ctrls.gain = v4l2_ctrl_new_std(
 		&imx274->ctrls.handler,
@@ -2108,7 +2091,7 @@ static int imx274_probe(struct i2c_client *client)
 		&imx274_ctrl_ops,
 		V4L2_CID_EXPOSURE, IMX274_MIN_EXPOSURE_TIME,
 		1000000 / IMX274_DEF_FRAME_RATE, 1,
-		IMX274_MIN_EXPOSURE_TIME);
+		1000000 / IMX274_DEF_FRAME_RATE);
 
 	imx274->ctrls.vflip = v4l2_ctrl_new_std(
 		&imx274->ctrls.handler,
@@ -2121,9 +2104,6 @@ static int imx274_probe(struct i2c_client *client)
 		goto err_ctrls;
 	}
 
-	/* load default control values */
-	imx274_load_default(imx274);
-
 	/* register subdevice */
 	ret = v4l2_async_register_subdev(sd);
 	if (ret < 0) {
-- 
2.17.1


Met vriendelijke groet / kind regards,

Bob Veringa


TOPIC Embedded Systems B.V.
Materiaalweg 4, 5681 RJ Best
The Netherlands

T: +31 (0) 499 33 69 79
E: bob.Veringa@topic.nl
W: www.topic.nl

Please consider the environment before printing this e-mail

  parent reply	other threads:[~2021-04-24 11:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <b236611b-3635-40c5-988a-5c9e9fae4458.949ef384-8293-46b8-903f-40a477c056ae.e28b24bb-3436-45c2-9a1c-f2edfb40a571@emailsignatures365.codetwo.com>
     [not found] ` <b236611b-3635-40c5-988a-5c9e9fae4458.0d2bd5fa-15cc-4b27-b94e-83614f9e5b38.3cf110e4-7db2-437b-a373-f2dd879058a9@emailsignatures365.codetwo.com>
2021-04-24 11:14   ` [PATCH 1/2] media: imx274: improve v4l2-compliance Bob Veringa
     [not found]     ` <b236611b-3635-40c5-988a-5c9e9fae4458.949ef384-8293-46b8-903f-40a477c056ae.ad56e9af-b436-4404-b6ae-4ce93968c3b3@emailsignatures365.codetwo.com>
     [not found]       ` <b236611b-3635-40c5-988a-5c9e9fae4458.0d2bd5fa-15cc-4b27-b94e-83614f9e5b38.8af6a0ab-fe37-4108-bf7a-19098799e037@emailsignatures365.codetwo.com>
2021-04-24 11:14         ` Bob Veringa [this message]
2021-04-29 16:16     ` Sakari Ailus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210424111459.20730-2-bob.veringa@topic.nl \
    --to=bob.veringa@topic.nl \
    --cc=leonl@leopardimaging.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=mike.looijmans@topic.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).