/* SPDX-License-Identifier: GPL-2.0-only
 * This file is part of the CAN-CTRL IP Core driver for Linux
 *
 * Copyright (C) Fraunhofer-Institut for Photonic Microsystems (IPMS)
 * Maria-Reiche-Str. 2
 * 01109 Dresden
 *
 * This file is licensed under the terms of the GNU General Public
 * License version 2. This program is licensed "as is" without any
 * warranty of any kind, whether express or implied.
 *
 * @file hal_porting.h
 * @author SVT
 * @date   04/05/2023
 * @brief  CAN Linux driver configuration interface
 */

#ifndef HAL_PORTING_H
#define HAL_PORTING_H

#include <linux/io.h>
#include <linux/types.h>

typedef void (*hal_log_t)(char level, const char *ctx, const char *format);

#define HAL_LOG_DEFAULT NULL

// mxprint => must print
// error_msg => error
// trace_msg => trace 
// reg_msg => register print
// debug_msg => debug

#if 0

#define mxprint(fmt, ...) printk("mx: " fmt, ##__VA_ARGS__)
#define error_msg(fmt, ...) printk("mx: " fmt, ##__VA_ARGS__)

//#define reg_msg(fmt, ...) printk("mx: " fmt, ##__VA_ARGS__)
#define reg_msg(fmt, ...)

//#define trace_msg(fmt, ...) printk("mx: " fmt, ##__VA_ARGS__)
#define trace_msg(fmt, ...)

//#define debug_msg(fmt, ...) printk("mx: " fmt, ##__VA_ARGS__)
#define debug_msg(fmt, ...)

#else
#define mxprint(...)
#define error_msg(fmt, ...)
#define reg_msg(fmt, ...)
#define trace_msg(fmt, ...)
#define debug_msg(fmt, ...)
#endif

#endif
