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