static int xylonfb_of_probe(struct platform_device *pdev) { struct xylonfb_init_data init_data; int i, rc; driver_devel("%s\n", __func__); memset(&init_data, 0, sizeof(struct xylonfb_init_data)); init_data.pdev = pdev; rc = xylonfb_parse_hw_info(pdev->dev.of_node, &init_data); if (rc) return rc; rc = xylonfb_parse_vram_info(pdev->dev.of_node, &init_data.vmem_base_addr, &init_data.vmem_high_addr); if (rc) return rc; rc = xylonfb_parse_layer_info(pdev->dev.of_node, &init_data); if (rc) return rc; /* if Device-Tree contains video mode options do not use kernel command line video mode options */ xylonfb_parse_vmode_info(pdev->dev.of_node, &init_data); for (i = 0; i < init_data.layers; i++) { rc = xylonfb_parse_layer_params(pdev->dev.of_node, i, &init_data.lfdata[i]); if (rc) return rc; } return xylonfb_init_driver(&init_data); }
static int xylonfb_platform_probe(struct platform_device *pdev) { struct xylonfb_init_data init_data; struct xylonfb_platform_data *pdata; int i; memset(&init_data, 0, sizeof(struct xylonfb_init_data)); init_data.pdev = pdev; pdata = (struct xylonfb_platform_data *)pdev->dev.platform_data; init_data.vmem_base_addr = pdata->vmem_base_addr; init_data.vmem_high_addr = pdata->vmem_high_addr; init_data.pixclk_src_id = pdata->pixclk_src_id; init_data.vmode_data.ctrl_reg = pdata->ctrl_reg; strcpy(init_data.vmode_data.fb_vmode_name, pdata->vmode); init_data.vmode_data.fb_vmode.refresh = 60; init_data.layers = pdata->num_layers; init_data.active_layer = pdata->active_layer; init_data.bg_layer_bpp = pdata->bg_layer_bpp; init_data.bg_layer_alpha_mode = pdata->bg_layer_alpha_mode; init_data.display_interface_type = pdata->display_interface_type; init_data.flags = pdata->flags; init_data.vmode_params_set = false; for (i = 0; i < init_data.layers; i++) { xylonfb_get_platform_layer_params( &pdata->layer_params[i], &init_data.lfdata[i], i); init_data.lfdata[i].width = pdata->row_stride; init_data.layer_ctrl_flags[i] = pdata->layer_params[i].ctrl_flags; } return xylonfb_init_driver(&init_data); }