summaryrefslogtreecommitdiff
path: root/drivers/media/platform/exynos4-is
AgeCommit message (Collapse)Author
2022-03-18media: platform: rename exynos4-is/ to samsung/exynos4-is/Mauro Carvalho Chehab
As the end goal is to have platform drivers split by vendor, rename exynos4-is/ to samsung/exynos4-is/. Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-03-14media: platform: move platform menu dependencies to driversMauro Carvalho Chehab
Right now, platform dependencies are organized by the type of the platform driver. Yet, things tend to become very messy with time. The better seems to organize the drivers per manufacturer, as other Kernel subsystems are doing. As a preparation for such purpose, get rid of menuconfigs, moving the per-menu dependencies to be at the driver-specifig config entires. This shoud give flexibility to reorganize the platform drivers per manufacturer and re-sort them. This patch removes all "if..endif" options from the platform Kconfig, converting them into depends on. Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-03-04media: media-entity: Add media_pad_is_streaming() helper functionLaurent Pinchart
Add a function to test if a pad is part of a pipeline currently streaming, and use it through drivers to replace direct access to the stream_count field. This will help reworking pipeline start/stop without disturbing drivers. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
2022-01-28media: exynos4-is: Use platform_get_irq() to get the interruptLad Prabhakar
platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2021-09-30media: exynos4-is: Make use of the helper function ↵Cai Huoqing
devm_platform_ioremap_resource() Use the devm_platform_ioremap_resource() helper instead of calling platform_get_resource() and devm_ioremap_resource() separately Signed-off-by: Cai Huoqing <caihuoqing@baidu.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-09-30media: v4l: async: Rename async nf functions, clean up long linesSakari Ailus
Rename V4L2 async notifier functions, replacing "notifier" with "nf" and removing "_subdev" at the end of the function names adding subdevs as you can only add subdevs to a notifier. Also wrap and otherwise clean up long lines. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com> (imx7) Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-08-04media: exynos4-is: use DEVICE_ATTR_RW() helper macroZhen Lei
Use DEVICE_ATTR_RW() helper macro instead of DEVICE_ATTR(), which is simpler and more readable. Due to the names of the read and write functions of the sysfs attribute is normalized, there is a natural association. Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-07-05Merge tag 'driver-core-5.14-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core changes from Greg KH: "Here is the small set of driver core and debugfs updates for 5.14-rc1. Included in here are: - debugfs api cleanups (touched some drivers) - devres updates - tiny driver core updates and tweaks Nothing major in here at all, and all have been in linux-next for a while with no reported issues" * tag 'driver-core-5.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (27 commits) docs: ABI: testing: sysfs-firmware-memmap: add some memmap types. devres: Enable trace events devres: No need to call remove_nodes() when there none present devres: Use list_for_each_safe_from() in remove_nodes() devres: Make locking straight forward in release_nodes() kernfs: move revalidate to be near lookup drivers/base: Constify static attribute_group structs firmware_loader: remove unneeded 'comma' macro devcoredump: remove contact information driver core: Drop helper devm_platform_ioremap_resource_wc() component: Rename 'dev' to 'parent' component: Drop 'dev' argument to component_match_realloc() device property: Don't check for NULL twice in the loops driver core: auxiliary bus: Fix typo in the docs drivers/base/node.c: make CACHE_ATTR define static DEVICE_ATTR_RO debugfs: remove return value of debugfs_create_ulong() debugfs: remove return value of debugfs_create_bool() scsi: snic: debugfs: remove local storage of debugfs files b43: don't save dentries for debugfs b43legacy: don't save dentries for debugfs ...
2021-06-17media: v4l2-subdev: add subdev-wide state structTomi Valkeinen
We have 'struct v4l2_subdev_pad_config' which contains configuration for a single pad used for the TRY functionality, and an array of those structs is passed to various v4l2_subdev_pad_ops. I was working on subdev internal routing between pads, and realized that there's no way to add TRY functionality for routes, which is not pad specific configuration. Adding a separate struct for try-route config wouldn't work either, as e.g. set-fmt needs to know the try-route configuration to propagate the settings. This patch adds a new struct, 'struct v4l2_subdev_state' (which at the moment only contains the v4l2_subdev_pad_config array) and the new struct is used in most of the places where v4l2_subdev_pad_config was used. All v4l2_subdev_pad_ops functions taking v4l2_subdev_pad_config are changed to instead take v4l2_subdev_state. The changes to drivers/media/v4l2-core/v4l2-subdev.c and include/media/v4l2-subdev.h were written by hand, and all the driver changes were done with the semantic patch below. The spatch needs to be applied to a select list of directories. I used the following shell commands to apply the spatch: dirs="drivers/media/i2c drivers/media/platform drivers/media/usb drivers/media/test-drivers/vimc drivers/media/pci drivers/staging/media" for dir in $dirs; do spatch -j8 --dir --include-headers --no-show-diff --in-place --sp-file v4l2-subdev-state.cocci $dir; done Note that Coccinelle chokes on a few drivers (gcc extensions?). With minor changes we can make Coccinelle run fine, and these changes can be reverted after spatch. The diff for these changes is: For drivers/media/i2c/s5k5baf.c: @@ -1481,7 +1481,7 @@ static int s5k5baf_set_selection(struct v4l2_subdev *sd, &s5k5baf_cis_rect, v4l2_subdev_get_try_crop(sd, cfg, PAD_CIS), v4l2_subdev_get_try_compose(sd, cfg, PAD_CIS), - v4l2_subdev_get_try_crop(sd, cfg, PAD_OUT) + v4l2_subdev_get_try_crop(sd, cfg, PAD_OUT), }; s5k5baf_set_rect_and_adjust(rects, rtype, &sel->r); return 0; For drivers/media/platform/s3c-camif/camif-capture.c: @@ -1230,7 +1230,7 @@ static int s3c_camif_subdev_get_fmt(struct v4l2_subdev *sd, *mf = camif->mbus_fmt; break; - case CAMIF_SD_PAD_SOURCE_C...CAMIF_SD_PAD_SOURCE_P: + case CAMIF_SD_PAD_SOURCE_C: /* crop rectangle at camera interface input */ mf->width = camif->camif_crop.width; mf->height = camif->camif_crop.height; @@ -1332,7 +1332,7 @@ static int s3c_camif_subdev_set_fmt(struct v4l2_subdev *sd, } break; - case CAMIF_SD_PAD_SOURCE_C...CAMIF_SD_PAD_SOURCE_P: + case CAMIF_SD_PAD_SOURCE_C: /* Pixel format can be only changed on the sink pad. */ mf->code = camif->mbus_fmt.code; mf->width = crop->width; The semantic patch is: // <smpl> // Change function parameter @@ identifier func; identifier cfg; @@ func(..., - struct v4l2_subdev_pad_config *cfg + struct v4l2_subdev_state *sd_state , ...) { <... - cfg + sd_state ...> } // Change function declaration parameter @@ identifier func; identifier cfg; type T; @@ T func(..., - struct v4l2_subdev_pad_config *cfg + struct v4l2_subdev_state *sd_state , ...); // Change function return value @@ identifier func; @@ - struct v4l2_subdev_pad_config + struct v4l2_subdev_state *func(...) { ... } // Change function declaration return value @@ identifier func; @@ - struct v4l2_subdev_pad_config + struct v4l2_subdev_state *func(...); // Some drivers pass a local pad_cfg for a single pad to a called function. Wrap it // inside a pad_state. @@ identifier func; identifier pad_cfg; @@ func(...) { ... struct v4l2_subdev_pad_config pad_cfg; + struct v4l2_subdev_state pad_state = { .pads = &pad_cfg }; <+... ( v4l2_subdev_call | sensor_call | isi_try_fse | isc_try_fse | saa_call_all ) (..., - &pad_cfg + &pad_state ,...) ...+> } // If the function uses fields from pad_config, access via state->pads @@ identifier func; identifier state; @@ func(..., struct v4l2_subdev_state *state , ...) { <... ( - state->try_fmt + state->pads->try_fmt | - state->try_crop + state->pads->try_crop | - state->try_compose + state->pads->try_compose ) ...> } // If the function accesses the filehandle, use fh->state instead @@ struct v4l2_subdev_fh *fh; @@ - fh->pad + fh->state @@ struct v4l2_subdev_fh fh; @@ - fh.pad + fh.state // Start of vsp1 specific @@ @@ struct vsp1_entity { ... - struct v4l2_subdev_pad_config *config; + struct v4l2_subdev_state *config; ... }; @@ symbol entity; @@ vsp1_entity_init(...) { ... entity->config = - v4l2_subdev_alloc_pad_config + v4l2_subdev_alloc_state (&entity->subdev); ... } @@ symbol entity; @@ vsp1_entity_destroy(...) { ... - v4l2_subdev_free_pad_config + v4l2_subdev_free_state (entity->config); ... } @exists@ identifier func =~ "(^vsp1.*)|(hsit_set_format)|(sru_enum_frame_size)|(sru_set_format)|(uif_get_selection)|(uif_set_selection)|(uds_enum_frame_size)|(uds_set_format)|(brx_set_format)|(brx_get_selection)|(histo_get_selection)|(histo_set_selection)|(brx_set_selection)"; symbol config; @@ func(...) { ... - struct v4l2_subdev_pad_config *config; + struct v4l2_subdev_state *config; ... } // End of vsp1 specific // Start of rcar specific @@ identifier sd; identifier pad_cfg; @@ rvin_try_format(...) { ... - struct v4l2_subdev_pad_config *pad_cfg; + struct v4l2_subdev_state *sd_state; ... - pad_cfg = v4l2_subdev_alloc_pad_config(sd); + sd_state = v4l2_subdev_alloc_state(sd); <... - pad_cfg + sd_state ...> - v4l2_subdev_free_pad_config(pad_cfg); + v4l2_subdev_free_state(sd_state); ... } // End of rcar specific // Start of rockchip specific @@ identifier func =~ "(rkisp1_rsz_get_pad_fmt)|(rkisp1_rsz_get_pad_crop)|(rkisp1_rsz_register)"; symbol rsz; symbol pad_cfg; @@ func(...) { + struct v4l2_subdev_state state = { .pads = rsz->pad_cfg }; ... - rsz->pad_cfg + &state ... } @@ identifier func =~ "(rkisp1_isp_get_pad_fmt)|(rkisp1_isp_get_pad_crop)"; symbol isp; symbol pad_cfg; @@ func(...) { + struct v4l2_subdev_state state = { .pads = isp->pad_cfg }; ... - isp->pad_cfg + &state ... } @@ symbol rkisp1; symbol isp; symbol pad_cfg; @@ rkisp1_isp_register(...) { + struct v4l2_subdev_state state = { .pads = rkisp1->isp.pad_cfg }; ... - rkisp1->isp.pad_cfg + &state ... } // End of rockchip specific // Start of tegra-video specific @@ identifier sd; identifier pad_cfg; @@ __tegra_channel_try_format(...) { ... - struct v4l2_subdev_pad_config *pad_cfg; + struct v4l2_subdev_state *sd_state; ... - pad_cfg = v4l2_subdev_alloc_pad_config(sd); + sd_state = v4l2_subdev_alloc_state(sd); <... - pad_cfg + sd_state ...> - v4l2_subdev_free_pad_config(pad_cfg); + v4l2_subdev_free_state(sd_state); ... } @@ identifier sd_state; @@ __tegra_channel_try_format(...) { ... struct v4l2_subdev_state *sd_state; <... - sd_state->try_crop + sd_state->pads->try_crop ...> } // End of tegra-video specific // </smpl> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-06-02media: exynos4-is: Fix a use after free in isp_video_releaseLv Yunlong
In isp_video_release, file->private_data is freed via _vb2_fop_release()->v4l2_fh_release(). But the freed file->private_data is still used in v4l2_fh_is_singular_file() ->v4l2_fh_is_singular(file->private_data), which is a use after free bug. My patch uses a variable 'is_singular_file' to avoid the uaf. v3: https://lore.kernel.org/patchwork/patch/1419058/ Fixes: 34947b8aebe3f ("[media] exynos4-is: Add the FIMC-IS ISP capture DMA driver") Signed-off-by: Lv Yunlong <lyl2019@mail.ustc.edu.cn> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-13firmware: replace HOTPLUG with UEVENT in FW_ACTION definesShawn Guo
With commit 312c004d36ce ("[PATCH] driver core: replace "hotplug" by "uevent"") already in the tree over a decade, update the name of FW_ACTION defines to follow semantics, and reflect what the defines are really meant for, i.e. whether or not generate user space event. Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Link: https://lore.kernel.org/r/20210425020024.28057-1-shawn.guo@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-11media: exynos4-is: remove a now unused integerMauro Carvalho Chehab
The usage of pm_runtime_resume_and_get() removed the need of a temporary integer. So, drop it. Fixes: 59f96244af94 ("media: exynos4-is: fix pm_runtime_get_sync() usage count") Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-10media: exynos4-is: fix pm_runtime_get_sync() usage countMauro Carvalho Chehab
The pm_runtime_get_sync() internally increments the dev->power.usage_count without decrementing it, even on errors. On some places, this is ok, but on others the usage count ended being unbalanced on failures. Replace it by the new pm_runtime_resume_and_get(), introduced by: commit dd8088d5a896 ("PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter") in order to properly decrement the usage counter, avoiding a potential PM usage counter leak. As a bonus, such function always return zero on success. So, some code can be simplified. Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-04-06media: exynos4-is: Fix kernel-doc entries in fimc-is.hSylwester Nawrocki
Fixes scripts/kernel-doc warnings: fimc-is.h:286: warning: Function parameter or member 'fw' not described in 'fimc_is' fimc-is.h:286: warning: Function parameter or member 'memory' not described in 'fimc_is' fimc-is.h:286: warning: Function parameter or member 'f_w' not described in 'fimc_is' fimc-is.h:286: warning: Function parameter or member 'isp' not described in 'fimc_is' fimc-is.h:286: warning: Function parameter or member 'sensor' not described in 'fimc_is' fimc-is.h:286: warning: Function parameter or member 'setfile' not described in 'fimc_is' fimc-is.h:286: warning: Function parameter or member 'ctrl_handler' not described in 'fimc_is' fimc-is.h:286: warning: Function parameter or member 'irq' not described in 'fimc_is' fimc-is.h:286: warning: Function parameter or member 'sensor_index' not described in 'fimc_is' fimc-is.h:286: warning: Function parameter or member 'i2h_cmd' not described in 'fimc_is' fimc-is.h:286: warning: Function parameter or member 'h2i_cmd' not described in 'fimc_is' fimc-is.h:286: warning: Function parameter or member 'fd_header' not described in 'fimc_is' fimc-is.h:286: warning: Function parameter or member 'config' not described in 'fimc_is' fimc-is.h:286: warning: Function parameter or member 'config_index' not described in 'fimc_is' fimc-is.h:286: warning: Function parameter or member 'is_p_region' not described in 'fimc_is' fimc-is.h:286: warning: Function parameter or member 'is_dma_p_region' not described in 'fimc_is' fimc-is.h:286: warning: Function parameter or member 'is_shared_region' not described in 'fimc_is' fimc-is.h:286: warning: Function parameter or member 'af' not described in 'fimc_is' fimc-is.h:286: warning: Function parameter or member 'debugfs_entry' not described in 'fimc_is' The f_w field is unused so remove it. Reported-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-04-06media: exynos4-is: fix kernel-doc warningsHans Verkuil
Fixes these kernel-doc warnings: drivers/media/platform/exynos4-is/fimc-isp.h:139: warning: Function parameter or member 've' not described in 'fimc_is_video' drivers/media/platform/exynos4-is/fimc-isp.h:139: warning: Function parameter or member 'buf_count' not described in 'fimc_is_video' drivers/media/platform/exynos4-is/fimc-isp.h:139: warning: Function parameter or member 'buf_mask' not described in 'fimc_is_video' drivers/media/platform/exynos4-is/fimc-isp.h:139: warning: Function parameter or member 'streaming' not described in 'fimc_is_video' drivers/media/platform/exynos4-is/fimc-isp.h:139: warning: Function parameter or member 'buffers' not described in 'fimc_is_video' drivers/media/platform/exynos4-is/fimc-isp.h:139: warning: Function parameter or member 'pixfmt' not described in 'fimc_is_video' drivers/media/platform/exynos4-is/fimc-isp.h:176: warning: Function parameter or member 'src_fmt' not described in 'fimc_isp' drivers/media/platform/exynos4-is/fimc-isp.h:176: warning: Function parameter or member 'sink_fmt' not described in 'fimc_isp' drivers/media/platform/exynos4-is/fimc-isp.h:176: warning: Function parameter or member 'subdev_lock' not described in 'fimc_isp' drivers/media/platform/exynos4-is/fimc-lite.h:178: warning: Function parameter or member 'events' not described in 'fimc_lite' drivers/media/platform/exynos4-is/fimc-lite.h:178: warning: Function parameter or member 'streaming' not described in 'fimc_lite' drivers/media/platform/exynos4-is/media-dev.h:143: warning: Function parameter or member 'wbclk' not described in 'fimc_md' drivers/media/platform/exynos4-is/media-dev.h:143: warning: Function parameter or member 'fimc_lite' not described in 'fimc_md' drivers/media/platform/exynos4-is/media-dev.h:143: warning: Function parameter or member 'clk_provider' not described in 'fimc_md' drivers/media/platform/exynos4-is/media-dev.h:143: warning: Function parameter or member 'subdev_notifier' not described in 'fimc_md' drivers/media/platform/exynos4-is/media-dev.h:143: warning: Function parameter or member 'pipelines' not described in 'fimc_md' drivers/media/platform/exynos4-is/media-dev.h:143: warning: Function parameter or member 'link_setup_graph' not described in 'fimc_md' drivers/media/platform/exynos4-is/fimc-core.h:261: warning: Function parameter or member 'alpha' not described in 'fimc_frame' drivers/media/platform/exynos4-is/fimc-core.h:321: warning: Function parameter or member 'streaming' not described in 'fimc_vid_cap' drivers/media/platform/exynos4-is/fimc-core.h:429: warning: Function parameter or member 'drv_data' not described in 'fimc_dev' drivers/media/platform/exynos4-is/fimc-core.h:495: warning: Function parameter or member 'in_order_1p' not described in 'fimc_ctx' drivers/media/platform/exynos4-is/fimc-core.h:673: warning: Function parameter or member 'vid_cap' not described in 'fimc_active_queue_add' drivers/media/platform/exynos4-is/fimc-core.h:685: warning: Function parameter or member 'vid_cap' not described in 'fimc_active_queue_pop' drivers/media/platform/exynos4-is/fimc-core.h:700: warning: Function parameter or member 'vid_cap' not described in 'fimc_pending_queue_add' drivers/media/platform/exynos4-is/fimc-core.h:711: warning: Function parameter or member 'vid_cap' not described in 'fimc_pending_queue_pop' drivers/media/platform/exynos4-is/fimc-reg.h:333: warning: Function parameter or member 'dev' not described in 'fimc_hw_set_dma_seq' Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-03-22media: exynos-gsc/exynos4-is: add missing 'struct' to kerneldocHans Verkuil
Fix kernel-doc warnings due to missing 'struct' keyword. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Cc: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-03-22media: exynos4-is: add missing call to of_node_put()Yang Li
In one of the error paths of the for_each_child_of_node() loop in fimc_md_parse_one_endpoint, add missing call to of_node_put(). Fix the following coccicheck warning: ./drivers/media/platform/exynos4-is/media-dev.c:489:1-23: WARNING: Function "for_each_child_of_node" should have of_node_put() before return around line 492. Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-03-11media: fix incorrect kernel doc usagesHans Verkuil
This patch fixes the following trivial warnings w.r.t. kernel-doc usage: drivers/media/common/videobuf2/frame_vector.c:38: warning: Excess function parameter 'gup_flags' description in 'get_vaddr_frames' drivers/media/dvb-core/dvb_ca_en50221.c:193: warning: wrong kernel-doc identifier on line: drivers/media/dvb-core/dvb_ca_en50221.c:1014: warning: expecting prototype for Wake up the DVB CA thread(). Prototype was for dvb_ca_en50221_thread_wakeup() instead drivers/media/dvb-core/dvb_ca_en50221.c:1023: warning: wrong kernel-doc identifier on line: drivers/media/dvb-core/dvb_ca_en50221.c:1081: warning: wrong kernel-doc identifier on line: drivers/media/dvb-core/dvb_ca_en50221.c:1112: warning: wrong kernel-doc identifier on line: drivers/media/dvb-core/dvb_ca_en50221.c:1327: warning: wrong kernel-doc identifier on line: drivers/media/dvb-core/dvb_ca_en50221.c:1411: warning: wrong kernel-doc identifier on line: drivers/media/dvb-core/dvb_ca_en50221.c:1426: warning: wrong kernel-doc identifier on line: drivers/media/dvb-core/dvb_ca_en50221.c:1582: warning: wrong kernel-doc identifier on line: drivers/media/dvb-core/dvb_ca_en50221.c:1693: warning: wrong kernel-doc identifier on line: drivers/media/dvb-core/dvb_ca_en50221.c:1743: warning: wrong kernel-doc identifier on line: drivers/media/dvb-core/dvb_ca_en50221.c:1772: warning: wrong kernel-doc identifier on line: drivers/media/dvb-core/dvb_ca_en50221.c:1830: warning: wrong kernel-doc identifier on line: drivers/media/dvb-core/dvb_ca_en50221.c:1922: warning: wrong kernel-doc identifier on line: drivers/media/rc/img-ir/img-ir-hw.c:628: warning: expecting prototype for img_ir_decoder_compatable(). Prototype was for img_ir_decoder_compatible() instead drivers/media/v4l2-core/v4l2-jpeg.c:461: warning: expecting prototype for jpeg_parse_header(). Prototype was for v4l2_jpeg_parse_header() instead drivers/media/platform/vsp1/vsp1_dl.c:166: warning: expecting prototype for struct vsp1_cmd_pool. Prototype was for struct vsp1_dl_cmd_pool instead drivers/media/platform/mtk-vpu/mtk_vpu.c:28: warning: expecting prototype for is a tiny processor controlling video hardware(). Prototype was for INIT_TIMEOUT_MS() instead drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_if.c:73: warning: expecting prototype for struct vp9_fb_info. Prototype was for struct vp9_ref_buf instead drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_if.c:85: warning: expecting prototype for struct vp9_fb_info. Prototype was for struct vp9_sf_ref_fb instead drivers/media/tuners/mt2063.c:1404: warning: expecting prototype for fLO_FractionalTerm(). Prototype was for MT2063_fLO_FractionalTerm() instead drivers/media/tuners/mt2063.c:1465: warning: expecting prototype for CalcLO2Mult(). Prototype was for MT2063_CalcLO2Mult() instead drivers/media/usb/pwc/pwc-dec23.c:640: warning: wrong kernel-doc identifier on line: drivers/media/platform/exynos4-is/media-dev.c:820: warning: expecting prototype for __fimc_md_create_fimc_links(). Prototype was for __fimc_md_create_fimc_sink_links() instead drivers/media/i2c/s5k6aa.c:426: warning: expecting prototype for s5k6aa_configure_pixel_clock(). Prototype was for s5k6aa_configure_pixel_clocks() instead drivers/media/i2c/imx274.c:700: warning: wrong kernel-doc identifier on line: drivers/media/i2c/imx274.c:735: warning: wrong kernel-doc identifier on line: drivers/media/i2c/imx274.c:983: warning: wrong kernel-doc identifier on line: Most are missing or mistyped function names. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-02-06media: v4l2-async: Improve v4l2_async_notifier_add_*_subdev() APILaurent Pinchart
The functions that add an async subdev to an async subdev notifier take as an argument the size of the container structure they need to allocate. This is error prone, as passing an invalid size will not be caught by the compiler. Wrap those functions in macros that take a container type instead of a size, and cast the returned pointer to the desired type. The compiler will catch mistakes if the incorrect type is passed to the macro, as the assignment types won't match. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Helen Koike <helen.koike@collabora.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> (core+ti-cal) Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-02-06media: exynos4-is: Use v4l2_async_notifier_add_fwnode_remote_subdevEzequiel Garcia
The use of v4l2_async_notifier_add_subdev will be discouraged. Drivers are instead encouraged to use a helper such as v4l2_async_notifier_add_fwnode_remote_subdev. This fixes a misuse of the API, as v4l2_async_notifier_add_subdev should get a kmalloc'ed struct v4l2_async_subdev, removing some boilerplate code while at it. Use the appropriate helper v4l2_async_notifier_add_fwnode_remote_subdev, which handles the needed setup, instead of open-coding it. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Reviewed-by: Helen Koike <helen.koike@collabora.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-03media: platform: exynos4-is: remove all references to physical addressesMarek Szyprowski
This driver always operates on the DMA/IOVA addresses, so calling them physical addresses is misleading, although when no IOMMU is used they equal each other. Fix this by renaming all such entries to 'addr' and adjusting comments. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: exynos4-is: use semicolons rather than commas to separate statementsJulia Lawall
Replace commas with semicolons. Commas introduce unnecessary variability in the code structure and are hard to see. What is done is essentially described by the following Coccinelle semantic patch (http://coccinelle.lip6.fr/): // <smpl> @@ expression e1,e2; @@ e1 -, +; e2 ... when any // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-10-15Merge tag 'dma-mapping-5.10' of git://git.infradead.org/users/hch/dma-mappingLinus Torvalds
Pull dma-mapping updates from Christoph Hellwig: - rework the non-coherent DMA allocator - move private definitions out of <linux/dma-mapping.h> - lower CMA_ALIGNMENT (Paul Cercueil) - remove the omap1 dma address translation in favor of the common code - make dma-direct aware of multiple dma offset ranges (Jim Quinlan) - support per-node DMA CMA areas (Barry Song) - increase the default seg boundary limit (Nicolin Chen) - misc fixes (Robin Murphy, Thomas Tai, Xu Wang) - various cleanups * tag 'dma-mapping-5.10' of git://git.infradead.org/users/hch/dma-mapping: (63 commits) ARM/ixp4xx: add a missing include of dma-map-ops.h dma-direct: simplify the DMA_ATTR_NO_KERNEL_MAPPING handling dma-direct: factor out a dma_direct_alloc_from_pool helper dma-direct check for highmem pages in dma_direct_alloc_pages dma-mapping: merge <linux/dma-noncoherent.h> into <linux/dma-map-ops.h> dma-mapping: move large parts of <linux/dma-direct.h> to kernel/dma dma-mapping: move dma-debug.h to kernel/dma/ dma-mapping: remove <asm/dma-contiguous.h> dma-mapping: merge <linux/dma-contiguous.h> into <linux/dma-map-ops.h> dma-contiguous: remove dma_contiguous_set_default dma-contiguous: remove dev_set_cma_area dma-contiguous: remove dma_declare_contiguous dma-mapping: split <linux/dma-mapping.h> cma: decrease CMA_ALIGNMENT lower limit to 2 firewire-ohci: use dma_alloc_pages dma-iommu: implement ->alloc_noncoherent dma-mapping: add new {alloc,free}_noncoherent dma_map_ops methods dma-mapping: add a new dma_alloc_pages API dma-mapping: remove dma_cache_sync 53c700: convert to dma_alloc_noncoherent ...
2020-10-06dma-mapping: merge <linux/dma-contiguous.h> into <linux/dma-map-ops.h>Christoph Hellwig
Merge dma-contiguous.h into dma-map-ops.h, after removing the comment describing the contiguous allocator into kernel/dma/contigous.c. Signed-off-by: Christoph Hellwig <hch@lst.de>
2020-09-27media: exynos4-is: Fix several reference count leaks due to pm_runtime_get_syncQiushi Wu
On calling pm_runtime_get_sync() the reference count of the device is incremented. In case of failure, decrement the reference count before returning the error. Signed-off-by: Qiushi Wu <wu000273@umn.edu> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-09-27media: exynos4-is: Fix a reference count leak due to pm_runtime_get_syncQiushi Wu
On calling pm_runtime_get_sync() the reference count of the device is incremented. In case of failure, decrement the reference count before returning the error. Signed-off-by: Qiushi Wu <wu000273@umn.edu> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-09-27media: exynos4-is: Fix a reference count leakQiushi Wu
pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code, causing incorrect ref count if pm_runtime_put_noidle() is not called in error handling paths. Thus call pm_runtime_put_noidle() if pm_runtime_get_sync() fails. Signed-off-by: Qiushi Wu <wu000273@umn.edu> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-09-01media: exynos4-is: no need to check return value of debugfs_create functionsGreg Kroah-Hartman
When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-09-01media: exynos4-is: Handle duplicate calls to vidioc_streamoffJonathan Bakker
vidioc_streamoff can be called multiple times from userspace, but we should only call media_pipeline_stop when we're actually setup. This became more noticeable after commit 2a2599c66368 ("[media] media: entity: Catch unbalanced media_pipeline_stop calls") was merged as it added a WARN for unbalanced calls to media_pipeline_stop. Signed-off-by: Jonathan Bakker <xc-racer2@live.ca> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-09-01media: exynos4-is: Remove unused struct member input_indexJonathan Bakker
This is no longer used since the conversion to DT Signed-off-by: Jonathan Bakker <xc-racer2@live.ca> Reviewed-by: Tomasz Figa <tfiga@chromium.org> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-09-01media: exynos4-is: Remove inh_sensor_ctrlsJonathan Bakker
This is a no-op as it is never set and is a remnant from non-DT days that can be safely removed. Signed-off-by: Jonathan Bakker <xc-racer2@live.ca> Reviewed-by: Tomasz Figa <tfiga@chromium.org> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-09-01media: exynos4-is: Add support for multiple sensors on one portJonathan Bakker
On some devices, there may be multiple camera sensors attached to the same port. Make sure we probe all of them, not just the first one. Signed-off-by: Jonathan Bakker <xc-racer2@live.ca> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-09-01media: exynos4-is: Use global num_sensors rather than local indexJonathan Bakker
Instead of keeping a local copy of how many sensors we've probed (which may not even properly represent the number of sensors probed if we have a port without a sensor), use the global num_sensors counter that has the actual number used. This will also make it easier to add support for multiple sensors being connected to the same port. Signed-off-by: Jonathan Bakker <xc-racer2@live.ca> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-09-01media: exynos4-is: Properly set JPEG options for parallel portsJonathan Bakker
Commit ee7160e57c98 ("[media] s5p-fimc: Add support for JPEG capture") added support for JPEG capture, but missed setting a register when the parallel port was used rather than the CSIS device. Signed-off-by: Jonathan Bakker <xc-racer2@live.ca> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-09-01media: exynos4-is: Correct missing entity function initializationJonathan Bakker
Commit bae4500399c4 ("[media] exynos4-is: Add missing entity function initialization") tried to suppress the warnings such as s5p-fimc-md camera: Entity type for entity FIMC.0 was not initialized! However, this missed setting for the subdev. Set it now to avoid the ugly warnings on boot. Signed-off-by: Jonathan Bakker <xc-racer2@live.ca> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-09-01media: exynos4-is: Fix nullptr when no CSIS device presentJonathan Bakker
Not all devices use the CSIS device, some may use the FIMC directly in which case the CSIS device isn't registered. This leads to a nullptr exception when starting the stream as the CSIS device is always referenced. Instead, if getting the CSIS device fails, try getting the FIMC directly to check if we are using the subdev API Signed-off-by: Jonathan Bakker <xc-racer2@live.ca> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-09-01media: exynos4-is: Request syscon only if ISP writeback is presentTomasz Figa
On FIMC variants which don't have writeback channel, there is no need to access system registers. This patch makes the driver request sysreg regmap conditionally depending on whether writeback is supported. Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com> Signed-off-by: Jonathan Bakker <xc-racer2@live.ca> Reviewed-by: Tomasz Figa <tfiga@chromium.org> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-09-01media: exynos4-is: Remove static driver data for S5PV210 FIMC variantsJonathan Bakker
The S5PV210 platform only supports device tree based booting where the FIMC variant data is parsed directly from the device tree, hence the now unused static data can be removed. Signed-off-by: Jonathan Bakker <xc-racer2@live.ca> Reviewed-by: Tomasz Figa <tfiga@chromium.org> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-08-29media: Use fallthrough pseudo-keywordGustavo A. R. Silva
Replace the existing /* fall through */ comments and its variants with the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary fall-through markings when it is the case. [1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-08-29media: exynos4-is: Simplify the pinctrl codeSylwester Nawrocki
There is no need to request the "idle" pinctrl state in the driver as that is implemented in the driver core and the pinctrl_pm_* API can be used for switching between the default and the idle state. Simplify the pinctrl code to only request and check for the mandatory "default" pinctrl state. Switching between the default/idle pinctrl state is not yet implemented in the driver and this patch doesn't change that. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-08-29media: Revert "media: exynos4-is: Add missed check for pinctrl_lookup_state()"Sylwester Nawrocki
The "idle" pinctrl state is optional as documented in the DT binding. The change introduced by the commit being reverted makes that pinctrl state mandatory and breaks initialization of the whole media driver, since the "idle" state is not specified in any mainline dts. This reverts commit 18ffec750578 ("media: exynos4-is: Add missed check for pinctrl_lookup_state()") to fix the regression. Fixes: 18ffec750578 ("media: exynos4-is: Add missed check for pinctrl_lookup_state()") Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-07-04media: exynos4-is: Add missed check for pinctrl_lookup_state()Chuhong Yuan
fimc_md_get_pinctrl() misses a check for pinctrl_lookup_state(). Add the missed check to fix it. Fixes: 4163851f7b99 ("[media] s5p-fimc: Use pinctrl API for camera ports configuration]") Signed-off-by: Chuhong Yuan <hslester96@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-07-04media: samsung: Rename Samsung and Exynos to lowercaseKrzysztof Kozlowski
Fix up inconsistent usage of upper and lowercase letters in "Samsung" and "Exynos" names. "SAMSUNG" and "EXYNOS" are not abbreviations but regular trademarked names. Therefore they should be written with lowercase letters starting with capital letter. The lowercase "Exynos" name is promoted by its manufacturer Samsung Electronics Co., Ltd., in advertisement materials and on website. Although advertisement materials usually use uppercase "SAMSUNG", the lowercase version is used in all legal aspects (e.g. on Wikipedia and in privacy/legal statements on https://www.samsung.com/semiconductor/privacy-global/). Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-07-04media: use v4l2_rect_enclosed helperBenoit Parrot
Several drivers implement the same enclosed_rectangle() function to check if a rectangle is enclosed into another. Replace this with the newly added v4l2_rect_enclosed() helper function. Signed-off-by: Benoit Parrot <bparrot@ti.com> Acked-by: Andrzej Pietrasiewicz <andrzejtp2010@gmail.com> Reviewed-by: Lad Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-06-23media: exynos4-is: Fix runtime PM imbalance in fimc_is_probeDinghao Liu
pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. For all error paths after pm_runtime_get_sync(), things are the same. Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-06-23media: exynos4-is: Fix runtime PM imbalance in isp_video_openDinghao Liu
pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-06-23media: fimc-capture: Fix runtime PM imbalance on errorDinghao Liu
pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-04-14media: Kconfig files: use select for V4L2 subdevs and MCMauro Carvalho Chehab
There are lots of drivers that only work when the media controller and/or the V4L2 subdev APIs are present. Right now, someone need to first enable those APIs before using those drivers. Well, ideally, drivers, should, instead *optionally* depend on it, in order for PC camera drivers to be able to use them, but nowadays most drivers are UVC cameras, with don't require a sensor driver. So, be it. Let's instead make them select the MEDIA_CONTROLLER and the SUBDEV API, in order to make easier for people to be able of enabling them. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-02-24media: media/platform: rename VFL_TYPE_GRABBER to _VIDEOHans Verkuil
'GRABBER' is a weird name, all other types map to the /dev device names. Rename to 'VIDEO' to be consistent with the other types. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-02-24media: exynos4-is: add missed clk_disable_unprepare in removeChuhong Yuan
This driver forgets to disable and unprepare clock when remove. Add a call to clk_disable_unprepare() to fix it. Signed-off-by: Chuhong Yuan <hslester96@gmail.com> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>