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 __GPIO_PRIVATE_H_INCLUDED__
17 #define __GPIO_PRIVATE_H_INCLUDED__
18
19 #include "assert_support.h"
20 #include "device_access.h"
21
gpio_reg_store(const gpio_ID_t ID,const unsigned int reg,const hrt_data value)22 static inline void gpio_reg_store(
23 const gpio_ID_t ID,
24 const unsigned int reg,
25 const hrt_data value)
26 {
27 OP___assert(ID < N_GPIO_ID);
28 OP___assert(GPIO_BASE[ID] != (hrt_address) - 1);
29 ia_css_device_store_uint32(GPIO_BASE[ID] + reg * sizeof(hrt_data), value);
30 return;
31 }
32
gpio_reg_load(const gpio_ID_t ID,const unsigned int reg)33 static inline hrt_data gpio_reg_load(
34 const gpio_ID_t ID,
35 const unsigned int reg)
36 {
37 OP___assert(ID < N_GPIO_ID);
38 OP___assert(GPIO_BASE[ID] != (hrt_address) - 1);
39 return ia_css_device_load_uint32(GPIO_BASE[ID] + reg * sizeof(hrt_data));
40 }
41
42 #endif /* __GPIO_PRIVATE_H_INCLUDED__ */
43