summaryrefslogtreecommitdiff
path: root/drivers/staging/media
AgeCommit message (Collapse)AuthorFilesLines
2023-11-07Merge tag 'media/v6.7-1' of ↵Linus Torvalds83-6926/+518
git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media Pull media updates from Mauro Carvalho Chehab: - the old V4L2 core videobuf kAPI was finally removed. All media drivers should now be using VB2 kAPI - new automotive driver: mgb4 - new platform video driver: npcm-video - new sensor driver: mt9m114 - new TI driver used in conjunction with Cadence CSI2RX IP to bridge TI-specific parts - ir-rx51 was removed and the N900 DT binding was moved to the pwm-ir-tx generic driver - drop atomisp-specific ov5693, using the upstream driver instead - the camss driver has gained RDI3 support for VFE 17x - the atomisp driver now detects ISP2400 or ISP2401 at run time. No need to set it up at build time anymore - lots of driver fixes, cleanups and improvements * tag 'media/v6.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (377 commits) media: nuvoton: VIDEO_NPCM_VCD_ECE should depend on ARCH_NPCM media: venus: Fix firmware path for resources media: venus: hfi_cmds: Replace one-element array with flex-array member and use __counted_by media: venus: hfi_parser: Add check to keep the number of codecs within range media: venus: hfi: add checks to handle capabilities from firmware media: venus: hfi: fix the check to handle session buffer requirement media: venus: hfi: add checks to perform sanity on queue pointers media: platform: cadence: select MIPI_DPHY dependency media: MAINTAINERS: Fix path for J721E CSI2RX bindings media: cec: meson: always include meson sub-directory in Makefile media: videobuf2: Fix IS_ERR checking in vb2_dc_put_userptr() media: platform: mtk-mdp3: fix uninitialized variable in mdp_path_config() media: mediatek: vcodec: using encoder device to alloc/free encoder memory media: imx-jpeg: notify source chagne event when the first picture parsed media: cx231xx: Use EP5_BUF_SIZE macro media: siano: Drop unnecessary error check for debugfs_create_dir/file() media: mediatek: vcodec: Handle invalid encoder vsi media: aspeed: Drop unnecessary error check for debugfs_create_file() Documentation: media: buffer.rst: fix V4L2_BUF_FLAG_PREPARED Documentation: media: gen-errors.rst: fix confusing ENOTTY description ...
2023-10-12staging: media: ipu3: remove ftrace-like loggingRicardo B. Marliere1-6/+0
This patch fixes the following checkpatch.pl warnings in ipu3.c: WARNING: Unnecessary ftrace-like logging - prefer using ftrace + dev_dbg(dev, "enter %s\n", __func__); WARNING: Unnecessary ftrace-like logging - prefer using ftrace + dev_dbg(dev, "leave %s\n", __func__); WARNING: Unnecessary ftrace-like logging - prefer using ftrace + dev_dbg(dev, "enter %s\n", __func__); WARNING: Unnecessary ftrace-like logging - prefer using ftrace + dev_dbg(dev, "leave %s\n", __func__); Fixes: 7fc7af649ca7 ("media: staging/intel-ipu3: Add imgu top level pci device driver") Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2023-10-11staging: media: atomisp: improve unwindingHans Verkuil1-6/+12
This fixes two smatch warnings: drivers/staging/media/atomisp/pci/atomisp_cmd.c:2779 atomisp_cp_dvs_6axis_config() warn: missing unwind goto? drivers/staging/media/atomisp/pci/atomisp_cmd.c:2878 atomisp_cp_morph_table() warn: missing unwind goto? Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> CC: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2023-10-11staging: media: atomisp: drop check for reentrant .s_stream()Hans Verkuil1-6/+0
The subdev .s_stream() operation shall not be called to start streaming on an already started subdev, or stop streaming on a stopped subdev. Remove the check that guards against that condition. Also fixes a smatch warning: drivers/staging/media/atomisp/i2c/atomisp-gc0310.c:446 gc0310_s_stream() warn: missing error code 'ret' Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> CC: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2023-10-07media: cedrus: Fix clock/reset sequenceJernej Skrabec1-12/+12
According to H6 user manual, resets should always be de-asserted before clocks are enabled. This is also consistent with vendor driver. Fixes: d5aecd289bab ("media: cedrus: Implement runtime PM") Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com> Acked-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2023-10-02staging: media: tegra-video: fix infinite recursion regressionLuca Ceresoli1-6/+10
Since commit 9bf19fbf0c8b ("media: v4l: async: Rework internal lists"), aka v6.6-rc1~97^2~198, probing the tegra-video VI driver causes infinite recursion due tegra_vi_graph_parse_one() calling itself until: [ 1.571168] Insufficient stack space to handle exception! ... [ 1.591416] Internal error: kernel stack overflow: 0 [#1] PREEMPT SMP ARM ... [ 3.861013] of_phandle_iterator_init from __of_parse_phandle_with_args+0x40/0xf0 [ 3.868497] __of_parse_phandle_with_args from of_fwnode_graph_get_remote_endpoint+0x68/0xa8 [ 3.876938] of_fwnode_graph_get_remote_endpoint from fwnode_graph_get_remote_port_parent+0x30/0x7c [ 3.885984] fwnode_graph_get_remote_port_parent from tegra_vi_graph_parse_one+0x7c/0x224 [ 3.894158] tegra_vi_graph_parse_one from tegra_vi_graph_parse_one+0x144/0x224 [ 3.901459] tegra_vi_graph_parse_one from tegra_vi_graph_parse_one+0x144/0x224 [ 3.908760] tegra_vi_graph_parse_one from tegra_vi_graph_parse_one+0x144/0x224 [ 3.916061] tegra_vi_graph_parse_one from tegra_vi_graph_parse_one+0x144/0x224 ... [ 4.857892] tegra_vi_graph_parse_one from tegra_vi_graph_parse_one+0x144/0x224 [ 4.865193] tegra_vi_graph_parse_one from tegra_vi_graph_parse_one+0x144/0x224 [ 4.872494] tegra_vi_graph_parse_one from tegra_vi_init+0x574/0x6d4 [ 4.878842] tegra_vi_init from host1x_device_init+0x84/0x15c [ 4.884594] host1x_device_init from host1x_video_probe+0xa0/0x114 [ 4.890770] host1x_video_probe from really_probe+0xe0/0x400 The reason is the mentioned commit changed tegra_vi_graph_find_entity() to search for an entity in the done notifier list: > @@ -1464,7 +1464,7 @@ tegra_vi_graph_find_entity(struct tegra_vi_channel *chan, > struct tegra_vi_graph_entity *entity; > struct v4l2_async_connection *asd; > > - list_for_each_entry(asd, &chan->notifier.asc_list, asc_entry) { > + list_for_each_entry(asd, &chan->notifier.done_list, asc_entry) { > entity = to_tegra_vi_graph_entity(asd); > if (entity->asd.match.fwnode == fwnode) > return entity; This is not always correct, being tegra_vi_graph_find_entity() called in three locations, in this order: 1. tegra_vi_graph_parse_one() -- called while probing 2. tegra_vi_graph_notify_bound() -- the .bound notifier op 3. tegra_vi_graph_build() -- called in the .complete notifier op Locations 1 and 2 are called before moving the entity from waiting_list to done_list, thus they won't find what they are looking for in done_list. Location 3 happens afterwards and thus it is not broken, however it means tegra_vi_graph_find_entity() should not search in the same list every time. The error appears at step 1: tegra_vi_graph_parse_one() iterates recursively until it finds the entity already notified, which now never happens. Fix by passing the specific notifier list pointer to tegra_vi_graph_find_entity() instead of the channel, so each caller can search in whatever list is correct. Also improve the tegra_vi_graph_find_entity() comment. Fixes: 9bf19fbf0c8b ("media: v4l: async: Rework internal lists") Cc: Thierry Reding <thierry.reding@gmail.com> Cc: Jonathan Hunter <jonathanh@nvidia.com> Cc: Sowjanya Komatineni <skomatineni@nvidia.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> [Sakari Ailus: Wrapped some long lines.] Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2023-10-02media: ipu-bridge: Fix Kconfig dependenciesSakari Ailus1-1/+1
The current Kconfig symbol dependencies allow having the following Kconfig symbol values CONFIG_IPU_BRIDGE=m CONFIG_VIDEO_IPU3_CIO2=y CONFIG_CIO2_BRIDGE=n This does not work as the IPU bridge API is conditional to IS_ENABLED(CONFIG_IPU_BRIDGE). Fix this by changing the dependencies so that CONFIG_IPU_BRIDGE can be separately selected. The CONFIG_CIO2_BRIDGE symbol becomes redundant as a result and is removed. Fixes: 2545a2c02ba1 ("media: ipu3-cio2: allow ipu_bridge to be a module again") Suggested-by: Arnd Bergmann <arnd@kernel.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2023-09-27media: atmel: drop bus_infoHans Verkuil1-4/+0
Let the V4L2 core fill this in. Fixes this warning: drivers/staging/media/deprecated/atmel/atmel-isc-base.c: In function 'isc_querycap': drivers/staging/media/deprecated/atmel/atmel-isc-base.c:496:28: warning: '%s' directive output may be truncated writing up to 35 bytes into a region of size 23 [-Wformat-truncation=] 496 | "platform:%s", isc->v4l2_dev.name); | ^~ drivers/staging/media/deprecated/atmel/atmel-isc-base.c:495:9: note: 'snprintf' output between 10 and 45 bytes into a destination of size 32 495 | snprintf(cap->bus_info, sizeof(cap->bus_info), | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 496 | "platform:%s", isc->v4l2_dev.name); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
2023-09-27media: use sizeof() instead of V4L2_SUBDEV_NAME_SIZEHans Verkuil2-3/+3
Don't rely on a define, let the compiler use the actual field size. Remove all uses of the V4L2_SUBDEV_NAME_SIZE define and also drop the define itself. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Maxime Ripard <mripard@kernel.org> Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Tested-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
2023-09-27media: v4l2-subdev.h: increase struct v4l2_subdev name sizeHans Verkuil1-1/+1
This resolves a lot of the string truncate compiler warnings. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2023-09-27media: atomisp: ia_ccs_debug.c: increase enable_info bufferHans Verkuil1-1/+1
Fixes these compiler warnings: drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c: In function 'ia_css_debug_pipe_graph_dump_stage': drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c:2786:66: warning: '\n' directive output may be truncated writing 2 bytes into a region of size between 0 and 198 [-Wformat-truncation=] 2786 | "%s\\n%s\\n%s", | ^~~ drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c:2785:49: note: 'snprintf' output between 5 and 302 bytes into a destination of size 200 2785 | snprintf(enable_info, sizeof(enable_info), | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2786 | "%s\\n%s\\n%s", | ~~~~~~~~~~~~~~~ 2787 | enable_info1, enable_info2, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2788 | enable_info3); | ~~~~~~~~~~~~~ drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c:2772:66: warning: '\n' directive output may be truncated writing 2 bytes into a region of size between 0 and 198 [-Wformat-truncation=] 2772 | "%s\\n%s\\n%s", | ^~~ drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c:2771:49: note: 'snprintf' output between 5 and 302 bytes into a destination of size 200 2771 | snprintf(enable_info, sizeof(enable_info), | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2772 | "%s\\n%s\\n%s", | ~~~~~~~~~~~~~~~ 2773 | enable_info1, enable_info2, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2774 | enable_info3); | ~~~~~~~~~~~~~ drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c:2749:92: warning: 'snprintf' output may be truncated before the last format character [-Wformat-truncation=] 2749 | snprintf(enable_info, sizeof(enable_info), "%s\\n%s", | ^ drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c:2749:41: note: 'snprintf' output between 3 and 201 bytes into a destination of size 200 2749 | snprintf(enable_info, sizeof(enable_info), "%s\\n%s", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2750 | enable_info1, enable_info2); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Arnd Bergmann <arnd@arndb.de>
2023-09-27media: atomisp: fix 'read beyond size of field'Hans Verkuil1-2/+2
If CONFIG_FORTIFY_SOURCE=y, then this warning is produced: In file included from ./include/linux/string.h:254, from ./include/linux/bitmap.h:11, from ./include/linux/cpumask.h:12, from ./arch/x86/include/asm/cpumask.h:5, from ./arch/x86/include/asm/msr.h:11, from ./arch/x86/include/asm/processor.h:23, from ./arch/x86/include/asm/cpufeature.h:5, from ./arch/x86/include/asm/thread_info.h:53, from ./include/linux/thread_info.h:60, from ./arch/x86/include/asm/preempt.h:9, from ./include/linux/preempt.h:79, from ./include/linux/spinlock.h:56, from ./include/linux/mmzone.h:8, from ./include/linux/gfp.h:7, from ./include/linux/slab.h:16, from ./drivers/staging/media/atomisp//include/hmm/hmm.h:26, from drivers/staging/media/atomisp/pci/sh_css_params.c:26: In function ‘fortify_memcpy_chk’, inlined from ‘sh_css_store_sp_group_to_ddr’ at drivers/staging/media/atomisp/pci/sh_css_params.c:3736:3: ./include/linux/fortify-string.h:592:25: warning: call to ‘__read_overflow2_field’ declared with attribute warning: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Wattribute-warning] 592 | __read_overflow2_field(q_size_field, size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The reason is that the memcpy copies two fields (each a u8), when the source pointer points to the first field. It's a bit unexpected, so just make this explicit. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2023-09-27media: atomisp: Drop atomisp-ov5693 sensor driverHans de Goede6-3172/+0
After recent improvements to atomisp driver, the atomisp driver now works fine with the standard ov5693 driver. Drop the no longer necessary atomisp specific atomisp-ov5693 sensor driver. Link: https://lore.kernel.org/r/20230813152645.45834-2-hdegoede@redhat.com Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27media: atomisp: Disable VCM for OV5693 for nowHans de Goede1-1/+6
ov5693 sensor modules have a VCM, but for unknown reasons the sensor fails to start streaming when instantiating a VCM i2c-client (and the runtime-pm link between VCM and sensor). Disable the VCM for now, until this is resolved. Link: https://lore.kernel.org/r/20230813152645.45834-1-hdegoede@redhat.com Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27media: atomisp: gc0310: Stop setting v4l2_subdev.fwnode to the endpoint fwnodeHans de Goede1-11/+9
Endpoint matching is now handled by the v4l2-core and drivers no longer should set v4l2_subdev.fwnode to the endpoint fwnode. Link: https://lore.kernel.org/r/20230812133628.355812-1-hdegoede@redhat.com Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27media: atomisp: Drop VIDEO_ATOMISP_ISP2401 Kconfig optionHans de Goede3-19/+0
Drop the VIDEO_ATOMISP_ISP2401 Kconfig option and the -DISP2401 cflags. This is no longer necessary since all ISP2400 vs ISP2401 differences are now dealt with at runtime. Many thanks to Kate Hsuan for all her work on this. Link: https://lore.kernel.org/r/20230812133523.355581-2-hdegoede@redhat.com Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27media: atomisp: Drop ia_css_debug_dump_debug_info() and functions only used ↵Hans de Goede17-2276/+0
by it ia_css_debug_dump_debug_info() is defined but never called anywhere, drop it. Also drop all the other ia_css_debug_dump_* functions only called by ia_css_debug_dump_debug_info(), as well as *_get_state() functions only used by those. Link: https://lore.kernel.org/r/20230812133523.355581-1-hdegoede@redhat.com Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27media: atomisp: Simplify some if (IS_ISP2401...) statementsHans de Goede1-2/+2
Replace: if (!IS_ISP2401 || (IS_ISP2401 && xxx)) with: if (!IS_ISP2401 || xxx) If the right side of the '||' needs to be evaluated then it is already known that IS_ISP2401 is true, so no need to check for it. Link: https://lore.kernel.org/r/20230812104612.38806-1-hdegoede@redhat.com Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27media: atomisp: atomisp_v4l2: Removed unnecessary codeKate Hsuan1-19/+0
Here is the last step of #ifdef ISP2401 removal work. Since the driver became generic, this part of the code was no longer needed and can be removed. Link: https://lore.kernel.org/r/20230802095606.1298152-13-hpa@redhat.com Signed-off-by: Kate Hsuan <hpa@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27media: atomisp: sh_css: Removed #ifdef ISP2401 to make the driver genericKate Hsuan1-25/+17
Removed #ifdef ISP2401 to make the driver generic. Link: https://lore.kernel.org/r/20230802095606.1298152-12-hpa@redhat.com Signed-off-by: Kate Hsuan <hpa@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27media: atomisp: sh_css: Removed #ifdef ISP2401 to make code genericKate Hsuan1-36/+38
Removed #ifdef ISP2401 to allow the destroy function can destroy the data of both types of ISP. Link: https://lore.kernel.org/r/20230802095606.1298152-11-hpa@redhat.com Signed-off-by: Kate Hsuan <hpa@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27media: atomisp: sh_css: Renamed sh_css_config_input_network()Kate Hsuan1-31/+21
sh_css_config_input_network() is renamed to sh_css_config_input_network_2400() and sh_css_config_input_network_2401() since a generic driver should cover the implementation for both types. Link: https://lore.kernel.org/r/20230802095606.1298152-10-hpa@redhat.com Signed-off-by: Kate Hsuan <hpa@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27media: atomisp: sh_css: Removed #ifdef ISP2401 to make driver genericKate Hsuan1-32/+22
Removed #ifdef ISP2401 to expose ia_css_stream_configure_rx() for ISP2400. Link: https://lore.kernel.org/r/20230802095606.1298152-9-hpa@redhat.com Signed-off-by: Kate Hsuan <hpa@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27media: atomisp: sh_css_sp: Remove #ifdef ISP2401 to make driver genericKate Hsuan2-41/+21
Removed #ifdef ISP2401 to make the driver generic. The uncessary codes were removed and the types of the ISP is determines in runtime. Link: https://lore.kernel.org/r/20230802095606.1298152-8-hpa@redhat.com Signed-off-by: Kate Hsuan <hpa@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27media: atomisp: sh_css: Removed #ifdef ISP2401 to make the driver genericKate Hsuan1-7/+5
Removed #ifdef ISP2401 to expose the necessary functions for ISP2401 and also make the driver generic. Link: https://lore.kernel.org/r/20230802095606.1298152-7-hpa@redhat.com Signed-off-by: Kate Hsuan <hpa@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27media: atomisp: sh_css_mipi: Removed unused code ↵Kate Hsuan2-45/+0
ia_css_mipi_frame_enable_check_on_size() ia_css_mipi_frame_enable_check_on_size() wasn't used by any functions. So, it can be removed. Link: https://lore.kernel.org/r/20230802095606.1298152-6-hpa@redhat.com Signed-off-by: Kate Hsuan <hpa@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27media: atomisp: atomisp_compat_css20: Removed #ifdef ISP2401 to make driver ↵Kate Hsuan1-8/+6
generic Removed #ifdef ISP2401 to make code to be generic. The driver flow is determined in runtime. Link: https://lore.kernel.org/r/20230802095606.1298152-5-hpa@redhat.com Signed-off-by: Kate Hsuan <hpa@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27media: atomisp: hive_isp_css_include: Removed #ifdef ISP2401 to make driver ↵Kate Hsuan2-4/+0
generic Removed #ifdef ISP2401 to make the driver generic. Link: https://lore.kernel.org/r/20230802095606.1298152-4-hpa@redhat.com Signed-off-by: Kate Hsuan <hpa@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27media: atomisp: binary: Removed #ifdef ISP2401 to make driver genericKate Hsuan1-7/+8
Removed #ifdef ISP2401 to make the driver generic. The driver flow is determined in runtime. Link: https://lore.kernel.org/r/20230802095606.1298152-3-hpa@redhat.com Signed-off-by: Kate Hsuan <hpa@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27media: atomisp: ia_css_raw.host: Remove #ifdef ISP2401 to make the driver ↵Kate Hsuan1-14/+7
generic Remove #ifdef from the code and made the code generic. The raw image configuration was determined during runtime. Link: https://lore.kernel.org/r/20230802095606.1298152-2-hpa@redhat.com Signed-off-by: Kate Hsuan <hpa@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27media: atomisp: Mark ia_css_isys_240?_init() staticHans de Goede1-2/+2
ia_css_isys_240?_init() are only used inside the C file where they are declared, mark them as static fixing: drivers/staging/media/atomisp/pci/runtime/isys/src/isys_init.c:24:20: warning: no previous prototype for 'ia_css_isys_2400_init' 24 | input_system_err_t ia_css_isys_2400_init(void) | ^~~~~~~~~~~~~~~~~~~~~ drivers/staging/media/atomisp/pci/runtime/isys/src/isys_init.c:87:20: warning: no previous prototype for 'ia_css_isys_2401_init' 87 | input_system_err_t ia_css_isys_2401_init(void) | ^~~~~~~~~~~~~~~~~~~~~ Closes: https://lore.kernel.org/oe-kbuild-all/202307152046.rvhFGrbz-lkp@intel.com/ Link: https://lore.kernel.org/r/20230715170906.3627-3-hdegoede@redhat.com Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Kate Hsuan <hpa@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27media: atomisp: Remove aliases for MIPI_FORMAT_2400_CUSTOM0Hans de Goede2-3/+1
isp2400_input_system_local.h defines 2 aliases for MIPI_FORMAT_2400_CUSTOM0 MIPI_FORMAT_JPEG, which is entirely unused and MIPI_FORMAT_BINARY_8 which is used once in ia_css_isys_2400_set_fmt_type(). Drop these aliases and directly use MIPI_FORMAT_2400_CUSTOM0 in ia_css_isys_2400_set_fmt_type(). Link: https://lore.kernel.org/r/20230715170906.3627-2-hdegoede@redhat.com Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Kate Hsuan <hpa@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27media: atomisp: Remove empty isys_public.hHans de Goede2-20/+0
isys_public.h is empty, remove it. Link: https://lore.kernel.org/r/20230715170906.3627-1-hdegoede@redhat.com Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Kate Hsuan <hpa@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27media: atomisp: isys_init: Initiate atomisp in a generic mannerKate Hsuan1-16/+15
The original implementation distinguishes and initiates atomisp during compiler time. This commit allows isys_init to initiate isys for both types of atomisp in a generic manner. Link: https://lore.kernel.org/r/20230713100231.308923-12-hpa@redhat.com Signed-off-by: Kate Hsuan <hpa@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27media: atomisp: rx: Removed #if defined(ISP2401) to make driver genericKate Hsuan1-15/+4
The conflicts of variable declarations were resolved through previous commits so the #if defined(ISP2401) can be removed. Link: https://lore.kernel.org/r/20230713100231.308923-11-hpa@redhat.com Signed-off-by: Kate Hsuan <hpa@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27media: atomisp: Compile the object codes for a generic driverKate Hsuan7-28/+3
Since a generic driver should support every type of atomisp, all the codes need to be compiled. The ISP2401 flag controls the Makefile to build the binary file for ISP2400 and ISP2401. Therefore, this section of Makefile should be removed allowing all the necessary codes can be built. Moreover, some parts of "removing #ifdef ISP2401" works are related to it so they were also removed here. Link: https://lore.kernel.org/r/20230713100231.308923-10-hpa@redhat.com Signed-off-by: Kate Hsuan <hpa@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27media: atomisp: ifmtr: Removed #if defined(ISP2401) to make driver genericKate Hsuan4-8/+0
Removed #if defined(ISP2401) to make driver generic. Link: https://lore.kernel.org/r/20230713100231.308923-9-hpa@redhat.com Signed-off-by: Kate Hsuan <hpa@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27media: atomisp: pipeline: Removed #if defined(ISP2401) to make driver genericKate Hsuan2-4/+0
Removed #if defined(ISP2401) to make driver generic. Link: https://lore.kernel.org/r/20230713100231.308923-8-hpa@redhat.com Signed-off-by: Kate Hsuan <hpa@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27media: atomisp: hive_isp_css_common: Removed #if defined(ISP2401) to make ↵Kate Hsuan1-2/+0
driver generic Removed #if defined(ISP2401) to make code generic. Link: https://lore.kernel.org/r/20230713100231.308923-7-hpa@redhat.com Signed-off-by: Kate Hsuan <hpa@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27media: atomisp: isys: Removed #if defined(ISP2401) to make driver genericKate Hsuan3-6/+0
Removed #if defined(ISP2401) to make code generic. Link: https://lore.kernel.org/r/20230713100231.308923-6-hpa@redhat.com Signed-off-by: Kate Hsuan <hpa@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27media: atomisp: css_2401_system: Remove #ifdef ISP2401 to make the driver ↵Kate Hsuan3-7/+0
generic Removed #if defined(2401) to make the driver generic. Link: https://lore.kernel.org/r/20230713100231.308923-5-hpa@redhat.com Signed-off-by: Kate Hsuan <hpa@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27media: atomisp: Included both input system headersKate Hsuan8-26/+15
Included necessary input system header files (local, private, public scopes) for both types of atomisp. There is also a conflict of declaration issue so the unused input_system_state_s is removed. Link: https://lore.kernel.org/r/20230713100231.308923-4-hpa@redhat.com Signed-off-by: Kate Hsuan <hpa@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27media: atomisp: Make two individual enum to define the MIPI formatKate Hsuan6-165/+224
The original mipi_format_t represents the MIPI format settings for both atomisp with the same name and the enum member was controlled by #if defined(ISP2401). However, if we want to make this driver generic, this enum should be individually defined for them. Since the format type is redefined, the format setting function ia_css_isys_set_fmt_type() should be reworked for ISP2400 and ISP2401 called ia_css_isys_2400_set_fmt_type() and ia_css_isys_2401_set_fmt_type() . Additionally, the function called is_mipi_format_yuv420() isn't used by any functions so it can be removed. Link: https://lore.kernel.org/r/20230713100231.308923-3-hpa@redhat.com Signed-off-by: Kate Hsuan <hpa@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27media: atomisp: ia_css_debug: Removed debug codes for dumping statusKate Hsuan9-481/+1
This portion of debug code was based on a structure for both ISP2400 and 2401 with the same name and controlled by #if defined(ISP2401). This structure was only used to dump the status of atomisp. So, to make the driver generic, this part of debug codes can be removed. Link: https://lore.kernel.org/r/20230713100231.308923-2-hpa@redhat.com Signed-off-by: Kate Hsuan <hpa@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27media: atomisp: Remove v4l2_ctrl_s_ctrl(asd->run_mode) calls from atomisp_open()Hans de Goede1-3/+0
The v4l2_ctrl_s_ctrl(asd->run_mode) call in atomisp_subdev_init_struct() gets immediately overridden by a second call directly after atomisp_subdev_init_struct() is called. And the second call in atomisp_open() also is not helpful. ATOMISP_RUN_MODE_PREVIEW is the default and if changed controls are supposed to stay changed over an open/close of the /dev/video# node. So drop both calls. Link: https://lore.kernel.org/r/20230619105212.303653-7-hdegoede@redhat.com Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27media: atomisp: Remove support for custom run-mode v4l2-ctrl on sensorsHans de Goede6-107/+0
Remove the support to update a V4L2_CID_RUN_MODE run-mode control on sensors when changing the atomisp run-mode or directly by calling the custom ATOMISP_IOC_S_SENSOR_RUNMODE IOCTL. No sensor drivers implement this and having custom controls / IOCTLs is undesirable. Even if there was such a control on sensors then userspace should directly talk to the sensor v4l2-subdev, rather than relying on a custom IOCTLs on the output /dev/video# node to pass this through to the senor. Link: https://lore.kernel.org/r/20230619105212.303653-6-hdegoede@redhat.com Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27media: atomisp: Add some higher resolutions to atomisp_enum_framesizes()Hans de Goede1-0/+3
Add some higher resolutions to the fixed list of resolutions which atomisp_enum_framesizes() uses on sensors which can do cropping and can thus make any resolution that will fit. This is useful for higher resolution sensors like the 2560x1920 ov5693 sensor. Note the highest resolutions added here are 1920x<height> because the atomisp firmware does not support widths > 1920 with the default asd->run_mode->val == ATOMISP_RUN_MODE_PREVIEW setting. Link: https://lore.kernel.org/r/20230619105212.303653-5-hdegoede@redhat.com Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27media: atomisp: Change atomisp_enum_framesizes() too small cut off from ↵Hans de Goede1-3/+3
2/3th to 5/8th Change atomisp_enum_framesizes() cut off for too small resolutions from 2/3th to 5/8th this results in more resolutions being available with some sensors. E.g. this allows using 800x600 with a 1280x960 sensor. Link: https://lore.kernel.org/r/20230619105212.303653-4-hdegoede@redhat.com Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27media: atomisp: Clamp width to max 1920 pixels when in ATOMISP_RUN_MODE_PREVIEWHans de Goede1-0/+4
The pipeline firmware-binaries used in previed mode have ia_css_binary_xinfo.output.max_width set to 1920. This causes ia_css_binary_find() to fail when trying to set a higher resolution resulting in the dump_stack() call in ia_css_binary_find() triggering and resulting in the try_fmt() or set_fmt() IOCTL failing. Fix this by clamping the width to max 1920 when in preview mode. Link: https://lore.kernel.org/r/20230619105212.303653-3-hdegoede@redhat.com Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-09-27media: atomisp: Fix missing v4l2_fh_release() in atomisp_open() error exitHans de Goede1-2/+2
Fix missing v4l2_fh_release() in atomisp_open()'s "if (pipe->users)" error exit path. Closes: https://lore.kernel.org/r/202306180511.XWN0Hr7F-lkp@intel.com/ Link: https://lore.kernel.org/r/20230619105212.303653-1-hdegoede@redhat.com Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>