• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2016 Allwinnertech Co.Ltd
3  * Authors: zhengwanyu
4  *
5  * This program is free software; you can redistribute  it and/or modify it
6  * under  the terms of  the GNU General  Public License as published by the
7  * Free Software Foundation;  either version 2 of the  License, or (at your
8  * option) any later version.
9  *
10  */
11 
12 #ifndef _SUNXI_COMMON_H_
13 #define _SUNXI_COMMON_H_
14 #include "disp_sys_intf.h"
15 
16 struct sunxi_connector_work_mode {
17 	unsigned int color_fmt;
18 	unsigned int color_depth;
19 };
20 
21 struct sunxi_dispdev_name {
22 	int device;
23 	char name[20];
24 };
25 
26 /*linux driver model information*/
27 struct drv_model_info {
28 	dev_t devid;
29 	struct cdev *cdev;
30 	struct device *dev;
31 	struct class *sysclass;
32 };
33 
34 enum {
35 	COLOR_FMT_RGB444,
36 	COLOR_FMT_YUV444,
37 	COLOR_FMT_RGB422,
38 	COLOR_FMT_RGB420,
39 	COLOR_FMT_YUV422,
40 	COLOR_FMT_YUV420,
41 };
42 
43 void sunxi_disp_bsp_init_para_init(void);
44 struct disp_bsp_init_para *sunxi_disp_get_bsp_init_para(void);
45 
46 struct device_node *sunxi_drm_get_name_node(char *device_name);
47 
48 int sunxi_drm_get_sys_item_gpio(struct device_node *node, char *sub_name,
49 					struct disp_gpio_info *gpio_info);
50 int sunxi_drm_get_sys_item_char(struct device_node *node, char *sub_name,
51 							    char *value);
52 int sunxi_drm_get_sys_item_int(struct device_node *node, char *sub_name,
53 							    int *value);
54 
55 int sunxi_drm_sys_pin_set_state(char *dev_name, char *name);
56 int sunxi_drm_sys_gpio_set_direction(u32 p_handler, u32 direction,
57 				const char *gpio_name);
58 int sunxi_drm_sys_gpio_release(int p_handler);
59 int sunxi_drm_sys_gpio_request(struct disp_gpio_info *gpio_info);
60 int sunxi_drm_sys_gpio_set_value(u32 p_handler, u32 value_to_gpio,
61 					   const char *gpio_name);
62 
63 
64 int sunxi_drm_sys_power_disable(struct device *dev, const char *name); /* fix me */
65 int sunxi_drm_sys_power_enable(struct device *dev, const char *name); /* fix me */
66 
67 void sunxi_drm_delayed_ms(unsigned int ms);
68 int bsp_disp_get_print_level(void);
69 void bsp_disp_set_print_level(unsigned char level);
70 
71 int disp_delay_us(u32 us);
72 s32 disp_delay_ms(u32 ms);
73 int disp_sys_script_get_item(char *main_name,
74 	char *sub_name, int value[], int type);
75 
76 #endif
77