aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging
AgeCommit message (Collapse)AuthorFilesLines
2022-01-31staging: r8188eu: remove HW_VAR_CAM_INVALID_ALLMichael Straube3-6/+2
Remove HW_VAR_CAM_INVALID_ALL from SetHwReg8188EU() and call rtw_write32() directly. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220130190321.7172-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-31staging: r8188eu: remove HW_VAR_SEC_CFGMichael Straube3-10/+3
Remove HW_VAR_SEC_CFG from SetHwReg8188EU() and call rtw_write8() directly. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220130190321.7172-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-31staging: r8188eu: remove HW_VAR_BEACON_INTERVALMichael Straube3-5/+1
Remove HW_VAR_BEACON_INTERVAL from SetHwReg8188EU() and call rtw_write16() directly. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220130190321.7172-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-31staging: r8188eu: convert rtw_p2p_got_wpsinfo to return voidAbdun Nihaal1-5/+3
rtw_p2p_got_wpsinfo always returns 0 and it's return value is not used. Convert it to return void. Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Abdun Nihaal <abdun.nihaal@gmail.com> Link: https://lore.kernel.org/r/f63e236e3a338789265172990fea049216115105.1643466748.git.abdun.nihaal@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-31staging: r8188eu: convert rtw_p2p_prov_disc to return voidAbdun Nihaal1-7/+5
rtw_p2p_prov_disc always returns 0 and it's return value is not used. Convert it to return void. Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Abdun Nihaal <abdun.nihaal@gmail.com> Link: https://lore.kernel.org/r/a6696ce2645a07ddd5b5eca21bcc04b196038e8e.1643466748.git.abdun.nihaal@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-31staging: r8188eu: convert rtw_p2p_set_persistent to return voidAbdun Nihaal1-6/+4
rtw_p2p_set_persistent always returns 0 and it's return value is not used. Convert it to return void. Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Abdun Nihaal <abdun.nihaal@gmail.com> Link: https://lore.kernel.org/r/2f23981bcdf4177327b9a29e88540380ef627aab.1643466748.git.abdun.nihaal@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-31staging: r8188eu: convert rtw_p2p_invite_req to return voidAbdun Nihaal1-7/+5
rtw_p2p_invite_req always returns 0 and it's return value is not used. Convert it to return void. Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Abdun Nihaal <abdun.nihaal@gmail.com> Link: https://lore.kernel.org/r/059a21d40a5c6cbe621ca969f9d32ea89bc9a977.1643466748.git.abdun.nihaal@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-31staging: r8188eu: convert rtw_p2p_get_op_ch to return voidAbdun Nihaal1-5/+3
rtw_p2p_get_op_ch always returns 0 and it's return value is not used. Convert it to return void. Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Abdun Nihaal <abdun.nihaal@gmail.com> Link: https://lore.kernel.org/r/c94caa66e738f254b7b1d967b3016975aa0df5d0.1643466748.git.abdun.nihaal@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-31staging: r8188eu: convert rtw_p2p_get_groupid to return voidAbdun Nihaal1-5/+3
rtw_p2p_get_groupid always returns 0 and it's return value is not used. Convert it to return void. Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Abdun Nihaal <abdun.nihaal@gmail.com> Link: https://lore.kernel.org/r/be08b2d84a7fc836db5aa008d906dee1b282fa54.1643466748.git.abdun.nihaal@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-31staging: r8188eu: convert rtw_p2p_get_peer_devaddr_by_invitation to return voidAbdun Nihaal1-5/+4
rtw_p2p_get_peer_devaddr_by_invitation always returns 0 and it's return value is not used. Convert it to return void. Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Abdun Nihaal <abdun.nihaal@gmail.com> Link: https://lore.kernel.org/r/06e2dce5de14c1abe457a40ec9ca597a06095437.1643466748.git.abdun.nihaal@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-31staging: r8188eu: convert rtw_p2p_get_peer_devaddr to return voidAbdun Nihaal1-5/+3
rtw_p2p_get_peer_devaddr always returns 0 and it's return value is not used. Convert it to return void. Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Abdun Nihaal <abdun.nihaal@gmail.com> Link: https://lore.kernel.org/r/cc077a7d11e4bda521294499c42164db7358b2e1.1643466748.git.abdun.nihaal@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-31staging: r8188eu: convert rtw_p2p_get_peer_ifaddr to return voidAbdun Nihaal1-5/+3
rtw_p2p_get_peer_ifaddr always returns 0 and it's return value is not used. Convert it to return void. Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Abdun Nihaal <abdun.nihaal@gmail.com> Link: https://lore.kernel.org/r/4a51963ce86a5f6bed4c07e545cd64091eeb0a8a.1643466748.git.abdun.nihaal@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-31staging: r8188eu: convert rtw_p2p_get_role to return voidAbdun Nihaal1-5/+3
rtw_p2p_get_role always returns 0 and it's return value is not used. Convert it to return void. Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Abdun Nihaal <abdun.nihaal@gmail.com> Link: https://lore.kernel.org/r/dcd4bba9910b172031ccc0f138c78e8471e36d91.1643466748.git.abdun.nihaal@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-31staging: r8188eu: convert rtw_p2p_get_req_cm to return voidAbdun Nihaal1-3/+1
rtw_p2p_get_req_cm always returns 0 and it's return value is not used. Convert it to return void. Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Abdun Nihaal <abdun.nihaal@gmail.com> Link: https://lore.kernel.org/r/a5940e6778431a4ce2d2e67543c59aae90464604.1643466748.git.abdun.nihaal@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-31staging: r8188eu: convert rtw_p2p_get_status to return voidAbdun Nihaal1-4/+1
rtw_p2p_get_status always returns 0 and it's return value is not used. Convert it to return void. Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Abdun Nihaal <abdun.nihaal@gmail.com> Link: https://lore.kernel.org/r/832c53cc201111449fccb40326084d20f676e722.1643466748.git.abdun.nihaal@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-31staging: r8188eu: convert rtw_p2p_setDN to return voidAbdun Nihaal1-6/+3
rtw_p2p_setDN always returns 0 and it's return value is not used. Convert it to return void. Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Abdun Nihaal <abdun.nihaal@gmail.com> Link: https://lore.kernel.org/r/fe4a9f0176c96ec327342c793de1f55c89d16768.1643466748.git.abdun.nihaal@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-31staging: r8188eu: convert rtw_p2p_set_go_nego_ssid to return voidAbdun Nihaal1-6/+3
rtw_p2p_set_go_nego_ssid always returns 0 and it's return value is not used. Convert it to return void. Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Abdun Nihaal <abdun.nihaal@gmail.com> Link: https://lore.kernel.org/r/90e2b3e4ff99131423c11b8f9206916791f742d9.1643466748.git.abdun.nihaal@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-31staging: r8188eu: propagate error code in rtw_p2p_get2Abdun Nihaal1-5/+5
rtw_p2p_get2 calls functions that can fail with -EFAULT. Return the error code from the called functions. Signed-off-by: Abdun Nihaal <abdun.nihaal@gmail.com> Link: https://lore.kernel.org/r/818aad89738b66942bb66568081f1953a9494078.1643466748.git.abdun.nihaal@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-31staging: r8188eu: remove unneeded variable in rtw_p2p_get_invitation_procedureAbdun Nihaal1-2/+1
Remove unneeded return variable that is initialized to 0 and not assigned after. Found using Coccinelle Signed-off-by: Abdun Nihaal <abdun.nihaal@gmail.com> Link: https://lore.kernel.org/r/ccec1f682fbc623381519610284530f940122d0e.1643466748.git.abdun.nihaal@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-31staging: r8188eu: remove unneeded variable in rtw_p2p_get_device_nameAbdun Nihaal1-2/+1
Remove unneeded return variable that is initialized to 0 and not assigned after. Found using Coccinelle Signed-off-by: Abdun Nihaal <abdun.nihaal@gmail.com> Link: https://lore.kernel.org/r/d94c3029128b9c094bf4e0b2e4574a177aef46e9.1643466748.git.abdun.nihaal@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-31staging: r8188eu: remove unneeded variable in rtw_p2p_get_device_typeAbdun Nihaal1-2/+1
Remove unneeded return variable that is initialized to 0 and not assigned after. Found using Coccinelle Signed-off-by: Abdun Nihaal <abdun.nihaal@gmail.com> Link: https://lore.kernel.org/r/83609e3c75a0bde4be612d32d76eaed6a26f72aa.1643466748.git.abdun.nihaal@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-31staging: r8188eu: remove unneeded variable in rtw_p2p_get_go_device_addressAbdun Nihaal1-2/+1
Remove unneeded return variable that is initialized to 0 and not assigned after. Found using Coccinelle Signed-off-by: Abdun Nihaal <abdun.nihaal@gmail.com> Link: https://lore.kernel.org/r/26a84fbef7e06d518efc29d2cd9e3dd685c96e0d.1643466748.git.abdun.nihaal@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-31staging: r8188eu: remove unneeded variable in rtw_p2p_get_wps_configmethodAbdun Nihaal1-2/+1
Remove unneeded return variable that is initialized to 0 and not assigned after. Found using Coccinelle Signed-off-by: Abdun Nihaal <abdun.nihaal@gmail.com> Link: https://lore.kernel.org/r/ae35e6f6f603ef83c2bad685ac247273041bd138.1643466748.git.abdun.nihaal@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-31staging: r8188eu: remove unneeded variable in rtw_p2p_getAbdun Nihaal1-3/+1
Remove unneeded return variable that is initialized to 0 and not assigned after. Found using Coccinelle Signed-off-by: Abdun Nihaal <abdun.nihaal@gmail.com> Link: https://lore.kernel.org/r/6c992e9481c7481aa5931635e162dd7a4400a2e2.1643466748.git.abdun.nihaal@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-31staging: r8188eu: remove unneeded variable in rtw_wx_get_encAbdun Nihaal1-2/+2
Remove unneeded return variable that is initialized to 0 and not assigned after. Found using Coccinelle Signed-off-by: Abdun Nihaal <abdun.nihaal@gmail.com> Link: https://lore.kernel.org/r/e31a2b15673497cbd70bf62b0093f46952cc7596.1643466748.git.abdun.nihaal@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-31staging: r8188eu: remove unneeded variable in rtw_wx_get_essidAbdun Nihaal1-2/+2
Remove unneeded return variable that is initialized to 0 and not assigned after. Found using Coccinelle Signed-off-by: Abdun Nihaal <abdun.nihaal@gmail.com> Link: https://lore.kernel.org/r/d0208689dffce91c52afbd5938b2704a8b1b554e.1643466748.git.abdun.nihaal@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-31staging: rt8188eu: Remove dead codeMuhammad Usama Anjum1-3/+0
rtStatus is _SUCCESS when the execution reaches this if condition. Remove the dead code. Fixes: 67396d2dfef3 ("staging: r8188eu: merge ODM_ConfigBBWithHeaderFile with its callers") Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Martin Kaiser <martin@kaiser.cx> Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com> Link: https://lore.kernel.org/r/20220128111954.1028121-1-usama.anjum@collabora.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-31staging: r8188eu: remove hal_init_macaddr()Michael Straube4-23/+12
hal_init_macaddr() is just a wrapper around SetHwReg8188EU() which calls hw_var_set_macaddr(). Remove hal_init_macaddr(), remove the HW_VAR_MAC_ADDR case from SetHwReg8188EU() and call hw_var_set_macaddr() directly. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220130111219.6390-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-31staging: r8188eu: remove unused parameter from hw_var_set_*Michael Straube1-8/+8
Remove the unused parameter 'variable' from hw_var_set_* functions. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220130111219.6390-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-31staging: r8188eu: remove c2h_evt_clear()Michael Straube3-8/+2
Function c2h_evt_clear() is just a wrapper around rtw_write8(). Remove c2h_evt_clear() and call rtw_write8() directly. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220130111219.6390-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-31staging: pi433: remove coding style item from the TODO filePaulo Miguel Almeida3-10/+6
After several patches sent by the community along the last couple of years, it's possible to remove the coding style item from the TODO file in the driver's folder. This patch addresses the last code formatting inconsistences and remove the coding style item from the TODO file. Signed-off-by: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com> Link: https://lore.kernel.org/r/YfYdVokxsQ+Adl+T@mail.google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-31staging: r8188eu: remove IS_*_CUT macrosMichael Straube2-26/+16
Remove the IS_*_CUT macros from HalVerDef.h. They are not needed, we can use a switch on chip_vers.CUTVersion directly in dump_chip_info() Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220128115445.6606-7-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-31staging: r8188eu: convert SetHalDefVar8188EUsb() to voidMichael Straube2-6/+2
The return value of SetHalDefVar8188EUsb() is not used. Convert the function to void. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220128115445.6606-6-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-31staging: r8188eu: convert GetHalDefVar8188EUsb() to voidMichael Straube2-6/+2
The return value of GetHalDefVar8188EUsb() is not used. Convert the function to void. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220128115445.6606-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-31staging: r8188eu: max_rx_ampdu_factor is always MAX_AMPDU_FACTOR_64KMichael Straube5-32/+3
The local variable max_rx_ampdu_factor in rtw_restructure_ht_ie() and issue_action_BA() is always set to MAX_AMPDU_FACTOR_64K. Remove the variable from both functions and use MAX_AMPDU_FACTOR_64K directly. The case HW_VAR_MAX_RX_AMPDU_FACTOR in GetHalDefVar8188EUsb() is now unused and can be removed. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220128115445.6606-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-31staging: r8188eu: remove unused cases from GetHalDefVar8188EUsb()Michael Straube2-25/+0
GetHalDefVar8188EUsb() is never called with HAL_DEF_DRVINFO_SZ, HAL_DEF_RA_DECISION_RATE, HAL_DEF_RA_SGI and HAL_DEF_PT_PWR_STATUS. Remove these cases from the function. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220128115445.6606-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-31staging: r8188eu: rx_packet_offset and max_recvbuf_sz are write-onlyMichael Straube3-12/+0
The local variables rx_packet_offset and max_recvbuf_sz in rtw_restructure_ht_ie() are set but never used. Remove them. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220128115445.6606-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-28media: v4l2-fwnode: Move bus config structure to v4l2_mediabus.hLaurent Pinchart3-3/+3
To prepare for usage of the v4l2_fwnode_bus_* data structures to describe bus configuration in the subdev .get_mbus_config() operation, rename the structures with a v4l2_mbus_config_ prefix instead of v4l2_fwnode_bus_, and move them to v4l2_mediabus.h. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-01-28media: hantro: jpeg: Remove open-coded size in quantization table codeChen-Yu Tsai1-3/+11
The quantization tables used in the Hantro JPEG encoder driver are implicitly sized by the data they contain, but the loop that scales the tables based on the compression quality hard codes the size to 64. No code exists to check whether the two actually match. Commit 85bdcb7eaae7 ("media: hantro: Write the quantization tables in proper order") introduced two new tables, with sizes hardcoded to 64, but still no checking if all the sizes are the same. Commit 41479adb5e52 ("media: hantro: Avoid global variable for jpeg quantization tables") added the macro JPEG_QUANT_SIZE, but only the newly added fields used this. This has resulted in code scattered with magic numbers and array sizes that happen to match up, without any sort of sanity checking to enforce it. Drop the hard-coded array sizes, replace the magic loop count with a proper JPEG_QUANT_SIZE macro, and add BUILD_BUG_ON()s to check that all the table sizes match up. Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-01-28media: hantro: output encoded JPEG content directly to capture buffersChen-Yu Tsai8-87/+34
Now that the JPEG header length is aligned with bus access boundaries, the JPEG encoder can output to the capture buffers directly without going through a bounce buffer. Do just that, and get rid of all the bounce buffer related code. Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-01-28media: hantro: Implement V4L2_CID_JPEG_ACTIVE_MARKER controlChen-Yu Tsai1-0/+21
The Hantro JPEG encoder driver adds various segments to the JPEG header. While it would be quite complicated to make these segments selectable to userspace, given that the driver has to fill in various fields in these segments, and also take care of alignment, it would be nice if the driver could signal to userspace what segments are included. Implement the V4L2_CID_JPEG_ACTIVE_MARKER control, and make it read only so that it always returns the set of segments that the driver adds. Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-01-28media: hantro: jpeg: Add COM segment to JPEG header to align image scanChen-Yu Tsai2-2/+23
The JPEG header size is not 64-bit aligned. This makes the driver require a bounce buffer for the encoded JPEG image scan output. Add a COM (comment) segment to the JPEG header so that the header size is a multiple of 64 bits. This will then allow dropping the use of the bounce buffer, and instead have the hardware write out to the capture buffer directly. Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-01-28media: hantro: jpeg: Add JFIF APP0 segment to JPEG encoder outputChen-Yu Tsai2-9/+14
While the V4L2_PIX_FMT_JPEG format doesn't specify any requirements for the APP0 or APP1 segments, it would be nice if the output is JFIF compliant. While some programs can read JPEG streams that aren't, some guess work is involved. Add the standard JFIF APP0 segment to the JPEG header, so that the JPEG encoder output is JFIF compliant. Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-01-28media: hantro: Support cropping visible area for encodersChen-Yu Tsai4-13/+101
Encoders typically operate on macroblocks. Thus their output or coded resolution is constrained to multiples of macroblocks. For frame sizes not aligned to macroblocks, cropping is needed to limit the visible area of the frame. Add support for cropping on the output (source) side for encoders, using the selection API. Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-01-28media: hantro: Fix overfill bottom register field nameChen-Yu Tsai2-2/+2
The Hantro H1 hardware can crop off pixels from the right and bottom of the source frame. These are controlled with the H1_REG_IN_IMG_CTRL_OVRFLB and H1_REG_IN_IMG_CTRL_OVRFLR in the H1_REG_IN_IMG_CTRL register. The ChromeOS kernel driver that this was based on incorrectly added the _D4 suffix H1_REG_IN_IMG_CTRL_OVRFLB. This field crops the bottom of the input frame, and the number is _not_ divided by 4. [1] Correct the name to avoid confusion when crop support with the selection API is added. [1] https://chromium.googlesource.com/chromiumos/third_party/kernel/+/refs/ \ heads/chromeos-4.19/drivers/staging/media/hantro/hantro_h1_vp8_enc.c#377 Fixes: 775fec69008d ("media: add Rockchip VPU JPEG encoder driver") Fixes: a29add8c9bb2 ("media: rockchip/vpu: rename from rockchip to hantro") Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-01-28media: imx: imx7-media-csi: add support for imx8mqMartin Kepplinger1-2/+30
Modeled after the NXP driver mx6s_capture.c that this driver is based on, imx8mq needs different settings for the baseaddr_switch mechanism. Define the needed bits and set that for imx8mq. Without these settings, the system will "sometimes" hang completely when starting to stream (the interrupt will never be called). Signed-off-by: Martin Kepplinger <martin.kepplinger@puri.sm> Acked-by: Rui Miguel Silva <rmfrfs@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-01-28media: meson: vdec: potential dereference of null pointerJiasheng Jiang3-5/+14
As the possible failure of the kzalloc(), the 'new_ts' could be NULL pointer. Therefore, it should be better to check it in order to avoid the dereference of the NULL pointer. Also, the caller esparser_queue() needs to deal with the return value of the amvdec_add_ts(). Fixes: 876f123b8956 ("media: meson: vdec: bring up to compliance") Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn> Suggested-by: Neil Armstrong <narmstrong@baylibre.com> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-01-26staging: mt7621-dts: align resets with binding documentationSergio Paracuellos1-12/+9
Binding documentation for compatible 'mediatek,mt7621-sysc' has been updated to be used as a reset provider. Align reset related bits and system controller node with binding documentation along the dtsi file. Tested-by: Arınç ÜNAL <arinc.unal@arinc9.com> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Link: https://lore.kernel.org/r/20220110114930.1406665-5-sergio.paracuellos@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-26staging: unisys: visorinput: Use struct_size() helper in kzalloc()Gustavo A. R. Silva1-1/+2
Make use of the struct_size() helper instead of an open-coded version, in order to avoid any potential type mistakes or integer overflows that, in the worst scenario, could lead to heap overflows. Also, address the following sparse warnings: drivers/staging/unisys/visorinput/visorinput.c:409:27: warning: using sizeof on a flexible structure Link: https://github.com/KSPP/linux/issues/174 Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> Link: https://lore.kernel.org/r/20220125223443.GA76937@embeddedor Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-26staging: mt7621-dts: fix pinctrl properties for ethernetArınç ÜNAL2-15/+14
Add pinctrl properties with rgmii1 & mdio pins under ethernet node which was wrongfully put under an external phy node. GMAC1 will start working with this fix. Link: https://lore.kernel.org/netdev/02ecce91-7aad-4392-c9d7-f45ca1b31e0b@arinc9.com/T/ Move GB-PC2 specific phy_external node to its own device tree. Reviewed-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com> Link: https://lore.kernel.org/r/20220125153903.1469-5-arinc.unal@arinc9.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>