aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/i2c/ov5670.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
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-04-04media: ov5670: 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-23media: ov5670: get rid of a series of __be warningsMauro Carvalho Chehab1-4/+5
There are some troubles on this driver with respect to the usage of __be16 and __b32 macros: drivers/media/i2c/ov5670.c:1857:27: warning: incorrect type in initializer (different base types) drivers/media/i2c/ov5670.c:1857:27: expected unsigned short [unsigned] [usertype] reg_addr_be drivers/media/i2c/ov5670.c:1857:27: got restricted __be16 [usertype] <noident> drivers/media/i2c/ov5670.c:1880:16: warning: cast to restricted __be32 drivers/media/i2c/ov5670.c:1880:16: warning: cast to restricted __be32 drivers/media/i2c/ov5670.c:1880:16: warning: cast to restricted __be32 drivers/media/i2c/ov5670.c:1880:16: warning: cast to restricted __be32 drivers/media/i2c/ov5670.c:1880:16: warning: cast to restricted __be32 drivers/media/i2c/ov5670.c:1880:16: warning: cast to restricted __be32 drivers/media/i2c/ov5670.c:1901:13: warning: incorrect type in assignment (different base types) drivers/media/i2c/ov5670.c:1901:13: expected unsigned int [unsigned] [usertype] val drivers/media/i2c/ov5670.c:1901:13: got restricted __be32 [usertype] <noident> Fix them. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-03-21media: ov5670: Use v4l2_find_nearest_sizeSakari Ailus1-31/+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>
2017-10-31media: ov5670: 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] media: ov5670: Fix not streaming issue after resumeChiranjeevi Rapolu1-4/+1
Previously, the sensor was not streaming after resume from suspend, i.e. on S0->S3->S0 transition. Due to this, camera app preview appeared as stuck. Now, handle streaming state correctly in case of suspend-resume. 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-10-04[media] media: ov5670: Use recommended black level and output biasChiranjeevi Rapolu1-6/+24
Previously, images were relatively darker due to non-optimal settings for black target level and bias. Now, use recommended settings for black target level and output bias as default values. The same default settings apply to all the resolutions. Given these recommeneded settings do not change dynamically, add these to existing mode register settings. 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: ov5670: Limit vblank to permissible rangeChiranjeevi Rapolu1-14/+26
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-20media: ov5670: Fix incorrect frame timing reported to userChiranjeevi Rapolu1-22/+23
Previously, pixel-rate/(pixels-per-line * lines-per-frame) was yielding incorrect frame timing for the user. OV sensor is using internal timing and this requires conversion (internal timing -> PPL) for correct HBLANK calculation. Now, change pixels-per-line domain from internal sensor clock to pixels domain. Set HBLANK read-only because fixed PPL is used for all resolutions. And, use more accurate link-frequency 422.4MHz instead of rounding down to 420MHz. 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@s-opensource.com>
2017-08-08media: i2c: fix semicolon.cocci warningskbuild test robot1-1/+1
drivers/media/i2c/ov5670.c:2033:2-3: Unneeded semicolon Remove unneeded semicolon. Generated by: scripts/coccinelle/misc/semicolon.cocci CC: Chiranjeevi Rapolu <chiranjeevi.rapolu@intel.com> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-19media: i2c: Add Omnivision OV5670 5M sensor supportChiranjeevi Rapolu1-0/+2588
Provides single source pad with up to 2592x1944 pixels at 10-bit raw bayer format over MIPI CSI2 two lanes at 840Mbps/lane. The driver supports following features: - up to 30fps at 5M pixels - manual exposure - digital/analog gain - V-blank/H-blank - test pattern - media controller - runtime pm [mchehab@s-opensource.com: fix a trivial merge conflict at Makefile] 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>