aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-01-30 16:37:57 -0700
committerTom Warren <twarren@nvidia.com>2016-02-16 09:17:52 -0700
commitf20b2c067160a38b4cc9da277cc03c95aa972e63 (patch)
tree14e7af2eb29924907ee8c013f7006f7b386fc0fc /drivers
parent9e6866d3b6687aaab854b29dad9809c7569e61a0 (diff)
downloadu-boot-f20b2c067160a38b4cc9da277cc03c95aa972e63.zip
u-boot-f20b2c067160a38b4cc9da277cc03c95aa972e63.tar.gz
u-boot-f20b2c067160a38b4cc9da277cc03c95aa972e63.tar.bz2
tegra: video: Remove the static variables
We can move the static variables into the driver-private data. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Anatolij Gustschin <agust@denx.de> Signed-off-by: Tom Warren <twarren@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/tegra.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/drivers/video/tegra.c b/drivers/video/tegra.c
index bb2601f..f49f95d 100644
--- a/drivers/video/tegra.c
+++ b/drivers/video/tegra.c
@@ -2,7 +2,7 @@
* Copyright (c) 2011 The Chromium OS Authors.
* SPDX-License-Identifier: GPL-2.0+
*/
-#define DEBUG
+
#include <common.h>
#include <dm.h>
#include <fdtdec.h>
@@ -31,11 +31,10 @@ enum stage_t {
STAGE_DONE,
};
-static enum stage_t stage; /* Current stage we are at */
-static unsigned long timer_next; /* Time we can move onto next stage */
-
/* Information about the display controller */
struct tegra_lcd_priv {
+ enum stage_t stage; /* Current stage we are at */
+ unsigned long timer_next; /* Time we can move onto next stage */
int width; /* width in pixels */
int height; /* height in pixels */
int bpp; /* number of bits per pixel */
@@ -497,10 +496,10 @@ static int fdt_decode_lcd(const void *blob, struct tegra_lcd_priv *priv)
*/
static int handle_stage(const void *blob, struct tegra_lcd_priv *priv)
{
- debug("%s: stage %d\n", __func__, stage);
+ debug("%s: stage %d\n", __func__, priv->stage);
/* do the things for this stage */
- switch (stage) {
+ switch (priv->stage) {
case STAGE_START:
/*
* It is possible that the FDT has requested that the LCD be
@@ -542,12 +541,12 @@ static int handle_stage(const void *blob, struct tegra_lcd_priv *priv)
}
/* set up timer for next stage */
- timer_next = timer_get_us();
- if (stage < FDT_LCD_TIMINGS)
- timer_next += priv->panel_timings[stage] * 1000;
+ priv->timer_next = timer_get_us();
+ if (priv->stage < FDT_LCD_TIMINGS)
+ priv->timer_next += priv->panel_timings[priv->stage] * 1000;
/* move to next stage */
- stage++;
+ priv->stage++;
return 0;
}
@@ -571,14 +570,14 @@ static int handle_stage(const void *blob, struct tegra_lcd_priv *priv)
static int tegra_lcd_check_next_stage(const void *blob,
struct tegra_lcd_priv *priv, int wait)
{
- if (stage == STAGE_DONE)
+ if (priv->stage == STAGE_DONE)
return 0;
do {
/* wait if we need to */
- debug("%s: stage %d\n", __func__, stage);
- if (stage != STAGE_START) {
- int delay = timer_next - timer_get_us();
+ debug("%s: stage %d\n", __func__, priv->stage);
+ if (priv->stage != STAGE_START) {
+ int delay = priv->timer_next - timer_get_us();
if (delay > 0) {
if (wait)
@@ -590,8 +589,8 @@ static int tegra_lcd_check_next_stage(const void *blob,
if (handle_stage(blob, priv))
return -1;
- } while (wait && stage != STAGE_DONE);
- if (stage == STAGE_DONE)
+ } while (wait && priv->stage != STAGE_DONE);
+ if (priv->stage == STAGE_DONE)
debug("%s: LCD init complete\n", __func__);
return 0;