summaryrefslogtreecommitdiffstats
path: root/drivers/media/i2c
Commit message (Collapse)AuthorAgeFilesLines
* media: i2c: Use the correct style for SPDX License IdentifierNishad Kamdar2019-11-104-5/+5
| | | | | | | | | | | | | | | | | This patch corrects the SPDX License Identifier style in header files related to I2C controlled media codec drivers. For C header files Documentation/process/license-rules.rst mandates C-like comments (opposed to C source files where C++ style should be used) Changes made by using a script provided by Joe Perches here: https://lkml.org/lkml/2019/2/7/46 and some manual changes. Suggested-by: Joe Perches <joe@perches.com> Signed-off-by: Nishad Kamdar <nishadkamdar@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
* media: ov6650: fix smatch warningHans Verkuil2019-11-081-1/+1
| | | | | | | | | | Initialize ret to 0 to fix this smatch error: drivers/media/i2c/ov6650.c:853 ov6650_video_probe() error: uninitialized symbol 'ret'. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
* media: hi556: Add support for Hi-556 sensorShawn Tu2019-11-053-0/+1213
| | | | | | | | | | | | | | | | | | | | | | Add a V4L2 sub-device driver for Hynix Hi-556 image sensor. This is a camera sensor using the I2C bus for control and the CSI-2 bus for data. This driver supports following features: - manual exposure and analog/digital gain control support - vblank/hblank control support - test pattern support - media controller support - runtime PM support - support following resolutions: + 2592x1944 at 30FPS + 1296x972 at 30FPS [sakari.ailus@linux.intel.com: Remove MEDIA_CAMERA_SUPPORT from Kconfig dependencies] Signed-off-by: Shawn Tu <shawnx.tu@intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
* media: bt819: Reduce amount of F* words in the worldAndy Shevchenko2019-11-051-1/+1
| | | | | | | | | | Replace F* word with something less offensive. [hverkuil: dropped 'Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")' tag since nothing was broken] Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
* media: vpx3220: make array input_vals static, makes object smallerColin Ian King2019-11-051-1/+1
| | | | | | | | | | | | | | | | | | | Don't populate the array input_vals on the stack but instead make it static. Makes the object code smaller by 106 bytes. Before: text data bss dec hex filename 11744 3536 128 15408 3c30 drivers/media/i2c/vpx3220.o After: text data bss dec hex filename 11574 3600 128 15302 3bc6 drivers/media/i2c/vpx3220.o (gcc version 9.2.1, amd64) Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
* media: smiapp: unlock on error in smiapp_start_streaming()Dan Carpenter2019-11-051-2/+2
| | | | | | | | | | We added two new error paths to smiapp_start_streaming(), but we can't return directly without dropping the "sensor->mutex" lock. Fixes: f8c4352c1bef ("media: smiapp: Move binning configuration to streaming start") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
* media: smiapp: Rename update_mode as pll_blanking_updateSakari Ailus2019-10-241-3/+3
| | | | | | | | | | Rename the confusingly named smiapp_update_mode() function as smiapp_pll_blanking_update(). The function is used to calculate new PLL and blanking configuration after binning or scaling configuration has been changed. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: smiapp: Register sensor after enabling runtime PM on the deviceSakari Ailus2019-10-241-4/+8
| | | | | | | | | | Earlier it was possible that the parts of the driver that assumed runtime PM was enabled were being called before runtime PM was enabled in the driver's probe function. So enable runtime PM before registering the sub-device. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: smiapp: Use non-binned and binned limits correctlySakari Ailus2019-10-241-7/+20
| | | | | | | | Use non-binned limits when binning is disabled and binned when they're enabled. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: smiapp: Don't update sensor configuration during power-on initSakari Ailus2019-10-241-4/+0
| | | | | | | | | The sensor configuration since it was previously powered off was not changed, so no need to update the PLL configuration etc. What is necessary though is to re-apply the configuration to the sensor's registers. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: smiapp: Move binning configuration to streaming startSakari Ailus2019-10-241-21/+22
| | | | | | | | Only write the binning configuration at stream start. It has no effect otherwise. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: smiapp: Don't get binning limits dynamicallySakari Ailus2019-10-241-65/+0
| | | | | | | | | | | The driver implementation assumed the binning limits could change dynamically based on the binning configuration. This is not actually the case; these limits are static and suitable to be used with all binning configurations but possibly not optimal limit for many of those configurations. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: smiapp: Destroy sensor's mutexSakari Ailus2019-10-241-1/+4
| | | | | | | Destroy the mutex initialised by the driver in probe. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: smiapp: Support probing NVM sizeSakari Ailus2019-10-242-56/+50
| | | | | | | | | | The interface supports probing for the NVM size but this was not implemented in the driver. Do that now. This will also make nokia,nvm-size property redundant. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: smiapp: Don't poll for NVM ready on devices that don't need itSakari Ailus2019-10-241-11/+17
| | | | | | | | Only some devices require polling for NVM ready. Do the polling only on devices that need it. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: smiapp: Add definitions for data transfer if capability bitsSakari Ailus2019-10-241-0/+3
| | | | | | | | The data transfer capability register was defined but its bits were not. Do that now. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: smiapp: Refactor reading NVM pageSakari Ailus2019-10-241-37/+46
| | | | | | | Split out reading a single NVM page into a separate function. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: smiapp: Fix error handling at NVM readingSakari Ailus2019-10-241-1/+2
| | | | | | | If NVM reading failed, the device was left powered on. Fix that. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: smiapp: Use the BIT macro where appropriate, remove useless definitionSakari Ailus2019-10-242-18/+18
| | | | | | | | | | | The BIT macro is a better way to define register bits, for 1 << bit is risky for 32-bit registers. Also remove the definition of SMIAPP_DATA_TRANSFER_IF_1_CTRL_RD_EN which has a value of zero. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: st-mipid02: add a check for devm_gpiod_get_optionalChuhong Yuan2019-10-241-0/+5
| | | | | | | | | | mipid02_probe misses a check for devm_gpiod_get_optional and may miss the failure. Add a check to fix the problem. Signed-off-by: Chuhong Yuan <hslester96@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: i2c: Add IMX290 CMOS image sensor driverManivannan Sadhasivam2019-10-243-0/+896
| | | | | | | | | | | Add driver for Sony IMX290 CMOS image sensor driver. The driver only supports I2C interface for programming and MIPI CSI-2 for sensor output. [Sakari Ailus: Rewrapped a few lines over 80 chars a little.] Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: i2c: ov5695: Fix randbuild errorYueHaibing2019-10-241-0/+1
| | | | | | | | | | | | | | If VIDEO_OV5695 is y and V4L2_FWNODE is m, building fails: drivers/media/i2c/ov5695.o: In function `ov5695_probe': ov5695.c:(.text+0xf4c): undefined reference to `v4l2_async_register_subdev_sensor_common' Select V4L2_FWNODE like OV5675 does. Fixes: 623df5d710fe ("media: i2c: ov5695: Modify the function of async register subdev related devices") Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: ad5820: Add support for ad5821 and ad5823Ricardo Ribalda Delgado2019-10-241-4/+6
| | | | | | | | | | | | | | | According to the datasheet, both AD5821 and AD5820 share a compatible register-set: http://www.analog.com/media/en/technical-documentation/data-sheets/AD5821.pdf Some camera modules also refer that AD5823 is a replacement of AD5820: https://download.kamami.com/p564094-OV8865_DS.pdf Suggested-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Ricardo Ribalda Delgado <ribalda@kernel.org> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: ad5820: Add support for of-autoloadRicardo Ribalda Delgado2019-10-241-0/+7
| | | | | | | | | | | | | | | Since kernel 4.16, i2c devices with DT compatible tag are modprobed using their DT modalias. Without this patch, if this driver is build as module it would never be autoprobed. There is no need to mask it with CONFIG_OF to allow ACPI loading, this also builds find with CONFIG_OF=n. Signed-off-by: Ricardo Ribalda Delgado <ribalda@kernel.org> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: ad5820: Add support for enable pinRicardo Ribalda Delgado2019-10-242-1/+18
| | | | | | | | | | | | | This patch adds support for a programmable enable pin. It can be used in situations where the ANA-vcc is not configurable (dummy-regulator), or just to have a more fine control of the power saving. The use of the enable pin is optional. Signed-off-by: Ricardo Ribalda Delgado <ribalda@kernel.org> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: ad5820: Define entity functionRicardo Ribalda Delgado2019-10-241-0/+1
| | | | | | | | | | | | | | Without this patch, media_device_register_entity throws a warning: dev_warn(mdev->dev, "Entity type for entity %s was not initialized!\n", entity->name); Signed-off-by: Ricardo Ribalda Delgado <ribalda@kernel.org> Acked-by: Pavel Machek <pavel@ucw.cz> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: ov5640: Make 2592x1944 mode only available at 15 fpsBenoit Parrot2019-10-241-0/+5
| | | | | | | | | | | The sensor data sheet clearly state that 2592x1944 only works at 15 fps make sure we don't try to miss configure the pll out of acceptable range. Signed-off-by: Benoit Parrot <bparrot@ti.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: ov5640: Fix 1920x1080 mode to remove extra enable/disableBenoit Parrot2019-10-241-2/+1
| | | | | | | | | | In the 1920x1080 register array an extra pair of reset ctrl disable re-enable was causing unwanted init delays. Signed-off-by: Benoit Parrot <bparrot@ti.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: ov5640: add PIXEL_RATE controlBenoit Parrot2019-10-241-2/+23
| | | | | | | | | | Add v4l2 controls to report the pixel rates of each mode. This is needed by some CSI2 receiver in order to perform proper DPHY configuration. Signed-off-by: Benoit Parrot <bparrot@ti.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: lm3646: remove redundant assignment to variable rvalColin Ian King2019-10-241-1/+1
| | | | | | | | | | | | The variable rval is being initialized with a value that is never read and is being re-assigned a little later on. The assignment is redundant and hence can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: ov6650: Fix arbitrary selection of master clock rateJanusz Krzysztofik2019-10-241-6/+58
| | | | | | | | | | | | | | | | | | | A hardcoded 12 MHz master clock frequency has been assumed since conversion of the driver from soc_camera sensor to a standalone V4L2 subdevice by commit 23a52386fabe ("media: ov6650: convert to standalone v4l2 subdevice"). Fix it. Define a static table of supported master clock rates (fix misnamed symbol while being at it), then use v4l2_clk_get/set_rate() to obtain a clock rate matching one of those supported. On success, apply respective master clock hardware divisor provided by the matching element of the table. [Sakari Ailus: Initialize xclk to NULL.] Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: ov6650: Drop unused .pclk_max fieldJanusz Krzysztofik2019-10-241-4/+0
| | | | | | | | This field of the driver private structure is no longer used, drop it. Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: ov6650: Don't reapply pixel clock divisor on format changeJanusz Krzysztofik2019-10-241-14/+3
| | | | | | | | | | | | | | | | | As calculation of pixel clock hardware divisor no longer depends on mbus format specific maximum pixel clock, there is no need to reapply the divisor on format change. Drop related code from ov6650_s_fmt() helper. Since a master clock hardware divisor, so far applied only together with the pixel clock divisor in a single operation, will no longer be applied from ov6650_s_fmt(), apply it, still using a hardcoded value for now, from ov6650_prog_dflt() helper so hardware is still initialised correctly on device probe. Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: ov6650: Simplify clock divisor calculationJanusz Krzysztofik2019-10-241-24/+5
| | | | | | | | | | | | | | | | | | | | | | As appears from an analysis of to_clkrc() helper code after its pclk_limit argument has been dropped, its result no longer depends on another argument - pclk_max. Moreover, assuming that a constant value of FRAME_RATE_MAX is always used as a denominator of the only significant argument left - a struct v4l2_fract, the result in fact depends only on the numerator value of that argument. As a further consequence, it no longer makes sense to recalculate frame intervals by converting them forth and back with a GET_CLKRC_DIV(to_clkrc(tpf)) construct. Drop use of GET_CLKRC_DIV() on results of to_clkrc() where possible - use the frame interval value directly. Furthermore, replace the to_clkrc() helper function with a simple macro and update its users to always use FRAME_RATE_MAX as frame interval denominator and pass only its numerator as an argument. Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: ov6650: Drop obsolete .pclk_limit attributeJanusz Krzysztofik2019-10-241-10/+4
| | | | | | | | | | | | | | | | | | | | That attribute used to be obtained from platform data by a soc_camera host interface and passed to the sensor driver for .s_mbus_fmt() video operation callback, later reused as .set_fmt() pad operation callback, to be able to limit frame rate. The driver stored that value in its private structure for further use from .g/s_parm(), later converted to g/s_frame_interval(). On conversion of the driver from soc_camera sensor to a standalone V4L2 subdevice by commit 23a52386fabe ("media: ov6650: convert to standalone v4l2 subdevice"), that attribute had been replaced by a constant and hardcoded to an arbitrarily chosen pixel clock limit. Drop it. Host interfaces can limit frame rate if needed by calling .s_frame_interval(). Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: ov6650: Fix stored frame interval not in sync with hardwareJanusz Krzysztofik2019-10-241-9/+12
| | | | | | | | | | | | | | | | | | | | | | The driver stores a frame interval value supposed to be in line with hardware state in a device private structure. Since the driver initial submission, the respective field of the structure has never been initialised on device probe. Moreover, if updated from .s_frame_interval(), a new value is stored before it is applied on hardware. If an error occurs during device update, the stored value may no longer reflect hardware state and consecutive calls to .g_frame_interval() may return incorrect information. Assuming a failed update of the device means its actual state hasn't changed, update the frame interval field of the device private structure with a new value only after it is successfully applied on hardware so it always reflects actual hardware state to the extent possible. Also, initialise the field with hardware default frame interval on device probe. Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: i2c: adv7842: make array cri static and const, makes object smallerChristophe JAILLET2019-10-241-2/+2
| | | | | | | | | | | | | | | | | | | Don't populate the array 'cri' on the stack but instead make it static and const. Makes the object code smaller by 165 bytes. Turn the 2nd parameter of 'log_infoframe()' const accordingly. Before: text data bss dec hex filename 98533 20024 256 118813 1d01d drivers/media/i2c/adv7842.o After: text data bss dec hex filename 98304 20088 256 118648 1cf78 drivers/media/i2c/adv7842.o Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: adv7180: Only print 'chip found' message on successful probeFabio Estevam2019-10-241-3/+3
| | | | | | | | | | | | | | Currently the "chip found" message is shown even in the case where the I2C address is wrongly passed in the device tree, or also in the case of probe failure, which is misleading. To avoid such problem, move this message after real I2C transactions have been successfully made and we are certain that the adv7180 is really present and probed. Signed-off-by: Fabio Estevam <festevam@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: imx214: Add new control with V4L2_CID_UNIT_CELL_SIZERicardo Ribalda Delgado2019-10-101-0/+9
| | | | | | | | | | According to the product brief, the unit cell size is 1120 nanometers^2. https://www.sony-semicon.co.jp/products_en/IS/sensor1/img/products/ProductBrief_IMX214_20150428.pdf Signed-off-by: Ricardo Ribalda Delgado <ribalda@kernel.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: i2c: Use div64_ul() for u64-by-unsigned-long divideGeert Uytterhoeven2019-10-101-2/+2
| | | | | | | | | | | | | | | | div_u64() does a 64-by-32 division, while the divisor max2175.xtal_freq is unsigned long, thus 64-bit on 64-bit platforms. Hence the proper function to call is div64_ul(). Note that this change does not have any functional impact, as the crystal frequency must be much lower than the 32-bit limit anyway. On 32-bit platforms, the generated code is the same. But at least on arm64, this saves an AND-instruction to truncate xtal_freq to 32-bit. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: i2c: ov2659: Switch to SPDX LicensingBenoit Parrot2019-10-011-13/+1
| | | | | | | | | Switch to SPDX licensing and drop the redundant GPL text. Signed-off-by: Benoit Parrot <bparrot@ti.com> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: i2c: ov2659: Fix missing 720p register configBenoit Parrot2019-10-011-0/+4
| | | | | | | | | | | | | | | The initial registers sequence is only loaded at probe time. Afterward only the resolution and format specific register are modified. Care must be taken to make sure registers modified by one resolution setting are reverted back when another resolution is programmed. This was not done properly for the 720p case. Signed-off-by: Benoit Parrot <bparrot@ti.com> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: i2c: ov2659: Add powerdown/reset gpio handlingBenoit Parrot2019-10-012-3/+85
| | | | | | | | | | | | | | | | | | | | | On some board it is possible that the sensor 'powerdown' and or 'reset' pin might be controlled by gpio instead of being tied. To implement we add pm_runtime support which will handle the power up/down sequence when it is available otherwise the sensor will be powered on at module insertion/probe and powered off at module removal. Now originally the driver assumed that the sensor would always stay powered and keep its register setting. We cannot assume this anymore, so every time we "power up" we need to re-program the initial registers configuration first. This was previously done only at probe time. [Sakari Ailus: Resolve a conflict in Kconfig] Signed-off-by: Benoit Parrot <bparrot@ti.com> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: i2c: ov2659: fix s_stream return valueBenoit Parrot2019-10-011-5/+9
| | | | | | | | | | In ov2659_s_stream() return value for invoked function should be checked and propagated. Signed-off-by: Benoit Parrot <bparrot@ti.com> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: i2c: ov2659: Cleanup include file listBenoit Parrot2019-10-011-14/+0
| | | | | | | | | | | | Several of include files listed are not explicitly needed. If they are need then they are implicitly included. Reduce the list of includes to an easier to manage list. Signed-off-by: Benoit Parrot <bparrot@ti.com> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: i2c: ov2659: Fix sensor detection to actually fail when device is not ↵Benoit Parrot2019-10-011-2/+3
| | | | | | | | | | | | | | present Make sure that if the expected sensor device id register is not recognized properly the failure is propagated up so devices are not left partially initialized. Signed-off-by: Benoit Parrot <bparrot@ti.com> Signed-off-by: Jyri Sarha <jsarha@ti.com> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: i2c: ov2659: Fix for image wrap-around in lower resolutionBenoit Parrot2019-10-011-2/+2
| | | | | | | | | | | | | Based on recently found sensor configuration examples, it was discovered that when scaling and binning are used for the lower resolutions (i.e. 640x480, 320x240) the read offset has to be increased otherwise the image appears to be wrapped around. Signed-off-by: Benoit Parrot <bparrot@ti.com> Signed-off-by: Jyri Sarha <jsarha@ti.com> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: i2c: ov5695: Modify the function of async register subdev related devicesDongchun Zhu2019-10-011-1/+1
| | | | | | | | | | | | | This patch adds support for registering a sensor sub-device to the async sub-device framework and parse set up common sensor related devices such as actuator/VCM. [Sakari Ailus: Rewrap commit message] Signed-off-by: Dongchun Zhu <dongchun.zhu@mediatek.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+samsung@kernel.org>
* media: v4l: Put camera sensor, lens and flash drivers under MEDIA_CAMERA_SUPPORTSakari Ailus2019-10-011-40/+11
| | | | | | | | | | | Instead of individually depending on MEDIA_CAMERA_SUPPORT (or forgetting it), put all camera sensor, lens and flash drivers under MEDIA_CAMERA_SUPPORT as a whole. The lens VCM devices didn't use to do this, but make them depend on MEDIA_CAMERA_SUPPORT as well since there's no use for these devices without that in practice. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: ov6650: Fix stored crop rectangle not in sync with hardwareJanusz Krzysztofik2019-10-011-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | The driver stores crop rectangle settings supposed to be in line with hardware state in a device private structure. Since the driver initial submission, crop rectangle width and height settings are not updated correctly when rectangle offset settings are applied on hardware. If an error occurs while the device is updated, the stored settings my no longer reflect hardware state and consecutive calls to .get_selection() as well as .get/set_fmt() may return incorrect information. That in turn may affect ability of a bridge device to use correct DMA transfer settings if such incorrect informamtion on active frame format returned by .get/set_fmt() is used. Assuming a failed update of the device means its actual settings haven't changed, update crop rectangle width and height settings stored in the device private structure correctly while the rectangle offset is successfully applied on hardware so the stored values always reflect actual hardware state to the extent possible. Fixes: 2f6e2404799a ("[media] SoC Camera: add driver for OV6650 sensor") Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
OpenPOWER on IntegriCloud