Commit 24385f9c authored by Dafna Hirschfeld's avatar Dafna Hirschfeld Committed by Mauro Carvalho Chehab

media: staging: rkisp1: use a macro for the statistics flags mask

The mask of the ready statistics flags is used in
several places in the code using bitwise-or.
Use a macro for that to make the code more readable.
Signed-off-by: default avatarDafna Hirschfeld <dafna.hirschfeld@collabora.com>
Acked-by: default avatarHelen Koike <helen.koike@collabora.com>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent af30d4f3
...@@ -45,6 +45,10 @@ ...@@ -45,6 +45,10 @@
#define RKISP1_MAX_BUS_CLK 8 #define RKISP1_MAX_BUS_CLK 8
#define RKISP1_STATS_MEAS_MASK (RKISP1_CIF_ISP_AWB_DONE | \
RKISP1_CIF_ISP_AFM_FIN | \
RKISP1_CIF_ISP_EXP_END | \
RKISP1_CIF_ISP_HIST_MEASURE_RDY)
enum rkisp1_rsz_pad { enum rkisp1_rsz_pad {
RKISP1_RSZ_PAD_SINK, RKISP1_RSZ_PAD_SINK,
RKISP1_RSZ_PAD_SRC, RKISP1_RSZ_PAD_SRC,
......
...@@ -1139,10 +1139,7 @@ void rkisp1_isp_isr(struct rkisp1_device *rkisp1) ...@@ -1139,10 +1139,7 @@ void rkisp1_isp_isr(struct rkisp1_device *rkisp1)
/* New frame from the sensor received */ /* New frame from the sensor received */
isp_ris = rkisp1_read(rkisp1, RKISP1_CIF_ISP_RIS); isp_ris = rkisp1_read(rkisp1, RKISP1_CIF_ISP_RIS);
if (isp_ris & (RKISP1_CIF_ISP_AWB_DONE | if (isp_ris & RKISP1_STATS_MEAS_MASK)
RKISP1_CIF_ISP_AFM_FIN |
RKISP1_CIF_ISP_EXP_END |
RKISP1_CIF_ISP_HIST_MEASURE_RDY))
rkisp1_stats_isr(&rkisp1->stats, isp_ris); rkisp1_stats_isr(&rkisp1->stats, isp_ris);
} }
......
...@@ -396,26 +396,18 @@ void rkisp1_stats_isr(struct rkisp1_stats *stats, u32 isp_ris) ...@@ -396,26 +396,18 @@ void rkisp1_stats_isr(struct rkisp1_stats *stats, u32 isp_ris)
struct rkisp1_device *rkisp1 = stats->rkisp1; struct rkisp1_device *rkisp1 = stats->rkisp1;
struct rkisp1_isp_readout_work *work; struct rkisp1_isp_readout_work *work;
unsigned int isp_mis_tmp = 0; unsigned int isp_mis_tmp = 0;
u32 val;
spin_lock(&stats->irq_lock); spin_lock(&stats->irq_lock);
val = RKISP1_CIF_ISP_AWB_DONE | RKISP1_CIF_ISP_AFM_FIN | rkisp1_write(rkisp1, RKISP1_STATS_MEAS_MASK, RKISP1_CIF_ISP_ICR);
RKISP1_CIF_ISP_EXP_END | RKISP1_CIF_ISP_HIST_MEASURE_RDY;
rkisp1_write(rkisp1, val, RKISP1_CIF_ISP_ICR);
isp_mis_tmp = rkisp1_read(rkisp1, RKISP1_CIF_ISP_MIS); isp_mis_tmp = rkisp1_read(rkisp1, RKISP1_CIF_ISP_MIS);
if (isp_mis_tmp & if (isp_mis_tmp & RKISP1_STATS_MEAS_MASK)
(RKISP1_CIF_ISP_AWB_DONE | RKISP1_CIF_ISP_AFM_FIN |
RKISP1_CIF_ISP_EXP_END | RKISP1_CIF_ISP_HIST_MEASURE_RDY))
rkisp1->debug.stats_error++; rkisp1->debug.stats_error++;
if (!stats->is_streaming) if (!stats->is_streaming)
goto unlock; goto unlock;
if (isp_ris & (RKISP1_CIF_ISP_AWB_DONE | if (isp_ris & RKISP1_STATS_MEAS_MASK) {
RKISP1_CIF_ISP_AFM_FIN |
RKISP1_CIF_ISP_EXP_END |
RKISP1_CIF_ISP_HIST_MEASURE_RDY)) {
work = kzalloc(sizeof(*work), GFP_ATOMIC); work = kzalloc(sizeof(*work), GFP_ATOMIC);
if (work) { if (work) {
INIT_WORK(&work->work, INIT_WORK(&work->work,
......
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