mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 18:13:41 +02:00
media: nxp: imx8-isi: Refine code by using helper macro
Make code more readable and easier to maintain by using the FIELD_PREP and GENMASK() macros. While at it, replace spaces with tabs for macro indentation. No functional changes. Reviewed-by: Frank Li <Frank.Li@nxp.com> Signed-off-by: Guoniu Zhou <guoniu.zhou@nxp.com> Link: https://patch.msgid.link/20250905-isi_imx93-v2-2-37db5f768c57@nxp.com Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
This commit is contained in:
parent
014619ac2c
commit
556e65b535
|
|
@ -3,6 +3,8 @@
|
|||
* Copyright 2019-2023 NXP
|
||||
*/
|
||||
|
||||
#include <linux/bitfield.h>
|
||||
#include <linux/bits.h>
|
||||
#include <linux/regmap.h>
|
||||
|
||||
#include <media/mipi-csi2.h>
|
||||
|
|
@ -16,8 +18,7 @@
|
|||
#define GASKET_BASE(n) (0x0060 + (n) * 0x30)
|
||||
|
||||
#define GASKET_CTRL 0x0000
|
||||
#define GASKET_CTRL_DATA_TYPE(dt) ((dt) << 8)
|
||||
#define GASKET_CTRL_DATA_TYPE_MASK (0x3f << 8)
|
||||
#define GASKET_CTRL_DATA_TYPE(dt) FIELD_PREP(GENMASK(13, 8), dt)
|
||||
#define GASKET_CTRL_DUAL_COMP_ENABLE BIT(1)
|
||||
#define GASKET_CTRL_ENABLE BIT(0)
|
||||
|
||||
|
|
@ -57,9 +58,9 @@ const struct mxc_gasket_ops mxc_imx8_gasket_ops = {
|
|||
* i.MX93 gasket
|
||||
*/
|
||||
|
||||
#define DISP_MIX_CAMERA_MUX 0x30
|
||||
#define DISP_MIX_CAMERA_MUX_DATA_TYPE(x) (((x) & 0x3f) << 3)
|
||||
#define DISP_MIX_CAMERA_MUX_GASKET_ENABLE BIT(16)
|
||||
#define DISP_MIX_CAMERA_MUX 0x30
|
||||
#define DISP_MIX_CAMERA_MUX_DATA_TYPE(x) FIELD_PREP(GENMASK(8, 3), x)
|
||||
#define DISP_MIX_CAMERA_MUX_GASKET_ENABLE BIT(16)
|
||||
|
||||
static void mxc_imx93_gasket_enable(struct mxc_isi_dev *isi,
|
||||
const struct v4l2_mbus_frame_desc *fd,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user