From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: Dongchun Zhu <dongchun.zhu@mediatek.com>
Cc: mchehab@kernel.org, andriy.shevchenko@linux.intel.com,
robh+dt@kernel.org, mark.rutland@arm.com, drinkcat@chromium.org,
tfiga@chromium.org, matthias.bgg@gmail.com, bingbu.cao@intel.com,
srv_heupstream@mediatek.com, linux-mediatek@lists.infradead.org,
linux-arm-kernel@lists.infradead.org, sj.huang@mediatek.com,
linux-media@vger.kernel.org, devicetree@vger.kernel.org,
louis.kuo@mediatek.com, shengnan.wang@mediatek.com
Subject: Re: [V3, 2/2] media: i2c: Add DW9768 VCM driver
Date: Tue, 10 Mar 2020 12:05:23 +0200 [thread overview]
Message-ID: <20200310100523.GC5379@paasikivi.fi.intel.com> (raw)
In-Reply-To: <1583834419.5781.33.camel@mhfsdcap03>
Hi Dongchun,
On Tue, Mar 10, 2020 at 06:00:19PM +0800, Dongchun Zhu wrote:
> Hi Sakari, Rob, Andy, Tomasz,
>
> On Fri, 2020-02-28 at 23:59 +0800, Dongchun Zhu wrote:
...
> > +static int dw9768_init(struct dw9768 *dw9768)
> > +{
> > + struct i2c_client *client = v4l2_get_subdevdata(&dw9768->sd);
> > + int ret, val;
> > +
> > + /* Reset DW9768_RING_PD_CONTROL_REG to default status 0x00 */
> > + ret = i2c_smbus_write_byte_data(client, DW9768_RING_PD_CONTROL_REG,
> > + DW9768_PD_MODE_OFF);
> > + if (ret < 0)
> > + return ret;
> > +
> > + /*
> > + * DW9769 requires waiting delay time of t_OPR
> > + * after PD reset takes place.
> > + */
> > + usleep_range(DW9768_T_OPR_US, DW9768_T_OPR_US + 100);
> > +
> > + ret = dw9768_write_array(dw9768, dw9768_init_regs,
> > + ARRAY_SIZE(dw9768_init_regs));
> > + if (ret)
> > + return ret;
> > +
> > + for (val = dw9768->focus->val % DW9768_MOVE_STEPS;
> > + val <= dw9768->focus->val;
> > + val += DW9768_MOVE_STEPS) {
> > + ret = dw9768_set_dac(dw9768, val);
> > + if (ret) {
> > + dev_err(&client->dev, "%s I2C failure: %d",
> > + __func__, ret);
> > + return ret;
> > + }
> > + usleep_range(DW9768_MOVE_DELAY_US,
> > + DW9768_MOVE_DELAY_US + 1000);
> > + }
> > +
>
> What do you think about the approach taken by this patch?
> From the view of VCM hardware, the collision sound of lens should only
> happen when moving position back to zero.
> When opening camera, one should be able to move lens to the position
> directly.
> I tried to replace this code to a single dw9768_set_dac(dw9768,
> dw9768->focus->val),
> there is no collision sound when open camera and it could reduce several
> hundred ms when open lens driver fd.
> Are we okay with this?
I think so. Usually on VCMs with ringing compensation the only problematic
case is when the power is cut. :-)
--
Sakari Ailus
prev parent reply other threads:[~2020-03-10 10:05 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-28 15:59 [V3, 0/2] media: i2c: add support for DW9768 VCM driver Dongchun Zhu
2020-02-28 15:59 ` [V3, 1/2] media: i2c: dw9768: Add DT support and MAINTAINERS entry Dongchun Zhu
2020-03-02 18:54 ` Rob Herring
2020-02-28 15:59 ` [V3, 2/2] media: i2c: Add DW9768 VCM driver Dongchun Zhu
2020-03-02 11:07 ` Andy Shevchenko
2020-03-05 12:05 ` Sakari Ailus
2020-03-10 10:10 ` Andy Shevchenko
2020-03-19 10:03 ` Dongchun Zhu
2020-03-19 11:36 ` Andy Shevchenko
2020-03-19 11:54 ` Dongchun Zhu
2020-03-18 10:20 ` Dongchun Zhu
2020-03-18 10:29 ` Sakari Ailus
2020-03-23 19:09 ` Tomasz Figa
2020-03-23 20:35 ` Sakari Ailus
2020-03-25 15:11 ` Tomasz Figa
2020-03-10 10:00 ` Dongchun Zhu
2020-03-10 10:05 ` Sakari Ailus [this message]
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=20200310100523.GC5379@paasikivi.fi.intel.com \
--to=sakari.ailus@linux.intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=bingbu.cao@intel.com \
--cc=devicetree@vger.kernel.org \
--cc=dongchun.zhu@mediatek.com \
--cc=drinkcat@chromium.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=louis.kuo@mediatek.com \
--cc=mark.rutland@arm.com \
--cc=matthias.bgg@gmail.com \
--cc=mchehab@kernel.org \
--cc=robh+dt@kernel.org \
--cc=shengnan.wang@mediatek.com \
--cc=sj.huang@mediatek.com \
--cc=srv_heupstream@mediatek.com \
--cc=tfiga@chromium.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