2 * Support for Intel Camera Imaging ISP subsystem.
3 * Copyright (c) 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 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)
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]);
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]);
42 /* get the states of all pixelgen devices */
43 for (i = 0; i < N_PIXELGEN_ID; i++) {
44 pixelgen_ctrl_get_state(
46 &state->pixelgen_ctrl_state[i]);
49 /* get the states of all stream2mmio devices */
50 for (i = 0; i < N_STREAM2MMIO_ID; i++) {
51 stream2mmio_get_state(
53 &state->stream2mmio_state[i]);
56 /* get the states of all ibuf-controller devices */
57 for (i = 0; i < N_IBUF_CTRL_ID; i++) {
60 &state->ibuf_ctrl_state[i]);
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]);
68 /* TODO: get the states of all ISYS2401 DMA devices */
69 for (i = 0; i < N_ISYS2401_DMA_ID; i++) {
72 return INPUT_SYSTEM_ERR_NO_ERROR;
75 STORAGE_CLASS_INPUT_SYSTEM_C void input_system_dump_state(
76 const input_system_ID_t ID,
77 input_system_state_t *state)
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]);
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]);
97 /* dump the states of all pixelgen devices */
98 for (i = 0; i < N_PIXELGEN_ID; i++) {
99 pixelgen_ctrl_dump_state(
101 &state->pixelgen_ctrl_state[i]);
104 /* dump the states of all st2mmio devices */
105 for (i = 0; i < N_STREAM2MMIO_ID; i++) {
106 stream2mmio_dump_state(
108 &state->stream2mmio_state[i]);
111 /* dump the states of all ibuf-controller devices */
112 for (i = 0; i < N_IBUF_CTRL_ID; i++) {
113 ibuf_ctrl_dump_state(
115 &state->ibuf_ctrl_state[i]);
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]);
123 /* TODO: dump the states of all ISYS2401 DMA devices */
124 for (i = 0; i < N_ISYS2401_DMA_ID; i++) {
129 #endif /* __INPUT_SYSTEM_PRIVATE_H_INCLUDED__ */