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