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 __FIFO_MONITOR_PRIVATE_H_INCLUDED__
16 #define __FIFO_MONITOR_PRIVATE_H_INCLUDED__
18 #include "fifo_monitor_public.h"
20 #define __INLINE_GP_DEVICE__
21 #include "gp_device.h"
23 #include "device_access.h"
25 #include "assert_support.h"
27 #ifdef __INLINE_FIFO_MONITOR__
28 extern const unsigned int FIFO_SWITCH_ADDR[N_FIFO_SWITCH];
31 STORAGE_CLASS_FIFO_MONITOR_C void fifo_switch_set(
32 const fifo_monitor_ID_t ID,
33 const fifo_switch_t switch_id,
36 assert(ID == FIFO_MONITOR0_ID);
37 assert(FIFO_MONITOR_BASE[ID] != (hrt_address)-1);
38 assert(switch_id < N_FIFO_SWITCH);
41 gp_device_reg_store(GP_DEVICE0_ID, FIFO_SWITCH_ADDR[switch_id], sel);
46 STORAGE_CLASS_FIFO_MONITOR_C hrt_data fifo_switch_get(
47 const fifo_monitor_ID_t ID,
48 const fifo_switch_t switch_id)
50 assert(ID == FIFO_MONITOR0_ID);
51 assert(FIFO_MONITOR_BASE[ID] != (hrt_address)-1);
52 assert(switch_id < N_FIFO_SWITCH);
55 return gp_device_reg_load(GP_DEVICE0_ID, FIFO_SWITCH_ADDR[switch_id]);
59 STORAGE_CLASS_FIFO_MONITOR_C void fifo_monitor_reg_store(
60 const fifo_monitor_ID_t ID,
61 const unsigned int reg,
64 assert(ID < N_FIFO_MONITOR_ID);
65 assert(FIFO_MONITOR_BASE[ID] != (hrt_address)-1);
66 ia_css_device_store_uint32(FIFO_MONITOR_BASE[ID] + reg*sizeof(hrt_data), value);
70 STORAGE_CLASS_FIFO_MONITOR_C hrt_data fifo_monitor_reg_load(
71 const fifo_monitor_ID_t ID,
72 const unsigned int reg)
74 assert(ID < N_FIFO_MONITOR_ID);
75 assert(FIFO_MONITOR_BASE[ID] != (hrt_address)-1);
76 return ia_css_device_load_uint32(FIFO_MONITOR_BASE[ID] + reg*sizeof(hrt_data));
79 #endif /* __FIFO_MONITOR_PRIVATE_H_INCLUDED__ */