GNU Linux-libre 4.14.266-gnu1
[releases.git] / drivers / staging / media / atomisp / pci / atomisp2 / css2400 / css_2401_csi2p_system / host / input_system_private.h
1 /*
2  * Support for Intel Camera Imaging ISP subsystem.
3  * Copyright (c) 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_SYSTEM_PRIVATE_H_INCLUDED__
16 #define __INPUT_SYSTEM_PRIVATE_H_INCLUDED__
17
18 #include "input_system_public.h"
19
20 STORAGE_CLASS_INPUT_SYSTEM_C input_system_err_t input_system_get_state(
21         const input_system_ID_t ID,
22         input_system_state_t *state)
23 {
24         uint32_t i;
25
26         (void)(ID);
27
28         /*  get the states of all CSI RX frontend devices */
29         for (i = 0; i < N_CSI_RX_FRONTEND_ID; i++) {
30                 csi_rx_fe_ctrl_get_state(
31                                 (csi_rx_frontend_ID_t)i,
32                                 &(state->csi_rx_fe_ctrl_state[i]));
33         }
34
35         /*  get the states of all CIS RX backend devices */
36         for (i = 0; i < N_CSI_RX_BACKEND_ID; i++) {
37                 csi_rx_be_ctrl_get_state(
38                                 (csi_rx_backend_ID_t)i,
39                                 &(state->csi_rx_be_ctrl_state[i]));
40         }
41
42         /* get the states of all pixelgen devices */
43         for (i = 0; i < N_PIXELGEN_ID; i++) {
44                 pixelgen_ctrl_get_state(
45                                 (pixelgen_ID_t)i,
46                                 &(state->pixelgen_ctrl_state[i]));
47         }
48
49         /* get the states of all stream2mmio devices */
50         for (i = 0; i < N_STREAM2MMIO_ID; i++) {
51                 stream2mmio_get_state(
52                                 (stream2mmio_ID_t)i,
53                                 &(state->stream2mmio_state[i]));
54         }
55
56         /* get the states of all ibuf-controller devices */
57         for (i = 0; i < N_IBUF_CTRL_ID; i++) {
58                 ibuf_ctrl_get_state(
59                                 (ibuf_ctrl_ID_t)i,
60                                 &(state->ibuf_ctrl_state[i]));
61         }
62
63         /* get the states of all isys irq controllers */
64         for (i = 0; i < N_ISYS_IRQ_ID; i++) {
65                 isys_irqc_state_get((isys_irq_ID_t)i, &(state->isys_irqc_state[i]));
66         }
67
68         /* TODO: get the states of all ISYS2401 DMA devices  */
69         for (i = 0; i < N_ISYS2401_DMA_ID; i++) {
70         }
71
72         return INPUT_SYSTEM_ERR_NO_ERROR;
73 }
74 STORAGE_CLASS_INPUT_SYSTEM_C void input_system_dump_state(
75         const input_system_ID_t ID,
76         input_system_state_t *state)
77 {
78         uint32_t i;
79
80         (void)(ID);
81
82         /*  dump the states of all CSI RX frontend devices */
83         for (i = 0; i < N_CSI_RX_FRONTEND_ID; i++) {
84                 csi_rx_fe_ctrl_dump_state(
85                                 (csi_rx_frontend_ID_t)i,
86                                 &(state->csi_rx_fe_ctrl_state[i]));
87         }
88
89         /*  dump the states of all CIS RX backend devices */
90         for (i = 0; i < N_CSI_RX_BACKEND_ID; i++) {
91                 csi_rx_be_ctrl_dump_state(
92                                 (csi_rx_backend_ID_t)i,
93                                 &(state->csi_rx_be_ctrl_state[i]));
94         }
95
96         /* dump the states of all pixelgen devices */
97         for (i = 0; i < N_PIXELGEN_ID; i++) {
98                 pixelgen_ctrl_dump_state(
99                                 (pixelgen_ID_t)i,
100                                 &(state->pixelgen_ctrl_state[i]));
101         }
102
103         /* dump the states of all st2mmio devices */
104         for (i = 0; i < N_STREAM2MMIO_ID; i++) {
105                 stream2mmio_dump_state(
106                                 (stream2mmio_ID_t)i,
107                                 &(state->stream2mmio_state[i]));
108         }
109
110         /* dump the states of all ibuf-controller devices */
111         for (i = 0; i < N_IBUF_CTRL_ID; i++) {
112                 ibuf_ctrl_dump_state(
113                                 (ibuf_ctrl_ID_t)i,
114                                 &(state->ibuf_ctrl_state[i]));
115         }
116
117         /* dump the states of all isys irq controllers */
118         for (i = 0; i < N_ISYS_IRQ_ID; i++) {
119                 isys_irqc_state_dump((isys_irq_ID_t)i, &(state->isys_irqc_state[i]));
120         }
121
122         /* TODO: dump the states of all ISYS2401 DMA devices  */
123         for (i = 0; i < N_ISYS2401_DMA_ID; i++) {
124         }
125
126         return;
127 }
128 #endif /* __INPUT_SYSTEM_PRIVATE_H_INCLUDED__ */