1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Support for Intel Camera Imaging ISP subsystem.
4  * Copyright (c) 2010-2015, Intel Corporation.
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms and conditions of the GNU General Public License,
8  * version 2, as published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
13  * more details.
14  */
15 
16 #ifndef __IRQ_PRIVATE_H_INCLUDED__
17 #define __IRQ_PRIVATE_H_INCLUDED__
18 
19 #include "irq_public.h"
20 
21 #include "device_access.h"
22 
23 #include "assert_support.h"
24 
irq_reg_store(const irq_ID_t ID,const unsigned int reg,const hrt_data value)25 STORAGE_CLASS_IRQ_C void irq_reg_store(
26     const irq_ID_t		ID,
27     const unsigned int	reg,
28     const hrt_data		value)
29 {
30 	assert(ID < N_IRQ_ID);
31 	assert(IRQ_BASE[ID] != (hrt_address) - 1);
32 	ia_css_device_store_uint32(IRQ_BASE[ID] + reg * sizeof(hrt_data), value);
33 	return;
34 }
35 
irq_reg_load(const irq_ID_t ID,const unsigned int reg)36 STORAGE_CLASS_IRQ_C hrt_data irq_reg_load(
37     const irq_ID_t		ID,
38     const unsigned int	reg)
39 {
40 	assert(ID < N_IRQ_ID);
41 	assert(IRQ_BASE[ID] != (hrt_address) - 1);
42 	return ia_css_device_load_uint32(IRQ_BASE[ID] + reg * sizeof(hrt_data));
43 }
44 
45 #endif /* __IRQ_PRIVATE_H_INCLUDED__ */
46