1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /* 3 * Support for Intel Camera Imaging ISP subsystem. 4 * Copyright (c) 2010-2015, Intel Corporation. 5 * 6 * This program is free software; you can redistribute it and/or modify it 7 * under the terms and conditions of the GNU General Public License, 8 * version 2, as published by the Free Software Foundation. 9 * 10 * This program is distributed in the hope it will be useful, but WITHOUT 11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 13 * more details. 14 */ 15 16 #ifndef __DMA_PRIVATE_H_INCLUDED__ 17 #define __DMA_PRIVATE_H_INCLUDED__ 18 19 #include "dma_public.h" 20 21 #include "device_access.h" 22 23 #include "assert_support.h" 24 25 STORAGE_CLASS_DMA_C void dma_reg_store(const dma_ID_t ID, 26 const unsigned int reg, 27 const hrt_data value) 28 { 29 assert(ID < N_DMA_ID); 30 assert(DMA_BASE[ID] != (hrt_address) - 1); 31 ia_css_device_store_uint32(DMA_BASE[ID] + reg * sizeof(hrt_data), value); 32 } 33 34 STORAGE_CLASS_DMA_C hrt_data dma_reg_load(const dma_ID_t ID, 35 const unsigned int reg) 36 { 37 assert(ID < N_DMA_ID); 38 assert(DMA_BASE[ID] != (hrt_address) - 1); 39 return ia_css_device_load_uint32(DMA_BASE[ID] + reg * sizeof(hrt_data)); 40 } 41 42 #endif /* __DMA_PRIVATE_H_INCLUDED__ */ 43