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 __GPIO_PRIVATE_H_INCLUDED__
8 #define __GPIO_PRIVATE_H_INCLUDED__
9 
10 #include "assert_support.h"
11 #include "device_access.h"
12 
gpio_reg_store(const gpio_ID_t ID,const unsigned int reg,const hrt_data value)13 static inline void gpio_reg_store(
14     const gpio_ID_t	ID,
15     const unsigned int		reg,
16     const hrt_data			value)
17 {
18 	OP___assert(ID < N_GPIO_ID);
19 	OP___assert(GPIO_BASE[ID] != (hrt_address) - 1);
20 	ia_css_device_store_uint32(GPIO_BASE[ID] + reg * sizeof(hrt_data), value);
21 	return;
22 }
23 
gpio_reg_load(const gpio_ID_t ID,const unsigned int reg)24 static inline hrt_data gpio_reg_load(
25     const gpio_ID_t	ID,
26     const unsigned int		reg)
27 {
28 	OP___assert(ID < N_GPIO_ID);
29 	OP___assert(GPIO_BASE[ID] != (hrt_address) - 1);
30 	return ia_css_device_load_uint32(GPIO_BASE[ID] + reg * sizeof(hrt_data));
31 }
32 
33 #endif /* __GPIO_PRIVATE_H_INCLUDED__ */
34