summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2021-01-12media: ccs: Add support for analogue gain coefficient controlsSakari Ailus1-2/+36
Add four controls for reading CCS analogue gain coefficients. The values are constants that are device specific. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: v4l: uapi: ccs: Add controls for analogue gain constantsSakari Ailus3-0/+40
Add V4L2 controls for analogue gain constants required to control analogue gain. The values are device specific and thus need to be obtained from the driver. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: Documentation: ccs: Add user documentation for the CCS driverSakari Ailus3-0/+61
Add user documentation for the CCS driver. This includes e.g. sub-devices implemented by the driver. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: v4l: uapi: Add user control base for CCS controlsSakari Ailus1-0/+5
Add a control base for CCS controls, and reserve 128 controls. Luckily these numbers are cheap. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: ccs: Only add analogue gain control if the device supports itSakari Ailus1-6/+10
Some devices do not implement analogue gain this way. Only add the control when a device does have the support. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: ccs: Remove analogue gain fieldSakari Ailus2-8/+6
The analogue gain control was stored to the device specific struct but was never used. Remove it. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: ccs: Add support for old-style SMIA digital gainSakari Ailus2-2/+33
SMIA only has per-component digital gain. Add support for it. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: ccs: Add digital gain supportSakari Ailus1-1/+16
CCS supports global (all-component) digital gain. Add support for it. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: mt9v111: Remove unneeded device-managed putsEzequiel Garcia1-6/+0
Drivers don't need to explicitly call devm_{}_put on driver removal, as it's automatically called by the device driver resource management code. Fixes: aab7ed1c3927 ("media: i2c: Add driver for Aptina MT9V111") Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: i2c: Add support for the OV8865 image sensorPaul Kocialkowski3-0/+2986
The OV8865 is a 8 Mpx CMOS image sensor producing 3264x2448 at 30 fps. Other modes (including some with sub-sampling) are available too. It outputs 10-bit bayer CFA data through a MIPI CSI-2 interface with up to 4 lanes supported. Some register initialisation sequences are still needed for this driver, as they cover registers for which no documentation is available. This work is based on the first version of the driver submitted by Kévin L'hôpital, which was adapted to mainline from the Allwinner BSP. This version is a rewrite of the first version that matches the structure of the OV5648 driver, with explicit PLL configuration, all the necessary mode-specific fields, associatied registers and reduced static sequences. It was tested with the Banana Pi Camera Board v3 and the Banana Pi M3. Co-developed-by: Kévin L'hôpital <kevin.lhopital@bootlin.com> Signed-off-by: Kévin L'hôpital <kevin.lhopital@bootlin.com> Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: dt-bindings: media: i2c: Add OV8865 bindings documentationPaul Kocialkowski1-0/+124
This introduces YAML bindings documentation for the OV8865 image sensor. Co-developed-by: Kévin L'hôpital <kevin.lhopital@bootlin.com> Signed-off-by: Kévin L'hôpital <kevin.lhopital@bootlin.com> Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: i2c: Add support for the OV5648 image sensorPaul Kocialkowski3-0/+2637
The OV5648 is a 5 Mpx CMOS image sensor, connected via MIPI CSI-2 in a one or two lane configuration. Most of the features of the hardware are supported, including: - Auto and manual exposition/gain - Auto and manual white balance - Horizontal and vertical flip - Test patterns But the following are still missing: - Debanding, based on power source frequency; - Exposition setting correlated to time units. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: dt-bindings: media: i2c: Add OV5648 bindings documentationPaul Kocialkowski1-0/+115
This introduces YAML bindings documentation for the OV5648 image sensor. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: ipu3-cio2: Fix mbus_code processing in cio2_subdev_set_fmt()Pavel Machek1-1/+1
Loop was useless as it would always exit on the first iteration. Fix it with right condition. Signed-off-by: Pavel Machek (CIP) <pavel@denx.de> Fixes: a86cf9b29e8b ("media: ipu3-cio2: Validate mbus format in setting subdev format") Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: stable@vger.kernel.org # v4.16 and up Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: i2c: ov5670: Fix PIXEL_RATE minimum valueJacopo Mondi1-1/+2
The driver currently reports a single supported value for V4L2_CID_PIXEL_RATE and initializes the control's minimum value to 0, which is very risky, as userspace might accidentally use it as divider when calculating the time duration of a line. Fix this by using as minimum the only supported value when registering the control. Fixes: 5de35c9b8dcd1 ("media: i2c: Add Omnivision OV5670 5M sensor support") Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: Documentation: media: Document clock handling in camera sensor driversSakari Ailus1-1/+19
Document pratices of handling clocks in camera sensor drivers on both DT and ACPI. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: ipu3-cio2: Build only for x86Andy Shevchenko1-1/+2
According to the original code in the driver it was never assumed to work with big page sizes: unsigned short type followed by PAGE_SHIFT and PAGE_MASK which may be different on non-x86 architectures. Recently LKP found an issue on non-x86 architectures due to above mentioned limitations. Since Sakari acknowledges that it's not really useful to be able to compile this elsewhere, mark it x86 only. Fixes: a31d19f88932 ("media: ipu3: allow building it with COMPILE_TEST on non-x86 archs") Reported-by: kernel test robot <lkp@intel.com> Suggested-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: v4l: ioctl: Use kmalloc to allocate a small chunk of memorySakari Ailus1-2/+2
kvmalloc() was used to allocate the temporary memory buffer that was used to contain both the IOCTL argument as well as a possible array argument that could have been large. Now that the two are separated, the IOCTL argument is known to be small in size. Use kmalloc to allocate it instead of kvmalloc. Similarly for releasing it. Suggested-by: Arnd Bergmann <arnd@kernel.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: v4l: ioctl: Fix memory leak in video_usercopySakari Ailus1-18/+14
When an IOCTL with argument size larger than 128 that also used array arguments were handled, two memory allocations were made but alas, only the latter one of them was released. This happened because there was only a single local variable to hold such a temporary allocation. Fix this by adding separate variables to hold the pointers to the temporary allocations. Reported-by: Arnd Bergmann <arnd@kernel.org> Reported-by: syzbot+1115e79c8df6472c612b@syzkaller.appspotmail.com Fixes: d14e6d76ebf7 ("[media] v4l: Add multi-planar ioctl handling code") Cc: stable@vger.kernel.org Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: uapi: Add an entity type for Image Signal ProcessorsSakari Ailus2-0/+8
Add and document a media entity type for Image Signal Processor devices. Surprisingly we didn't have one, so add one now. More or less all ISP drivers should use this type instead of what they currently are using (or not using anything). Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: v4l: fwnode: v4l2_async_notifier_parse_fwnode_endpoints is deprecatedSakari Ailus1-0/+4
Document that v4l2_async_notifier_parse_fwnode_endpoints() is deprecated. Its functionality has been replaced by other, better functions. Also add a reference to an example if someone ends up wandering here. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: Documentation: media: Update pixel rate formula for C-PHYSakari Ailus1-1/+3
Update the formula to calculate the pixel rate on the link for C-PHY. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: ov5647: Remove 640x480 SBGGR8 modeJacopo Mondi1-171/+9
Capturing in 640x480 SBGGR8_1X8 hangs the system when capturing with the unicam driver on RaspberryPi 4 platform. Remove it and remove the support for multiple media bus codes in the driver. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: ov5647: Support VIDIOC_SUBSCRIBE_EVENTJacopo Mondi1-0/+3
The driver reports the V4L2_SUBDEV_FL_HAS_EVENTS flag but does not support subscribing and unsubscribing to events. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: ov5647: Constify oe_enable/disable reglistJacopo Mondi1-2/+2
Make the two register-value lists const. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: ov5647: Apply controls only when poweredJacopo Mondi1-17/+27
Use pm_runtime_get_if_in_use() in s_ctrl to apply controls only when the device is powered on. Rework the control set function to balance the pm_runtime_get_if_in_use() call with pm_runtime_put() at the end of the function. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: ov5647: Rework s_stream() operationJacopo Mondi1-2/+31
Rework the s_stream() operation to turn the sensor on and off at stream enable/disable time using the pm_runtime infrastructure. Protect the stream on/off from being called multiple times in sequence with a 'streaming' flag. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: ov5647: Use pm_runtime infrastructureJacopo Mondi1-71/+71
Use the pm_runtime framework to replace the legacy s_power() operation. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: ov5647: Advertise the correct exposure rangeDave Stevenson1-4/+35
Exposure is clipped by the VTS of the mode, so it needs to be updated when this is changed. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: ov5647: Support V4L2_CID_VBLANK controlDave Stevenson1-4/+46
Adds vblank control to allow for frame rate control. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: ov5647: Support V4L2_CID_HBLANK controlJacopo Mondi1-1/+26
Add support for the V4L2_CID_HBLANK read-only control. The implementation has been upported from RaspberryPi BSP commit: commit d82f202156605 ("media: i2c: ov5647: Set V4L2_SUBDEV_FL_HAS_EVENTS flag") Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: ov5647: Support V4L2_CID_PIXEL_RATEDave Stevenson1-11/+32
Clients need to know the pixel rate in order to compute exposure and frame rate values. Advertise it. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: ov5647: Set V4L2_SUBDEV_FL_HAS_EVENTS flagDave Stevenson1-1/+1
The ov5647 subdev can generate control events, therefore set the V4L2_SUBDEV_FL_HAS_EVENTS flag. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: ov5647: Implement set_fmt pad operationJacopo Mondi1-4/+62
Now that the driver supports more than a single mode, implement the .set_fmt pad operation and adjust the existing .get_fmt one to report the currently applied format. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: ov5647: Use SBGGR10_1X10 640x480 as defaultJacopo Mondi1-3/+3
The SBGGR10_1X10 formats support more resolutions than SBGGR8_1X8. Make it the default sensor format and set 2x2 binned 640x480 resolution as default sensor size as it maximizes the FOV and framerate. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: ov5647: Add SGGBR10_1X10 modesJacopo Mondi1-0/+441
Add 4 additional sensor modes in SBGGR10_1X10 format. Add the following resolutions: - 2592x1944 full resolution - 1920x1080 1080p cropped - 1296x972 2x2 binned - 640x480 2x2 binned, 2x2 subsampled The register lists and modes definition have been upported from the RaspberryPi BSP at revision: commit 581dfda6d0a62 ("media: i2c: ov5647: Advertise the correct exposure range") Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: ov5647: Rename SBGGR8 VGA modeJacopo Mondi1-6/+7
Before adding new modes, rename the only existing one to report the bit depth to distinguish it from future additions. While at it, briefly describe the mode. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: ov5647: Add support for get_selection()Dave Stevenson1-23/+71
Support the get_selection() pad operation to report the device full pixel array size, the currently applied analogue crop rectangle and the active pixel array dimensions. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: ov5647: Break out format handlingJacopo Mondi1-26/+65
Break format handling out from the main driver structure. This commit prepares for the introduction of more sensor formats and resolutions by instrumenting the existing operation to work on multiple modes instead of assuming a single supported one. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: ov5647: Rationalize driver structure nameJacopo Mondi1-23/+23
The driver structure name is referred to with different names ('ov5647', 'state', 'sensor') in different functions in the driver. Polish this up by using 'struct ov5647 *sensor' everywhere. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: ov5647: Support gain, exposure and AWB controlsDavid Plowman1-2/+170
Add controls to support AWB, AEC and AGC. Also add control support to set exposure (in lines) and analogue gain (as a register code). Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: ov5647: Protect s_stream() with mutexJacopo Mondi1-2/+9
Use the driver mutex to protect s_stream() operations. This will become more relevant once the sensor will support more formats and set_format() could be issue concurrently to s_stream(). Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: ov5647: Implement enum_frame_size()Jacopo Mondi1-3/+22
Implement the .enum_frame_size subdev pad operation. As the driver only supports one format and one resolution at the moment the implementation is trivial. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: ov5647: Program mode at s_stream(1) timeJacopo Mondi1-37/+44
Rename __sensor_init() function to ov5647_set_mode() as the function is a regular one and the double underscores prefix shall be removed, and then move it to program the mode at s_stream(1) time, not at sensor power up. Break out from __sensor_init() the stream_off() operation call at sensor power up to coax the lanes in LP-11 state. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: ov5647: Fix return value from read/writeJacopo Mondi1-4/+8
The ov5647_read()/ov5647_write() return in case of success the number of bytes read or written respectively. This requires callers to check if the return value is less than zero to detect an error. Unfortunately, in several places, callers directly return the result of a read/write call, causing issues when the returned valued is checked to be different from zero to detect an error. Fix this by returning zero if i2c_master_send() and i2c_master_read() return a positive value (the number of bytes written or read). Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: ov5647: Replace license with SPDX identifierJacopo Mondi1-9/+1
Replace the boilerplate license text with the SPDX identifier. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: ov5647: Fix style issuesJacopo Mondi1-55/+47
The driver has some obvious style issues which are worth fixing before expanding the driver capabilities. Fix: - Variable declaration order - Function parameters alignment - Multi-line comments and spurious line breaks - Use lowercase for hexadecimal values - > 80 cols lines Cosmetic change, no functional changes intended. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: ov5647: Fix format initializationJacopo Mondi1-3/+2
The driver currently support a single format. Fix its initialization to use the only supported resolution. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: ov5647: Add set_fmt and get_fmt calls.Dave Stevenson1-0/+19
There's no way to query the subdevice for the supported resolutions. Add set_fmt and get_fmt implementations. Since there's only one format supported set_fmt does nothing and get returns single format. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org> Signed-off-by: Roman Kovalivskyi <roman.kovalivskyi@globallogic.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-01-12media: ov5647: Add support for non-continuous clock modeDave Stevenson1-4/+20
Add support for optional non-continuous clock mode to the ov5647 sensor driver. Non-continuous clock saves a small amount of power and on some SoCs is easier to interface with. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org> Signed-off-by: Roman Kovalivskyi <roman.kovalivskyi@globallogic.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>