2f42a9c2771ce65676a1b93aaecdace3d430c1ca
[linux.git] /
1 /*
2  * Support for Intel Camera Imaging ISP subsystem.
3  * Copyright (c) 2010-2015, Intel Corporation.
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms and conditions of the GNU General Public License,
7  * version 2, as published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
12  * more details.
13  */
14
15 #ifndef __INPUT_FORMATTER_PRIVATE_H_INCLUDED__
16 #define __INPUT_FORMATTER_PRIVATE_H_INCLUDED__
17
18 #include "input_formatter_public.h"
19
20 #include "device_access.h"
21
22 #include "assert_support.h"
23
24 STORAGE_CLASS_INPUT_FORMATTER_C void input_formatter_reg_store(
25         const input_formatter_ID_t              ID,
26         const hrt_address                       reg_addr,
27         const hrt_data                          value)
28 {
29         assert(ID < N_INPUT_FORMATTER_ID);
30         assert(INPUT_FORMATTER_BASE[ID] != (hrt_address)-1);
31         assert((reg_addr % sizeof(hrt_data)) == 0);
32         ia_css_device_store_uint32(INPUT_FORMATTER_BASE[ID] + reg_addr, value);
33         return;
34 }
35
36 STORAGE_CLASS_INPUT_FORMATTER_C hrt_data input_formatter_reg_load(
37         const input_formatter_ID_t      ID,
38         const unsigned int                      reg_addr)
39 {
40         assert(ID < N_INPUT_FORMATTER_ID);
41         assert(INPUT_FORMATTER_BASE[ID] != (hrt_address)-1);
42         assert((reg_addr % sizeof(hrt_data)) == 0);
43         return ia_css_device_load_uint32(INPUT_FORMATTER_BASE[ID] + reg_addr);
44 }
45
46 #endif /* __INPUT_FORMATTER_PRIVATE_H_INCLUDED__ */