361f6fb25395ede1e34323de21023b87bacfee67
[linux.git] /
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         u32 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
75 STORAGE_CLASS_INPUT_SYSTEM_C void input_system_dump_state(
76         const input_system_ID_t ID,
77         input_system_state_t *state)
78 {
79         u32 i;
80
81         (void)(ID);
82
83         /*  dump the states of all CSI RX frontend devices */
84         for (i = 0; i < N_CSI_RX_FRONTEND_ID; i++) {
85                 csi_rx_fe_ctrl_dump_state(
86                                 (csi_rx_frontend_ID_t)i,
87                                 &state->csi_rx_fe_ctrl_state[i]);
88         }
89
90         /*  dump the states of all CIS RX backend devices */
91         for (i = 0; i < N_CSI_RX_BACKEND_ID; i++) {
92                 csi_rx_be_ctrl_dump_state(
93                                 (csi_rx_backend_ID_t)i,
94                                 &state->csi_rx_be_ctrl_state[i]);
95         }
96
97         /* dump the states of all pixelgen devices */
98         for (i = 0; i < N_PIXELGEN_ID; i++) {
99                 pixelgen_ctrl_dump_state(
100                                 (pixelgen_ID_t)i,
101                                 &state->pixelgen_ctrl_state[i]);
102         }
103
104         /* dump the states of all st2mmio devices */
105         for (i = 0; i < N_STREAM2MMIO_ID; i++) {
106                 stream2mmio_dump_state(
107                                 (stream2mmio_ID_t)i,
108                                 &state->stream2mmio_state[i]);
109         }
110
111         /* dump the states of all ibuf-controller devices */
112         for (i = 0; i < N_IBUF_CTRL_ID; i++) {
113                 ibuf_ctrl_dump_state(
114                                 (ibuf_ctrl_ID_t)i,
115                                 &state->ibuf_ctrl_state[i]);
116         }
117
118         /* dump the states of all isys irq controllers */
119         for (i = 0; i < N_ISYS_IRQ_ID; i++) {
120                 isys_irqc_state_dump((isys_irq_ID_t)i, &state->isys_irqc_state[i]);
121         }
122
123         /* TODO: dump the states of all ISYS2401 DMA devices  */
124         for (i = 0; i < N_ISYS2401_DMA_ID; i++) {
125         }
126
127         return;
128 }
129 #endif /* __INPUT_SYSTEM_PRIVATE_H_INCLUDED__ */