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 #include <type_support.h> /* for uint32_t */ 16 #include "ia_css_timer.h" /*struct ia_css_clock_tick */ 17 #include "sh_css_legacy.h" /* IA_CSS_PIPE_ID_NUM*/ 18 #include "gp_timer.h" /*gp_timer_read()*/ 19 #include "assert_support.h" 20 21 enum ia_css_err 22 ia_css_timer_get_current_tick( 23 struct ia_css_clock_tick *curr_ts) { 24 assert(curr_ts); 25 if (!curr_ts) 26 { 27 return IA_CSS_ERR_INVALID_ARGUMENTS; 28 } 29 curr_ts->ticks = (clock_value_t)gp_timer_read(GP_TIMER_SEL); 30 return IA_CSS_SUCCESS; 31 } 32