int __init pismo_panel_init(void) { int err = 0; struct resource __maybe_unused *res; struct platform_device *phost1x = NULL; sd_settings = pismo_sd_settings; pismo_panel_select(); #ifdef CONFIG_TEGRA_NVMAP pismo_carveouts[1].base = tegra_carveout_start; pismo_carveouts[1].size = tegra_carveout_size; pismo_carveouts[2].base = tegra_vpr_start; pismo_carveouts[2].size = tegra_vpr_size; err = platform_device_register(&pismo_nvmap_device); if (err) { pr_err("nvmap device registration failed\n"); return err; } #endif phost1x = pismo_host1x_init(); if (!phost1x) { pr_err("host1x devices registration failed\n"); return -EINVAL; } res = platform_get_resource_byname(&pismo_disp1_device, IORESOURCE_MEM, "fbmem"); res->start = tegra_fb_start; res->end = tegra_fb_start + tegra_fb_size - 1; /* Copy the bootloader fb to the fb. */ __tegra_move_framebuffer(&pismo_nvmap_device, tegra_fb_start, tegra_bootloader_fb_start, min(tegra_fb_size, tegra_bootloader_fb_size)); pismo_disp1_device.dev.parent = &phost1x->dev; err = platform_device_register(&pismo_disp1_device); if (err) { pr_err("disp1 device registration failed\n"); return err; } err = tegra_init_hdmi(&pismo_disp2_device, phost1x); if (err) return err; #ifdef CONFIG_TEGRA_NVAVP nvavp_device.dev.parent = &phost1x->dev; err = platform_device_register(&nvavp_device); if (err) { pr_err("nvavp device registration failed\n"); return err; } #endif return err; }
int __init roth_panel_init(int board_id) { int err = 0; struct resource __maybe_unused *res; struct platform_device *phost1x = NULL; #ifdef CONFIG_TEGRA_NVMAP roth_carveouts[1].base = tegra_carveout_start; roth_carveouts[1].size = tegra_carveout_size; roth_carveouts[2].base = tegra_vpr_start; roth_carveouts[2].size = tegra_vpr_size; err = platform_device_register(&roth_nvmap_device); if (err) { pr_err("nvmap device registration failed\n"); return err; } #endif phost1x = roth_host1x_init(); if (!phost1x) { pr_err("host1x devices registration failed\n"); return -EINVAL; } res = platform_get_resource_byname(&roth_disp1_device, IORESOURCE_MEM, "fbmem"); res->start = tegra_fb_start; res->end = tegra_fb_start + tegra_fb_size - 1; /* Copy the bootloader fb to the fb. */ __tegra_move_framebuffer(&roth_nvmap_device, tegra_fb_start, tegra_bootloader_fb_start, min(tegra_fb_size, tegra_bootloader_fb_size)); /* * only roth supports initialized mode. */ if (!board_id) roth_disp1_out.flags |= TEGRA_DC_OUT_INITIALIZED_MODE; roth_disp1_device.dev.parent = &phost1x->dev; err = platform_device_register(&roth_disp1_device); if (err) { pr_err("disp1 device registration failed\n"); return err; } err = tegra_init_hdmi(&roth_disp2_device, phost1x); if (err) return err; #if IS_EXTERNAL_PWM err = platform_add_devices(roth_bl_device, ARRAY_SIZE(roth_bl_device)); if (err) { pr_err("disp1 bl device registration failed"); return err; } #endif #ifdef CONFIG_TEGRA_NVAVP if (!of_have_populated_dt()) { nvavp_device.dev.parent = &phost1x->dev; err = platform_device_register(&nvavp_device); if (err) { pr_err("nvavp device registration failed\n"); return err; } } #endif return err; }
int __init pluto_panel_init(void) { int err = 0; struct resource __maybe_unused *res; struct platform_device *phost1x = NULL; pluto_panel_select(); #ifdef CONFIG_TEGRA_NVMAP pluto_carveouts[1].base = tegra_carveout_start; pluto_carveouts[1].size = tegra_carveout_size; pluto_carveouts[2].base = tegra_vpr_start; pluto_carveouts[2].size = tegra_vpr_size; #ifdef CONFIG_NVMAP_USE_CMA_FOR_CARVEOUT pluto_carveouts[1].cma_dev = &tegra_generic_cma_dev; pluto_carveouts[1].resize = false; pluto_carveouts[2].cma_dev = &tegra_vpr_cma_dev; pluto_carveouts[2].resize = true; pluto_carveouts[2].cma_chunk_size = SZ_32M; #endif err = platform_device_register(&pluto_nvmap_device); if (err) { pr_err("nvmap device registration failed\n"); return err; } #endif phost1x = pluto_host1x_init(); if (!phost1x) { pr_err("host1x devices registration failed\n"); return -EINVAL; } res = platform_get_resource_byname(&pluto_disp1_device, IORESOURCE_MEM, "fbmem"); res->start = tegra_fb_start; res->end = tegra_fb_start + tegra_fb_size - 1; /* Copy the bootloader fb to the fb. */ __tegra_move_framebuffer(&pluto_nvmap_device, tegra_fb_start, tegra_bootloader_fb_start, min(tegra_fb_size, tegra_bootloader_fb_size)); pluto_disp1_device.dev.parent = &phost1x->dev; err = platform_device_register(&pluto_disp1_device); if (err) { pr_err("disp1 device registration failed\n"); return err; } err = tegra_init_hdmi(&pluto_disp2_device, phost1x); if (err) return err; #ifdef CONFIG_TEGRA_NVAVP if (!of_have_populated_dt()) { nvavp_device.dev.parent = &phost1x->dev; err = platform_device_register(&nvavp_device); if (err) { pr_err("nvavp device registration failed\n"); return err; } } #endif return err; }