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 
7 #ifndef __GP_DEVICE_PRIVATE_H_INCLUDED__
8 #define __GP_DEVICE_PRIVATE_H_INCLUDED__
9 
10 #include "gp_device_public.h"
11 
12 #include "device_access.h"
13 
14 #include "assert_support.h"
15 
gp_device_reg_store(const gp_device_ID_t ID,const unsigned int reg_addr,const hrt_data value)16 STORAGE_CLASS_GP_DEVICE_C void gp_device_reg_store(
17     const gp_device_ID_t	ID,
18     const unsigned int		reg_addr,
19     const hrt_data			value)
20 {
21 	assert(ID < N_GP_DEVICE_ID);
22 	assert(GP_DEVICE_BASE[ID] != (hrt_address) - 1);
23 	assert((reg_addr % sizeof(hrt_data)) == 0);
24 	ia_css_device_store_uint32(GP_DEVICE_BASE[ID] + reg_addr, value);
25 	return;
26 }
27 
gp_device_reg_load(const gp_device_ID_t ID,const hrt_address reg_addr)28 STORAGE_CLASS_GP_DEVICE_C hrt_data gp_device_reg_load(
29     const gp_device_ID_t	ID,
30     const hrt_address	reg_addr)
31 {
32 	assert(ID < N_GP_DEVICE_ID);
33 	assert(GP_DEVICE_BASE[ID] != (hrt_address)-1);
34 	assert((reg_addr % sizeof(hrt_data)) == 0);
35 	return ia_css_device_load_uint32(GP_DEVICE_BASE[ID] + reg_addr);
36 }
37 
38 #endif /* __GP_DEVICE_PRIVATE_H_INCLUDED__ */
39