1 /* SPDX-License-Identifier: GPL-2.0 */ 2 #ifndef RGA_API_H__ 3 #define RGA_API_H__ 4 5 #include <linux/miscdevice.h> 6 #include <linux/wakelock.h> 7 8 #include "rga2_reg_info.h" 9 #include "rga2_debugger.h" 10 #include "rga2.h" 11 12 /* Driver information */ 13 #define DRIVER_DESC "RGA2 Device Driver" 14 #define DRIVER_NAME "rga2" 15 #define DRIVER_VERSION "2.1.0" 16 17 /* Logging */ 18 #define RGA_DEBUG 1 19 #if RGA_DEBUG 20 #define DBG(format, args...) printk(KERN_DEBUG "%s: " format, DRIVER_NAME, ##args) 21 #define ERR(format, args...) printk(KERN_ERR "%s: " format, DRIVER_NAME, ##args) 22 #define WARNING(format, args...) printk(KERN_WARN "%s: " format, DRIVER_NAME, ##args) 23 #define INFO(format, args...) printk(KERN_INFO "%s: " format, DRIVER_NAME, ##args) 24 #else 25 #define DBG(format, args...) 26 #define ERR(format, args...) 27 #define WARNING(format, args...) 28 #define INFO(format, args...) 29 #endif 30 31 struct rga2_drvdata_t { 32 struct miscdevice miscdev; 33 struct device *dev; 34 void *rga_base; 35 int irq; 36 37 struct delayed_work power_off_work; 38 struct wake_lock wake_lock; 39 void (*rga_irq_callback)(int rga_retval); 40 41 struct clk *aclk_rga2; 42 struct clk *hclk_rga2; 43 struct clk *pd_rga2; 44 struct clk *clk_rga2; 45 46 struct ion_client *ion_client; 47 char version[16]; 48 49 #ifdef CONFIG_ROCKCHIP_RGA2_DEBUGGER 50 struct rga_debugger *debugger; 51 #endif 52 }; 53 54 #define ENABLE 1 55 #define DISABLE 0 56 57 #endif 58