/* * GigaSpaceWire switch driver for MC-30SF6EM-6U evaluation kit * * Copyright (c) 2019 Elvees (support@elvees.com) * Author: Dmitry Evtushenko * */ #ifndef __func_h #define __func_h #include #include #ifdef CONFIG_MC30SF6 #include #endif //CONFIG_MC30SF6 //#define PRINT_ENA #ifdef PRINT_ENA #define PRINT pr_info #else //!PRINT_ENA: #define PRINT print_empty #endif //!PRINT_ENA //////////////////// functions: //////////////////// static inline void print_empty( const char *psFmt, ...) { } static inline void print_dma_rx_desc_regs( const char *ps_mes) { PRINT("%s: rx_des: IR=%Xh RUN=%Xh CP=%Xh\n", ps_mes, MC_IR_GSPW_RX_DES, MC_RUN_GSPW_RX_DES, MC_CP_GSPW_RX_DES); } static inline void print_dma_rx_data_regs( const char *ps_mes) { PRINT("%s: rx_dat: IR=%Xh RUN=%Xh CP=%Xh\n", ps_mes, MC_IR_GSPW_RX_DAT, MC_RUN_GSPW_RX_DAT, MC_CP_GSPW_RX_DAT); } static inline void print_dma_tx_desc_regs( const char *ps_mes) { PRINT("%s: tx_des: IR=%Xh RUN=%Xh CP=%Xh\n", ps_mes, MC_IR_GSPW_TX_DES, MC_RUN_GSPW_TX_DES, MC_CP_GSPW_TX_DES); } static inline void print_dma_tx_data_regs( const char *ps_mes) { PRINT("%s: tx_dat: IR=%Xh RUN=%Xh CP=%Xh\n", ps_mes, MC_IR_GSPW_TX_DAT, MC_RUN_GSPW_TX_DAT, MC_CP_GSPW_TX_DAT); } static inline void print_dma_all_regs( void) { pr_info("Current DMA regs:\n"); print_dma_rx_desc_regs( " "); print_dma_rx_data_regs( " "); print_dma_tx_desc_regs( " "); print_dma_tx_data_regs( " "); } #endif //!__func_h