[U-Boot] [PATCH 08/60] video: tegra: move header file to driver directory

Stephen Warren
2016-04-19T20:58:48Z

From: Stephen Warren <swarren@nvidia.com>

Tegra's dc.h/display.h only contain private definitions for use inside the
Tegra display driver. Move them out of the global include directory since
nothing needs to access it there. Since they both describe DC registers,
combine then into a single header.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
arch/arm/include/asm/arch-tegra20/display.h | 29 ---------------------
arch/arm/mach-tegra/tegra20/display.c | 15 -----------
drivers/video/tegra.c | 3 +--
drivers/video/tegra124/display.c | 2 +-
drivers/video/tegra124/dp.c | 4 +--
drivers/video/tegra124/sor.c | 4 +--
.../arch-tegra/dc.h => drivers/video/tegra_dc.h | 30 +++++++++++++++++++---
7 files changed, 32 insertions(+), 55 deletions(-)
delete mode 100644 arch/arm/include/asm/arch-tegra20/display.h
delete mode 100644 arch/arm/mach-tegra/tegra20/display.c
rename arch/arm/include/asm/arch-tegra/dc.h => drivers/video/tegra_dc.h (94%)

diff --git a/arch/arm/include/asm/arch-tegra20/display.h b/arch/arm/include/asm/arch-tegra20/display.h
deleted file mode 100644
index ee5a3f6c91c0..000000000000
--- a/arch/arm/include/asm/arch-tegra20/display.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * (C) Copyright 2010
- * NVIDIA Corporation <www.nvidia.com>
- *
- * SPDX-License-Identifier: GPL-2.0+
- */
-
-#ifndef __ASM_ARCH_TEGRA_DISPLAY_H
-#define __ASM_ARCH_TEGRA_DISPLAY_H
-
-#include <asm/arch-tegra/dc.h>
-
-/* This holds information about a window which can be displayed */
-struct disp_ctl_win {
- enum win_color_depth_id fmt; /* Color depth/format */
- unsigned bpp; /* Bits per pixel */
- phys_addr_t phys_addr; /* Physical address in memory */
- unsigned x; /* Horizontal address offset (bytes) */
- unsigned y; /* Veritical address offset (bytes) */
- unsigned w; /* Width of source window */
- unsigned h; /* Height of source window */
- unsigned stride; /* Number of bytes per line */
- unsigned out_x; /* Left edge of output window (col) */
- unsigned out_y; /* Top edge of output window (row) */
- unsigned out_w; /* Width of output window in pixels */
- unsigned out_h; /* Height of output window in pixels */
-};
-
-#endif /*__ASM_ARCH_TEGRA_DISPLAY_H*/
diff --git a/arch/arm/mach-tegra/tegra20/display.c b/arch/arm/mach-tegra/tegra20/display.c
deleted file mode 100644
index 52a476eb7d8a..000000000000
--- a/arch/arm/mach-tegra/tegra20/display.c
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * (C) Copyright 2010-2016
- * NVIDIA Corporation <www.nvidia.com>
- *
- * SPDX-License-Identifier: GPL-2.0+
- */
-
-#include <common.h>
-#include <asm/io.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/tegra.h>
-#include <asm/arch/display.h>
-#include <asm/arch-tegra/dc.h>
-#include <asm/arch-tegra/clk_rst.h>
-
diff --git a/drivers/video/tegra.c b/drivers/video/tegra.c
index b4c83b674147..45a2876d4030 100644
--- a/drivers/video/tegra.c
+++ b/drivers/video/tegra.c
@@ -13,11 +13,10 @@
#include <asm/system.h>
#include <asm/gpio.h>
#include <asm/io.h>
-
#include <asm/arch/clock.h>
#include <asm/arch/funcmux.h>
#include <asm/arch/pinmux.h>
-#include <asm/arch/display.h>
+#include "tegra_dc.h"

DECLARE_GLOBAL_DATA_PTR;

diff --git a/drivers/video/tegra124/display.c b/drivers/video/tegra124/display.c
index d627285b8081..bc31103e8b92 100644
--- a/drivers/video/tegra124/display.c
+++ b/drivers/video/tegra124/display.c
@@ -19,8 +19,8 @@
#include <asm/gpio.h>
#include <asm/io.h>
#include <asm/arch/clock.h>
-#include <asm/arch-tegra/dc.h>
#include <dm/uclass-internal.h>
+#include "../tegra_dc.h"
#include "displayport.h"

DECLARE_GLOBAL_DATA_PTR;
diff --git a/drivers/video/tegra124/dp.c b/drivers/video/tegra124/dp.c
index 5bf8524a5e8a..4e97b6de276a 100644
--- a/drivers/video/tegra124/dp.c
+++ b/drivers/video/tegra124/dp.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2013, NVIDIA Corporation.
+ * Copyright (c) 2011-2016, NVIDIA Corporation.
* Copyright 2014 Google Inc.
*
* SPDX-License-Identifier: GPL-2.0
@@ -13,7 +13,7 @@
#include <fdtdec.h>
#include <video_bridge.h>
#include <asm/io.h>
-#include <asm/arch-tegra/dc.h>
+#include "../tegra_dc.h"
#include "display.h"
#include "edid.h"
#include "sor.h"
diff --git a/drivers/video/tegra124/sor.c b/drivers/video/tegra124/sor.c
index e5cea51d48c8..40d9dd22a2c4 100644
--- a/drivers/video/tegra124/sor.c
+++ b/drivers/video/tegra124/sor.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2013, NVIDIA Corporation.
+ * Copyright (c) 2011-2016, NVIDIA Corporation.
*
* SPDX-License-Identifier: GPL-2.0
*/
@@ -13,7 +13,7 @@
#include <video_bridge.h>
#include <asm/io.h>
#include <asm/arch/clock.h>
-#include <asm/arch-tegra/dc.h>
+#include "../tegra_dc.h"
#include "displayport.h"
#include "sor.h"

diff --git a/arch/arm/include/asm/arch-tegra/dc.h b/drivers/video/tegra_dc.h
similarity index 94%
rename from arch/arm/include/asm/arch-tegra/dc.h
rename to drivers/video/tegra_dc.h
index 3a7ee5e77baf..77ff2122de3c 100644
--- a/arch/arm/include/asm/arch-tegra/dc.h
+++ b/drivers/video/tegra_dc.h
@@ -1,12 +1,12 @@
/*
- * (C) Copyright 2010
+ * (C) Copyright 2010-2016
* NVIDIA Corporation <www.nvidia.com>
*
* SPDX-License-Identifier: GPL-2.0+
*/

-#ifndef __ASM_ARCH_TEGRA_DC_H
-#define __ASM_ARCH_TEGRA_DC_H
+#ifndef _VIDEO_TEGRA_DC_H
+#define _VIDEO_TEGRA_DC_H

/* Register definitions for the Tegra display controller */

@@ -566,4 +566,26 @@ enum {
#define DC_N_WINDOWS 5
#define DC_REG_SAVE_SPACE (DC_N_WINDOWS + 5)

-#endif /* __ASM_ARCH_TEGRA_DC_H */
+#ifdef CONFIG_TEGRA20
+/*
+ * I am not sure if this structure actually only applies to Tegra20, or simply
+ * was only in <arch-tegra20/display.h> and nowhere else for no good reason.
+ */
+/* This holds information about a window which can be displayed */
+struct disp_ctl_win {
+ enum win_color_depth_id fmt; /* Color depth/format */
+ unsigned bpp; /* Bits per pixel */
+ phys_addr_t phys_addr; /* Physical address in memory */
+ unsigned x; /* Horizontal address offset (bytes) */
+ unsigned y; /* Veritical address offset (bytes) */
+ unsigned w; /* Width of source window */
+ unsigned h; /* Height of source window */
+ unsigned stride; /* Number of bytes per line */
+ unsigned out_x; /* Left edge of output window (col) */
+ unsigned out_y; /* Top edge of output window (row) */
+ unsigned out_w; /* Width of output window in pixels */
+ unsigned out_h; /* Height of output window in pixels */
+};
+#endif
+
+#endif
--
2.8.1