From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: bbara93@gmail.com
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Hans de Goede <hdegoede@redhat.com>,
Alexander Stein <alexander.stein@ew.tq-group.com>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
Benjamin Bara <benjamin.bara@skidata.com>
Subject: Re: [PATCH v3 1/7] media: i2c: imx290: Define standby mode values
Date: Mon, 2 Sep 2024 22:55:29 +0300 [thread overview]
Message-ID: <20240902195529.GP1995@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20240902-imx290-avail-v3-1-b32a12799fed@skidata.com>
Hi Benjamin,
On Mon, Sep 02, 2024 at 05:57:26PM +0200, bbara93@gmail.com wrote:
> From: Benjamin Bara <benjamin.bara@skidata.com>
>
> The imx290 datasheet states that the IMX290_STANDBY register has two
> values: 0 for operating and 1 for standby. Define and use them.
>
> Signed-off-by: Benjamin Bara <benjamin.bara@skidata.com>
> ---
> Changes since v2:
> - new, split out from the previous 1/2
> ---
> drivers/media/i2c/imx290.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/i2c/imx290.c b/drivers/media/i2c/imx290.c
> index 4150e6e4b9a6..1c97f9650eb4 100644
> --- a/drivers/media/i2c/imx290.c
> +++ b/drivers/media/i2c/imx290.c
> @@ -29,6 +29,8 @@
> #include <media/v4l2-subdev.h>
>
> #define IMX290_STANDBY CCI_REG8(0x3000)
> +#define IMX290_STANDBY_OPERATING 0x00
> +#define IMX290_STANDBY_STANDBY BIT(0)
The convention, for single-bit fields, is to define a macro to describe
the bit, but not a macro to describe the bit not being set.
> #define IMX290_REGHOLD CCI_REG8(0x3001)
> #define IMX290_XMSTA CCI_REG8(0x3002)
> #define IMX290_ADBIT CCI_REG8(0x3005)
> @@ -1016,7 +1018,8 @@ static int imx290_start_streaming(struct imx290 *imx290,
> return ret;
> }
>
> - cci_write(imx290->regmap, IMX290_STANDBY, 0x00, &ret);
> + cci_write(imx290->regmap, IMX290_STANDBY, IMX290_STANDBY_OPERATING,
> + &ret);
I would thus rather drop this change.
>
> msleep(30);
>
> @@ -1029,7 +1032,7 @@ static int imx290_stop_streaming(struct imx290 *imx290)
> {
> int ret = 0;
>
> - cci_write(imx290->regmap, IMX290_STANDBY, 0x01, &ret);
> + cci_write(imx290->regmap, IMX290_STANDBY, IMX290_STANDBY_STANDBY, &ret);
And keep this one.
>
> msleep(30);
>
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2024-09-02 19:56 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-02 15:57 [PATCH v3 0/7] media: i2c: imx290: check for availability in probe() bbara93
2024-09-02 15:57 ` [PATCH v3 1/7] media: i2c: imx290: Define standby mode values bbara93
2024-09-02 19:55 ` Laurent Pinchart [this message]
2024-09-02 20:05 ` Benjamin Bara
2024-09-02 15:57 ` [PATCH v3 2/7] media: i2c: imx290: Define absolute control ranges bbara93
2024-09-02 18:00 ` Dave Stevenson
2024-09-02 19:43 ` Benjamin Bara
2024-09-02 20:06 ` Laurent Pinchart
2024-09-02 21:17 ` Benjamin Bara
2024-09-03 7:38 ` Benjamin Bara
2024-09-02 15:57 ` [PATCH v3 3/7] media: i2c: imx290: Remove CHIP_ID reg definition bbara93
2024-09-02 15:57 ` [PATCH v3 4/7] media: i2c: imx290: Introduce initial "off" mode & link freq bbara93
2024-09-02 19:58 ` Laurent Pinchart
2024-09-02 20:55 ` Benjamin Bara
2024-09-03 13:00 ` Laurent Pinchart
2024-09-03 14:13 ` Dave Stevenson
2024-09-02 15:57 ` [PATCH v3 5/7] media: i2c: imx290: Avoid communication during probe() bbara93
2024-09-02 20:00 ` Laurent Pinchart
2024-09-02 21:03 ` Benjamin Bara
2024-09-02 15:57 ` [PATCH v3 6/7] media: i2c: imx290: Check for availability in probe() bbara93
2024-09-02 18:22 ` Dave Stevenson
2024-09-02 20:01 ` Laurent Pinchart
2024-09-02 20:03 ` Benjamin Bara
2024-09-02 15:57 ` [PATCH v3 7/7] media: i2c: imx290: Implement a "privacy mode" for probe() bbara93
2024-09-02 18:10 ` Dave Stevenson
2024-09-02 19:49 ` Benjamin Bara
2024-09-02 20:04 ` Laurent Pinchart
2024-09-02 21:04 ` Benjamin Bara
2024-09-02 17:55 ` [PATCH v3 0/7] media: i2c: imx290: check for availability in probe() Dave Stevenson
2024-09-02 18:18 ` Benjamin Bara
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=20240902195529.GP1995@pendragon.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=alexander.stein@ew.tq-group.com \
--cc=bbara93@gmail.com \
--cc=benjamin.bara@skidata.com \
--cc=hdegoede@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=manivannan.sadhasivam@linaro.org \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.com \
/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 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.