Commit 34516204 authored by Fabio Estevam's avatar Fabio Estevam Committed by Mauro Carvalho Chehab

media: imx7-media-csi: Use functions instead of macros

Currently there is a macro for reading and another macro for writing
to the CSI registers.

Functions can do parameter type checking, which leads to a safer code,
so switch from macro to function implementation.
Signed-off-by: default avatarFabio Estevam <festevam@gmail.com>
Reviewed-by: default avatarRui Miguel Silva <rmfrfs@gmail.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 2b0287ef
......@@ -195,10 +195,16 @@ struct imx7_csi {
struct completion last_eof_completion;
};
#define imx7_csi_reg_read(_csi, _offset) \
__raw_readl((_csi)->regbase + (_offset))
#define imx7_csi_reg_write(_csi, _val, _offset) \
__raw_writel(_val, (_csi)->regbase + (_offset))
static u32 imx7_csi_reg_read(struct imx7_csi *csi, unsigned int offset)
{
return readl(csi->regbase + offset);
}
static void imx7_csi_reg_write(struct imx7_csi *csi, unsigned int value,
unsigned int offset)
{
writel(value, csi->regbase + offset);
}
static void imx7_csi_hw_reset(struct imx7_csi *csi)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment