1 /* 2 * Allwinner SoCs display driver. 3 * 4 * Copyright (C) 2016 Allwinner. 5 * 6 * This file is licensed under the terms of the GNU General Public 7 * License version 2. This program is licensed "as is" without any 8 * warranty of any kind, whether express or implied. 9 */ 10 #include "include.h" 11 12 #ifndef _LCD_FB_INTF_ 13 #define _LCD_FB_INTF_ 14 15 struct disp_gpio_info { 16 unsigned gpio; 17 char name[32]; 18 int value; 19 }; 20 21 #define DISP_IRQ_RETURN IRQ_HANDLED 22 #define DISP_PIN_STATE_ACTIVE "active" 23 #define DISP_PIN_STATE_SLEEP "sleep" 24 25 int lcd_fb_register_irq(u32 IrqNo, u32 Flags, void *Handler, void *pArg, 26 u32 DataSize, u32 Prio); 27 void lcd_fb_unregister_irq(u32 IrqNo, void *Handler, void *pArg); 28 void lcd_fb_disable_irq(u32 IrqNo); 29 void lcd_fb_enable_irq(u32 IrqNo); 30 31 /* returns: 0:invalid, 1: int; 2:str, 3: gpio */ 32 int lcd_fb_script_get_item(char *main_name, char *sub_name, int value[], 33 int count); 34 35 int lcd_fb_get_ic_ver(void); 36 37 int lcd_fb_gpio_request(struct disp_gpio_info *gpio_info); 38 int lcd_fb_gpio_request_simple(struct disp_gpio_info *gpio_list, 39 u32 group_count_max); 40 int lcd_fb_gpio_release(struct disp_gpio_info *gpio_info); 41 42 /* direction: 0:input, 1:output */ 43 int lcd_fb_gpio_set_direction(u32 p_handler, u32 direction, 44 const char *gpio_name); 45 int lcd_fb_gpio_get_value(u32 p_handler, const char *gpio_name); 46 int lcd_fb_gpio_set_value(u32 p_handler, u32 value_to_gpio, 47 const char *gpio_name); 48 int lcd_fb_pin_set_state(char *dev_name, char *name); 49 50 int lcd_fb_power_enable(char *name); 51 int lcd_fb_power_disable(char *name); 52 void *lcd_fb_malloc(u32 size); 53 54 uintptr_t lcd_fb_pwm_request(u32 pwm_id); 55 int lcd_fb_pwm_free(uintptr_t p_handler); 56 int lcd_fb_pwm_enable(uintptr_t p_handler); 57 int lcd_fb_pwm_disable(uintptr_t p_handler); 58 int lcd_fb_pwm_config(uintptr_t p_handler, int duty_ns, int period_ns); 59 int lcd_fb_pwm_set_polarity(uintptr_t p_handler, int polarity); 60 s32 disp_delay_ms(u32 ms); 61 s32 disp_delay_us(u32 us); 62 63 #endif 64