1 /* 2 * 3 * Copyright (c) 2021 Allwinnertech Co., Ltd. 4 * Author: libairong <libairong@allwinnertech.com> 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License version 2 as 8 * published by the Free Software Foundation. 9 */ 10 #ifndef __LCD_DEBUG_H__ 11 #define __LCD_DEBUG_H__ 12 13 #define NAME_LENGTH 32 14 #define VALUE_LENGTH 100 15 #define BASE_PROPERTY_NAME "base_config_start" 16 #define OPEN_PROPERTY_NAME "lcd_open_flow_start" 17 #define CLOSE_PROPERTY_NAME "lcd_close_flow_start" 18 19 struct dt_property { 20 char *name; 21 int length; 22 void *value; 23 int index; 24 struct dt_property *next; 25 }; 26 27 typedef enum { 28 CREATE = 1, 29 RETRIEVIE, 30 UPDATE, 31 DELETE, 32 } request_opcode; 33 34 typedef enum { 35 BASE = 1, 36 OPEN, 37 CLOSE, 38 } opcode_flag; 39 40 struct para { 41 opcode_flag flag; 42 request_opcode opcode; 43 struct dt_property prop_src; 44 struct dt_property prop_dts; 45 }; 46 47 int handle_request(struct para *lcd_debug_para); 48 void copy_result_to_prop_dts(struct property *result, struct dt_property *prop_dts); 49 int retrieve_prop(struct para *lcd_debug_para); 50 int create_prop(struct para *lcd_debug_para); 51 int update_prop(struct para *lcd_debug_para); 52 int delete_prop(struct para *lcd_debug_para); 53 int init_device_node(char *node_name); 54 55 #endif 56