• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #ifndef __SYSTEM_INTERRUPTS_H__
21 #define __SYSTEM_INTERRUPTS_H__
22 
23 #include "acamera_types.h"
24 
25 #define ACAMERA_IRQ_COUNT 32
26 
27 #define ACAMERA_IRQ_MASK( num ) ( 1 << num )
28 
29 typedef uint32_t system_fw_interrupt_mask_t;
30 
31 typedef void ( *system_interrupt_handler_t )( void *ptr, uint32_t mask );
32 
33 
34 /**
35  *   Initialize system interrupts
36  *
37  *   This function initializes system dependent interrupt functionality
38  *
39  *   @return none
40  */
41 void system_interrupts_init( void );
42 
43 
44 /**
45  *   Set an interrupt handler
46  *
47  *   This function is used by application to set an interrupt handler for all ISP related interrupt events.
48  *
49  *   @param
50  *          handler - a callback to handle interrupts
51  *          param - pointer to a context which must be send to interrupt handler
52  *
53  *   @return none
54  */
55 void system_interrupt_set_handler( system_interrupt_handler_t handler, void *param );
56 
57 
58 /**
59  *   Enable system interrupts
60  *
61  *   This function is used by firmware to enable system interrupts in a case if they were disabled before
62  *
63  *   @return none
64  */
65 void system_interrupts_enable( void );
66 
67 
68 /**
69  *   Disable system interrupts
70  *
71  *   This function is used by firmware to disable system interrupts for a short period of time.
72  *   Usually IRQ register is updated by new interrupts but main interrupt handler is not called by a system.
73  *
74  *   @return none
75  */
76 void system_interrupts_disable( void );
77 
78 #endif /* __SYSTEM_INTERRUPTS_H__ */
79