2 * Support for Intel Camera Imaging ISP subsystem.
3 * Copyright (c) 2010-2015, Intel Corporation.
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.
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
15 #ifndef __INPUT_SYSTEM_PRIVATE_H_INCLUDED__
16 #define __INPUT_SYSTEM_PRIVATE_H_INCLUDED__
18 #include "input_system_public.h"
20 #include "device_access.h"
22 #include "assert_support.h"
24 STORAGE_CLASS_INPUT_SYSTEM_C
void input_system_reg_store(
25 const input_system_ID_t ID
,
26 const hrt_address reg
,
29 assert(ID
< N_INPUT_SYSTEM_ID
);
30 assert(INPUT_SYSTEM_BASE
[ID
] != (hrt_address
)-1);
31 ia_css_device_store_uint32(INPUT_SYSTEM_BASE
[ID
] + reg
*sizeof(hrt_data
), value
);
35 STORAGE_CLASS_INPUT_SYSTEM_C hrt_data
input_system_reg_load(
36 const input_system_ID_t ID
,
37 const hrt_address reg
)
39 assert(ID
< N_INPUT_SYSTEM_ID
);
40 assert(INPUT_SYSTEM_BASE
[ID
] != (hrt_address
)-1);
41 return ia_css_device_load_uint32(INPUT_SYSTEM_BASE
[ID
] + reg
*sizeof(hrt_data
));
44 STORAGE_CLASS_INPUT_SYSTEM_C
void receiver_reg_store(
46 const hrt_address reg
,
50 assert(RX_BASE
[ID
] != (hrt_address
)-1);
51 ia_css_device_store_uint32(RX_BASE
[ID
] + reg
*sizeof(hrt_data
), value
);
55 STORAGE_CLASS_INPUT_SYSTEM_C hrt_data
receiver_reg_load(
57 const hrt_address reg
)
60 assert(RX_BASE
[ID
] != (hrt_address
)-1);
61 return ia_css_device_load_uint32(RX_BASE
[ID
] + reg
*sizeof(hrt_data
));
64 STORAGE_CLASS_INPUT_SYSTEM_C
void receiver_port_reg_store(
66 const mipi_port_ID_t port_ID
,
67 const hrt_address reg
,
71 assert(port_ID
< N_MIPI_PORT_ID
);
72 assert(RX_BASE
[ID
] != (hrt_address
)-1);
73 assert(MIPI_PORT_OFFSET
[port_ID
] != (hrt_address
)-1);
74 ia_css_device_store_uint32(RX_BASE
[ID
] + MIPI_PORT_OFFSET
[port_ID
] + reg
*sizeof(hrt_data
), value
);
78 STORAGE_CLASS_INPUT_SYSTEM_C hrt_data
receiver_port_reg_load(
80 const mipi_port_ID_t port_ID
,
81 const hrt_address reg
)
84 assert(port_ID
< N_MIPI_PORT_ID
);
85 assert(RX_BASE
[ID
] != (hrt_address
)-1);
86 assert(MIPI_PORT_OFFSET
[port_ID
] != (hrt_address
)-1);
87 return ia_css_device_load_uint32(RX_BASE
[ID
] + MIPI_PORT_OFFSET
[port_ID
] + reg
*sizeof(hrt_data
));
90 STORAGE_CLASS_INPUT_SYSTEM_C
void input_system_sub_system_reg_store(
91 const input_system_ID_t ID
,
92 const sub_system_ID_t sub_ID
,
93 const hrt_address reg
,
96 assert(ID
< N_INPUT_SYSTEM_ID
);
97 assert(sub_ID
< N_SUB_SYSTEM_ID
);
98 assert(INPUT_SYSTEM_BASE
[ID
] != (hrt_address
)-1);
99 assert(SUB_SYSTEM_OFFSET
[sub_ID
] != (hrt_address
)-1);
100 ia_css_device_store_uint32(INPUT_SYSTEM_BASE
[ID
] + SUB_SYSTEM_OFFSET
[sub_ID
] + reg
*sizeof(hrt_data
), value
);
104 STORAGE_CLASS_INPUT_SYSTEM_C hrt_data
input_system_sub_system_reg_load(
105 const input_system_ID_t ID
,
106 const sub_system_ID_t sub_ID
,
107 const hrt_address reg
)
109 assert(ID
< N_INPUT_SYSTEM_ID
);
110 assert(sub_ID
< N_SUB_SYSTEM_ID
);
111 assert(INPUT_SYSTEM_BASE
[ID
] != (hrt_address
)-1);
112 assert(SUB_SYSTEM_OFFSET
[sub_ID
] != (hrt_address
)-1);
113 return ia_css_device_load_uint32(INPUT_SYSTEM_BASE
[ID
] + SUB_SYSTEM_OFFSET
[sub_ID
] + reg
*sizeof(hrt_data
));
116 #endif /* __INPUT_SYSTEM_PRIVATE_H_INCLUDED__ */