public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexander Stein <alexander.stein@ew.tq-group.com>
To: Mauro Carvalho Chehab <mchehab@kernel.org>,
	Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Benjamin Bara <bbara93@gmail.com>
Cc: Hans de Goede <hdegoede@redhat.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	Benjamin Bara <benjamin.bara@skidata.com>
Subject: Re: [PATCH 2/2] media: i2c: imx290: Check for availability in probe()
Date: Wed, 07 Aug 2024 10:33:51 +0200	[thread overview]
Message-ID: <6072611.lOV4Wx5bFT@steina-w> (raw)
In-Reply-To: <20240807-imx290-avail-v1-2-666c130c7601@skidata.com>

Hi Benjamin,

Am Mittwoch, 7. August 2024, 10:10:28 CEST schrieb Benjamin Bara:
> Currently, the V4L2 subdevice is also created when the device is not
> available/connected. In this case, dmesg shows the following:
> 
> [   10.419510] imx290 7-001a: Error writing reg 0x301c: -6
> [   10.428981] imx290 7-001a: Error writing reg 0x3020: -6
> [   10.442712] imx290 7-001a: Error writing reg 0x3018: -6
> [   10.454018] imx290 7-001a: Error writing reg 0x3020: -6
> 
> which seems to come from imx290_ctrl_update() after the subdev init is
> finished. However, as the errors are ignored, the subdev is initialized
> but simply does not work. From userspace perspective, there is no
> visible difference between a working and not-working subdevice (except
> when trying it out or watching for the error message).
> 
> This commit adds a simple availability check before starting with the
> subdev initialization to error out instead.

There is already a patch reading the ID register at [1]. This also reads the
ID register. But I don't have any documentation regarding that register,
neither address nor values definitions. If there is known information about
that I would prefer reading the ID and compare it to expected values.

Best regards,
Alexander

[1] https://gitlab.com/ideasonboard/nxp/linux/-/commit/85ce725f1de7c16133bfb92b2ab0d3d84efcdb47

> Signed-off-by: Benjamin Bara <benjamin.bara@skidata.com>
> ---
>  drivers/media/i2c/imx290.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/media/i2c/imx290.c b/drivers/media/i2c/imx290.c
> index 4150e6e4b9a6..a86076e42a36 100644
> --- a/drivers/media/i2c/imx290.c
> +++ b/drivers/media/i2c/imx290.c
> @@ -1580,6 +1580,11 @@ static int imx290_probe(struct i2c_client *client)
>  	pm_runtime_set_autosuspend_delay(dev, 1000);
>  	pm_runtime_use_autosuspend(dev);
>  
> +	/* Make sure the sensor is available before V4L2 subdev init. */
> +	ret = cci_read(imx290->regmap, IMX290_STANDBY, NULL, NULL);
> +	if (ret)
> +		goto err_pm;
> +
>  	/* Initialize the V4L2 subdev. */
>  	ret = imx290_subdev_init(imx290);
>  	if (ret)
> 
> 


-- 
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
http://www.tq-group.com/



  reply	other threads:[~2024-08-07  8:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-07  8:10 [PATCH 0/2] media: i2c: imx290: check for availability in probe() Benjamin Bara
2024-08-07  8:10 ` [PATCH 1/2] media: v4l2-cci: Allow "empty read" Benjamin Bara
2024-08-07  8:10 ` [PATCH 2/2] media: i2c: imx290: Check for availability in probe() Benjamin Bara
2024-08-07  8:33   ` Alexander Stein [this message]
2024-08-07  8:43     ` Sakari Ailus
2024-08-07  8:50       ` Benjamin Bara
2024-08-07  8:47     ` Benjamin Bara
2024-08-07  9:49       ` Laurent Pinchart
2024-08-07 11:07         ` Benjamin Bara
2024-08-07 12:12           ` Alexander Stein
2024-08-07 12:16             ` Laurent Pinchart
2024-08-07 12:39               ` Alexander Stein
2024-08-07 12:40                 ` Alexander Stein

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=6072611.lOV4Wx5bFT@steina-w \
    --to=alexander.stein@ew.tq-group.com \
    --cc=bbara93@gmail.com \
    --cc=benjamin.bara@skidata.com \
    --cc=hdegoede@redhat.com \
    --cc=laurent.pinchart@ideasonboard.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox