mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: Benjamin Bara <bbara93@gmail.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>,
	Hans de Goede <hdegoede@redhat.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.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 v2 1/2] media: i2c: imx290: Check for availability in probe()
Date: Thu, 29 Aug 2024 12:42:27 +0000	[thread overview]
Message-ID: <ZtBss-c1IN7j-Nf5@kekkonen.localdomain> (raw)
In-Reply-To: <20240828-imx290-avail-v2-1-bd320ac8e8fa@skidata.com>

Hi Benjamin,

On Wed, Aug 28, 2024 at 08:13:07PM +0200, Benjamin Bara wrote:
> 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.
> 
> Signed-off-by: Benjamin Bara <benjamin.bara@skidata.com>
> ---
> Changes since v1:
> - define operating/standby mode and use it
> - read out the standby mode during probe and ensure it is standby
> ---
>  drivers/media/i2c/imx290.c | 17 +++++++++++++++--
>  1 file changed, 15 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/i2c/imx290.c b/drivers/media/i2c/imx290.c
> index 4150e6e4b9a6..2a869576600c 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			(0 << 0)
> +#define IMX290_STANDBY_STANDBY				(1 << 0)

This should use BIT() instead (or at least unsigned values). I'll fix that
while at it, too...

-- 
Kind regards,

Sakari Ailus

  parent reply	other threads:[~2024-08-29 12:42 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-28 18:13 [PATCH v2 0/2] media: i2c: imx290: check " Benjamin Bara
2024-08-28 18:13 ` [PATCH v2 1/2] media: i2c: imx290: Check " Benjamin Bara
2024-08-29  7:05   ` Sakari Ailus
2024-08-29  7:32     ` Benjamin Bara
2024-08-29 12:39     ` Sakari Ailus
2024-08-29 12:41       ` Sakari Ailus
2024-08-29 12:42   ` Sakari Ailus [this message]
2024-08-29 13:19   ` Laurent Pinchart
2024-08-29 15:36     ` Benjamin Bara
2024-08-29 17:00       ` Laurent Pinchart
2024-08-29 16:32     ` Manivannan Sadhasivam
2024-08-29 16:48       ` Laurent Pinchart
2024-08-30  8:31         ` Manivannan Sadhasivam
2024-08-30  9:25           ` Laurent Pinchart
2024-08-30 12:25             ` Manivannan Sadhasivam
2024-08-31  0:53               ` Laurent Pinchart
2024-08-28 18:13 ` [PATCH v2 2/2] media: i2c: imx290: Remove CHIP_ID reg definition Benjamin Bara
2024-08-29 12:39   ` Laurent Pinchart
2024-08-29 13:06 ` [PATCH v2 0/2] media: i2c: imx290: check for availability in probe() 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=ZtBss-c1IN7j-Nf5@kekkonen.localdomain \
    --to=sakari.ailus@linux.intel.com \
    --cc=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 \
    /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

all inboxes | Powered by JetHome®