]> git.sur5r.net Git - u-boot/commitdiff
sunxi: video: Rename tve.c to tve_common.c
authorJernej Skrabec <jernej.skrabec@siol.net>
Fri, 19 May 2017 15:41:14 +0000 (17:41 +0200)
committerAnatolij Gustschin <agust@denx.de>
Fri, 9 Jun 2017 13:30:13 +0000 (15:30 +0200)
In order to avoid future confusion with similary named files, rename
tve.c to tve_common.c. New name better represents the fact that this file
holds code which can be and will be shared between multiple drivers.

Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/video/sunxi/Makefile
drivers/video/sunxi/tve.c [deleted file]
drivers/video/sunxi/tve_common.c [new file with mode: 0644]

index dbaab61b59c09a092755c1942ddeefd2468c26d5..0d64c2021f874c60736910576a54eaccb1280715 100644 (file)
@@ -5,5 +5,5 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-obj-$(CONFIG_VIDEO_SUNXI) += sunxi_display.o lcdc.o tve.o ../videomodes.o
+obj-$(CONFIG_VIDEO_SUNXI) += sunxi_display.o lcdc.o tve_common.o ../videomodes.o
 obj-$(CONFIG_VIDEO_DE2) += sunxi_de2.o sunxi_dw_hdmi.o lcdc.o ../dw_hdmi.o
diff --git a/drivers/video/sunxi/tve.c b/drivers/video/sunxi/tve.c
deleted file mode 100644 (file)
index adea78a..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * TV encoder driver for Allwinner SoCs.
- *
- * (C) Copyright 2013-2014 Luc Verhaegen <libv@skynet.be>
- * (C) Copyright 2014-2015 Hans de Goede <hdegoede@redhat.com>
- * (C) Copyright 2017 Jernej Skrabec <jernej.skrabec@siol.net>
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <common.h>
-
-#include <asm/arch/tve.h>
-#include <asm/io.h>
-
-void tvencoder_mode_set(struct sunxi_tve_reg * const tve, enum tve_mode mode)
-{
-       switch (mode) {
-       case tve_mode_vga:
-               writel(SUNXI_TVE_GCTRL_DAC_INPUT(0, 1) |
-                      SUNXI_TVE_GCTRL_DAC_INPUT(1, 2) |
-                      SUNXI_TVE_GCTRL_DAC_INPUT(2, 3), &tve->gctrl);
-               writel(SUNXI_TVE_CFG0_VGA, &tve->cfg0);
-               writel(SUNXI_TVE_DAC_CFG0_VGA, &tve->dac_cfg0);
-               writel(SUNXI_TVE_UNKNOWN1_VGA, &tve->unknown1);
-               break;
-       case tve_mode_composite_pal_nc:
-               writel(SUNXI_TVE_CHROMA_FREQ_PAL_NC, &tve->chroma_freq);
-               /* Fall through */
-       case tve_mode_composite_pal:
-               writel(SUNXI_TVE_GCTRL_DAC_INPUT(0, 1) |
-                      SUNXI_TVE_GCTRL_DAC_INPUT(1, 2) |
-                      SUNXI_TVE_GCTRL_DAC_INPUT(2, 3) |
-                      SUNXI_TVE_GCTRL_DAC_INPUT(3, 4), &tve->gctrl);
-               writel(SUNXI_TVE_CFG0_PAL, &tve->cfg0);
-               writel(SUNXI_TVE_DAC_CFG0_COMPOSITE, &tve->dac_cfg0);
-               writel(SUNXI_TVE_FILTER_COMPOSITE, &tve->filter);
-               writel(SUNXI_TVE_PORCH_NUM_PAL, &tve->porch_num);
-               writel(SUNXI_TVE_LINE_NUM_PAL, &tve->line_num);
-               writel(SUNXI_TVE_BLANK_BLACK_LEVEL_PAL,
-                      &tve->blank_black_level);
-               writel(SUNXI_TVE_UNKNOWN1_COMPOSITE, &tve->unknown1);
-               writel(SUNXI_TVE_CBR_LEVEL_PAL, &tve->cbr_level);
-               writel(SUNXI_TVE_BURST_WIDTH_COMPOSITE, &tve->burst_width);
-               writel(SUNXI_TVE_UNKNOWN2_PAL, &tve->unknown2);
-               writel(SUNXI_TVE_ACTIVE_NUM_COMPOSITE, &tve->active_num);
-               writel(SUNXI_TVE_CHROMA_BW_GAIN_COMP, &tve->chroma_bw_gain);
-               writel(SUNXI_TVE_NOTCH_WIDTH_COMPOSITE, &tve->notch_width);
-               writel(SUNXI_TVE_RESYNC_NUM_PAL, &tve->resync_num);
-               writel(SUNXI_TVE_SLAVE_PARA_COMPOSITE, &tve->slave_para);
-               break;
-       case tve_mode_composite_pal_m:
-               writel(SUNXI_TVE_CHROMA_FREQ_PAL_M, &tve->chroma_freq);
-               writel(SUNXI_TVE_COLOR_BURST_PAL_M, &tve->color_burst);
-               /* Fall through */
-       case tve_mode_composite_ntsc:
-               writel(SUNXI_TVE_GCTRL_DAC_INPUT(0, 1) |
-                      SUNXI_TVE_GCTRL_DAC_INPUT(1, 2) |
-                      SUNXI_TVE_GCTRL_DAC_INPUT(2, 3) |
-                      SUNXI_TVE_GCTRL_DAC_INPUT(3, 4), &tve->gctrl);
-               writel(SUNXI_TVE_CFG0_NTSC, &tve->cfg0);
-               writel(SUNXI_TVE_DAC_CFG0_COMPOSITE, &tve->dac_cfg0);
-               writel(SUNXI_TVE_FILTER_COMPOSITE, &tve->filter);
-               writel(SUNXI_TVE_PORCH_NUM_NTSC, &tve->porch_num);
-               writel(SUNXI_TVE_LINE_NUM_NTSC, &tve->line_num);
-               writel(SUNXI_TVE_BLANK_BLACK_LEVEL_NTSC,
-                      &tve->blank_black_level);
-               writel(SUNXI_TVE_UNKNOWN1_COMPOSITE, &tve->unknown1);
-               writel(SUNXI_TVE_CBR_LEVEL_NTSC, &tve->cbr_level);
-               writel(SUNXI_TVE_BURST_PHASE_NTSC, &tve->burst_phase);
-               writel(SUNXI_TVE_BURST_WIDTH_COMPOSITE, &tve->burst_width);
-               writel(SUNXI_TVE_UNKNOWN2_NTSC, &tve->unknown2);
-               writel(SUNXI_TVE_SYNC_VBI_LEVEL_NTSC, &tve->sync_vbi_level);
-               writel(SUNXI_TVE_ACTIVE_NUM_COMPOSITE, &tve->active_num);
-               writel(SUNXI_TVE_CHROMA_BW_GAIN_COMP, &tve->chroma_bw_gain);
-               writel(SUNXI_TVE_NOTCH_WIDTH_COMPOSITE, &tve->notch_width);
-               writel(SUNXI_TVE_RESYNC_NUM_NTSC, &tve->resync_num);
-               writel(SUNXI_TVE_SLAVE_PARA_COMPOSITE, &tve->slave_para);
-               break;
-       }
-}
-
-void tvencoder_enable(struct sunxi_tve_reg * const tve)
-{
-       setbits_le32(&tve->gctrl, SUNXI_TVE_GCTRL_ENABLE);
-}
diff --git a/drivers/video/sunxi/tve_common.c b/drivers/video/sunxi/tve_common.c
new file mode 100644 (file)
index 0000000..adea78a
--- /dev/null
@@ -0,0 +1,86 @@
+/*
+ * TV encoder driver for Allwinner SoCs.
+ *
+ * (C) Copyright 2013-2014 Luc Verhaegen <libv@skynet.be>
+ * (C) Copyright 2014-2015 Hans de Goede <hdegoede@redhat.com>
+ * (C) Copyright 2017 Jernej Skrabec <jernej.skrabec@siol.net>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+
+#include <asm/arch/tve.h>
+#include <asm/io.h>
+
+void tvencoder_mode_set(struct sunxi_tve_reg * const tve, enum tve_mode mode)
+{
+       switch (mode) {
+       case tve_mode_vga:
+               writel(SUNXI_TVE_GCTRL_DAC_INPUT(0, 1) |
+                      SUNXI_TVE_GCTRL_DAC_INPUT(1, 2) |
+                      SUNXI_TVE_GCTRL_DAC_INPUT(2, 3), &tve->gctrl);
+               writel(SUNXI_TVE_CFG0_VGA, &tve->cfg0);
+               writel(SUNXI_TVE_DAC_CFG0_VGA, &tve->dac_cfg0);
+               writel(SUNXI_TVE_UNKNOWN1_VGA, &tve->unknown1);
+               break;
+       case tve_mode_composite_pal_nc:
+               writel(SUNXI_TVE_CHROMA_FREQ_PAL_NC, &tve->chroma_freq);
+               /* Fall through */
+       case tve_mode_composite_pal:
+               writel(SUNXI_TVE_GCTRL_DAC_INPUT(0, 1) |
+                      SUNXI_TVE_GCTRL_DAC_INPUT(1, 2) |
+                      SUNXI_TVE_GCTRL_DAC_INPUT(2, 3) |
+                      SUNXI_TVE_GCTRL_DAC_INPUT(3, 4), &tve->gctrl);
+               writel(SUNXI_TVE_CFG0_PAL, &tve->cfg0);
+               writel(SUNXI_TVE_DAC_CFG0_COMPOSITE, &tve->dac_cfg0);
+               writel(SUNXI_TVE_FILTER_COMPOSITE, &tve->filter);
+               writel(SUNXI_TVE_PORCH_NUM_PAL, &tve->porch_num);
+               writel(SUNXI_TVE_LINE_NUM_PAL, &tve->line_num);
+               writel(SUNXI_TVE_BLANK_BLACK_LEVEL_PAL,
+                      &tve->blank_black_level);
+               writel(SUNXI_TVE_UNKNOWN1_COMPOSITE, &tve->unknown1);
+               writel(SUNXI_TVE_CBR_LEVEL_PAL, &tve->cbr_level);
+               writel(SUNXI_TVE_BURST_WIDTH_COMPOSITE, &tve->burst_width);
+               writel(SUNXI_TVE_UNKNOWN2_PAL, &tve->unknown2);
+               writel(SUNXI_TVE_ACTIVE_NUM_COMPOSITE, &tve->active_num);
+               writel(SUNXI_TVE_CHROMA_BW_GAIN_COMP, &tve->chroma_bw_gain);
+               writel(SUNXI_TVE_NOTCH_WIDTH_COMPOSITE, &tve->notch_width);
+               writel(SUNXI_TVE_RESYNC_NUM_PAL, &tve->resync_num);
+               writel(SUNXI_TVE_SLAVE_PARA_COMPOSITE, &tve->slave_para);
+               break;
+       case tve_mode_composite_pal_m:
+               writel(SUNXI_TVE_CHROMA_FREQ_PAL_M, &tve->chroma_freq);
+               writel(SUNXI_TVE_COLOR_BURST_PAL_M, &tve->color_burst);
+               /* Fall through */
+       case tve_mode_composite_ntsc:
+               writel(SUNXI_TVE_GCTRL_DAC_INPUT(0, 1) |
+                      SUNXI_TVE_GCTRL_DAC_INPUT(1, 2) |
+                      SUNXI_TVE_GCTRL_DAC_INPUT(2, 3) |
+                      SUNXI_TVE_GCTRL_DAC_INPUT(3, 4), &tve->gctrl);
+               writel(SUNXI_TVE_CFG0_NTSC, &tve->cfg0);
+               writel(SUNXI_TVE_DAC_CFG0_COMPOSITE, &tve->dac_cfg0);
+               writel(SUNXI_TVE_FILTER_COMPOSITE, &tve->filter);
+               writel(SUNXI_TVE_PORCH_NUM_NTSC, &tve->porch_num);
+               writel(SUNXI_TVE_LINE_NUM_NTSC, &tve->line_num);
+               writel(SUNXI_TVE_BLANK_BLACK_LEVEL_NTSC,
+                      &tve->blank_black_level);
+               writel(SUNXI_TVE_UNKNOWN1_COMPOSITE, &tve->unknown1);
+               writel(SUNXI_TVE_CBR_LEVEL_NTSC, &tve->cbr_level);
+               writel(SUNXI_TVE_BURST_PHASE_NTSC, &tve->burst_phase);
+               writel(SUNXI_TVE_BURST_WIDTH_COMPOSITE, &tve->burst_width);
+               writel(SUNXI_TVE_UNKNOWN2_NTSC, &tve->unknown2);
+               writel(SUNXI_TVE_SYNC_VBI_LEVEL_NTSC, &tve->sync_vbi_level);
+               writel(SUNXI_TVE_ACTIVE_NUM_COMPOSITE, &tve->active_num);
+               writel(SUNXI_TVE_CHROMA_BW_GAIN_COMP, &tve->chroma_bw_gain);
+               writel(SUNXI_TVE_NOTCH_WIDTH_COMPOSITE, &tve->notch_width);
+               writel(SUNXI_TVE_RESYNC_NUM_NTSC, &tve->resync_num);
+               writel(SUNXI_TVE_SLAVE_PARA_COMPOSITE, &tve->slave_para);
+               break;
+       }
+}
+
+void tvencoder_enable(struct sunxi_tve_reg * const tve)
+{
+       setbits_le32(&tve->gctrl, SUNXI_TVE_GCTRL_ENABLE);
+}