aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-07-12staging: r8188eu: remove HW_VAR_MLME_SITESURVEY from SetHwReg8188EU()Michael Straube5-66/+70
Remove the HW_VAR_MLME_SITESURVEY case from SetHwReg8188EU() and move the functionality to two new functions in rtw_mlme_ext.c. This is part of the ongoing effort to get rid of SetHwReg8188EU(). Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150 Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220711174417.10721-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-11staging: r8188eu: the bcnhead parameter is always 0Martin Kaiser1-14/+2
The only caller of efuse_read_phymap_from_txpktbuf sets bcnhead to 0. Remove this function parameter and simplify the function body. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220709171000.180481-15-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-11staging: r8188eu: efuse_utilized is never readMartin Kaiser1-9/+0
The efuse_utilized variable in function efuse_phymap_to_logical is written to but never read. Remove it. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220709171000.180481-14-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-11staging: r8188eu: _offset is always 0 in efuse_phymap_to_logicalMartin Kaiser1-4/+3
The _offset parameter of iol_read_efuse is always 0. Remove the parameter and use 0 in the function body. We can now replace the bytewise copy from efuseTbl to pbuf with memcpy. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220709171000.180481-13-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-11staging: r8188eu: offset is always 0 in iol_read_efuseMartin Kaiser1-3/+3
The offset parameter of iol_read_efuse is always 0. Remove the parameter and use 0 in the function body. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220709171000.180481-12-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-11staging: r8188eu: offset is always 0 in rtl8188e_ReadEFuseMartin Kaiser3-5/+5
The offset parameter of rtl8188e_ReadEFuse is always 0. Remove the parameter and use 0 in the function body. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220709171000.180481-11-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-11staging: r8188eu: txpktbuf_bndy is always 0Martin Kaiser1-4/+4
The only caller of iol_read_efuse sets the txpktbuf_bndy parameter to 0. Remove the parameter from iol_read_efuse and use 0 in the function body. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220709171000.180481-10-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-11staging: r8188eu: merge ReadEFuseByIC into rtl8188e_ReadEFuseMartin Kaiser1-6/+1
The rtl8188e_ReadEFuse function is just a wrapper to call ReadEFuseByIC. Copy ReadEFuseByIC into rtl8188e_ReadEFuse and remove ReadEFuseByIC. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220709171000.180481-9-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-11staging: r8188eu: use memcpy for fallback mac addressMartin Kaiser1-3/+1
Use memcpy to store the fallback mac address in eeprom->mac_addr. Do not copy byte by byte. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220709171000.180481-8-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-11staging: r8188eu: always initialise efuse buffer with 0xffMartin Kaiser1-8/+6
If BOOT_FROM_EEPROM is set, efuse_buf is not initialised before it is passed to functions that read from it. The buffer will be filled with 0x00 in this case like all local variables. However, the parsing functions expect the buffer to be filled with 0xFF if reading eeprom/efuse data failed. Fill the buffer with 0xFF before we try to read the data. Please note that this problem existed before we started using a local buffer. Adapter->eeprompriv->efuse_eeprom_data was allocated as a part of struct adapter by a vzalloc call in rtw_usb_if1_init. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220709171000.180481-7-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-11staging: r8188eu: use a local buffer for efuse dataMartin Kaiser2-14/+12
The efuse_eeprom_data array in struct eeprom_priv is used only by ReadAdapterInfo8188EU. We can remove efuse_eeprom_data and use a local buffer instead. Use EFUSE_MAP_LEN_88E as buffer size. Its value is the same as HWSET_MAX_SIZE_512. The functions that access the buffer use EFUSE_MAP_LEN_88E for its size. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220709171000.180481-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-11staging: r8188eu: merge EFUSE_ShadowMapUpdate with its callerMartin Kaiser3-34/+9
Merge the EFUSE_ShadowMapUpdate function into ReadAdapterInfo8188EU, which is the only caller. Merging the two functions makes it clearer that eeprom->efuse_eeprom_data is in fact a temporary buffer that stores info read from efuses. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220709171000.180481-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-11staging: r8188eu: remove eeprom function prototypesMartin Kaiser1-6/+0
Remove prototypes for non-existing eeprom functions. It seems that r8188eu has efuses but no eeprom. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220709171000.180481-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-11staging: r8188eu: remove EepromOrEfuse from struct eeprom_privMartin Kaiser3-5/+1
The EepromOrEfuse flag in struct eeprom_priv is used only in the ReadAdapterInfo8188EU function. We can remove EepromOrEfuse from struct eeprom_priv. As the meaning of EepromOrEfuse isn't obvious, there is a macro is_boot_from_eeprom that's used for checking the value. We don't need the macro, writing the check as !(eeValue & BOOT_FROM_EEPROM) makes it clear what is checked. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220709171000.180481-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-11staging: r8188eu: remove unused eeprom definesMartin Kaiser1-6/+0
Remove some eeprom-related defines which are not used by the r8188eu driver. This driver uses BOOT_FROM_EEPROM and EEPROM_EN instead of the defines that this patch removes. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220709171000.180481-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-11staging: r8188eu: remove HW_VAR_DM_FUNC_CLR from SetHwReg8188EU()Michael Straube3-8/+10
Remove the HW_VAR_DM_FUNC_CLR case from SetHwReg8188EU() and move its functionality to a static function. This is part of the ongoing effort to get rid of SetHwReg8188EU(). Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220709094458.9578-6-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-11staging: r8188eu: remove HW_VAR_DM_FUNC_RESET from SetHwReg8188EU()Michael Straube3-6/+10
Remove the HW_VAR_DM_FUNC_RESET case from SetHwReg8188EU() and move its functionality to a static function. This is part of the ongoing effort to get rid of SetHwReg8188EU(). Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220709094458.9578-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-11staging: r8188eu: remove HW_VAR_DM_FLAG from SetHwReg8188EU()Michael Straube3-5/+9
Remove the HW_VAR_DM_FLAG case from SetHwReg8188EU() and move its functionality to a static function. This is part of the ongoing effort to get rid of SetHwReg8188EU(). Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220709094458.9578-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-11staging: r8188eu: remove HW_VAR_DM_FUNC_OP from SetHwReg8188EU()Michael Straube3-11/+6
Remove the HW_VAR_DM_FUNC_OP case from SetHwReg8188EU() and move the functionality to the functions that call SetHwReg8188EU() with HW_VAR_DM_FUNC_OP. This is part of the ongoing effort to get rid of SetHwReg8188EU(). Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220709094458.9578-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-11staging: r8188eu: remove HW_VAR_BASIC_RATE from SetHwReg8188EU()Michael Straube5-40/+42
Remove the HW_VAR_BASIC_RATE case from SetHwReg8188EU() and move the functionality to a separate function. This is part of the ongoing effort to get rid of SetHwReg8188EU(). Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220709094458.9578-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-11staging: rtl8192u: Fix sleep in atomic context bug in dm_fsync_timer_callbackDuoming Zhou3-22/+20
There are sleep in atomic context bugs when dm_fsync_timer_callback is executing. The root cause is that the memory allocation functions with GFP_KERNEL or GFP_NOIO parameters are called in dm_fsync_timer_callback which is a timer handler. The call paths that could trigger bugs are shown below: (interrupt context) dm_fsync_timer_callback write_nic_byte kzalloc(sizeof(data), GFP_KERNEL); //may sleep usb_control_msg kmalloc(.., GFP_NOIO); //may sleep write_nic_dword kzalloc(sizeof(data), GFP_KERNEL); //may sleep usb_control_msg kmalloc(.., GFP_NOIO); //may sleep This patch uses delayed work to replace timer and moves the operations that may sleep into the delayed work in order to mitigate bugs. Fixes: 8fc8598e61f6 ("Staging: Added Realtek rtl8192u driver to staging") Signed-off-by: Duoming Zhou <duoming@zju.edu.cn> Link: https://lore.kernel.org/r/20220710103002.63283-1-duoming@zju.edu.cn Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-11Merge 5.19-rc6 into staging-nextGreg Kroah-Hartman1-1/+1
We need the staging driver fix in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-08media: hantro: Fix RK3399 H.264 format advertisingEzequiel Garcia1-7/+53
Commit 1f82f2df523cb ("media: hantro: Enable H.264 on Rockchip VDPU2") enabled H.264 on some SoCs with VDPU2 cores. This had the side-effect of exposing H.264 coded format as supported on RK3399. Fix this and clarify how the codec is explicitly disabled on RK3399 on this driver. Fixes: 1f82f2df523cb ("media: hantro: Enable H.264 on Rockchip VDPU2") Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Tested-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08media: staging: media: imx: imx7-media-csi: Drop usage of shared helpersLaurent Pinchart1-2/+0
None of the shared helpers are used anymore. Make this official by dropping inclusion of imx-media.h. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Rui Miguel Silva <rmfrfs@gmail.com> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08media: staging: media: imx: imx7-media-csi: Drop V4L2 events supportLaurent Pinchart1-16/+0
The only event that the driver allows subscribing to, V4L2_EVENT_IMX_FRAME_INTERVAL_ERROR, is never generated. Drop events support. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Rui Miguel Silva <rmfrfs@gmail.com> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08media: staging: media: imx: imx7-media-csi: Inline imx7_csi_enum_pixel_formats()Laurent Pinchart1-50/+34
Inline the imx7_csi_enum_pixel_formats() function in its only caller. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Rui Miguel Silva <rmfrfs@gmail.com> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08media: staging: media: imx: imx7-media-csi: Drop unneeded pixel format validationLaurent Pinchart1-33/+0
The driver won't accept unsupported pixel formats, there's thus no need to validate it in imx7_csi_pad_link_validate(). Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Rui Miguel Silva <rmfrfs@gmail.com> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08media: staging: media: imx: imx7-media-csi: Add V4L2_PIX_FMT_Y14 supportLaurent Pinchart1-0/+5
The device supports 14-bit greyscale formats the same way it supports 14-bit Bayer formats. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Rui Miguel Silva <rmfrfs@gmail.com> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08media: staging: media: imx: imx7-media-csi: Fix list of supported formatsLaurent Pinchart1-39/+55
The list of supported formats comes from helpers shared with the i.MX6 IPUv3 and is incorrect in multiple regards: - 10-, 12- and 14-bit Bayer formats are stored in memory as SBGGR10, SBGGR12 and SBGGR14 respectively (plus components permutations), not SBGGR16. Same thing for greyscale formats. - 16-bit RAW formats are not supported by the hardware. Fix the supported formats table. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Rui Miguel Silva <rmfrfs@gmail.com> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08media: staging: media: imx: imx7-media-csi: Simplify default format in try_fmtLaurent Pinchart1-3/+5
When trying a format on the video node, if the requested pixel format isn't supported, fallback to the default with a simpler logic. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Rui Miguel Silva <rmfrfs@gmail.com> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08media: staging: media: imx: imx7-media-csi: Inline imx7_csi_init_mbus_fmt()Laurent Pinchart1-39/+15
Inline the imx7_csi_init_mbus_fmt() function in its only caller. This allows simplifying the code. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Rui Miguel Silva <rmfrfs@gmail.com> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08media: staging: media: imx: imx7-media-csi: Drop unneeded imx7_csi_pixfmt fieldsLaurent Pinchart1-21/+2
The imx7_csi_pixfmt cycles field is never used nor set, the bayer field is never used, and the planar field is never set. Drop them. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Rui Miguel Silva <rmfrfs@gmail.com> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08media: staging: media: imx: imx7-media-csi: Drop YUV/RGB/BAYER format selectorsLaurent Pinchart1-83/+22
All the format lookup functions are called with a ANY selector, drop selector support. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Rui Miguel Silva <rmfrfs@gmail.com> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08media: staging: media: imx: imx7-media-csi: Simplify default mbus code in try_fmtLaurent Pinchart1-4/+3
When trying a format on the subdev sink pad, if the requested media bus code isn't supported, fallback to the default with a simpler logic. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Rui Miguel Silva <rmfrfs@gmail.com> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08media: staging: media: imx: imx7-media-csi: Define macro for default mbus codeLaurent Pinchart1-3/+5
Define a macro for the default media bus code and use it through the driver to replace a hardcoded value and a dynamic query from the pixel_formats table. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Rui Miguel Silva <rmfrfs@gmail.com> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08media: staging: media: imx: imx7-media-csi: Make default formats consistentLaurent Pinchart1-7/+10
Use the same default image width and height for both the CSI subdev and the video node to achieve a consistent default through the driver. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Rui Miguel Silva <rmfrfs@gmail.com> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08media: staging: media: imx: imx7-media-csi: Drop unsupported YUV and RGB formatsLaurent Pinchart1-55/+0
A large number of formats defined in the pixel_formats array are not supported, as shown by the switch-case check in imx7_csi_pad_link_validate(). Drop them. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Rui Miguel Silva <rmfrfs@gmail.com> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08media: staging: media: imx: imx7-media-csi: Drop IPU-only formatsLaurent Pinchart1-92/+6
The formats specific to the IPUv3 are not supported by the CSI bridge. Drop them, along with the related code. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Rui Miguel Silva <rmfrfs@gmail.com> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08media: staging: media: imx: imx7-media-csi: Drop IC support from imx7_csi_try_colorimetry()Laurent Pinchart1-17/+5
The imx7_csi_try_colorimetry() function supports the unrelated image converter hardware as it originates from shared helpers. Drop that. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Rui Miguel Silva <rmfrfs@gmail.com> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08media: staging: media: imx: imx7-media-csi: Replace ipu_color_space with bool yuv fieldLaurent Pinchart1-45/+26
Replace the enum ipu_color_space cs field in struct imx7_csi_pixfmt with a bool yuv field. This decouples the driver from the unrelated IPUv3 headers. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Rui Miguel Silva <rmfrfs@gmail.com> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08media: staging: media: imx: imx7-media-csi: Import format helpersLaurent Pinchart1-45/+615
To prepare for code refactoring, copy the format helpers used by this driver from imx-media-utils.c. Rename structures and functions to avoid name clashes, no functional change intended. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Rui Miguel Silva <rmfrfs@gmail.com> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08media: staging: media: imx: imx7-media-csi: Drop error message on alloc failureLaurent Pinchart1-3/+1
The kernel memory allocators already complain loudly to the log when allocation fails. There's no need for an additional message. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Rui Miguel Silva <rmfrfs@gmail.com> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08media: staging: media: imx: imx7-media-csi: Decouple from shared macrosLaurent Pinchart1-3/+6
Decouple from the IMX7_CSI_VIDEO_DEF_PIX_WIDTH, IMX7_CSI_VIDEO_DEF_PIX_HEIGHT and IMX_MEDIA_EOF_TIMEOUT macros defined in shared helpers by duplicating them in the imx7-media-csi driver, with a rename to avoid name clashes. No functional change intended. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Rui Miguel Silva <rmfrfs@gmail.com> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08media: staging: media: imx: imx7-media-csi: Decouple from imx_media_dma_bufLaurent Pinchart1-4/+36
Decouple from the imx_media_dma_buf structure defined in shared helpers by duplicating it in the imx7-media-csi driver, along with the two small alloc and free functions. No functional change intended. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Rui Miguel Silva <rmfrfs@gmail.com> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08media: staging: media: imx: imx7-media-csi: Store imx7_csi in drv dataLaurent Pinchart1-6/+3
Replace the subdev pointer stored in platform drv data with the imx7_csi pointer. Drop a now redundant dev_set_drvdata() call. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Rui Miguel Silva <rmfrfs@gmail.com> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08media: staging: media: imx: imx7-media-csi: Fold imx_media_video_dev into imx7_csiLaurent Pinchart1-64/+57
Now that the driver doesn't use any helper that relies on the imx_media_video_dev structure anymore, merge its fields directly in the imx7_csi structure. Update all the users accordingly, and drop the list field that isn't used by the driver. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Rui Miguel Silva <rmfrfs@gmail.com> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08media: staging: media: imx: imx7-media-csi: Decouple from imx_media_bufferLaurent Pinchart1-14/+27
Decouple from the imx_media_buffer structure defined in shared helpers by duplicating it in the imx7-media-csi driver. No functional change intended. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Rui Miguel Silva <rmfrfs@gmail.com> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08media: staging: media: imx: imx7-media-csi: Fold imx_media_dev into imx7_csiLaurent Pinchart1-31/+30
Now that the driver doesn't use any helper that relies on the imx_media_dev structure anymore, merge the three fields of the imx_media_dev structure directly in the imx7_csi structure. Update all the users accordingly. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Rui Miguel Silva <rmfrfs@gmail.com> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08media: staging: media: imx: imx7-media-csi: Inline pipeline start/stopLaurent Pinchart1-36/+22
The imx7_csi_media_pipeline_set_stream() function has separate branches for the start and stop paths, surrounded by mutex lock/unlock. That is very little shared code, inline the locking and corresponding branch in each of the two callers. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Rui Miguel Silva <rmfrfs@gmail.com> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08media: staging: media: imx: imx7-media-csi: Avoid unnecessary castsLaurent Pinchart1-21/+10
Simplify the imx7_csi_media_pipeline_set_stream() function by passing it the imx7_csi pointer, which avoids going from subdev to entity and back to subdev. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Rui Miguel Silva <rmfrfs@gmail.com> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>