static int get_lcd_extern_config(struct device_node* of_node, struct lcd_extern_config_t *lcd_ext_cfg) { int ret = 0; struct aml_lcd_extern_driver_t* lcd_ext; ret = get_lcd_extern_dt_data(of_node, lcd_ext_cfg); if (ret) { printk("[error] %s: failed to get dt data\n", LCD_EXTERN_NAME); return ret; } //lcd extern driver update lcd_ext = aml_lcd_extern_get_driver(); if (lcd_ext) { lcd_ext->type = lcd_ext_cfg->type; lcd_ext->name = lcd_ext_cfg->name; lcd_ext->init_on_cmd_8 = &mipi_init_on_table[0]; lcd_ext->init_off_cmd_8 = &mipi_init_off_table[0]; } else { printk("[error] %s get lcd_extern_driver failed\n", lcd_ext_cfg->name); ret = -1; } return ret; }
int lcd_extern_driver_check(void) { struct aml_lcd_extern_driver_t* lcd_ext; lcd_ext = aml_lcd_extern_get_driver(); if (lcd_ext) { if (lcd_ext->type < LCD_EXTERN_MAX) { printk("[warning]: lcd_extern has already exist (%s)\n", lcd_ext->name); return -1; } } else { printk("get lcd_extern_driver failed\n"); } return 0; }