From: Sakari Ailus <sakari.ailus@iki.fi>
To: "Rapolu, Chiranjeevi" <chiranjeevi.rapolu@intel.com>
Cc: "linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
"sakari.ailus@linux.intel.com" <sakari.ailus@linux.intel.com>,
"Zheng, Jian Xu" <jian.xu.zheng@intel.com>,
"Mani, Rajmohan" <rajmohan.mani@intel.com>,
"Yang, Hyungwoo" <hyungwoo.yang@intel.com>,
"tfiga@chromium.org" <tfiga@chromium.org>
Subject: Re: [PATCH] ov5670: Add Omnivision OV5670 5M sensor support
Date: Fri, 26 May 2017 11:29:07 +0300 [thread overview]
Message-ID: <20170526082907.GO29527@valkosipuli.retiisi.org.uk> (raw)
In-Reply-To: <8408A4B5C50F354EA5F62D9FC805153D018D4DD9@ORSMSX115.amr.corp.intel.com>
Hi Chiranjeevi,
On Fri, May 26, 2017 at 01:19:59AM +0000, Rapolu, Chiranjeevi wrote:
> >> +/* Analog gain controls from sensor */
> >> +#define ANALOG_GAIN_MIN 0
> >> +#define ANALOG_GAIN_MAX 8191
> >> +#define ANALOG_GAIN_STEP 1
> >> +#define ANALOG_GAIN_DEFAULT 128
> >> +
> >> +/* Exposure controls from sensor */
> >> +#define EXPOSURE_MIN 0
> >> +#define EXPOSURE_MAX 1048575
> >> +#define EXPOSURE_STEP 1
> >> +#define EXPOSURE_DEFAULT 47232
> >
> >Are these values dependent on sensor configuration i.e. in the case of this
> >driver modes?
> >
> Default values for a given resolutions can be fine-tuned. I think it is up to
> the HAL/application as to what default exposure for a given resolution. Driver
> has the support to change per application.
How about the minimum and maximum values? Are they dependent on other
configuration?
...
> >> +/* Write a list of registers */
> >> +static int ov5670_write_regs(struct ov5670 *ov5670,
> >> + const struct ov5670_reg *regs,
> >> + int len)
> >
> >How about using unsigned int for len?
> >
> Now u32 len.
> >> +{
> >> + struct i2c_client *client = v4l2_get_subdevdata(&ov5670->sd);
> >> + int i;
> >
> >i as well.
> >
> Now u32 i
An insigned int should do. Types with explicit widths should be only used
when the exact value ranges is known, e.g. a 32-bit or 16-bit register.
...
> >> +static int ov5670_set_stream(struct v4l2_subdev *sd, int enable)
> >> +{
> >> + struct ov5670 *ov5670 = to_ov5670(sd);
> >> + int ret = 0;
> >> +
> >> + mutex_lock(&ov5670->mutex);
> >> + if (ov5670->streaming == enable) {
> >> + mutex_unlock(&ov5670->mutex);
> >> + return 0;
> >> + }
> >> + mutex_unlock(&ov5670->mutex);
> >> +
> >> + if (enable) {
> >> + ret = ov5670_prepare_streaming(ov5670);
> >
> >ov5670_prepare_streaming() and ov5670_start_streaming() are always called
> >sequientally. Could you combine the two?
> >
> >About locking --- you would likely benefit from an unlocked variant of
> >v4l2_ctrl_handler_setup(). I uploaded it here, let me know if it works for
> >you:
> >
> ><URL:https://git.linuxtv.org/sailus/media_tree.git/log/?h=ctrl-setup-unlocked>
> >
> Tried unlocked __v4l2_ctrl_handler_setup(), working fine, used.
> Can you push this patch?
Great! I sent it to the list a moment ago. :-)
> >> +static struct i2c_driver ov5670_i2c_driver = {
> >
> >const?
> >
> Made const
I later on figured out this was probably a bad suggestion. The driver
registration changes the i2c_driver struct, causing a compiler warning.
> >> + .driver = {
> >> + .name = "ov5670",
> >> + .owner = THIS_MODULE,
> >> + .pm = &ov5670_pm_ops,
> >> + .acpi_match_table = ACPI_PTR(ov5670_acpi_ids),
> >> + },
> >> + .probe = ov5670_probe,
> >> + .remove = ov5670_remove,
> >> + .id_table = ov5670_id_table,
> >> +};
> >> +
> >> +module_i2c_driver(ov5670_i2c_driver);
> >> +
> >> +MODULE_AUTHOR("Rapolu, Chiranjeevi <chiranjeevi.rapolu@intel.com>");
> >> +MODULE_AUTHOR("Yang, Hyungwoo <hyungwoo.yang@intel.com>");
> >> +MODULE_AUTHOR("Pu, Yuning <yuning.pu@intel.com>");
> >> +MODULE_DESCRIPTION("Omnivision ov5670 sensor driver");
> >> +MODULE_LICENSE("GPL");
--
Kind regards,
Sakari Ailus
e-mail: sakari.ailus@iki.fi XMPP: sailus@retiisi.org.uk
next prev parent reply other threads:[~2017-05-26 8:29 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-03 22:06 [PATCH] ov5670: Add Omnivision OV5670 5M sensor support Chiranjeevi Rapolu
2017-05-04 8:48 ` Sakari Ailus
2017-05-04 8:50 ` Sakari Ailus
2017-05-26 1:21 ` Rapolu, Chiranjeevi
2017-05-26 1:19 ` Rapolu, Chiranjeevi
2017-05-26 8:29 ` Sakari Ailus [this message]
2017-06-14 18:27 ` Rapolu, Chiranjeevi
2017-05-25 22:42 ` [PATCH v2 1/1] [media] i2c: " chiranjeevi.rapolu
2017-05-26 6:42 ` kbuild test robot
2017-06-14 1:39 ` [PATCH v3 1/1] " chiranjeevi.rapolu
2017-06-14 13:47 ` [PATCH] i2c: fix platform_no_drv_owner.cocci warnings kbuild test robot
2017-06-14 13:47 ` [PATCH v3 1/1] i2c: Add Omnivision OV5670 5M sensor support kbuild test robot
2017-06-14 13:47 ` [PATCH] i2c: fix semicolon.cocci warnings kbuild test robot
2017-06-14 23:00 ` [PATCH v3 1/1] i2c: Add Omnivision OV5670 5M sensor support Sakari Ailus
2017-07-01 22:31 ` Rapolu, Chiranjeevi
2017-07-01 20:49 ` [PATCH v4 " chiranjeevi.rapolu
2017-07-07 22:24 ` Sakari Ailus
2017-07-14 4:35 ` Rapolu, Chiranjeevi
2017-07-07 22:48 ` Mani, Rajmohan
2017-07-14 4:36 ` Rapolu, Chiranjeevi
2017-07-14 1:51 ` [PATCH v5 " Chiranjeevi Rapolu
2017-07-14 10:43 ` Sakari Ailus
2021-07-08 8:10 ` Laurent Pinchart
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=20170526082907.GO29527@valkosipuli.retiisi.org.uk \
--to=sakari.ailus@iki.fi \
--cc=chiranjeevi.rapolu@intel.com \
--cc=hyungwoo.yang@intel.com \
--cc=jian.xu.zheng@intel.com \
--cc=linux-media@vger.kernel.org \
--cc=rajmohan.mani@intel.com \
--cc=sakari.ailus@linux.intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.