summaryrefslogtreecommitdiffstats
path: root/drivers/media/i2c
Commit message (Collapse)AuthorAgeFilesLines
* media: i2c: thp7312: select CONFIG_FW_LOADERArnd Bergmann2024-01-111-0/+1
| | | | | | | | | | | | | | | | | | | | The recently added driver uses the firmware loader mechanism but causes a link failure when that is in a loadable module while thp7312 itself is built-in: arm-linux-gnueabi-ld: drivers/media/i2c/thp7312.o: in function `thp7312_probe': thp7312.c:(.text+0x4164): undefined reference to `firmware_upload_register' Select the required Kconfig symbol. Note that the driver specifically needs the firmware upload interface that is controlled by CONFIG_FW_UPLOAD, but there is no link failure when that is disabled because the interfaces are stubbed out here. Link: https://lore.kernel.org/linux-media/20240103155811.4092035-1-arnd@kernel.org Fixes: 7a52ab415b43 ("media: i2c: Add driver for THine THP7312") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
* media: i2c: mt9m114: use fsleep() in place of udelay()Arnd Bergmann2023-12-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | With clang-16, building without COMMON_CLK triggers a range check on udelay() because of a constant division-by-zero calculation: ld.lld: error: undefined symbol: __bad_udelay >>> referenced by mt9m114.c >>> drivers/media/i2c/mt9m114.o:(mt9m114_power_on) in archive vmlinux.a In this configuration, the driver already fails to probe, before this function gets called, so it's enough to suppress the assertion. Do this by using fsleep(), which turns long delays into sleep() calls in place of the link failure. This is probably a good idea regardless to avoid overly long dynamic udelay() calls on a slow clock. Cc: Sakari Ailus <sakari.ailus@linux.intel.com> Fixes: 24d756e914fc ("media: i2c: Add driver for onsemi MT9M114 camera sensor") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: videobuf2: core: Rename min_buffers_needed field in vb2_queueBenjamin Gaignard2023-12-131-1/+1
| | | | | | | | | | | | Rename min_buffers_needed into min_queued_buffers and update the documentation about it. Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> [hverkuil: Drop the change where min_queued_buffers + 1 buffers would be] [hverkuil: allocated. Now this patch only renames this field instead of making] [hverkuil: a functional change as well.] [hverkuil: Renamed 3 remaining min_buffers_needed occurrences.]
* media: i2c: thp7312: Store frame interval in subdev stateLaurent Pinchart2023-12-131-77/+81
| | | | | | | | | Use the newly added storage for frame interval in the subdev state to simplify the driver. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: v4l2-subdev: Add which field to struct v4l2_subdev_frame_intervalLaurent Pinchart2023-12-1324-0/+290
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to a historical mishap, the v4l2_subdev_frame_interval structure is the only part of the V4L2 subdev userspace API that doesn't contain a 'which' field. This prevents trying frame intervals using the subdev 'TRY' state mechanism. Adding a 'which' field is simple as the structure has 8 reserved fields. This would however break userspace as the field is currently set to 0, corresponding to V4L2_SUBDEV_FORMAT_TRY, while the corresponding ioctls currently operate on the 'ACTIVE' state. We thus need to add a new subdev client cap, V4L2_SUBDEV_CLIENT_CAP_INTERVAL_USES_WHICH, to indicate that userspace is aware of this new field. All drivers that implement the subdev .get_frame_interval() and .set_frame_interval() operations are updated to return -EINVAL when operating on the TRY state, preserving the current behaviour. While at it, fix a bad copy&paste in the documentation of the struct v4l2_subdev_frame_interval_enum 'which' field. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> # for imx-media Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com> # for tegra-video Reviewed-by: Mauro Carvalho Chehab <mchehab@kernel.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: v4l2-subdev: Turn .[gs]_frame_interval into pad operationsLaurent Pinchart2023-12-1325-257/+233
| | | | | | | | | | | | | | | | | | | | | | The subdev .[gs]_frame_interval are video operations, but they operate on pads (and even on streams). Not only is this confusing, it causes practical issues for drivers as the operations don't receive a subdev state pointer, requiring manual state handling. To improve the situation, turn the operations into pad operations, and extend them to receive a state pointer like other pad operations. While at it, rename the operations to .[gs]et_frame_interval at the same time to match the naming scheme of other pad operations. This isn't strictly necessary, but given that all drivers using those operations need to be modified, handling the rename separately would generate more churn for very little gain (if at all). Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> # for imx-media Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com> # for tegra-video Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: i2c: Add driver for OmniVision OV64A40Jacopo Mondi2023-12-133-0/+3701
| | | | | | | | | | Add a driver for the OmniVision OV64A40 image sensor. Co-developed-by: Lee Jackson <lee.jackson@arducam.com> Signed-off-by: Lee Jackson <lee.jackson@arducam.com> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: i2c: imx335: Support 2592x1940 10-bit modeUmang Jain2023-12-131-7/+71
| | | | | | | | | | | | | | | In addition to the existing 2592x1940 12-bit mode, introduce support for 2592x1940 10-bit mode. Following are the register set which control the 10/12 bit mode setting: MDBIT 0x319d ADBIT 0x3050 ADBIT1 0x341c 0x341d Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: i2c: imx335: Fix hblank min/max valuesKieran Bingham2023-12-131-2/+2
| | | | | | | | | | | | The V4L2_CID_HBLANK control is marked as readonly and can only be a single value. Set the minimum and maximum value to match the mode value. Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: i2c: imx335: Implement get selection APIKieran Bingham2023-12-131-0/+45
| | | | | | | | | | | | | Support reporting of the Sensor Native and Active pixel array areas through the Selection API. The implementation reports a single target crop only for the mode that is presently exposed by the driver. Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: i2c: imx335: Enable regulator suppliesKieran Bingham2023-12-131-2/+34
| | | | | | | | | | | | Provide support for enabling and disabling regulator supplies to control power to the camera sensor. While updating the power on function, document that a sleep is represented as 'T4' in the datasheet power on sequence. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: i2c: imx335: Improve configuration error reportingKieran Bingham2023-12-131-1/+5
| | | | | | | | | | | | | | The existing imx335_parse_hw_config function has two paths that can be taken without reporting to the user the reason for failing to accept the hardware configuration. Extend the error reporting paths to identify failures when probing the device. Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: i2c: imx335: Fix logging line endingsKieran Bingham2023-12-131-21/+21
| | | | | | | | | | | | | | | | The use of \n as a line ending throughout the driver is inconsistent. While it is possible for logging messages to automatically have newlines added by the kernel printk mechanisms, this is specifically to support continued lines with PR_CONT and the lack of a new line character indicates that the text is a fragment of a continuation line. As each of these lines are whole and not fragments, explicitly define the newline for consistency. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: i2c: imx214: Add sensor's pixel matrix sizeAndré Apitzsch2023-12-131-7/+32
| | | | | | | | | | | | Set effective and active sensor pixel sizes as shown in product brief[1]. [1]: https://www.mouser.com/datasheet/2/897/ProductBrief_IMX214_20150428-1289331.pdf Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: André Apitzsch <git@apitzsch.eu> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: i2c: imx214: Read orientation and rotation from system firmwareAndré Apitzsch2023-12-131-1/+8
| | | | | | | | | | | | Obtain rotation and orientation information from system firmware and register the appropriate controls. While at it, update number of pre-allocated control slots. Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: André Apitzsch <git@apitzsch.eu> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: i2c: imx214: Move controls init to separate functionAndré Apitzsch2023-12-131-48/+67
| | | | | | | | | | | | | Code refinement. While at it, don't destroy the mutex not initialized yet if the controls are initialized incorrectly. Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: André Apitzsch <git@apitzsch.eu> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: i2c: imx214: Explain some magic numbersAndré Apitzsch2023-12-131-4/+18
| | | | | | | | | | | Code refinement, no functional changes. Reviewed-by: Ricardo Ribalda <ribalda@chromium.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: André Apitzsch <git@apitzsch.eu> [Sakari Ailus: The control handler remains in the context struct still.] Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: i2c: gc0308: new driverSebastian Reichel2023-12-133-0/+1462
| | | | | | | | | | | | Introduce new driver for GalaxyCore GC0308, which is a cheap 640x480 with an on-chip ISP sensor sold since 2010. Data is provided via parallel bus. Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Sebastian Reichel <sre@kernel.org> [Sakari Ailus: Changed MAINTAINERS to match GC2145 entry.] Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: ov2740: Add a sleep after resetting the sensorHans de Goede2023-12-131-2/+9
| | | | | | | | | | | | | | Split the resetting of the sensor out of the link_freq_config reg_list and add a delay after this. This hopefully fixes the stream sometimes not starting, this was taken from the ov2740 sensor driver in the out of tree IPU6 driver: https://github.com/intel/ipu6-drivers/ Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: ov2740: Add support for 180 MHz link frequencyHans de Goede2023-12-131-24/+239
| | | | | | | | | | | | | | | | | | | | | | | | | On various Lenovo Thinkpad models with an ov2740 sensor the 360 MHz link frequency is not supported. Add support for 180 MHz link frequency, even though this has half the pixel clock, this supports the same framerate by using half the VTS value (significantly reducing the amount of empty lines send during vblank). Normally if there are multiple link-frequencies then the sensor driver choses the lowest link-frequency still usable for the chosen resolution. In this case the board supports only 1 link-frequency. Which frequency is supported is checked in ov2740_check_hwcfg() and then a different set of supported_modes (using only the supported link-freq) is selected. The register settings for this were taken from the ov2740 sensor driver in the out of tree IPU6 driver: https://github.com/intel/ipu6-drivers/ Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: ov2740: Check hwcfg after allocating the ov2740 structHans de Goede2023-12-131-6/+7
| | | | | | | | | | | | Alloc ov2740_data and set up the drvdata pointer before calling ov2740_check_hwcfg(). This is a preparation patch to allow ov2740_check_hwcfg() to store some of the parsed data in the ov2740 struct. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: ov2740: Fix hts valueHans de Goede2023-12-131-14/+3
| | | | | | | | | | | | | | HTS must be more then width, so the 1080 value clearly is wrong, this is then corrected with some weird math dividing clocks in to_pixels_per_line() which results in the hts getting multiplied by 2, resulting in 2160. Instead just directly set hts to the correct value of 2160 and drop to_pixels_per_line(). Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: ov2740: Improve ov2740_check_hwcfg() error reportingHans de Goede2023-12-131-2/+3
| | | | | | | | | Make ov2740_check_hwcfg() report an error on failure in all error paths, so that it is always clear why the probe() failed. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: ov2740: Move fwnode_graph_get_next_endpoint() call upHans de Goede2023-12-131-6/+14
| | | | | | | | | | | | If the bridge has not yet setup the fwnode-graph then the fwnode_property_read_u32("clock-frequency") call will fail. Move the fwnode_graph_get_next_endpoint() call to above reading the clock-frequency. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: ov2740: Add support for external clockHans de Goede2023-12-131-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 ThinkPad models with IPU6 + ov2740 sensor, the sensor driver must control the reset GPIO and the sensor's clock itself. Add support for having the driver control an optional clock. Reviewed-by: Bingbu Cao <bingbu.cao@intel.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: ov2740: Add support for reset GPIOHans de Goede2023-12-131-2/+46
| | | | | | | | | | | | | | | | | 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 ThinkPad models with IPU6 + ov2740 sensor, the sensor driver must control the reset GPIO and the sensor's clock itself. Add support for having the driver control an optional reset GPIO. Reviewed-by: Bingbu Cao <bingbu.cao@intel.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: i2c: Add support for alvium cameraTommaso Merciai2023-12-134-0/+3033
| | | | | | | | | | | | | | | | | | | | | | The Alvium camera is shipped with sensor + isp in the same housing. The camera can be equipped with one out of various sensor and abstract the user from this. Camera is connected via MIPI CSI-2. Most of the camera module features are supported, with the main exception being fw update. The driver provides all mandatory, optional and recommended V4L2 controls for maximum compatibility with libcamera References: - https://www.alliedvision.com/en/products/embedded-vision-solutions Signed-off-by: Tommaso Merciai <tomm.merciai@gmail.com> [Sakari Ailus: Assign ret before using it in probe and squash Tommaso's other fixes.] Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> [hverkuil: alvium-csi2.h: SPDX must use /* */ instead of //]
* media: i2c: ak7375: Add support for ak7345Vincent Knecht2023-12-131-4/+22
| | | | | | | | | | | | Add support for ak7345 VCM, which has 9 bits position values, longer power-up delay, and no known standby register setting. Might be compatible as-is with ak7348. Tested on msm8916-alcatel-idol347 phone. Signed-off-by: Vincent Knecht <vincent.knecht@mailoo.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: i2c: ak7375: Prepare for supporting another chipVincent Knecht2023-12-131-44/+66
| | | | | | | | | | | | In view of adding support for at least one other chip, change the driver to move chip-specific properties and values in a common structure. No functional changes. Signed-off-by: Vincent Knecht <vincent.knecht@mailoo.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: i2c: imx290: Properly encode registers as little-endianAlexander Stein2023-12-131-21/+21
| | | | | | | | | | | | | | | The conversion to CCI also converted the multi-byte register access to big-endian. Correct the register definition by using the correct little-endian ones. Fixes: af73323b9770 ("media: imx290: Convert to new CCI register access helpers") Cc: stable@vger.kernel.org Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> [Sakari Ailus: Fixed the Fixes: tag.] Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: i2c: Introduce a driver for the Techwell TW9900 decoderMehdi Djait2023-12-133-0/+797
| | | | | | | | | | | | | | | | The Techwell video decoder supports PAL, NTSC standards and has a parallel BT.656 output interface. This commit adds support for this device, with basic support for NTSC and PAL, along with brightness and contrast controls. The TW9900 is capable of automatic standard detection. This driver is implemented with support for PAL and NTSC autodetection. Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Signed-off-by: Mehdi Djait <mehdi.djait@bootlin.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: ov9640: Don't set format in sub-device stateSakari Ailus2023-12-081-2/+0
| | | | | | | | | | | | For the purpose of setting old non-pad based sub-device try format as a basis for VIDIOC_TRY_FMT implementation, there is no need to set the format in the sub-device state. Drop the assignment to the state, which would result in a NULL pointer dereference. Fixes: fd17e3a9a788 ("media: i2c: Use accessors for pad config 'try_*' fields") Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: tw9910: Don't set format in sub-device stateSakari Ailus2023-12-081-2/+0
| | | | | | | | | | | | For the purpose of setting old non-pad based sub-device try format as a basis for VIDIOC_TRY_FMT implementation, there is no need to set the format in the sub-device state. Drop the assignment to the state, which would result in a NULL pointer dereference. Fixes: fd17e3a9a788 ("media: i2c: Use accessors for pad config 'try_*' fields") Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: rj54n1cb0c: Don't set format in sub-device stateSakari Ailus2023-12-081-3/+1
| | | | | | | | | | | | For the purpose of setting old non-pad based sub-device try format as a basis for VIDIOC_TRY_FMT implementation, there is no need to set the format in the sub-device state. Drop the assignment to the state, which would result in a NULL pointer dereference. Fixes: fd17e3a9a788 ("media: i2c: Use accessors for pad config 'try_*' fields") Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: mt9t112: Don't set format in sub-device stateSakari Ailus2023-12-081-1/+0
| | | | | | | | | | | | For the purpose of setting old non-pad based sub-device try format as a basis for VIDIOC_TRY_FMT implementation, there is no need to set the format in the sub-device state. Drop the assignment to the state, which would result in a NULL pointer dereference. Fixes: fd17e3a9a788 ("media: i2c: Use accessors for pad config 'try_*' fields") Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: adv7183: Don't set format in sub-device stateSakari Ailus2023-12-081-2/+0
| | | | | | | | | | | | For the purpose of setting old non-pad based sub-device try format as a basis for VIDIOC_TRY_FMT implementation, there is no need to set the format in the sub-device state. Drop the assignment to the state, which would result in a NULL pointer dereference. Fixes: fd17e3a9a788 ("media: i2c: Use accessors for pad config 'try_*' fields") Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: saa6752hs: Don't set format in sub-device stateSakari Ailus2023-12-081-3/+1
| | | | | | | | | | | | For the purpose of setting old non-pad based sub-device try format as a basis for VIDIOC_TRY_FMT implementation, there is no need to set the format in the sub-device state. Drop the assignment to the state, which would result in a NULL pointer dereference. Fixes: fd17e3a9a788 ("media: i2c: Use accessors for pad config 'try_*' fields") Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: ccs: Select V4L2_CCI_I2CSakari Ailus2023-12-081-0/+1
| | | | | | | | | | Select V4L2_CCI_I2C Kconfig option which the CCS driver now depends on. Fixes: 529322112a3b ("media: ccs: Use V4L2 CCI for accessing sensor registers") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202312060941.CYiHppAp-lkp@intel.com/ Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: ccs: Use V4L2 CCI for accessing sensor registersSakari Ailus2023-12-045-1136/+999
| | | | | | | | | | | | | Use V4L2 CCI for accessing device's registers. The 8-bit compatibility read option is removed but this is supported by regmap through other means. Also the CCS register definitions are re-generated with V4L2 CCI definitions. The older SMIA++ register definitions have been manually converted. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: ccs: Better separate CCS static data accessSakari Ailus2023-12-041-10/+11
| | | | | | | | | | | | | | Separate CCS static data read-only register access in ccs-reg-access.c by naming them differently. The code in this file generally deals with reading and writing registers where as static data (when it comes to ccs_static_data_read_ro_reg()) contains the read-only register values but no hardware registers are accessed in that case. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: imx319: Enable runtime PM before registering async sub-deviceSakari Ailus2023-12-041-5/+7
| | | | | | | | | As the sensor may be accessible right after its async sub-device is registered, enable runtime PM before doing so. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: ccs: Print ireal and float limits converted to integersSakari Ailus2023-12-041-4/+13
| | | | | | | | A number of CCS register value limits are in ireal or float format. Also convert them to integers for easier interpretation. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: ov9734: Enable runtime PM before registering async sub-deviceBingbu Cao2023-12-041-8/+11
| | | | | | | | | | | | | | | | As the sensor device maybe accessible right after its async sub-device is registered, such as ipu-bridge will try to power up sensor by sensor's client device's runtime PM from the async notifier callback, if runtime PM is not enabled, it will fail. So runtime PM should be ready before its async sub-device is registered and accessible by others. Fixes: d3f863a63fe4 ("media: i2c: Add ov9734 image sensor driver") Cc: stable@vger.kernel.org Signed-off-by: Bingbu Cao <bingbu.cao@intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: ov13b10: Enable runtime PM before registering async sub-deviceBingbu Cao2023-12-041-5/+9
| | | | | | | | | | | | | | | | As the sensor device maybe accessible right after its async sub-device is registered, such as ipu-bridge will try to power up sensor by sensor's client device's runtime PM from the async notifier callback, if runtime PM is not enabled, it will fail. So runtime PM should be ready before its async sub-device is registered and accessible by others. Fixes: 7ee850546822 ("media: Add sensor driver support for the ov13b10 camera.") Cc: stable@vger.kernel.org Signed-off-by: Bingbu Cao <bingbu.cao@intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: ov01a10: Enable runtime PM before registering async sub-deviceBingbu Cao2023-12-041-4/+14
| | | | | | | | | | | | | | | | | | | As the sensor device maybe accessible right after its async sub-device is registered, such as ipu-bridge will try to power up sensor by sensor's client device's runtime PM from the async notifier callback, if runtime PM is not enabled, it will fail. So runtime PM should be ready before its async sub-device is registered and accessible by others. It also sets the runtime PM status to active as the sensor was turned on by i2c-core. Fixes: 0827b58dabff ("media: i2c: add ov01a10 image sensor driver") Cc: stable@vger.kernel.org Signed-off-by: Bingbu Cao <bingbu.cao@intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: imx355: Enable runtime PM before registering async sub-deviceBingbu Cao2023-12-041-5/+7
| | | | | | | | | | | | | | | | As the sensor device maybe accessible right after its async sub-device is registered, such as ipu-bridge will try to power up sensor by sensor's client device's runtime PM from the async notifier callback, if runtime PM is not enabled, it will fail. So runtime PM should be ready before its async sub-device is registered and accessible by others. Fixes: df0b5c4a7ddd ("media: add imx355 camera sensor driver") Cc: stable@vger.kernel.org Signed-off-by: Bingbu Cao <bingbu.cao@intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: i2c: st-vgxy61: add v4l2_fwnode ctrls parse and additionAlain Volmat2023-12-041-0/+9
| | | | | | | | | Allow parsing of the v4l2_fwnode properties from the DT and addition of those properties (such as orientation, rotation). Signed-off-by: Alain Volmat <alain.volmat@foss.st.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: i2c: st-vgxy61: Add V4L2_SUBDEV_FL_HAS_EVENTS and subscribe hooksAlain Volmat2023-12-041-1/+9
| | | | | | | | | | | | Any V4L2 subdevice that implements controls and declares V4L2_SUBDEV_FL_HAS_DEVNODE should also declare V4L2_SUBDEV_FL_HAS_EVENTS and implement subscribe_event and unsubscribe_event hooks. With that done, v4l2-compliance testing is now ok. Signed-off-by: Alain Volmat <alain.volmat@foss.st.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: i2c: st-mipid02: add Y8 format supportAlain Volmat2023-12-041-1/+3
| | | | | | | | Add support of MEDIA_BUS_FMT_Y8_1X8. Signed-off-by: Alain Volmat <alain.volmat@foss.st.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: i2c: st-mipid02: removal of unused link_frequency variableAlain Volmat2023-12-041-1/+0
| | | | | | | | | link_frequency variable within struct mipid02_dev seems to have never been used hence remove it. Signed-off-by: Alain Volmat <alain.volmat@foss.st.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>