2 * File: drivers/video/omap_new/debug.c
4 * Debug support for the omapfb driver
6 * Copyright (C) 2004 Nokia Corporation
7 * Author: Imre Deak <imre.deak@nokia.com>
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 #ifndef __OMAPFB_DEBUG_H
25 #define __OMAPFB_DEBUG_H
31 #define DBGPRINT(level, fmt, ...) if (level <= OMAPFB_DBG) do { \
32 printk(KERN_DEBUG "%s: "fmt, \
33 __FUNCTION__, ## __VA_ARGS__); \
35 #define DBGENTER(level) DBGPRINT(level, "Enter\n")
36 #define DBGLEAVE(level) DBGPRINT(level, "Leave\n")
38 static inline void dump_dma_regs(int lch)
40 #ifdef CONFIG_ARCH_OMAP1
41 #define _R(x) __REG16(OMAP_DMA_##x(lch))
43 DBGPRINT(4, "\nCSDP :%#06x CCR :%#06x CSSA_U :%#06x "
44 "\nCDSA_L:%#06x CDSA_U :%#06x CEN :%#06x "
45 "\nCFN :%#06x CSFI :%#06x CSEI :%#06x "
46 "\nCSAC :%#06x CICR :%#06x CSR :%04x "
47 "\nCSSA_L:%#06x CDAC :%#06x CDEI :%#06x "
48 "\nCDFI :%#06x COLOR_L :%#06x COLOR_U :%#06x "
49 "\nCCR2 :%#06x CLNK_CTRL:%#06x LCH_CTRL:%#06x\n",
50 _R(CSDP), _R(CCR), _R(CSSA_U),
51 _R(CDSA_L), _R(CDSA_U), _R(CEN),
52 _R(CFN), _R(CSFI), _R(CSEI),
53 _R(CSAC), _R(CICR), 0, /* _R(CSR), */
54 _R(CSSA_L), _R(CDAC), _R(CDEI),
55 _R(CDFI), _R(COLOR_L), _R(COLOR_U),
56 _R(CCR2), _R(CLNK_CTRL), _R(LCH_CTRL));
61 #define DUMP_DMA_REGS(lch) dump_dma_regs(lch)
63 #else /* OMAPFB_DBG */
65 #define DBGPRINT(level, format, ...)
66 #define DBGENTER(level)
67 #define DBGLEAVE(level)
68 #define DUMP_DMA_REGS(lch)
70 #endif /* OMAPFB_DBG */
72 #endif /* __OMAPFB_DEBUG_H */