media: ti-vpe: cal: improve enable_irqs

IRQENABLE_SET registers are (usually) not meant to be read, only written
to. The current driver needlessly uses read-modify-write cycle to enable
IRQ bits.

The read-modify-write has no bad side effects here, but it's still
better to clean this up by only using write.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
Tomi Valkeinen 2020-03-25 13:14:53 +01:00 committed by Mauro Carvalho Chehab
parent 3dc4365ba8
commit 528649578a

View File

@ -706,16 +706,16 @@ static void cal_quickdump_regs(struct cal_dev *dev)
*/
static void enable_irqs(struct cal_ctx *ctx)
{
u32 val;
/* Enable IRQ_WDMA_END 0/1 */
reg_write_field(ctx->dev,
CAL_HL_IRQENABLE_SET(2),
CAL_HL_IRQ_ENABLE,
CAL_HL_IRQ_MASK(ctx->csi2_port));
val = 0;
set_field(&val, CAL_HL_IRQ_ENABLE, CAL_HL_IRQ_MASK(ctx->csi2_port));
reg_write(ctx->dev, CAL_HL_IRQENABLE_SET(2), val);
/* Enable IRQ_WDMA_START 0/1 */
reg_write_field(ctx->dev,
CAL_HL_IRQENABLE_SET(3),
CAL_HL_IRQ_ENABLE,
CAL_HL_IRQ_MASK(ctx->csi2_port));
val = 0;
set_field(&val, CAL_HL_IRQ_ENABLE, CAL_HL_IRQ_MASK(ctx->csi2_port));
reg_write(ctx->dev, CAL_HL_IRQENABLE_SET(3), val);
/* Todo: Add VC_IRQ and CSI2_COMPLEXIO_IRQ handling */
reg_write(ctx->dev, CAL_CSI2_VC_IRQENABLE(1), 0xFF000000);
}