aboutsummaryrefslogtreecommitdiff
path: root/drivers/media
AgeCommit message (Collapse)AuthorFilesLines
2024-04-29media: dw2102: Don't translate i2c read into writeMichael Bunk1-47/+73
The code ignored the I2C_M_RD flag on I2C messages. Instead it assumed an i2c transaction with a single message must be a write operation and a transaction with two messages would be a read operation. Though this works for the driver code, it leads to problems once the i2c device is exposed to code not knowing this convention. For example, I did "insmod i2c-dev" and issued read requests from userspace, which were translated into write requests and destroyed the EEPROM of my device. So, just check and respect the I2C_M_READ flag, which indicates a read when set on a message. If it is absent, it is a write message. Incidentally, changing from the case statement to a while loop allows the code to lift the limitation to two i2c messages per transaction. There are 4 more *_i2c_transfer functions affected by the same behaviour and limitation that should be fixed in the same way. Link: https://lore.kernel.org/linux-media/[email protected] Signed-off-by: Michael Bunk <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2024-04-29media: m88ds3103: Fix lock led supportMichael Bunk1-0/+7
The new m88ds3101b demodulator version requires the highest bit of register 0x11 be cleared after tuning to a new frequency to make the lock output pin go high when a signal is found. This pin is normally connected to an indicator led. Link: https://lore.kernel.org/linux-media/[email protected] Signed-off-by: Michael Bunk <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2024-04-29media: i2c: max9271: Add header include guards to max9271.hLaurent Pinchart1-0/+5
Protect against multiple inclusions of the max9271.h header with include guards. Link: https://lore.kernel.org/linux-media/[email protected] Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Kieran Bingham <[email protected]> Reviewed-by: Jacopo Mondi <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2024-04-29media: i2c: rdacm20: Fix indentation in commentLaurent Pinchart1-2/+2
Fix a small indentation issue in a comment block. Link: https://lore.kernel.org/linux-media/[email protected] Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Kieran Bingham <[email protected]> Reviewed-by: Jacopo Mondi <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2024-04-27media: mediatek: vcodec: fix possible unbalanced PM counterEugen Hristev3-3/+8
It is possible that mtk_vcodec_enc_pw_on fails, and in that scenario the PM counter is not incremented, and subsequent call to mtk_vcodec_enc_pw_off decrements the counter, leading to a PM imbalance. Fix by bailing out of venc_if_encode in the case when mtk_vcodec_enc_pw_on fails. Fixes: 4e855a6efa54 ("[media] vcodec: mediatek: Add Mediatek V4L2 Video Encoder Driver") Signed-off-by: Eugen Hristev <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Signed-off-by: Andrzej Pietrasiewicz <[email protected]> Signed-off-by: Sebastian Fricke <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-26media: mediatek: vcodec: Only free buffer VA that is not NULLFei Shao2-9/+18
In the MediaTek vcodec driver, while mtk_vcodec_mem_free() is mostly called only when the buffer to free exists, there are some instances that didn't do the check and triggered warnings in practice. We believe those checks were forgotten unintentionally. Add the checks back to fix the warnings. Signed-off-by: Fei Shao <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Signed-off-by: Andrzej Pietrasiewicz <[email protected]> Signed-off-by: Sebastian Fricke <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2024-04-26media: mediatek: vcodec: Update mtk_vcodec_mem_free() error messagesFei Shao1-2/+3
In mtk_vcodec_mem_free(), there are two cases where a NULL VA is passed: - mem->size == 0: we are called to free no memory. This may happen when we call mtk_vcodec_mem_free() twice or the memory has never been allocated. - mem->size > 0: we are called to free memory but without VA. This means that we failed to free the memory for real. Both cases are not expected to happen, and we want to have clearer error messages to describe which one we just encountered. Update the error messages to include more information for that purpose. Signed-off-by: Fei Shao <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Signed-off-by: Andrzej Pietrasiewicz <[email protected]> Signed-off-by: Sebastian Fricke <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2024-04-26media: mediatek: vcodec: Drop unnecessary variableFei Shao1-12/+10
In mtk_vcodec_mem_alloc() and mtk_vcodec_mem_free(), the value of mem->size is not expected to change before and when using the DMA APIs and debug print, so there's no point in keeping local copies of it. Drop the local variable "size" in the mentioned functions, and update printk format identifiers accordingly. This makes the code slightly more visually consistent, and retrieve a small amount of memory that is used for no real purpose. Signed-off-by: Fei Shao <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Signed-off-by: Andrzej Pietrasiewicz <[email protected]> Signed-off-by: Sebastian Fricke <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2024-04-26media: mediatek: vcodec: Replace dev_name in error stringFei Shao1-2/+2
mtk_v4l2_err() already uses dev_err(), so don't print the device name again. Print the function name instead. Signed-off-by: Fei Shao <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Signed-off-by: Andrzej Pietrasiewicz <[email protected]> Signed-off-by: Sebastian Fricke <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2024-04-26media: v4l: async: Set owner for async sub-devicesSakari Ailus1-2/+6
Set the owner field of the async sub-devices by making v4l2_async_register_subdev() a macro and obtaining THIS_MODULE that way. Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2024-04-26media: v4l: Set sub-device's owner field to the caller's moduleSakari Ailus4-8/+10
Set a sub-device's owner field to the caller's module, provided as an argument to the function. v4l2_device_register_subdev() becomes a macro passing THIS_MODULE to the __v4l2_device_register_subdev() function. Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2024-04-26media: i2c: imx219: Use dev_err_probe on probeUmang Jain1-42/+35
Drop dev_err() and use the dev_err_probe() helper on probe path. No functional changes intended. Signed-off-by: Umang Jain <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2024-04-26media: i2c: ov4689: Set timing registers programmaticallyMikhail Rudenko1-15/+68
Set timing-related and BLC anchor registers via cci calls instead of hardcoding them in the register table. This prepares the driver for implementation of configurable analogue crop and binning. No functional change intended. Signed-off-by: Mikhail Rudenko <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2024-04-26media: i2c: ov4689: Move pixel array size out of struct ov4689_modeMikhail Rudenko1-16/+13
Pixel array dimensions and default crop size do not belong to the ov4689_mode structure, since they are mode independent. Make them defines instead. Signed-off-by: Mikhail Rudenko <[email protected]> Reviewed-by: Kieran Bingham <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2024-04-26media: i2c: ov4689: Implement manual color balance controlsMikhail Rudenko1-1/+22
The OV4689 sensor has separate red and blue gain settings (up to 4x). Implement appropriate controls in the driver. Default gain values are not modified. Signed-off-by: Mikhail Rudenko <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2024-04-26media: i2c: ov4689: Implement digital gain controlMikhail Rudenko1-2/+14
The OV4689 sensor supports digital gain up to 16x. Implement corresponding control in the driver. Default digital gain value is not modified by this patch. Signed-off-by: Mikhail Rudenko <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2024-04-26media: i2c: ov4689: Implement vflip/hflip controlsMikhail Rudenko1-2/+22
The OV4689 sensor supports horizontal and vertical flipping. Add appropriate controls to the driver. Toggling both array flip and digital flip bits allows to achieve flipping while maintaining output Bayer order. Note that the default value of hflip control corresponds to both bits set, as it was before this patch. Signed-off-by: Mikhail Rudenko <[email protected]> Reviewed-by: Kieran Bingham <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2024-04-26media: i2c: ov4689: Make horizontal blanking configurableMikhail Rudenko1-11/+20
Make horizontal blanking configurable. To do so, set HTS register according to the requested horizontal blanking in ov4689_set_ctrl instead of the register table. Default HTS value is not changed by this patch. Minimal HTS value is found experimentally and corresponds to 90 fps framerate at minimum vertical blanking. Real HTS value is the register value multiplied by 4. Signed-off-by: Mikhail Rudenko <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2024-04-26media: i2c: ov4689: Remove max_fps field from struct ov4689_modeMikhail Rudenko1-2/+0
max_fps field of struct ov4689_mode is unused in this driver, so remove it. Signed-off-by: Mikhail Rudenko <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2024-04-26media: i2c: ov4689: Use runtime PM autosuspendMikhail Rudenko1-4/+11
Use runtime PM autosuspend to avoid powering off the sensor during fast stop-reconfigure-restart cycles. Signed-off-by: Mikhail Rudenko <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2024-04-26media: i2c: ov4689: Enable runtime PM before registering sub-deviceMikhail Rudenko1-6/+8
As the sensor may be accessible right after its async sub-device is registered, enable runtime PM before doing so. Signed-off-by: Mikhail Rudenko <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2024-04-26media: i2c: ov4689: Use sub-device active stateMikhail Rudenko1-44/+31
Use sub-device active state. Employ control handler lock to synchronize access to the active state and s_stream. Signed-off-by: Mikhail Rudenko <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2024-04-26media: i2c: ov4689: Refactor ov4689_set_ctrlMikhail Rudenko1-6/+6
Introduce local variable for regmap within the ov4689_set_ctrl function. This adjustment eliminates repetition within the function. Signed-off-by: Mikhail Rudenko <[email protected]> Reviewed-by: Kieran Bingham <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2024-04-26media: i2c: ov4689: Remove i2c_client from ov4689 structMikhail Rudenko1-18/+18
The 'client' field within the 'ov4689' structure is solely used to access its 'dev' member. This commit removes the 'client' field and directly stores a pointer to the 'struct device'. Signed-off-by: Mikhail Rudenko <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2024-04-26media: i2c: ov4689: CCI conversionMikhail Rudenko2-227/+134
Convert the i2c register accesses to utilize the CCI helper library rather than relying on driver-specific functions. Also, set analogue gain in a single 16-bit write instead of two 8-bit writes. [Sakari Ailus: Initialise sensor_gain as 0.] Signed-off-by: Mikhail Rudenko <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2024-04-26media: i2c: ov4689: Fix typo in a commentMikhail Rudenko1-1/+1
Fix a spelling error in a comment. Signed-off-by: Mikhail Rudenko <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2024-04-26media: i2c: ov4689: Sort register definitions by addressMikhail Rudenko1-5/+5
Put register defininitions in the order of increasing register address. Signed-off-by: Mikhail Rudenko <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2024-04-26media: i2c: ov4689: Clean up and annotate the register tableMikhail Rudenko1-86/+119
Many values in the register table are actually power-on defaults. Remove those and also unused HDR exposures and gains. Annotate the remaining values using the publicly available datasheet to facilitate further development. No functional change intended. Signed-off-by: Mikhail Rudenko <[email protected]> Acked-by: Laurent Pinchart <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2024-04-24media: stk1160: fix bounds checking in stk1160_copy_video()Dan Carpenter1-5/+15
The subtract in this condition is reversed. The ->length is the length of the buffer. The ->bytesused is how many bytes we have copied thus far. When the condition is reversed that means the result of the subtraction is always negative but since it's unsigned then the result is a very high positive value. That means the overflow check is never true. Additionally, the ->bytesused doesn't actually work for this purpose because we're not writing to "buf->mem + buf->bytesused". Instead, the math to calculate the destination where we are writing is a bit involved. You calculate the number of full lines already written, multiply by two, skip a line if necessary so that we start on an odd numbered line, and add the offset into the line. To fix this buffer overflow, just take the actual destination where we are writing, if the offset is already out of bounds print an error and return. Otherwise, write up to buf->length bytes. Fixes: 9cb2173e6ea8 ("[media] media: Add stk1160 new driver (easycap replacement)") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Ricardo Ribalda <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-24media: videobuf2: improve max_num_buffers sanity checksHans Verkuil1-1/+7
Ensure that drivers set max_num_buffers to a value >= 32. For now there is no reason for drivers to request a lower limit and doing so might potentially cause userspace issues. Note that the old check of > MAX_BUFFER_INDEX was pointless since q->max_num_buffers was already limited to MAX_BUFFER_INDEX or less. Also add a sanity check in __vb2_init_fileio(), returning -ENOSPC if a driver returns more than 32 buffers from VIDIOC_REQBUFS with count = q->min_reqbufs_allocation. The vb2_fileio_data struct only supports up to 32 buffers, so we need a check there. Signed-off-by: Hans Verkuil <[email protected]>
2024-04-24media: cec: return -ENODEV instead of -ENXIO if unregisteredHans Verkuil1-2/+2
If the CEC device is unregistered, then an attempt to open the device node should result in an -ENODEV error instead of -ENXIO. Document this as well in cec-func-open.rst. This is consistent with the error code returned by other file operations such as ioctl. Signed-off-by: Hans Verkuil <[email protected]>
2024-04-24media: v4l2-core: hold videodev_lock until dev reg, finishesHans Verkuil1-0/+3
After the new V4L2 device node was registered, some additional initialization was done before the device node was marked as 'registered'. During the time between creating the device node and marking it as 'registered' it was possible to open the device node, which would return -ENODEV since the 'registered' flag was not yet set. Hold the videodev_lock mutex from just before the device node is registered until the 'registered' flag is set. Since v4l2_open will take the same lock, it will wait until this registration process is finished. This resolves this race condition. Signed-off-by: Hans Verkuil <[email protected]> Reviewed-by: Sakari Ailus <[email protected]> Cc: <[email protected]> # for vi4.18 and up
2024-04-22Merge tag 'tags/media-next-uvc-20240419' of ↵Hans Verkuil2-1/+55
git://git.kernel.org/pub/scm/linux/kernel/git/pinchartl/linux.git into media_stage uvcvideo fixes: Ricardo Ribalda (3): media: uvcvideo: Add quirk for Logitech Rally Bar media: uvcvideo: Fix power line control for Shine-Optics Camera media: uvcvideo: Disable autosuspend for Insta360 Link Signed-off-by: Hans Verkuil <[email protected]> From: Laurent Pinchart <[email protected]> Link: https://patchwork.linuxtv.org/project/linux-media/patch/[email protected]/
2024-04-22media: imx335: Describe CCI struct memberUmang Jain1-0/+1
Add description for 'struct regmap *cci' member of struct imx335. This will fix the following compile-time warning: warning: Function parameter or struct member 'cci' not described in 'imx335' Signed-off-by: Umang Jain <[email protected]> Reviewed-by: Kieran Bingham <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-22media: hi556: Add support for avdd regulatorHans de Goede1-0/+24
On some ACPI platforms, such as Chromebooks the ACPI methods to change the power-state (_PS0 and _PS3) fully take care of powering on/off the sensor. On other ACPI platforms, such as e.g. various HP models with IPU6 + hi556 sensor, the sensor driver must control the avdd regulator itself. Add support for having the driver control the sensor's avdd regulator. Note this relies on the regulator-core providing a dummy regulator (which it does by default) on platforms where Linux is not aware of the avdd regulator. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-22media: hi556: Add support for external clockHans de Goede1-0/+13
On some ACPI platforms, such as Chromebooks the ACPI methods to change the power-state (_PS0 and _PS3) fully take care of powering on/off the sensor. On other ACPI platforms, such as e.g. various HP models with IPU6 + hi556 sensor, the sensor driver must control the sensor's clock itself. Add support for having the driver control an optional clock. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-22media: hi556: Add support for reset GPIOHans de Goede1-1/+44
On some ACPI platforms, such as Chromebooks the ACPI methods to change the power-state (_PS0 and _PS3) fully take care of powering on/off the sensor. On other ACPI platforms, such as e.g. various HP models with IPU6 + hi556 sensor, the sensor driver must control the reset GPIO itself. Add support for having the driver control an optional reset GPIO. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-22media: hi556: Return -EPROBE_DEFER if no endpoint is foundHans de Goede1-11/+12
With ipu bridge, endpoints may only be created when ipu bridge has initialised. This may happen after the sensor driver has first probed. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-22media: ov2680: Add camera orientation and sensor rotation controlsHans de Goede1-0/+7
Add camera orientation and sensor rotation controls using the v4l2_fwnode_device_parse() and v4l2_ctrl_new_fwnode_properties() helpers. Reviewed-by: Kieran Bingham <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-22media: ov2680: Add hblank controlHans de Goede1-0/+12
Add hblank control so that the sensor has all the mandatory controls for libcamera. Reviewed-by: Kieran Bingham <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-22media: ov2680: Add vblank controlHans de Goede1-7/+49
Add vblank control to allow changing the framerate / higher exposure values. Reviewed-by: Kieran Bingham <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-22media: ov2680: Drop hts, vts ov2680_mode struct membersHans de Goede1-6/+2
The hts, vts ov2680_mode struct members always contain OV2680_PIXELS_PER_LINE resp. OV2680_LINES_PER_FRAME, drop them and simply use these values directly. Reviewed-by: Kieran Bingham <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-22media: ov2680: Stop sending more data then requestedHans de Goede1-7/+2
There is no reason to send OV2680_END_MARGIN extra columns on top of the mode width and the same for sending extra lines over the mode height. This sending of extra lines/columns was inherited from the atomisp ov2680 driver, it is unclear why this was done and this complicates adding V4L2_CID_VBLANK support, so remove it. Reviewed-by: Kieran Bingham <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-22media: ov2680: Do not fail if data-lanes property is absentFabio Estevam1-7/+0
Since commit 63b0cd30b78e ("media: ov2680: Add bus-cfg / endpoint property verification") the ov2680 driver no longer probes when the 'data-lanes' property is absent. The OV2680 sensor has only one data lane, so there is no need for describing it the devicetree. Remove the unnecessary data-lanes property check. Suggested-by: Sakari Ailus <[email protected]> Fixes: 63b0cd30b78e ("media: ov2680: Add bus-cfg / endpoint property verification") Signed-off-by: Fabio Estevam <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-22media: imx335: Limit analogue gain valueUmang Jain1-4/+12
The sensor gain (both analog and digital) are controlled by a single gain value where: - 0dB to 30dB correspond to analog gain - 30.3dB to 72dB correspond to digital gain (with 0.3dB step) Hence, limit the analogue gain value to 100. For digital gain, support can be added later if needed. Signed-off-by: Umang Jain <[email protected]> Reviewed-by: Kieran Bingham <[email protected]> Reviewed-by: Tommaso Merciai <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-22media: imx335: Fix active area height discrepencyUmang Jain1-5/+5
The imx335 reports a recommended pixel area of - 2592x1944. The driver supported mode however limits it to height=1940. Fix the height discrepency by correctly the value of height (with updates to vblank and mode registers). The IMX335_REG_HTRIMMING should also be corrected to the start offset(i.e. 48) instead of chosing a abritrary crop start of 384. Signed-off-by: Umang Jain <[email protected]> Reviewed-by: Kieran Bingham <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-22media: imx335: Use integer values for size registersUmang Jain1-6/+6
Consider integer values for registers that are related to various sizes in the register map. This helps in improving the overall readability. No functional changes intended in this patch. Signed-off-by: Umang Jain <[email protected]> Reviewed-by: Tommaso Merciai <[email protected]> Reviewed-by: Kieran Bingham <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-22media: imx335: Use V4L2 CCI for accessing sensor registersUmang Jain2-330/+266
Use the new comon CCI register access helpers to replace the private register access helpers in the imx335 driver. Select V4L2_CCI_I2C Kconfig option which the imx335 driver now depends on. Signed-off-by: Umang Jain <[email protected]> Reviewed-by: Kieran Bingham <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-22media: imx335: Parse fwnode propertiesKieran Bingham1-1/+9
Call the V4L2 fwnode device parser to handle controls that are standardised by the framework. Signed-off-by: Kieran Bingham <[email protected]> Signed-off-by: Umang Jain <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-22media: imx335: Support 2 or 4 lane operation modesKieran Bingham1-1/+20
The IMX335 can support both 2 and 4 lane configurations. Extend the driver to configure the lane mode accordingly. Update the pixel rate depending on the number of lanes in use. Signed-off-by: Kieran Bingham <[email protected]> Signed-off-by: Umang Jain <[email protected]> Reviewed-by: Tommaso Merciai <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> [hverkuil: fixup missing : in @lane_mode kerneldoc line]