summaryrefslogtreecommitdiff
path: root/drivers/staging
AgeCommit message (Collapse)AuthorFilesLines
2024-05-19Merge tag 'mm-stable-2024-05-17-19-19' of ↵Linus Torvalds1-1/+1
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Pull mm updates from Andrew Morton: "The usual shower of singleton fixes and minor series all over MM, documented (hopefully adequately) in the respective changelogs. Notable series include: - Lucas Stach has provided some page-mapping cleanup/consolidation/ maintainability work in the series "mm/treewide: Remove pXd_huge() API". - In the series "Allow migrate on protnone reference with MPOL_PREFERRED_MANY policy", Donet Tom has optimized mempolicy's MPOL_PREFERRED_MANY mode, yielding almost doubled performance in one test. - In their series "Memory allocation profiling" Kent Overstreet and Suren Baghdasaryan have contributed a means of determining (via /proc/allocinfo) whereabouts in the kernel memory is being allocated: number of calls and amount of memory. - Matthew Wilcox has provided the series "Various significant MM patches" which does a number of rather unrelated things, but in largely similar code sites. - In his series "mm: page_alloc: freelist migratetype hygiene" Johannes Weiner has fixed the page allocator's handling of migratetype requests, with resulting improvements in compaction efficiency. - In the series "make the hugetlb migration strategy consistent" Baolin Wang has fixed a hugetlb migration issue, which should improve hugetlb allocation reliability. - Liu Shixin has hit an I/O meltdown caused by readahead in a memory-tight memcg. Addressed in the series "Fix I/O high when memory almost met memcg limit". - In the series "mm/filemap: optimize folio adding and splitting" Kairui Song has optimized pagecache insertion, yielding ~10% performance improvement in one test. - Baoquan He has cleaned up and consolidated the early zone initialization code in the series "mm/mm_init.c: refactor free_area_init_core()". - Baoquan has also redone some MM initializatio code in the series "mm/init: minor clean up and improvement". - MM helper cleanups from Christoph Hellwig in his series "remove follow_pfn". - More cleanups from Matthew Wilcox in the series "Various page->flags cleanups". - Vlastimil Babka has contributed maintainability improvements in the series "memcg_kmem hooks refactoring". - More folio conversions and cleanups in Matthew Wilcox's series: "Convert huge_zero_page to huge_zero_folio" "khugepaged folio conversions" "Remove page_idle and page_young wrappers" "Use folio APIs in procfs" "Clean up __folio_put()" "Some cleanups for memory-failure" "Remove page_mapping()" "More folio compat code removal" - David Hildenbrand chipped in with "fs/proc/task_mmu: convert hugetlb functions to work on folis". - Code consolidation and cleanup work related to GUP's handling of hugetlbs in Peter Xu's series "mm/gup: Unify hugetlb, part 2". - Rick Edgecombe has developed some fixes to stack guard gaps in the series "Cover a guard gap corner case". - Jinjiang Tu has fixed KSM's behaviour after a fork+exec in the series "mm/ksm: fix ksm exec support for prctl". - Baolin Wang has implemented NUMA balancing for multi-size THPs. This is a simple first-cut implementation for now. The series is "support multi-size THP numa balancing". - Cleanups to vma handling helper functions from Matthew Wilcox in the series "Unify vma_address and vma_pgoff_address". - Some selftests maintenance work from Dev Jain in the series "selftests/mm: mremap_test: Optimizations and style fixes". - Improvements to the swapping of multi-size THPs from Ryan Roberts in the series "Swap-out mTHP without splitting". - Kefeng Wang has significantly optimized the handling of arm64's permission page faults in the series "arch/mm/fault: accelerate pagefault when badaccess" "mm: remove arch's private VM_FAULT_BADMAP/BADACCESS" - GUP cleanups from David Hildenbrand in "mm/gup: consistently call it GUP-fast". - hugetlb fault code cleanups from Vishal Moola in "Hugetlb fault path to use struct vm_fault". - selftests build fixes from John Hubbard in the series "Fix selftests/mm build without requiring "make headers"". - Memory tiering fixes/improvements from Ho-Ren (Jack) Chuang in the series "Improved Memory Tier Creation for CPUless NUMA Nodes". Fixes the initialization code so that migration between different memory types works as intended. - David Hildenbrand has improved follow_pte() and fixed an errant driver in the series "mm: follow_pte() improvements and acrn follow_pte() fixes". - David also did some cleanup work on large folio mapcounts in his series "mm: mapcount for large folios + page_mapcount() cleanups". - Folio conversions in KSM in Alex Shi's series "transfer page to folio in KSM". - Barry Song has added some sysfs stats for monitoring multi-size THP's in the series "mm: add per-order mTHP alloc and swpout counters". - Some zswap cleanups from Yosry Ahmed in the series "zswap same-filled and limit checking cleanups". - Matthew Wilcox has been looking at buffer_head code and found the documentation to be lacking. The series is "Improve buffer head documentation". - Multi-size THPs get more work, this time from Lance Yang. His series "mm/madvise: enhance lazyfreeing with mTHP in madvise_free" optimizes the freeing of these things. - Kemeng Shi has added more userspace-visible writeback instrumentation in the series "Improve visibility of writeback". - Kemeng Shi then sent some maintenance work on top in the series "Fix and cleanups to page-writeback". - Matthew Wilcox reduces mmap_lock traffic in the anon vma code in the series "Improve anon_vma scalability for anon VMAs". Intel's test bot reported an improbable 3x improvement in one test. - SeongJae Park adds some DAMON feature work in the series "mm/damon: add a DAMOS filter type for page granularity access recheck" "selftests/damon: add DAMOS quota goal test" - Also some maintenance work in the series "mm/damon/paddr: simplify page level access re-check for pageout" "mm/damon: misc fixes and improvements" - David Hildenbrand has disabled some known-to-fail selftests ni the series "selftests: mm: cow: flag vmsplice() hugetlb tests as XFAIL". - memcg metadata storage optimizations from Shakeel Butt in "memcg: reduce memory consumption by memcg stats". - DAX fixes and maintenance work from Vishal Verma in the series "dax/bus.c: Fixups for dax-bus locking"" * tag 'mm-stable-2024-05-17-19-19' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (426 commits) memcg, oom: cleanup unused memcg_oom_gfp_mask and memcg_oom_order selftests/mm: hugetlb_madv_vs_map: avoid test skipping by querying hugepage size at runtime mm/hugetlb: add missing VM_FAULT_SET_HINDEX in hugetlb_wp mm/hugetlb: add missing VM_FAULT_SET_HINDEX in hugetlb_fault selftests: cgroup: add tests to verify the zswap writeback path mm: memcg: make alloc_mem_cgroup_per_node_info() return bool mm/damon/core: fix return value from damos_wmark_metric_value mm: do not update memcg stats for NR_{FILE/SHMEM}_PMDMAPPED selftests: cgroup: remove redundant enabling of memory controller Docs/mm/damon/maintainer-profile: allow posting patches based on damon/next tree Docs/mm/damon/maintainer-profile: change the maintainer's timezone from PST to PT Docs/mm/damon/design: use a list for supported filters Docs/admin-guide/mm/damon/usage: fix wrong schemes effective quota update command Docs/admin-guide/mm/damon/usage: fix wrong example of DAMOS filter matching sysfs file selftests/damon: classify tests for functionalities and regressions selftests/damon/_damon_sysfs: use 'is' instead of '==' for 'None' selftests/damon/_damon_sysfs: find sysfs mount point from /proc/mounts selftests/damon/_damon_sysfs: check errors from nr_schemes file reads mm/damon/core: initialize ->esz_bp from damos_quota_init_priv() selftests/damon: add a test for DAMOS quota goal ...
2024-05-18Merge tag 'kbuild-v6.10' of ↵Linus Torvalds1-1/+1
git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull Kbuild updates from Masahiro Yamada: - Avoid 'constexpr', which is a keyword in C23 - Allow 'dtbs_check' and 'dt_compatible_check' run independently of 'dt_binding_check' - Fix weak references to avoid GOT entries in position-independent code generation - Convert the last use of 'optional' property in arch/sh/Kconfig - Remove support for the 'optional' property in Kconfig - Remove support for Clang's ThinLTO caching, which does not work with the .incbin directive - Change the semantics of $(src) so it always points to the source directory, which fixes Makefile inconsistencies between upstream and downstream - Fix 'make tar-pkg' for RISC-V to produce a consistent package - Provide reasonable default coverage for objtool, sanitizers, and profilers - Remove redundant OBJECT_FILES_NON_STANDARD, KASAN_SANITIZE, etc. - Remove the last use of tristate choice in drivers/rapidio/Kconfig - Various cleanups and fixes in Kconfig * tag 'kbuild-v6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (46 commits) kconfig: use sym_get_choice_menu() in sym_check_prop() rapidio: remove choice for enumeration kconfig: lxdialog: remove initialization with A_NORMAL kconfig: m/nconf: merge two item_add_str() calls kconfig: m/nconf: remove dead code to display value of bool choice kconfig: m/nconf: remove dead code to display children of choice members kconfig: gconf: show checkbox for choice correctly kbuild: use GCOV_PROFILE and KCSAN_SANITIZE in scripts/Makefile.modfinal Makefile: remove redundant tool coverage variables kbuild: provide reasonable defaults for tool coverage modules: Drop the .export_symbol section from the final modules kconfig: use menu_list_for_each_sym() in sym_check_choice_deps() kconfig: use sym_get_choice_menu() in conf_write_defconfig() kconfig: add sym_get_choice_menu() helper kconfig: turn defaults and additional prompt for choice members into error kconfig: turn missing prompt for choice members into error kconfig: turn conf_choice() into void function kconfig: use linked list in sym_set_changed() kconfig: gconf: use MENU_CHANGED instead of SYMBOL_CHANGED kconfig: gconf: remove debug code ...
2024-05-16Merge tag 'media/v6.10-1' of ↵Linus Torvalds57-2988/+443
git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media Pull media updates from Mauro Carvalho Chehab: - New V4L2 ioctl VIDIOC_REMOVE_BUFS - experimental support for using generic metaformats on V4L2 core - New drivers: Intel IPU6 controller driver, Broadcom BCM283x/BCM271x - More cleanups at atomisp driver - Usual bunch of driver cleanups, improvements and fixes * tag 'media/v6.10-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (328 commits) media: bcm2835-unicam: Depend on COMMON_CLK Revert "media: v4l2-ctrls: show all owned controls in log_status" media: ov2740: Ensure proper reset sequence on probe() media: intel/ipu6: Don't print user-triggerable errors to kernel log media: bcm2835-unicam: Fix driver path in MAINTAINERS media: bcm2835-unicam: Fix a NULL vs IS_ERR() check media: bcm2835-unicam: Do not print error when irq not found media: bcm2835-unicam: Do not replace IRQ retcode during probe media: bcm2835-unicam: Convert to platform remove callback returning void media: media: intel/ipu6: Fix spelling mistake "remappinp" -> "remapping" media: intel/ipu6: explicitly include vmalloc.h media: cec.h: Fix kerneldoc media: uvcvideo: Refactor iterators media: v4l: async: refactor v4l2_async_create_ancillary_links media: intel/ipu6: Don't re-allocate memory for firmware media: dvb-frontends: tda10048: Fix integer overflow media: tc358746: Use the correct div_ function media: i2c: st-mipid02: Use the correct div function media: tegra-vde: Refactor timeout handling media: stk1160: Use min macro ...
2024-05-15Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsiLinus Torvalds1-12/+12
Pull SCSI updates from James Bottomley: "Updates to the usual drivers (ufs, lpfc, qla2xxx, mpi3mr, libsas). The major update (which causes a conflict with block, see below) is Christoph removing the queue limits and their associated block helpers. The remaining patches are assorted minor fixes and deprecated function updates plus a bit of constification" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (141 commits) scsi: mpi3mr: Sanitise num_phys scsi: lpfc: Copyright updates for 14.4.0.2 patches scsi: lpfc: Update lpfc version to 14.4.0.2 scsi: lpfc: Add support for 32 byte CDBs scsi: lpfc: Change lpfc_hba hba_flag member into a bitmask scsi: lpfc: Introduce rrq_list_lock to protect active_rrq_list scsi: lpfc: Clear deferred RSCN processing flag when driver is unloading scsi: lpfc: Update logging of protection type for T10 DIF I/O scsi: lpfc: Change default logging level for unsolicited CT MIB commands scsi: target: Remove unused list 'device_list' scsi: iscsi: Remove unused list 'connlist_err' scsi: ufs: exynos: Add support for Tensor gs101 SoC scsi: ufs: exynos: Add some pa_dbg_ register offsets into drvdata scsi: ufs: exynos: Allow max frequencies up to 267Mhz scsi: ufs: exynos: Add EXYNOS_UFS_OPT_TIMER_TICK_SELECT option scsi: ufs: exynos: Add EXYNOS_UFS_OPT_UFSPR_SECURE option scsi: ufs: dt-bindings: exynos: Add gs101 compatible scsi: qla2xxx: Fix debugfs output for fw_resource_count scsi: qedf: Ensure the copied buf is NUL terminated scsi: bfa: Ensure the copied buf is NUL terminated ...
2024-05-09kbuild: use $(src) instead of $(srctree)/$(src) for source directoryMasahiro Yamada1-1/+1
Kbuild conventionally uses $(obj)/ for generated files, and $(src)/ for checked-in source files. It is merely a convention without any functional difference. In fact, $(obj) and $(src) are exactly the same, as defined in scripts/Makefile.build: src := $(obj) When the kernel is built in a separate output directory, $(src) does not accurately reflect the source directory location. While Kbuild resolves this discrepancy by specifying VPATH=$(srctree) to search for source files, it does not cover all cases. For example, when adding a header search path for local headers, -I$(srctree)/$(src) is typically passed to the compiler. This introduces inconsistency between upstream and downstream Makefiles because $(src) is used instead of $(srctree)/$(src) for the latter. To address this inconsistency, this commit changes the semantics of $(src) so that it always points to the directory in the source tree. Going forward, the variables used in Makefiles will have the following meanings: $(obj) - directory in the object tree $(src) - directory in the source tree (changed by this commit) $(objtree) - the top of the kernel object tree $(srctree) - the top of the kernel source tree Consequently, $(srctree)/$(src) in upstream Makefiles need to be replaced with $(src). Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
2024-05-07staging: iio: impedance-analyzer: ad5933: Use ↵David Lechner1-24/+2
devm_regulator_get_enable_read_voltage() We can reduce boilerplate code by using devm_regulator_get_enable_read_voltage(). Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: David Lechner <dlechner@baylibre.com> Link: https://lore.kernel.org/r/20240429-regulator-get-enable-get-votlage-v2-6-b1f11ab766c1@baylibre.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-05-03media: staging: media: tegra-video: Use swap macroRicardo Ribalda1-7/+2
Makes the code simpler and cocci happier: drivers/staging/media/tegra-video/tegra20.c:324:44-45: WARNING opportunity for swap() Link: https://lore.kernel.org/linux-media/20240429-fix-cocci-v3-10-3c4865f5a4b0@chromium.org Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-05-03media: staging: sun6i-isp: Remove redundant printkRicardo Ribalda1-2/+1
platform_get_irq() already prints an error for us. Found by cocci: drivers/staging/media/sunxi/sun6i-isp/sun6i_isp.c:389:2-9: line 389 is redundant because platform_get_irq() already prints an error Link: https://lore.kernel.org/linux-media/20240429-fix-cocci-v3-7-3c4865f5a4b0@chromium.org Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-05-03media: staging: media: starfive: Clean pad selection in isp_try_format()Changhuang Liang1-8/+2
The code to select isp_dev->formats[] is overly complicated. We can just use the "pad" as the index. This will making adding new pads easier in future patches. No functional change. Link: https://lore.kernel.org/linux-media/20240312024520.11022-1-changhuang.liang@starfivetech.com Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com> Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-04-30media: staging: max96712: fix copy-paste errorIhor Matushchak1-1/+1
Link: https://lore.kernel.org/linux-media/20231014143843.3409-1-ihor.matushchak@foobox.net Signed-off-by: Ihor Matushchak <ihor.matushchak@foobox.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-04-30media: ipu3: Use MODULE_FIRMWARE to add firmware files metadataVíctor Gonzalo1-0/+4
The ipu3 driver requests firmware files but does not use the MODULE_FIRMWARE macro to show them in the module metadata [mchehab: add missing firmware file: IMGU_FW_NAME_IPU_20161208] Link: https://lore.kernel.org/linux-media/20230914135100.19911-1-victor.gonzalo@anddroptable.net Signed-off-by: Víctor Gonzalo <victor.gonzalo@anddroptable.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-04-29media: atomisp-mt9m114: adjust macro parameter nameJulia Lawall1-1/+1
The macro parameter name, sd, captures the field name in the third argument of container_of. Fortunately, the argument at all uses is actually sd. But change the macro parameter name anyway, for a little added safety. Link: https://lore.kernel.org/linux-media/20230315090904.20092-1-Julia.Lawall@inria.fr Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-04-26media: atomisp: Fix sh_css_config_input_network_2400() coding styleHans de Goede1-9/+7
Fix the if (stream->config.mode == IA_CSS_INPUT_MODE_PRBS) {} block coding style. Specifically fix the weird declaration of variables split over multiple lines. While at it also split the multi-line width calculation at a more logical place. Reported-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-04-26media: atomisp: Remove setting of f->fmt.pix.priv from atomisp_set_fmt()Hans de Goede1-2/+0
This value is not used by the driver, only returned to userspace and userspace should not rely on / use the priv fields. Drop setting this. Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-04-26media: atomisp: Cleanup atomisp_isr_thread() spinlock handlingHans de Goede1-7/+4
Refactor the code a tiny bit to avoid the need to have 2 different paths with spin_unlock_irqrestore() in there. While at it also remove the non helpful dev_dbg() message. Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-04-26media: atomisp: Remove empty s_stream() op from CSI subdevHans de Goede1-23/+0
Remove the empty csi2_set_stream() callback and remove the now empty csi2_video_ops struct. While at it also remove the empty csi2_core_ops struct. Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-04-26media: atomisp: Remove empty s_power() op from ISP subdevHans de Goede1-13/+1
Remove the empty isp_subdev_set_power() callback. Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-04-26media: atomisp: Remove clearing of ISP crop / compose rectangles on file releaseHans de Goede1-21/+0
There is no need to clear the ISP sink-pad crop and source-pad compose rectangles on release of the /dev/video# file. Both will be reset by atomisp_set_fmt() which is guaranteed to get called by atomisp_queue_setup() (if not called already) before another stream starts and thus before these selections are used again. Also the file injection support the comment talks about has long been dropped from the driver. Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-04-26media: atomisp: Remove struct atomisp_platform_dataHans de Goede4-40/+19
struct atomisp_platform_data only has a single subdevs member. Remove this struct and replace atomisp_get_platform_data() with atomisp_platform_get_subdevs(). Note atomisp_get_platform_data() and now atomisp_platform_get_subdevs() always succeed, so while at it also remove unnecessary error checking. Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-04-26media: atomisp: Remove gmin_platform VCM code.Hans de Goede3-71/+0
VCM support has already been removed from the main atomisp driver in commit 7473c97dd8d0 ("media: atomisp: Remove custom VCM handling") remove the left-over dead VCM handling from the gmin platform code. Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-04-26media: atomisp: Drop intel_v4l2_subdev_typeHans de Goede9-50/+22
intel_v4l2_subdev_type / atomisp_input_subdev.type now always is RAW_CAMERA, drop it. Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-04-26media: atomisp: Drop unused frame_status trackingHans de Goede4-29/+2
After removing the flash support frame_status now always is ATOMISP_FRAME_STATUS_OK aka 0. Drop frame_status tracking. This also means one less atomisp custom use for the vb2_buffer->reserved* fields (all custom use of these fields should be removed). While at it also remove the no longer used vf_frame pointer from struct atomisp_sub_device. Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-04-26media: atomisp: Drop custom flash supportHans de Goede12-313/+2
Remove the custom flash handling from the atomisp driver. There are only few Bay Trail / Cherry Trail devices with flash and if those will ever get supported then this should be done through the new standard include/linux/led-class-flash.h APIs instead of with atomisp specific custom APIs. Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-04-26media: atomisp: Drop the atomisp custom lm3554 flash driverHans de Goede4-1107/+0
Drop the atomisp custom lm3554 flash driver, support for flash drivers using the custom atomisp flash interface is going to be removed from the atomisp driver. If flash supports for the lm3554 turns out to be necessary on some atomisp devices in the future then this should be re-implemented using the new include/linux/led-class-flash.h APIs. The atomisp specific lm3554 driver could still be usable as a reference for how to use / driver the lm3554 for a future re-implementation using standardized APIs, but for that it can be retrieved from the git history. Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-04-26media: atomisp: Remove input_port_ID_tHans de Goede2-13/+1
Change the single, unexpected user of CSI_PORT0_ID for (port = CSI_PORT0_ID; port < N_CSI_PORTS; port++) to for (port = 0; port < N_CSI_PORTS; port++) { matching all the other for-loops iterating over the ports in the same file. And remove the now fully unused input_port_ID_t enum type. Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-04-26media: atomisp: Remove test pattern generator (TPG) supportHans de Goede22-585/+21
The TPG support registers a v4l2-subdev for this, but this is not part of the media-controller graph in any way. After manually selecting the TPG as input using the s_input ioctl it does not work. Several supported sensors have their own working TPG and using the sensor's TPG means that the same data-flow is used as with actual sensors rather then the quite different data-flow from the ISP's builtin TPG. Remove the broken TPG support, when a test-pattern is needed for testing a sensor's TPG can be used. Using a sensor's TPG is actually better for testing since then the actual normal data-flow is being tested. Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-04-26media: atomisp: ov2722: Remove power on sensor from set_fmt() callbackHans de Goede2-13/+0
The atomisp driver now properly ensures s_power(1) is called before calling the set_fmt() callback, so this workaround is no longer necessary. Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-04-26media: atomisp: Drop atomisp_pipe_check() from atomisp_link_setup()Hans de Goede1-7/+1
The media-controller core (__media_entity_setup_link()) already checks that the pads of the link are not streaming before calling the setup_link() pad-op so calling atomisp_pipe_check() is not necessary; and taking isp->mutex inside the setup_link() pad-op leads to a possible ABBA deadlock vs the media-device graph_mutex which in the case of the setup_link() pad-op is taken before calling the op, while in other scenarios the graph_mutex is taken after the isp->mutex. Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-04-26media: atomisp: Call media_pipeline_alloc_start() in stream startHans de Goede2-0/+16
Call media_pipeline_alloc_start() from atomisp_start_streaming() to mark all involved subdevs as busy so that the links cannot be changed through the media-controller APIs while streaming. Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-04-26media: atomisp: Propagate v4l2_mbus_framefmt.field to CSI port sink padHans de Goede1-0/+3
Most sensor drivers report V4L2_FIELD_NONE as v4l2_mbus_framefmt.field value. Propagate this to the v4l2_mbus_framefmt for the CSI port to pass the link validation done by media_pipeline_start(). Keep the v4l2_mbus_framefmt.field for the source pad of the CSI port as V4L2_FIELD_ANY to match the ISP sink pad. Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-04-26media: atomisp: Propagate set_fmt on sensor results to CSI portHans de Goede4-14/+12
So far the CSI port sink and source pads have not had their fmt set at all, leaving things at the default of SBGGR8_1X8/0x0. This means that pipeline validation such as e.g. done when calling media_pipeline_start() will fail since the links to / from the CSI ports have different fmts on each end. Store a pointer to the CSI port v4l2-subdev in struct atomisp_input_subdev, and use this in atomisp_set_sensor_crop_and_fmt() to propagate the sensors new fmt after a successful set_fmt to the CSI port it is connected too. The input->csi_port pointer also allows simplifying atomisp_link_setup(). Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-04-26media: atomisp: Ensure CSI-receiver[x] -> ISP links correctly reflect ↵Hans de Goede4-1/+46
current sensor Add a new atomisp_setup_input_links() helper which ensures that the CSI-receiver -> ISP link for input_curr is marked as enabled and the other CSI-receiver -> ISP links are disabled. And call this helper from atomisp_register_device_nodes() for the initial setup and from atomisp_select_input() for runtime input_curr changes. Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-04-26media: atomisp: Simplify atomisp_s_input() input argument checkingHans de Goede1-12/+6
Simplify the checking of the input argument to atomisp_s_input(): - Remove the check for input >= ATOM_ISP_MAX_INPUTS, input_cnt never is > ATOM_ISP_MAX_INPUTS so checking only that is sufficient - Remove the unnecessary camera local variable - Move the 2 invalid argument checks to above the atomisp_pipe_check() which checks if the pipe is busy or not Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-04-26media: atomisp: Add atomisp_select_input() helperHans de Goede4-18/+32
When switching input/sensor the s_power() callback must be called for old sensor drivers to power on the new sensor and power off the previous sensor. atomisp_s_input() already does this but atomisp_link_setup() did not do this. Add a new atomisp_select_input() helper which does this and use this in both atomisp_s_input() and atomisp_link_setup() for consistent behavior. Also make atomisp_link_setup() turn the sensor back off when a link gets disabled. Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-04-26media: atomisp: Turn on sensor power from atomisp_set_fmt()Hans de Goede1-0/+11
ATM the atomisp driver does not call s_power() at all when no s_input ioctl() is done by the application. This breaks older sensor drivers which rely on s_power() for power-management. Some drivers have worked around this, e.g. commit c5fafbadaeae ("media: atomisp: gc0310: Power on sensor from set_fmt() callback") and commit b3118a942c82 ("media: atomisp: ov2722: Power on sensor from set_fmt() callback"), but this really should be fixed in the atomisp driver itself, so that all old drivers can work. A logical place to call s_power() would be from atomisp_start_streaming() / atomisp_stop_streaming(). But some older drivers, e.g. the atomisp-ov2722 driver already write mode related registers on set_fmt() instead of waiting on stream on. So the s_power(1) needs to happen at the first set_fmt(). Add an atomisp_s_sensor_power(..., 1) call just before calling set_fmt() for this. If the power was already enabled through e.g. a s_input ioctl atomisp_s_sensor_power() will skip calling the s_power() v4l2-subdev-op a second time. Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-04-26media: atomisp: Add atomisp_s_sensor_power() helperHans de Goede5-35/+26
Since the atomisp driver only supports 1 stream / only has 1 asd now, there is no longer a need to track which stream owns the sensor. So the asd owner-pointer of struct atomisp_input_subdev can be dropped, replace this with a simple camera_on boolean and add a new atomisp_s_sensor_power() helper which takes care of avoiding unbalanced s_power() subdev calls as well as takes care of handling the special -ENOIOCTLCMD return for subdevs which don't implement s_power(). Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-04-26media: atomisp: Get rid of PCI device ID hack checkAndy Shevchenko2-22/+21
Always check exact PCI ID match and drop hack checks. Link: https://lore.kernel.org/r/20240402204447.294280-1-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-04-26media: atomisp: Replace open-coded i2c_find_device_by_fwnode()Andy Shevchenko1-6/+2
gmin_i2c_dev_exists() is using open-coded variant of i2c_find_device_by_fwnode(). Replace it with a corresponding call. Link: https://lore.kernel.org/r/20240326202813.1425431-3-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-04-26media: atomisp: Put PMIC device after getting its I²C addressAndy Shevchenko1-5/+8
We don't use the PMIC I²C client device after getting its address. Drop the reference to it. We do not expect device to disappear as it should be taken care by the OpRegion drivers. Link: https://lore.kernel.org/r/20240326202813.1425431-2-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-04-26media: atomisp: Remove unsused macrosAndy Shevchenko5-60/+4
Entire defs.h can be killed, so do that. Also kill same macro definitions in hive_types.h Link: https://lore.kernel.org/r/20240326190903.1422069-1-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-04-26media: staging: media: atomisp: Remove extra whitespace after opening ↵Jonathan Bergh1-2/+2
parentheses This patch makes the following changes: * Removes spurious whitespace after the opening parentheses as per code style guidelines Link: https://lore.kernel.org/r/20240227163043.112162-2-bergh.jonathan@gmail.com Signed-off-by: Jonathan Bergh <bergh.jonathan@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-04-26media: staging: media: atomisp: Fix various multiline block comment ↵Jonathan Bergh1-16/+18
formatting instances This patch makes the following fixes: * Reformats a number of multiline block comments to ensure * and */ align correctly Link: https://lore.kernel.org/r/20240227163043.112162-1-bergh.jonathan@gmail.com Signed-off-by: Jonathan Bergh <bergh.jonathan@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-04-26media: staging: media: atomisp: Remove old commented code and fix multiple ↵Jonathan Bergh1-39/+49
block comment style This patch fixes the following minor code and code style issues: * Removes a block of commented out (unused) code from the src * Reformats various multiline block comments to meet the kernel code style guidelines for block comments Link: https://lore.kernel.org/r/20240226194023.69070-7-bergh.jonathan@gmail.com Signed-off-by: Jonathan Bergh <bergh.jonathan@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-04-26media: staging: media: atomisp: Remove unneeded return statement from void ↵Jonathan Bergh1-2/+0
function This patch makes the following change: * Removes an unnecessary 'return' statement from a void function implementation Link: https://lore.kernel.org/r/20240226194023.69070-6-bergh.jonathan@gmail.com Signed-off-by: Jonathan Bergh <bergh.jonathan@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-04-26media: staging: media: atomisp: Remove unnecessary parentheses from ↵Jonathan Bergh1-1/+1
conditional statement This patch makes the following changes: * Removes additional, unnecessary parentheses from a conditional "if" statement Link: https://lore.kernel.org/r/20240226194023.69070-5-bergh.jonathan@gmail.com Signed-off-by: Jonathan Bergh <bergh.jonathan@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-04-26media: staging: media: atomisp: Ensure trailing statements are on a newline ↵Jonathan Bergh1-2/+4
and remove spurious whitespaces This patch fixes the following minor code style issues: * Ensure trailing statements are located on a newline * Removes an instance of a spurious whitespace following a conditional statement Link: https://lore.kernel.org/r/20240226194023.69070-4-bergh.jonathan@gmail.com Signed-off-by: Jonathan Bergh <bergh.jonathan@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-04-26media: staging: media: atomisp: Fixed "unsigned int *" rather than "unsigned ↵Jonathan Bergh1-1/+1
*" declaration in variable declaration This code fixes a code style issue where: * Checkpatch suggests using "unsigned int *" rather than a bare "unsigned *" declaration in the code Link: https://lore.kernel.org/r/20240226194023.69070-3-bergh.jonathan@gmail.com Signed-off-by: Jonathan Bergh <bergh.jonathan@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-04-26media: staging: media: atomisp: Remove unnecessary braces from single line ↵Jonathan Bergh1-8/+7
conditional statements This patch does the following things: * Tidies up code in several places where braces were used in conjunction with single line conditional statements Link: https://lore.kernel.org/r/20240226194023.69070-2-bergh.jonathan@gmail.com Signed-off-by: Jonathan Bergh <bergh.jonathan@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-04-26media: staging: media: atomisp: Fix formatting issues and minor code issueJonathan Bergh2-7/+7
This patch fixes the following code style and formatting issues: * Ensure multiline block comments are correctly formatted * Remove extra braces not required for single line conditional statements Link: https://lore.kernel.org/r/20240225155359.41435-1-bergh.jonathan@gmail.com Signed-off-by: Jonathan Bergh <bergh.jonathan@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-04-26media: staging: media: atomisp: Fix various formatting issues and remove ↵Jonathan Bergh1-7/+8
unneccesary braces This patch fixes the following formatting issues: * Fix various misaligned * and */ in multiline block comments * Remove unnecessary braces from single line conditional statements * Remove repeated word "from" from comment Link: https://lore.kernel.org/r/20240225120350.31226-1-bergh.jonathan@gmail.com Signed-off-by: Jonathan Bergh <bergh.jonathan@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>