aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/media/i2c/ov13858.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2020-05-18media: i2c: ov13858: Parse and register propertiesJacopo Mondi1-1/+12
Parse device properties and register controls for them using the newly introduced helpers. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2019-06-21media: i2c: Fix Unnecessary Semicolon Warning Reported by coccicheckShobhit Kukreti1-2/+2
Removed the warning from the following files: drivers/media/i2c/ov13858.c drivers/media/i2c/ov2685.c drivers/media/i2c/ov5695.c Signed-off-by: Shobhit Kukreti <shobhitkukreti@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-06media: ov13858: Check for possible null pointerChiranjeevi Rapolu1-2/+4
Check for possible null pointer to avoid crash. Signed-off-by: Chiranjeevi Rapolu <chiranjeevi.rapolu@intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-08-31media: i2c: Fix pm_runtime_get_if_in_use() usage in sensor driversSakari Ailus1-1/+1
pm_runtime_get_if_in_use() returns -EINVAL if runtime PM is disabled. This should not be considered an error. Generally the driver has enabled runtime PM already so getting this error due to runtime PM being disabled will not happen. Instead of checking for lesser or equal to zero, check for zero only. Address this for drivers where this pattern exists. This patch has been produced using the following command: $ git grep -l pm_runtime_get_if_in_use -- drivers/media/i2c/ | \ xargs perl -i -pe 's/(pm_runtime_get_if_in_use\(.*\)) \<\= 0/!$1/' Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Tomasz Figa <tfiga@chromium.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-08-31media: ov5670, ov13858: Use pm_runtime_idleSakari Ailus1-9/+1
Replace the calls to pm_runtime_get_noresume() and pm_runtime_put() with pm_runtime_idle() in the driver's probe function. This will have the same effect with fewer calls. pm_runtime_disable() in remove is sufficient as the device is already in RPM_SUSPENDED state. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-05-04media: ov13858: Remove owner assignment from i2c_driverFabio Estevam1-1/+0
Structure i2c_driver does not need to set the owner field, as this will be populated by the driver core. Generated by scripts/coccinelle/api/platform_no_drv_owner.cocci. Cc: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-04-04media: ov13858: Update to SPDX identifierChiranjeevi Rapolu1-13/+2
Replace GPL v2 license notice with SPDX license identifier. Signed-off-by: Chiranjeevi Rapolu <chiranjeevi.rapolu@intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-04media: v4l: Bring back array_size parameter to v4l2_find_nearest_sizeSakari Ailus1-1/+3
An older version of the driver patches were merged accidentally which resulted in missing the array_size parameter that tells the length of the array that contains the different supported sizes. Bring it back to v4l2_find_nearest size and make the corresponding change for the drivers using it as well. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-03-21media: ov13858: Use v4l2_find_nearest_sizeSakari Ailus1-34/+2
Use v4l2_find_nearest_size instead of a driver specific function to find nearest matching size. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-02-23ov13858: fix endiannes warningsMauro Carvalho Chehab1-5/+8
3 warning regressions: + drivers/media/i2c/ov13858.c: warning: cast to restricted __be32: => 1093:16 + drivers/media/i2c/ov13858.c: warning: incorrect type in assignment (different base types): => 1111:13 + drivers/media/i2c/ov13858.c: warning: incorrect type in initializer (different base types): => 1071:27 Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-02-23media: ov13858: Use false for boolean valueGustavo A. R. Silva1-1/+1
Assign true or false to boolean variables instead of an integer value. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-02-23media: ov13858: Avoid possible null first frameChiranjeevi Rapolu1-0/+4
Previously, the sensor, with default settings, was outputting SOF without data. This results in frame sync error on the receiver side. Now, configure the sensor to output SOF with MIPI data for all frames. This avoids possible null first frame on the bus. Signed-off-by: Chiranjeevi Rapolu <chiranjeevi.rapolu@intel.com> Signed-off-by: Tianshu Qiu <tian.shu.qiu@intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-10-31media: ov13858: Add support for flash and lens devicesSakari Ailus1-1/+1
Parse async sub-devices related to the sensor by switching the async sub-device registration function. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-10-04[media] ov13858: Use do_div() for dividing a 64-bit numberSakari Ailus1-4/+10
ov13858 contained a 64-bit division. Use do_div() for calculating it. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Tested-by: Chiranjeevi Rapolu <chiranjeevi.rapolu@intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2017-10-04[media] media: ov13858: Fix 4224x3136 video flickering at some vblanksChiranjeevi Rapolu1-2/+2
Previously, with crop (0, 0), (4255, 3167), VTS < 0xC9E was resulting in blank frames sometimes. This appeared as video flickering. But we need VTS < 0xC9E to get ~30fps. Omni Vision recommends to use crop (0,8), (4255, 3159) for 4224x3136. With this crop, VTS 0xC8E is supported and yields ~30fps. Signed-off-by: Chiranjeevi Rapolu <chiranjeevi.rapolu@intel.com> Reviewed-by: Tomasz Figa <tfiga@chromium.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2017-10-04[media] media: ov13858: Calculate pixel-rate at runtime, use modeChiranjeevi Rapolu1-20/+29
Calculate pixel-rate at run time instead of compile time. Instead of using hardcoded pixels-per-line, extract it from current sensor mode. Signed-off-by: Chiranjeevi Rapolu <chiranjeevi.rapolu@intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2017-08-20media: ov13858: Limit vblank to permissible rangeChiranjeevi Rapolu1-12/+23
Previously, vblank range given to user was too big, falling outside of permissible range for a given resolution. Sometimes, too low vblank resulted in errors. Now, limit vblank to only permissible range for a given resolution. This change limits lower-bounds of vblank, doesn't affect upper bounds. Signed-off-by: Chiranjeevi Rapolu <chiranjeevi.rapolu@intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-08-09media: ov13858: Increase digital gain granularity, rangeChiranjeevi Rapolu1-16/+16
Previously, possible digital gains were just 1x, 2x and 4x. These coarse gains were not sufficient in fine-tuning the image capture. Now, digital gain range is [0, 16x] with each step 1/1024, default 1x. This is achieved through OV13858 MWB R/G/B gain controls. Signed-off-by: Chiranjeevi Rapolu <chiranjeevi.rapolu@intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-08-09media: ov13858: Correct link-frequency and pixel-rateChiranjeevi Rapolu1-13/+15
Previously both link-frequency and pixel-rate reported by the sensor was incorrect, resulting in incorrect FPS. Report link-frequency in Hz rather than link data rate in bps. Calculate pixel-rate from link-frequency. Signed-off-by: Chiranjeevi Rapolu <chiranjeevi.rapolu@intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-08-09media: ov13858: Fix initial expsoure maxChiranjeevi Rapolu1-2/+3
Previously, initial exposure max was set incorrectly to (0x7fff - 8). Now, limit exposure max to current resolution (VTS - 8). Signed-off-by: Chiranjeevi Rapolu <chiranjeevi.rapolu@intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-08-09media: ov13858: Set default fps as current fpsChiranjeevi Rapolu1-1/+4
On format change, sometimes, sensor was streaming at a much higher FPS than the default. This was resulting in various problems like frame drops/corruption. Upon format change, set default vblank as current vblank. This will ensure that sensor will start streaming at default fps. Signed-off-by: Chiranjeevi Rapolu <chiranjeevi.rapolu@intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-20[media] ov13858: remove duplicated const declarationMauro Carvalho Chehab1-1/+1
As reported by gcc: drivers/media/i2c/ov13858.c:953:20: warning: duplicate const drivers/media/i2c/ov13858.c:953:14: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier] static const const s64 link_freq_menu_items[OV13858_NUM_OF_LINK_FREQS] = { ^~~~~ Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-20[media] ov13858: add support for OV13858 sensorHyungwoo Yang1-0/+1816
This patch adds driver for Omnivision's ov13858 sensor, the driver supports following features: - manual exposure/gain(analog and digital) control support - two link frequencies - VBLANK/HBLANK support - test pattern support - media controller support - runtime pm support - supported resolutions + 4224x3136 at 30FPS + 2112x1568 at 30FPS(default) and 60FPS + 2112x1188 at 30FPS(default) and 60FPS + 1056x784 at 30FPS(default) and 60FPS [Sakari Ailus: use V4L2_CID_DIGITAL_GAIN instead, add MAINTAINERS entry.] Signed-off-by: Hyungwoo Yang <hyungwoo.yang@intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>