summaryrefslogtreecommitdiffstats
path: root/drivers/media/i2c
AgeCommit message (Collapse)AuthorFilesLines
2020-05-25mailmap: change email for Ricardo RibaldaRicardo Ribalda Delgado1-2/+2
Modify emails to ribalda@kernel.org and unify my surname in all the files. Signed-off-by: Ricardo Ribalda <ribalda@kernel.org> Link: https://lore.kernel.org/r/20200430135224.362700-1-ricardo@ribalda.com Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2020-03-24media: i2c: video-i2c: fix build errors due to 'imply hwmon'Matt Ranostay1-1/+1
Fix build fault when CONFIG_HWMON is a module, and CONFIG_VIDEO_I2C as builtin. This is due to 'imply hwmon' in the respective Kconfig. Issue build log: ld: drivers/media/i2c/video-i2c.o: in function `amg88xx_hwmon_init': video-i2c.c:(.text+0x2e1): undefined reference to `devm_hwmon_device_register_with_info Cc: rdunlap@infradead.org Fixes: acbea6798955 (media: video-i2c: add hwmon support for amg88xx) Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-03-12media: i2c: s5c73m3: Fix number in auto focus clusterSebastian Gross1-1/+1
As of `s5c73m3.h` the auto focus cluster in `s5c73m3_ctrls` has 5 and not 6 controls. Signed-off-by: Sebastian Gross <sebastian.gross@emlix.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-03-12media: imx214: Remove redundant codeRicardo Ribalda Delgado1-1/+0
The pad is now checked by v4l2_subdev_call_wappers call_g_frame_interval-> check_frame_interval-> check_pad 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+huawei@kernel.org>
2020-03-12media: i2c: ov5695: Fix power on and off sequencesDongchun Zhu1-18/+31
From the measured hardware signal, OV5695 reset pin goes high for a short period of time during boot-up. From the sensor specification, the reset pin is active low and the DT binding defines the pin as active low, which means that the values set by the driver are inverted and thus the value requested in probe ends up high. Fix it by changing probe to request the reset GPIO initialized to high, which makes the initial state of the physical signal low. In addition, DOVDD rising must occur before DVDD rising from spec., but regulator_bulk_enable() API enables all the regulators asynchronously. Use an explicit loops of regulator_enable() instead. For power off sequence, it is required that DVDD falls first. Given the bulk API does not give any guarantee about the order of regulators, change the driver to use regulator_disable() instead. The sensor also requires a delay between reset high and first I2C transaction, which was assumed to be 8192 XVCLK cycles, but 1ms is recommended by the vendor. Fix this as well. Signed-off-by: Dongchun Zhu <dongchun.zhu@mediatek.com> Signed-off-by: Tomasz Figa <tfiga@chromium.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-03-12media: i2c: imx219: Add support for cropped 640x480 resolutionLad Prabhakar1-1/+69
This patch adds mode table entry for capturing cropped 640x480 resolution Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Acked-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-03-12media: i2c: imx219: Add support for RAW8 bit bayer formatLad Prabhakar1-32/+116
IMX219 sensor is capable for RAW8/RAW10 modes. This commit adds support for RAW8 bayer format. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-03-12media: i2c: imx219: Fix power sequenceLad Prabhakar1-0/+17
When supporting Rpi Camera v2 Module on the RZ/G2E, found the driver had some issues with rcar mipi-csi driver. The sensor never entered into LP-11 state. The powerup sequence in the datasheet[1] shows the sensor entering into LP-11 in streaming mode, so to fix this issue transitions are performed from "streaming -> standby" in the probe() after power up. With this commit the sensor is able to enter LP-11 mode during power up, as expected by some CSI-2 controllers. [1] https://publiclab.org/system/images/photos/000/023/294/original/ RASPBERRY_PI_CAMERA_V2_DATASHEET_IMX219PQH5_7.0.0_Datasheet_XXX.PDF Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Acked-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-03-12media: Fix build failure due to missing select REGMAP_I2CIan Kumlien1-0/+5
While upgrading from 5.5.2 -> 5.5.6 I was surprised by: ld: drivers/media/i2c/tvp5150.o: in function `tvp5150_probe': tvp5150.c:(.text+0x11ac): undefined reference to `__devm_regmap_init_i2c' make: *** [Makefile:1078: vmlinux] Error 1 The fix was quick enough, make VIDEO_TVP5150 select REGMAP_I2C And a quick grep showed that it was needed by more targets. Signed-off-by: Ian Kumlien <ian.kumlien@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-03-12media: tvp5150: make debug output more readableMarco Felsch1-3/+6
The debug output for tvp5150_selmux() isn't really intuitive. Register values are printed decimal formatted and the input/output driver states are printed as enum. Even more the "normal" output enum mapps to zero so a active output will printing output=0 and a inactive output=1. Change this by brinting the register values hex formatted and the states as more readable string. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Reviewed-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>
2020-03-12media: tvp5150: add support to limit sdtv standardsMarco Felsch1-2/+74
The tvp5150 accepts NTSC(M,J,4.43), PAL (B,D,G,H,I,M,N) and SECAM video data and is able to auto-detect the input signal. The auto-detection does not work if the connector does not receive an input signal and the tvp5150 might not be configured correctly. This misconfiguration leads into wrong decoded video streams if the tvp5150 gets powered on before the video signal is present. Limit the supported sdtv standards according to the actual selected connector to avoid a misconfiguration. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-03-12media: tvp5150: add subdev open/close callbacksMarco Felsch1-0/+22
Bring the device into a working state upon a open/close call. Currently this involves only the interrupt enable/disable process but can be extended in the future. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-03-12media: tvp5150: add v4l2-event supportMarco Felsch1-1/+17
Currently the driver notifies internal subdevs if the signal is locked or not. This information is also useful for userpace applications e.g. to switch to another input device upon a signal lost event. This commit adds the support for the userspace to subscribe to the V4L2_EVENT_SOURCE_CHANGE and V4L2_EVENT_CTRL events. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-03-12media: tvp5150: move irq en-/disable into runtime-pm opsMarco Felsch1-6/+55
As documented in [1] the runtime-pm ops are used to set the device into a fully 'workable' state. Therefore it can be used to enable or disable the irqs. [1] https://www.kernel.org/doc/html/latest/power/runtime_pm.html Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-03-12media: tvp5150: initialize subdev before parsing device treeMichael Tretter1-4/+3
There are several debug prints in the tvp5150_parse_dt() function, which do not print the prefix, because the v4l2_subdev is not initialized, yet. Initialize the v4l2_subdev before parsing the device tree to fix the debug messages. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-03-12media: tvp5150: add FORMAT_TRY support for get/set selection handlersMarco Felsch1-32/+81
Since commit 10d5509c8d50 ("[media] v4l2: remove g/s_crop from video ops") the 'which' field for set/get_selection must be FORMAT_ACTIVE. There is no way to try different selections. The patch adds a helper function to select the correct selection memory space (sub-device file handle or driver state) which will be set/returned. The selection rectangle is updated if the format is FORMAT_ACTIVE and the rectangle position and/or size differs from the current set rectangle. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-03-12media: tvp5150: fix set_selection rectangle handlingMarco Felsch1-16/+16
Currently a local copy of sel->r is made and adapted to the hardware constraints. After the adaption the value is applied to the hardware but the driver forgot to reflect the adapted value to the user space. Drop the local copy and work directly on the requested rectangle instead to fix this. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-03-12media: tvp5150: add input source selection of_graph supportMarco Felsch1-27/+404
This patch adds the of_graph support to describe the tvp input connections. Physical the TVP5150 has three ports: AIP1A, AIP1B and YOUT. As result of discussion [1],[2] the device-tree maps these ports 1:1. Look at the Documentation for more information. Since the TVP5150 is a converter/bridge the device-tree must contain at least 1-input and 1-output port. The mc-connectors and mc-links are only created if the device-tree contains the corresponding connector nodes. If more than one connector is available the media_entity_operations.link_setup() callback ensures that only one connector is active. [1] https://www.spinics.net/lists/linux-media/msg138545.html [2] https://www.spinics.net/lists/linux-media/msg138546.html Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-03-12media: partial revert of "[media] tvp5150: add HW input connectors support"Javier Martinez Canillas1-145/+0
Commit f7b4b54e6364 ("[media] tvp5150: add HW input connectors support") added input signals support for the tvp5150, but the approach was found to be incorrect so the corresponding DT binding commit 82c2ffeb217a ("[media] tvp5150: document input connectors DT bindings") was reverted. This left the driver with an undocumented (and wrong) DT parsing logic, so lets get rid of this code as well until the input connectors support is implemented properly. It's a partial revert due other patches added on top of mentioned commit not allowing the commit to be reverted cleanly anymore. But all the code related to the DT parsing logic and input entities creation are removed. Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> [m.felsch@pengutronix.de: rm TVP5150_INPUT_NUM define] Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-02-27media: smiapp: Move definitions under driver directorySakari Ailus2-1/+47
include/media/i2c/smiapp.h was meant to serve systems where the sensor is enumerated through platform data. That's no longer necessary, hopefully not even in out-of-tree use cases. Move the definitions to the appropriate headers. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2020-02-27media: smiapp: Refactor reading SMIA limitsSakari Ailus1-22/+10
Combine the two trivial functions reading limits into one. Also rename smiapp_get_all_limits() as smiapp_read_all_smia_limits(). Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2020-02-27media: smiapp: Move SMIA limit reading upSakari Ailus1-39/+39
Move SMIA limit reading up, where other limit and capability handling takes place. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2020-02-27media: smiapp: Turn limit lookup into a functionSakari Ailus1-91/+102
Instead of direct array access, turn accessing limit information into a function. Going forward, more elaborate CCS limits will replace most SMIA limits, and conversion will be less complicated this way. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2020-02-27media: smiapp: Use unaligned get and put functionsSakari Ailus1-50/+19
Use get_unaligned_be* and put_unaligned_be* functions to convert register values to CPU endianness. Consequently, two instances of BUG() are removed. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2020-02-27media: smiapp: Simplify condition for choosing 8-bit accessSakari Ailus1-1/+1
Use the only8 boolean to determine whether 8-bit access is required for reading. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2020-02-27media: i2c: Add driver for Sony IMX219 sensorDave Stevenson3-0/+1324
Adds a driver for the 8MPix Sony IMX219 CSI2 sensor. Whilst the sensor supports 2 or 4 CSI2 data lanes, this driver currently only supports 2 lanes. 8MPix @ 15fps, 1080P @ 30fps (cropped FOV), and 1640x1232 (2x2 binned) @ 30fps are currently supported. [Sakari Ailus: make imx219_check_hwcfg static] Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Andrey Konovalov <andrey.konovalov@linaro.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2020-02-27media: ov5675: add vflip/hflip control supportShawn Tu1-9/+73
- Add V4L2 controls: horizontal/vertical flip, keep SGRBG10 Bayer order output (via change v/hflip) - Fix Bayer order output in 1296x972 binning registers 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+samsung@kernel.org>
2020-02-24media: media/i2c/video-i2c: rename VFL_TYPE_GRABBER to _VIDEOHans Verkuil1-1/+1
'GRABBER' is a weird name, all other types map to the /dev device names. Rename to 'VIDEO' to be consistent with the other types. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Cc: Matt Ranostay <matt.ranostay@konsulko.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-02-24media: adv7180: Add init_cfg pad operationNiklas Söderlund1-0/+12
Add a init_cfg pad operation so that configurations allocated with v4l2_subdev_alloc_pad_config() are initialized. Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-23media: mt9v111: constify copied structureJulia Lawall1-1/+1
The mt9v111_def_fmt structure is only copied into another structure, so make it const. The opportunity for this change was found using Coccinelle. Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr> Acked-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-04media: i2c: mt9v032: fix enum mbus codes and frame sizesEugen Hristev1-2/+8
This driver supports both the mt9v032 (color) and the mt9v022 (mono) sensors. Depending on which sensor is used, the format from the sensor is different. The format.code inside the dev struct holds this information. The enum mbus and enum frame sizes need to take into account both type of sensors, not just the color one. To solve this, use the format.code in these functions instead of the hardcoded bayer color format (which is only used for mt9v032). [Sakari Ailus: rewrapped commit message] Suggested-by: Wenyou Yang <wenyou.yang@microchip.com> Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com> 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+huawei@kernel.org>
2020-01-04media: ov5640: Fix check for PLL1 exceeding max allowed rateAdam Ford1-1/+1
The variable _rate is by ov5640_compute_sys_clk() which returns zero if the PLL exceeds 1GHz. Unfortunately, the check to see if the max PLL1 output is checking 'rate' and not '_rate' and 'rate' does not ever appear to be 0. This patch changes the check against the returned value of '_rate' to determine if the PLL1 output exceeds 1GHz. Fixes: aa2882481cad ("media: ov5640: Adjust the clock based on the expected rate") Signed-off-by: Adam Ford <aford173@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-04media: ov5640: Put max framerate into table and simplify checkAdam Ford1-17/+22
Currently the various modes are placed into a table, but when ov5640_find_mode is called, it has to double check whether or not the requested framerate is tolerated by the mode. The determination is based on checking hact, vact, and frame rate. Only 640x480 is allowed at 60fps and QSXGA is limited to 15fps, but as the number of permitted frame rates change, this will begin to add more and more complexity to the check. This patch simplifies the check by adding the max framerate allowed for each mode into the table of modes. It then compares the requested framerate to the max permitted in the mode's table. This reduces the number of comparisions to one down from three at run-time. Signed-off-by: Adam Ford <aford173@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-03media: smiapp: Put the device again if starting streaming failsSakari Ailus1-1/+4
If there was an error in starting streaming, put the runtime usage count of the device. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-01-03media: smiapp: Avoid maintaining power state informationSakari Ailus3-90/+113
Instead of keeping track of the power state ourselves, let runtime PM handle it. This also splits handling controls between side effect management and writing the new configuration to the sensor's registers. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2019-12-16media: adv7604: extend deep color mode to ADV7611Dragos Bogdan1-11/+21
The AD7611 chip supports the same Deep Color Mode settings as the AD7604. This change extends support for this feature to the AD7611 by adding a wrapper function for the `read_hdmi_pixelclock` hook and adding the same frequency adjustment logic. Signed-off-by: Dragos Bogdan <dragos.bogdan@analog.com> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2019-12-13media: i2c: adv748x: Fix unsafe macrosGustavo A. R. Silva1-4/+4
Enclose multiple macro parameters in parentheses in order to make such macros safer and fix the Clang warning below: drivers/media/i2c/adv748x/adv748x-afe.c:452:12: warning: operator '?:' has lower precedence than '|'; '|' will be evaluated first [-Wbitwise-conditional-parentheses] ret = sdp_clrset(state, ADV748X_SDP_FRP, ADV748X_SDP_FRP_MASK, enable ? ctrl->val - 1 : 0); Fixes: 3e89586a64df ("media: i2c: adv748x: add adv748x driver") Reported-by: Dmitry Vyukov <dvyukov@google.com> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2019-11-10media: i2c: Use the correct style for SPDX License IdentifierNishad Kamdar4-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>
2019-11-08media: ov6650: fix smatch warningHans Verkuil1-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>
2019-11-05media: hi556: Add support for Hi-556 sensorShawn Tu3-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>
2019-11-05media: bt819: Reduce amount of F* words in the worldAndy Shevchenko1-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>
2019-11-05media: vpx3220: make array input_vals static, makes object smallerColin Ian King1-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>
2019-11-05media: smiapp: unlock on error in smiapp_start_streaming()Dan Carpenter1-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>
2019-10-24media: smiapp: Rename update_mode as pll_blanking_updateSakari Ailus1-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>
2019-10-24media: smiapp: Register sensor after enabling runtime PM on the deviceSakari Ailus1-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>
2019-10-24media: smiapp: Use non-binned and binned limits correctlySakari Ailus1-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>
2019-10-24media: smiapp: Don't update sensor configuration during power-on initSakari Ailus1-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>
2019-10-24media: smiapp: Move binning configuration to streaming startSakari Ailus1-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>
2019-10-24media: smiapp: Don't get binning limits dynamicallySakari Ailus1-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>
2019-10-24media: smiapp: Destroy sensor's mutexSakari Ailus1-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>