From: Andy Shevchenko <andriy.shevchenko@linux•intel.com>
To: dongchun.zhu@mediatek•com
Cc: mark.rutland@arm•com, devicetree@vger•kernel.org,
drinkcat@chromium•org, srv_heupstream@mediatek•com,
shengnan.wang@mediatek•com, tfiga@chromium•org,
louis.kuo@mediatek•com, sj.huang@mediatek•com,
robh+dt@kernel•org, linux-mediatek@lists•infradead.org,
sakari.ailus@linux•intel.com, matthias.bgg@gmail•com,
bingbu.cao@intel•com, mchehab@kernel•org,
linux-arm-kernel@lists•infradead.org,
linux-media@vger•kernel.org
Subject: Re: [V2, 2/2] media: i2c: Add more sensor modes for ov8856 camera sensor
Date: Tue, 10 Sep 2019 20:44:50 +0300 [thread overview]
Message-ID: <20190910174450.GJ2680@smile.fi.intel.com> (raw)
In-Reply-To: <20190910130446.26413-3-dongchun.zhu@mediatek.com>
On Tue, Sep 10, 2019 at 09:04:46PM +0800, dongchun.zhu@mediatek•com wrote:
> From: Dongchun Zhu <dongchun.zhu@mediatek•com>
>
> This patch mainly adds two more sensor modes for OV8856 CMOS image sensor.
> That is, the resolution of 1632*1224 and 3264*2448, corresponding to the bayer order of BGGR.
> The sensor revision also differs in some OTP register.
> +static int __ov8856_power_on(struct ov8856 *ov8856)
> +{
> + struct i2c_client *client = v4l2_get_subdevdata(&ov8856->sd);
> + int ret;
> +
> + ret = clk_prepare_enable(ov8856->xvclk);
> + if (ret < 0) {
> + dev_err(&client->dev, "failed to enable xvclk\n");
> + return ret;
> + }
> +
> + gpiod_set_value_cansleep(ov8856->n_shutdn_gpio, GPIOD_OUT_LOW);
> +
> + ret = regulator_bulk_enable(OV8856_NUM_SUPPLIES, ov8856->supplies);
> + if (ret < 0) {
> + dev_err(&client->dev, "failed to enable regulators\n");
> + goto disable_clk;
> + }
> +
> + gpiod_set_value_cansleep(ov8856->n_shutdn_gpio, GPIOD_OUT_HIGH);
> +
> + usleep_range(1400, 1500);
This should be commented why this is needed and from where the requirement
comes from. Also, not, that 100us, which is only ~7%, is small margin.
Recommended one is ~20%.
> +
> + return 0;
> +
> +disable_clk:
> + clk_disable_unprepare(ov8856->xvclk);
> +
> + return ret;
> +}
> + ov8856->is_1B_revision = (val == OV8856_1B_MODULE) ? 1 : 0;
!! will give same result without using ternary operator.
> + ov8856->xvclk = devm_clk_get(&client->dev, "xvclk");
> + if (IS_ERR(ov8856->xvclk)) {
> + dev_err(&client->dev, "failed to get xvclk\n");
> + return -EINVAL;
> + }
Previously it was optional.
How did it work before and why it's not optional?
> + ov8856->n_shutdn_gpio = devm_gpiod_get(&client->dev, "reset",
> + GPIOD_OUT_LOW);
> + if (IS_ERR(ov8856->n_shutdn_gpio)) {
> + dev_err(&client->dev, "failed to get reset-gpios\n");
> + return -EINVAL;
> + }
Ditto.
> +static const struct of_device_id ov8856_of_match[] = {
> + { .compatible = "ovti,ov8856" },
> + {},
No comma needed for terminator line.
> +};
--
With Best Regards,
Andy Shevchenko
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists•infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-09-10 17:45 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <media: ov8856: DT bindings and sensor mode improvements>
2019-09-10 13:04 ` [V2, 0/2] media: ov8856: DT bindings and sensor mode improvements dongchun.zhu
2019-09-10 13:04 ` [V2, 1/2] media: dt-bindings: media: i2c: Add bindings for ov8856 dongchun.zhu
2019-09-10 17:37 ` Andy Shevchenko
2019-09-17 12:02 ` Sakari Ailus
2019-09-17 14:44 ` Rob Herring
2019-10-30 9:00 ` Dongchun Zhu
2019-10-30 9:08 ` Sakari Ailus
2019-09-10 13:04 ` [V2, 2/2] media: i2c: Add more sensor modes for ov8856 camera sensor dongchun.zhu
2019-09-10 17:44 ` Andy Shevchenko [this message]
2019-10-30 13:04 ` Dongchun Zhu
2019-10-30 13:55 ` Sakari Ailus
2019-09-11 10:12 ` Tomasz Figa
2019-09-11 11:43 ` Sakari Ailus
2019-09-13 7:55 ` Sakari Ailus
2019-10-30 13:02 ` Dongchun Zhu
2019-11-06 14:22 ` 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=20190910174450.GJ2680@smile.fi.intel.com \
--to=andriy.shevchenko@linux$(echo .)intel.com \
--cc=bingbu.cao@intel$(echo .)com \
--cc=devicetree@vger$(echo .)kernel.org \
--cc=dongchun.zhu@mediatek$(echo .)com \
--cc=drinkcat@chromium$(echo .)org \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
--cc=linux-media@vger$(echo .)kernel.org \
--cc=linux-mediatek@lists$(echo .)infradead.org \
--cc=louis.kuo@mediatek$(echo .)com \
--cc=mark.rutland@arm$(echo .)com \
--cc=matthias.bgg@gmail$(echo .)com \
--cc=mchehab@kernel$(echo .)org \
--cc=robh+dt@kernel$(echo .)org \
--cc=sakari.ailus@linux$(echo .)intel.com \
--cc=shengnan.wang@mediatek$(echo .)com \
--cc=sj.huang@mediatek$(echo .)com \
--cc=srv_heupstream@mediatek$(echo .)com \
--cc=tfiga@chromium$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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