linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ian Arkver <ian.arkver.dev@gmail.com>
To: Todor Tomov <todor.tomov@linaro.org>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	broonie@kernel.org
Cc: robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com,
	ijc+devicetree@hellion.org.uk, galak@codeaurora.org,
	mchehab@osg.samsung.com, hverkuil@xs4all.nl,
	geert@linux-m68k.org, matrandg@cisco.com, sakari.ailus@iki.fi,
	linux-media@vger.kernel.org
Subject: Re: [PATCH v6 2/2] media: Add a driver for the ov5645 camera sensor.
Date: Wed, 26 Oct 2016 13:48:24 +0100	[thread overview]
Message-ID: <e88eeb08-6d33-df4e-5d75-6606a4ffa0f3@gmail.com> (raw)
In-Reply-To: <5810931B.4070101@linaro.org>

[snip]
>>>>>> +static int ov5645_regulators_enable(struct ov5645 *ov5645)
>>>>>> +{
>>>>>> +	int ret;
>>>>>> +
>>>>>> +	ret = regulator_enable(ov5645->io_regulator);
>>>>>> +	if (ret < 0) {
>>>>>> +		dev_err(ov5645->dev, "set io voltage failed\n");
>>>>>> +		return ret;
>>>>>> +	}
>>>>>> +
>>>>>> +	ret = regulator_enable(ov5645->core_regulator);
>>>>>> +	if (ret) {
>>>>>> +		dev_err(ov5645->dev, "set core voltage failed\n");
>>>>>> +		goto err_disable_io;
>>>>>> +	}
>>>>>> +
>>>>>> +	ret = regulator_enable(ov5645->analog_regulator);
>>>>>> +	if (ret) {
>>>>>> +		dev_err(ov5645->dev, "set analog voltage failed\n");
>>>>>> +		goto err_disable_core;
>>>>>> +	}
>>>>> How about using the regulator bulk API ? This would simplify the enable
>>>>> and disable functions.
>>>> The driver must enable the regulators in this order. I can see in the
>>>> implementation of the bulk api that they are enabled again in order
>>>> but I don't see stated anywhere that it is guaranteed to follow the
>>>> same order in future. I'd prefer to keep it explicit as it is now.
>>> I believe it should be an API guarantee, otherwise many drivers using the bulk
>>> API would break. Mark, could you please comment on that ?
>> Ok, let's wait for a response from Mark.
I don't have the OV5645 datasheet, but I do have the OV5640 and OV5647 
datasheets. Both of these show that AVDD should come up before DVDD 
where DVDD is externally supplied, although the minimum delay between 
them is 0ms. Both datasheets also imply that this requirement is only to 
allow host SCCB access on a shared I2C bus while the device is powering 
up. They imply that if one waits 20ms after power on then SCCB will be 
fine without this sequencing. Your code includes an msleep(20);

Further, the reference schematic for the OV5647 shows three separate 
LDOs with no sequencing between them.

I've no comment on whether the bulk regulator API needs a "keep 
sequencing" flag or somesuch, but I don't think this device will drive 
that requirement.

Regards,
Ian


  parent reply	other threads:[~2016-10-26 12:48 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-08  9:13 [PATCH v6 0/2] OV5645 camera sensor driver Todor Tomov
2016-09-08  9:13 ` [PATCH v6 1/2] media: i2c/ov5645: add the device tree binding document Todor Tomov
2016-09-08 12:22   ` Laurent Pinchart
2016-10-14 12:01     ` Todor Tomov
2016-10-19  8:49       ` Laurent Pinchart
2016-10-19  9:14         ` Todor Tomov
2016-10-19  9:21           ` Laurent Pinchart
2016-10-26 18:53             ` Rob Herring
2016-11-01  8:24               ` Todor Tomov
2016-11-03  0:06                 ` Laurent Pinchart
2016-09-08  9:13 ` [PATCH v6 2/2] media: Add a driver for the ov5645 camera sensor Todor Tomov
2016-09-08 12:22   ` Laurent Pinchart
2016-10-14 11:57     ` Todor Tomov
2016-10-19  8:44       ` Laurent Pinchart
2016-10-26 11:15         ` Todor Tomov
2016-10-26 11:27           ` Todor Tomov
2016-10-26 11:51             ` Mark Brown
2016-11-14 12:18               ` Laurent Pinchart
2016-11-14 13:46                 ` Mark Brown
2016-10-26 12:48             ` Ian Arkver [this message]
2016-10-26 14:07               ` Todor Tomov
2016-10-26 16:48                 ` Ian Arkver
2016-10-27  7:50                   ` Todor Tomov

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=e88eeb08-6d33-df4e-5d75-6606a4ffa0f3@gmail.com \
    --to=ian.arkver.dev@gmail.com \
    --cc=broonie@kernel.org \
    --cc=galak@codeaurora.org \
    --cc=geert@linux-m68k.org \
    --cc=hverkuil@xs4all.nl \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=matrandg@cisco.com \
    --cc=mchehab@osg.samsung.com \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=sakari.ailus@iki.fi \
    --cc=todor.tomov@linaro.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;
as well as URLs for NNTP newsgroup(s).