1 /*
2 *
3 * SPDX-License-Identifier: GPL-2.0
4 *
5 * Copyright (C) 2011-2018 ARM or its affiliates
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 *
18 */
19
20 #include "acamera_firmware_config.h"
21 #include "acamera_fw.h"
22
acamera_fsm_util_is_irq_event_ignored(fsm_irq_mask_t * p_mask,uint8_t irq_event)23 uint32_t acamera_fsm_util_is_irq_event_ignored( fsm_irq_mask_t *p_mask, uint8_t irq_event )
24 {
25 uint32_t ignore_irq = 1;
26 uint32_t fsm_mask;
27 uint32_t mask = 1 << irq_event;
28 fsm_mask = p_mask->irq_mask & mask;
29 if ( fsm_mask ) {
30 p_mask->irq_mask &= ( ~fsm_mask ) | ( p_mask->repeat_irq_mask );
31 ignore_irq = 0;
32 }
33
34 return ignore_irq;
35 }
36
acamera_fsm_util_get_cur_frame_id(fsm_common_t * p_cmn)37 uint32_t acamera_fsm_util_get_cur_frame_id( fsm_common_t *p_cmn )
38 {
39 uint32_t cur_frame_id = 0;
40 cur_frame_id = acamera_isp_isp_global_dbg_frame_cnt_ctx0_read( p_cmn->isp_base );
41 return cur_frame_id;
42 }
43