19d4fa1a1SMauro Carvalho Chehab /* 29d4fa1a1SMauro Carvalho Chehab * Support for Intel Camera Imaging ISP subsystem. 39d4fa1a1SMauro Carvalho Chehab * Copyright (c) 2010-2015, Intel Corporation. 49d4fa1a1SMauro Carvalho Chehab * 59d4fa1a1SMauro Carvalho Chehab * This program is free software; you can redistribute it and/or modify it 69d4fa1a1SMauro Carvalho Chehab * under the terms and conditions of the GNU General Public License, 79d4fa1a1SMauro Carvalho Chehab * version 2, as published by the Free Software Foundation. 89d4fa1a1SMauro Carvalho Chehab * 99d4fa1a1SMauro Carvalho Chehab * This program is distributed in the hope it will be useful, but WITHOUT 109d4fa1a1SMauro Carvalho Chehab * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 119d4fa1a1SMauro Carvalho Chehab * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 129d4fa1a1SMauro Carvalho Chehab * more details. 139d4fa1a1SMauro Carvalho Chehab */ 149d4fa1a1SMauro Carvalho Chehab 159d4fa1a1SMauro Carvalho Chehab #include "assert_support.h" 169d4fa1a1SMauro Carvalho Chehab #include "gp_device.h" 179d4fa1a1SMauro Carvalho Chehab 189d4fa1a1SMauro Carvalho Chehab #ifndef __INLINE_GP_DEVICE__ 199d4fa1a1SMauro Carvalho Chehab #include "gp_device_private.h" 209d4fa1a1SMauro Carvalho Chehab #endif /* __INLINE_GP_DEVICE__ */ 219d4fa1a1SMauro Carvalho Chehab 229d4fa1a1SMauro Carvalho Chehab void gp_device_get_state( 239d4fa1a1SMauro Carvalho Chehab const gp_device_ID_t ID, 249d4fa1a1SMauro Carvalho Chehab gp_device_state_t *state) 259d4fa1a1SMauro Carvalho Chehab { 269d4fa1a1SMauro Carvalho Chehab assert(ID < N_GP_DEVICE_ID); 279d4fa1a1SMauro Carvalho Chehab assert(state); 289d4fa1a1SMauro Carvalho Chehab 299d4fa1a1SMauro Carvalho Chehab state->syncgen_enable = gp_device_reg_load(ID, 309d4fa1a1SMauro Carvalho Chehab _REG_GP_SYNCGEN_ENABLE_ADDR); 319d4fa1a1SMauro Carvalho Chehab state->syncgen_free_running = gp_device_reg_load(ID, 329d4fa1a1SMauro Carvalho Chehab _REG_GP_SYNCGEN_FREE_RUNNING_ADDR); 339d4fa1a1SMauro Carvalho Chehab state->syncgen_pause = gp_device_reg_load(ID, 349d4fa1a1SMauro Carvalho Chehab _REG_GP_SYNCGEN_PAUSE_ADDR); 359d4fa1a1SMauro Carvalho Chehab state->nr_frames = gp_device_reg_load(ID, 369d4fa1a1SMauro Carvalho Chehab _REG_GP_NR_FRAMES_ADDR); 379d4fa1a1SMauro Carvalho Chehab state->syngen_nr_pix = gp_device_reg_load(ID, 389d4fa1a1SMauro Carvalho Chehab _REG_GP_SYNGEN_NR_PIX_ADDR); 399d4fa1a1SMauro Carvalho Chehab state->syngen_nr_pix = gp_device_reg_load(ID, 409d4fa1a1SMauro Carvalho Chehab _REG_GP_SYNGEN_NR_PIX_ADDR); 419d4fa1a1SMauro Carvalho Chehab state->syngen_nr_lines = gp_device_reg_load(ID, 429d4fa1a1SMauro Carvalho Chehab _REG_GP_SYNGEN_NR_LINES_ADDR); 439d4fa1a1SMauro Carvalho Chehab state->syngen_hblank_cycles = gp_device_reg_load(ID, 449d4fa1a1SMauro Carvalho Chehab _REG_GP_SYNGEN_HBLANK_CYCLES_ADDR); 459d4fa1a1SMauro Carvalho Chehab state->syngen_vblank_cycles = gp_device_reg_load(ID, 469d4fa1a1SMauro Carvalho Chehab _REG_GP_SYNGEN_VBLANK_CYCLES_ADDR); 479d4fa1a1SMauro Carvalho Chehab state->isel_sof = gp_device_reg_load(ID, 489d4fa1a1SMauro Carvalho Chehab _REG_GP_ISEL_SOF_ADDR); 499d4fa1a1SMauro Carvalho Chehab state->isel_eof = gp_device_reg_load(ID, 509d4fa1a1SMauro Carvalho Chehab _REG_GP_ISEL_EOF_ADDR); 519d4fa1a1SMauro Carvalho Chehab state->isel_sol = gp_device_reg_load(ID, 529d4fa1a1SMauro Carvalho Chehab _REG_GP_ISEL_SOL_ADDR); 539d4fa1a1SMauro Carvalho Chehab state->isel_eol = gp_device_reg_load(ID, 549d4fa1a1SMauro Carvalho Chehab _REG_GP_ISEL_EOL_ADDR); 559d4fa1a1SMauro Carvalho Chehab state->isel_lfsr_enable = gp_device_reg_load(ID, 569d4fa1a1SMauro Carvalho Chehab _REG_GP_ISEL_LFSR_ENABLE_ADDR); 579d4fa1a1SMauro Carvalho Chehab state->isel_lfsr_enable_b = gp_device_reg_load(ID, 589d4fa1a1SMauro Carvalho Chehab _REG_GP_ISEL_LFSR_ENABLE_B_ADDR); 599d4fa1a1SMauro Carvalho Chehab state->isel_lfsr_reset_value = gp_device_reg_load(ID, 609d4fa1a1SMauro Carvalho Chehab _REG_GP_ISEL_LFSR_RESET_VALUE_ADDR); 619d4fa1a1SMauro Carvalho Chehab state->isel_tpg_enable = gp_device_reg_load(ID, 629d4fa1a1SMauro Carvalho Chehab _REG_GP_ISEL_TPG_ENABLE_ADDR); 639d4fa1a1SMauro Carvalho Chehab state->isel_tpg_enable_b = gp_device_reg_load(ID, 649d4fa1a1SMauro Carvalho Chehab _REG_GP_ISEL_TPG_ENABLE_B_ADDR); 659d4fa1a1SMauro Carvalho Chehab state->isel_hor_cnt_mask = gp_device_reg_load(ID, 669d4fa1a1SMauro Carvalho Chehab _REG_GP_ISEL_HOR_CNT_MASK_ADDR); 679d4fa1a1SMauro Carvalho Chehab state->isel_ver_cnt_mask = gp_device_reg_load(ID, 689d4fa1a1SMauro Carvalho Chehab _REG_GP_ISEL_VER_CNT_MASK_ADDR); 699d4fa1a1SMauro Carvalho Chehab state->isel_xy_cnt_mask = gp_device_reg_load(ID, 709d4fa1a1SMauro Carvalho Chehab _REG_GP_ISEL_XY_CNT_MASK_ADDR); 719d4fa1a1SMauro Carvalho Chehab state->isel_hor_cnt_delta = gp_device_reg_load(ID, 729d4fa1a1SMauro Carvalho Chehab _REG_GP_ISEL_HOR_CNT_DELTA_ADDR); 739d4fa1a1SMauro Carvalho Chehab state->isel_ver_cnt_delta = gp_device_reg_load(ID, 749d4fa1a1SMauro Carvalho Chehab _REG_GP_ISEL_VER_CNT_DELTA_ADDR); 759d4fa1a1SMauro Carvalho Chehab state->isel_tpg_mode = gp_device_reg_load(ID, 769d4fa1a1SMauro Carvalho Chehab _REG_GP_ISEL_TPG_MODE_ADDR); 779d4fa1a1SMauro Carvalho Chehab state->isel_tpg_red1 = gp_device_reg_load(ID, 789d4fa1a1SMauro Carvalho Chehab _REG_GP_ISEL_TPG_RED1_ADDR); 799d4fa1a1SMauro Carvalho Chehab state->isel_tpg_green1 = gp_device_reg_load(ID, 809d4fa1a1SMauro Carvalho Chehab _REG_GP_ISEL_TPG_GREEN1_ADDR); 819d4fa1a1SMauro Carvalho Chehab state->isel_tpg_blue1 = gp_device_reg_load(ID, 829d4fa1a1SMauro Carvalho Chehab _REG_GP_ISEL_TPG_BLUE1_ADDR); 839d4fa1a1SMauro Carvalho Chehab state->isel_tpg_red2 = gp_device_reg_load(ID, 849d4fa1a1SMauro Carvalho Chehab _REG_GP_ISEL_TPG_RED2_ADDR); 859d4fa1a1SMauro Carvalho Chehab state->isel_tpg_green2 = gp_device_reg_load(ID, 869d4fa1a1SMauro Carvalho Chehab _REG_GP_ISEL_TPG_GREEN2_ADDR); 879d4fa1a1SMauro Carvalho Chehab state->isel_tpg_blue2 = gp_device_reg_load(ID, 889d4fa1a1SMauro Carvalho Chehab _REG_GP_ISEL_TPG_BLUE2_ADDR); 899d4fa1a1SMauro Carvalho Chehab state->isel_ch_id = gp_device_reg_load(ID, 909d4fa1a1SMauro Carvalho Chehab _REG_GP_ISEL_CH_ID_ADDR); 919d4fa1a1SMauro Carvalho Chehab state->isel_fmt_type = gp_device_reg_load(ID, 929d4fa1a1SMauro Carvalho Chehab _REG_GP_ISEL_FMT_TYPE_ADDR); 939d4fa1a1SMauro Carvalho Chehab state->isel_data_sel = gp_device_reg_load(ID, 949d4fa1a1SMauro Carvalho Chehab _REG_GP_ISEL_DATA_SEL_ADDR); 959d4fa1a1SMauro Carvalho Chehab state->isel_sband_sel = gp_device_reg_load(ID, 969d4fa1a1SMauro Carvalho Chehab _REG_GP_ISEL_SBAND_SEL_ADDR); 979d4fa1a1SMauro Carvalho Chehab state->isel_sync_sel = gp_device_reg_load(ID, 989d4fa1a1SMauro Carvalho Chehab _REG_GP_ISEL_SYNC_SEL_ADDR); 999d4fa1a1SMauro Carvalho Chehab state->syncgen_hor_cnt = gp_device_reg_load(ID, 1009d4fa1a1SMauro Carvalho Chehab _REG_GP_SYNCGEN_HOR_CNT_ADDR); 1019d4fa1a1SMauro Carvalho Chehab state->syncgen_ver_cnt = gp_device_reg_load(ID, 1029d4fa1a1SMauro Carvalho Chehab _REG_GP_SYNCGEN_VER_CNT_ADDR); 1039d4fa1a1SMauro Carvalho Chehab state->syncgen_frame_cnt = gp_device_reg_load(ID, 1049d4fa1a1SMauro Carvalho Chehab _REG_GP_SYNCGEN_FRAME_CNT_ADDR); 1059d4fa1a1SMauro Carvalho Chehab state->soft_reset = gp_device_reg_load(ID, 1069d4fa1a1SMauro Carvalho Chehab _REG_GP_SOFT_RESET_ADDR); 1079d4fa1a1SMauro Carvalho Chehab return; 1089d4fa1a1SMauro Carvalho Chehab } 109