From: Dongchun Zhu <dongchun.zhu@mediatek.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: <linus.walleij@linaro.org>, <bgolaszewski@baylibre.com>,
<mchehab@kernel.org>, <robh+dt@kernel.org>,
<mark.rutland@arm.com>, <sakari.ailus@linux.intel.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: [V8, 2/2] media: i2c: ov02a10: Add OV02A10 image sensor driver
Date: Mon, 11 May 2020 20:06:35 +0800 [thread overview]
Message-ID: <1589198795.8804.276.camel@mhfsdcap03> (raw)
In-Reply-To: <20200511093308.GF185537@smile.fi.intel.com>
Hi Andy,
Thanks for the kindly review.
On Mon, 2020-05-11 at 12:33 +0300, Andy Shevchenko wrote:
> On Sat, May 09, 2020 at 04:06:27PM +0800, Dongchun Zhu wrote:
> > Add a V4L2 sub-device driver for OV02A10 image sensor.
>
> ...
>
> > +#define OV02A10_ID(_msb, _lsb) ((_msb) << 8 | (_lsb))
>
> How often do you use this macro?
>
Just once.
I would try to use the macro function directly in next release.
> ...
>
> > +static int ov02a10_read_smbus(struct ov02a10 *ov02a10, unsigned char reg,
> > + unsigned char *val)
> > +{
> > + struct i2c_client *client = v4l2_get_subdevdata(&ov02a10->subdev);
> > + int ret;
> > +
> > + ret = i2c_smbus_read_byte_data(client, reg);
>
> > +
>
> Extra blank line.
>
Thanks for the carefully reminder.
This error can easily be neglected.
I would remove it in next release.
> > + if (ret < 0)
> > + return ret;
> > +
> > + *val = (unsigned char)ret;
> > +
> > + return 0;
> > +}
>
> ...
>
> > +static int ov02a10_entity_init_cfg(struct v4l2_subdev *sd,
> > + struct v4l2_subdev_pad_config *cfg)
> > +{
> > + struct v4l2_subdev_format fmt = {
>
> > + .which = cfg ? V4L2_SUBDEV_FORMAT_TRY
> > + : V4L2_SUBDEV_FORMAT_ACTIVE,
>
> I think it would be fine to have it on one line.
>
Got it.
Fixed in next release.
> > + .format = {
> > + .width = 1600,
> > + .height = 1200,
> > + }
> > + };
> > +
> > + ov02a10_set_fmt(sd, cfg, &fmt);
> > +
> > + return 0;
> > +}
>
> ...
>
> > + if (!ret) {
> > + if (rotation == 180) {
>
> if (a) {
> if (b) {
> ...
> }
> }
>
> ==
>
> if (a && b) {
> ...
> }
>
Thanks for the reminder :-)
Next release would use:
if (!ret && rotation == 180) {
...
}
> > + ov02a10->upside_down = true;
> > + ov02a10->fmt.code = MEDIA_BUS_FMT_SRGGB10_1X10;
> > + }
> > + }
>
next prev parent reply other threads:[~2020-05-11 12:07 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-09 8:06 [V8, 0/2] media: i2c: Add support for OV02A10 sensor Dongchun Zhu
2020-05-09 8:06 ` [V8, 1/2] media: dt-bindings: media: i2c: Document OV02A10 bindings Dongchun Zhu
2020-05-11 16:02 ` Rob Herring
2020-05-11 19:54 ` Sakari Ailus
2020-05-12 2:40 ` Dongchun Zhu
2020-05-21 18:59 ` Tomasz Figa
2020-05-24 20:33 ` Sakari Ailus
2020-05-21 19:35 ` Tomasz Figa
2020-05-22 9:44 ` Dongchun Zhu
2020-05-09 8:06 ` [V8, 2/2] media: i2c: ov02a10: Add OV02A10 image sensor driver Dongchun Zhu
2020-05-11 8:51 ` Sakari Ailus
2020-05-11 11:52 ` Dongchun Zhu
2020-05-11 9:33 ` Andy Shevchenko
2020-05-11 12:06 ` Dongchun Zhu [this message]
2020-05-21 19:32 ` Tomasz Figa
2020-05-23 4:50 ` Dongchun Zhu
2020-06-10 18:36 ` Tomasz Figa
2020-06-12 9:31 ` Dongchun Zhu
2020-06-12 18:49 ` Tomasz Figa
2020-06-15 7:24 ` Dongchun Zhu
2020-06-15 8:44 ` Andy Shevchenko
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=1589198795.8804.276.camel@mhfsdcap03 \
--to=dongchun.zhu@mediatek.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=bgolaszewski@baylibre.com \
--cc=bingbu.cao@intel.com \
--cc=devicetree@vger.kernel.org \
--cc=drinkcat@chromium.org \
--cc=linus.walleij@linaro.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=sakari.ailus@linux.intel.com \
--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;
as well as URLs for NNTP newsgroup(s).