mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Bryan O'Donoghue <bod@kernel.org>
Cc: Pratap Nirujogi <pratap.nirujogi@amd.com>,
	mchehab@kernel.org, sakari.ailus@linux.intel.com,
	kieran.bingham@ideasonboard.com, hao.yao@intel.com,
	mehdi.djait@linux.intel.com, dongcheng.yan@linux.intel.com,
	hverkuil@xs4all.nl, krzk@kernel.org,
	dave.stevenson@raspberrypi.com, hdegoede@redhat.com,
	jai.luthra@ideasonboard.com, tomi.valkeinen@ideasonboard.com,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	benjamin.chan@amd.com, bin.du@amd.com, grosikop@amd.com,
	king.li@amd.com, dantony@amd.com, vengutta@amd.com,
	Phil.Jawich@amd.com
Subject: Re: [PATCH v4] media: i2c: Add OV05C10 camera sensor driver
Date: Tue, 15 Jul 2025 21:13:58 +0300	[thread overview]
Message-ID: <20250715181358.GI20231@pendragon.ideasonboard.com> (raw)
In-Reply-To: <60cf7590-4fd8-419b-a782-8bc89fb5395a@kernel.org>

On Tue, Jul 15, 2025 at 12:54:30PM +0100, Bryan O'Donoghue wrote:
> On 14/07/2025 21:51, Pratap Nirujogi wrote:
> 
> > +	ret = ov05c10_init_controls(ov05c10);
> > +	if (ret) {
> > +		dev_err(ov05c10->dev, "fail to init ov05c10 ctl %d\n", ret);
> > +		goto err_pm;
> > +	}
> 
> I would expect to see an "identify_module()" function here, something 
> similar to ov02c10.
> 
> ret = ov02c10_power_on(&client->dev);
> if (ret) {
>          dev_err_probe(&client->dev, ret, "failed to power on\n");
>          return ret;
> }
> 
> ret = ov02c10_identify_module(ov02c10);
> if (ret) {
>         dev_err(&client->dev, "failed to find sensor: %d", ret);
>          goto probe_error_power_off;
> }
> 
> ret = ov02c10_init_controls(ov02c10);
> if (ret) {
>         dev_err(&client->dev, "failed to init controls: %d", ret);
>          goto probe_error_v4l2_ctrl_handler_free;
> }
> 
> Standard practice is to try to talk to the sensor in probe() and bug out 
> if you can't.

It's actually not that standard, and is a frowned upon behaviour when
the sensor has a privacy LED GPIO connected to the power rail instead of
a hardware streaming signal. It would cause the privacy GPIO to flash at
boot time, which is considered a worrying behaviour for users. That's
why a few sensor drivers make runtime identification optional. We should
try to handle that in a standard way across all drivers, likely based on
a device property..

> With your current logic, the first time you'd realise no sensor was 
> present or is in reset etc is the first time you try to stream I think..
> 
> Definitely a good idea to probe for your sensor in probe failing the 
> probe if you can't find the hardware.

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2025-07-15 18:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-14 20:51 Pratap Nirujogi
2025-07-15 11:54 ` Bryan O'Donoghue
2025-07-15 18:13   ` Laurent Pinchart [this message]
2025-07-16 18:00     ` Nirujogi, Pratap
2025-07-15 14:19 ` kernel test robot
2025-07-15 16:45 ` kernel test robot

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=20250715181358.GI20231@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=Phil.Jawich@amd.com \
    --cc=benjamin.chan@amd.com \
    --cc=bin.du@amd.com \
    --cc=bod@kernel.org \
    --cc=dantony@amd.com \
    --cc=dave.stevenson@raspberrypi.com \
    --cc=dongcheng.yan@linux.intel.com \
    --cc=grosikop@amd.com \
    --cc=hao.yao@intel.com \
    --cc=hdegoede@redhat.com \
    --cc=hverkuil@xs4all.nl \
    --cc=jai.luthra@ideasonboard.com \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=king.li@amd.com \
    --cc=krzk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=mehdi.djait@linux.intel.com \
    --cc=pratap.nirujogi@amd.com \
    --cc=sakari.ailus@linux.intel.com \
    --cc=tomi.valkeinen@ideasonboard.com \
    --cc=vengutta@amd.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

all inboxes | Powered by JetHome®