Commit Graph

7 Commits

Author SHA1 Message Date
Hans Verkuil 2dbcb6fb96 media: media/i2c: don't return ENOTTY if SUBDEV_API is not set
If CONFIG_VIDEO_V4L2_SUBDEV_API is not set, then it is still possible
to call set_fmt for V4L2_SUBDEV_FORMAT_TRY, the result is just not
stored. So return 0 instead of -ENOTTY.

Calling get_fmt with V4L2_SUBDEV_FORMAT_TRY should return -EINVAL
instead of -ENOTTY, after all the get_fmt functionality is still
present, just not supported for TRY.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-07-23 11:47:09 -04:00
Shobhit Kukreti 26092e7eec media: i2c: Fix Unnecessary Semicolon Warning Reported by coccicheck
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>
2019-06-21 17:52:50 -04:00
Sakari Ailus 4d471563d8 media: i2c: Fix pm_runtime_get_if_in_use() usage in sensor drivers
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-31 09:23:53 -04:00
Fabio Estevam 949abce61c media: ov5695: Remove owner assignment from i2c_driver
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: Shunqian Zheng <zhengsq@rock-chips.com>
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-05-04 14:33:25 -04:00
Dan Carpenter f68e68d292 media: ov5695: Off by one in ov5695_enum_frame_sizes()
The ">" should be ">=" so that we don't read one element beyond the end
of the array.

Fixes: 8a77009be4 ("media: ov5695: add support for OV5695 sensor")

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-03-06 12:25:10 -05:00
Arnd Bergmann 94d4a1a671 media: ov5695: mark PM functions as __maybe_unused
Without CONFIG_PM, we get a harmless build warning:

drivers/media/i2c/ov5695.c:1033:12: error: 'ov5695_runtime_suspend' defined but not used [-Werror=unused-function]
 static int ov5695_runtime_suspend(struct device *dev)
            ^~~~~~~~~~~~~~~~~~~~~~
drivers/media/i2c/ov5695.c:1024:12: error: 'ov5695_runtime_resume' defined but not used [-Werror=unused-function]
 static int ov5695_runtime_resume(struct device *dev)

This marks the affected functions as __maybe_unused.

Fixes: 8a77009be4 ("media: ov5695: add support for OV5695 sensor")

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-02-26 10:38:39 -05:00
Shunqian Zheng 8a77009be4 media: ov5695: add support for OV5695 sensor
This patch adds driver for Omnivision's ov5695 sensor,
the driver supports following features:
 - supported resolutions
   + 2592x1944 at 30fps
   + 1920x1080 at 30fps
   + 1296x972 at 60fps
   + 1280x720 at 30fps
   + 640x480 at 120fps
 - test patterns
 - manual exposure/gain(analog and digital) control
 - vblank and hblank
 - media controller
 - runtime pm

Signed-off-by: Shunqian Zheng <zhengsq@rock-chips.com>
Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-02-23 02:40:02 -05:00