blob: ca3d57579ee23064a5f0684dce5979d0194d6a86 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Simon Glass3ef2a722015-04-14 21:03:42 -06002/*
3 * (C) Copyright 2010
4 * NVIDIA Corporation <www.nvidia.com>
Simon Glass3ef2a722015-04-14 21:03:42 -06005 */
6
7#ifndef __ASM_ARCH_TEGRA_DISPLAY_H
8#define __ASM_ARCH_TEGRA_DISPLAY_H
9
10/**
11 * Register a new display based on device tree configuration.
12 *
Robert P. J. Day8d56db92016-07-15 13:44:45 -040013 * The frame buffer can be positioned by U-Boot or overridden by the fdt.
Simon Glass3ef2a722015-04-14 21:03:42 -060014 * You should pass in the U-Boot address here, and check the contents of
15 * struct fdt_disp_config to see what was actually chosen.
16 *
17 * @param blob Device tree blob
18 * @param default_lcd_base Default address of LCD frame buffer
Heinrich Schuchardt47b4c022022-01-19 18:05:50 +010019 * Return: 0 if ok, -1 on error (unsupported bits per pixel)
Simon Glass3ef2a722015-04-14 21:03:42 -060020 */
21int tegra_display_probe(const void *blob, void *default_lcd_base);
22
23/**
24 * Return the current display configuration
25 *
Heinrich Schuchardt47b4c022022-01-19 18:05:50 +010026 * Return: pointer to display configuration, or NULL if there is no valid
Simon Glass3ef2a722015-04-14 21:03:42 -060027 * config
28 */
29struct fdt_disp_config *tegra_display_get_config(void);
30
31/**
32 * Perform the next stage of the LCD init if it is time to do so.
33 *
34 * LCD init can be time-consuming because of the number of delays we need
35 * while waiting for the backlight power supply, etc. This function can
36 * be called at various times during U-Boot operation to advance the
37 * initialization of the LCD to the next stage if sufficient time has
38 * passed since the last stage. It keeps track of what stage it is up to
39 * and the time that it is permitted to move to the next stage.
40 *
41 * The final call should have wait=1 to complete the init.
42 *
43 * @param blob fdt blob containing LCD information
44 * @param wait 1 to wait until all init is complete, and then return
45 * 0 to return immediately, potentially doing nothing if it is
46 * not yet time for the next init.
47 */
48int tegra_lcd_check_next_stage(const void *blob, int wait);
49
50/**
51 * Set up the maximum LCD size so we can size the frame buffer.
52 *
53 * @param blob fdt blob containing LCD information
54 */
55void tegra_lcd_early_init(const void *blob);
56
57#endif /*__ASM_ARCH_TEGRA_DISPLAY_H*/