All of lore.kernel.org
 help / color / mirror / Atom feed
From: Giulio Benetti <giulio.benetti@benettiengineering.com>
To: u-boot@lists.denx.de
Subject: [PATCH 05/18] sunxi: display: use common video_ctfb_mode_to_display_timing()
Date: Wed, 26 Feb 2020 18:15:48 +0100	[thread overview]
Message-ID: <20200226171601.31142-6-giulio.benetti@benettiengineering.com> (raw)
In-Reply-To: <20200226171601.31142-1-giulio.benetti@benettiengineering.com>

Since video_ctfb_mode_to_display_timing() has been implemented by moving
sunxi_ctfb_mode_to_display_timing() to video_modes.c and it's meant to be
used by other video subsystem, let's use it instead of local
sunxi_ctfb_mode_to_display_timing().

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
 drivers/video/sunxi/sunxi_display.c | 33 ++---------------------------
 1 file changed, 2 insertions(+), 31 deletions(-)

diff --git a/drivers/video/sunxi/sunxi_display.c b/drivers/video/sunxi/sunxi_display.c
index 31f0aa7ddc..a6a62c83ef 100644
--- a/drivers/video/sunxi/sunxi_display.c
+++ b/drivers/video/sunxi/sunxi_display.c
@@ -615,35 +615,6 @@ static void sunxi_lcdc_backlight_enable(void)
 		gpio_direction_output(pin, PWM_ON);
 }
 
-static void sunxi_ctfb_mode_to_display_timing(const struct ctfb_res_modes *mode,
-					      struct display_timing *timing)
-{
-	timing->pixelclock.typ = mode->pixclock_khz * 1000;
-
-	timing->hactive.typ = mode->xres;
-	timing->hfront_porch.typ = mode->right_margin;
-	timing->hback_porch.typ = mode->left_margin;
-	timing->hsync_len.typ = mode->hsync_len;
-
-	timing->vactive.typ = mode->yres;
-	timing->vfront_porch.typ = mode->lower_margin;
-	timing->vback_porch.typ = mode->upper_margin;
-	timing->vsync_len.typ = mode->vsync_len;
-
-	timing->flags = 0;
-
-	if (mode->sync & FB_SYNC_HOR_HIGH_ACT)
-		timing->flags |= DISPLAY_FLAGS_HSYNC_HIGH;
-	else
-		timing->flags |= DISPLAY_FLAGS_HSYNC_LOW;
-	if (mode->sync & FB_SYNC_VERT_HIGH_ACT)
-		timing->flags |= DISPLAY_FLAGS_VSYNC_HIGH;
-	else
-		timing->flags |= DISPLAY_FLAGS_VSYNC_LOW;
-	if (mode->vmode == FB_VMODE_INTERLACED)
-		timing->flags |= DISPLAY_FLAGS_INTERLACED;
-}
-
 static void sunxi_lcdc_tcon0_mode_set(const struct ctfb_res_modes *mode,
 				      bool for_ext_vga_dac)
 {
@@ -673,7 +644,7 @@ static void sunxi_lcdc_tcon0_mode_set(const struct ctfb_res_modes *mode,
 	lcdc_pll_set(ccm, 0, mode->pixclock_khz, &clk_div, &clk_double,
 		     sunxi_is_composite());
 
-	sunxi_ctfb_mode_to_display_timing(mode, &timing);
+	video_ctfb_mode_to_display_timing(mode, &timing);
 	lcdc_tcon0_mode_set(lcdc, &timing, clk_div, for_ext_vga_dac,
 			    sunxi_display.depth, CONFIG_VIDEO_LCD_DCLK_PHASE);
 }
@@ -689,7 +660,7 @@ static void sunxi_lcdc_tcon1_mode_set(const struct ctfb_res_modes *mode,
 		(struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
 	struct display_timing timing;
 
-	sunxi_ctfb_mode_to_display_timing(mode, &timing);
+	video_ctfb_mode_to_display_timing(mode, &timing);
 	lcdc_tcon1_mode_set(lcdc, &timing, use_portd_hvsync,
 			    sunxi_is_composite());
 
-- 
2.20.1

  parent reply	other threads:[~2020-02-26 17:15 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-26 17:15 [PATCH 00/18] i.MXRT1050 add LCDIF support Giulio Benetti
2020-02-26 17:15 ` [PATCH 01/18] clk: imx: pllv3: add enable_bit Giulio Benetti
2020-03-08 20:27   ` Lukasz Majewski
2020-02-26 17:15 ` [PATCH 02/18] clk: imx: imxrt1050-clk: fix typo in clock name "video:" Giulio Benetti
2020-03-08 20:27   ` Lukasz Majewski
2020-02-26 17:15 ` [PATCH 03/18] clk: imx: clk-imxrt1050: setup PLL5 for video in non-SPL Giulio Benetti
2020-02-26 17:37   ` Fabio Estevam
2020-02-26 17:54     ` Giulio Benetti
2020-02-26 17:59       ` Fabio Estevam
2020-02-26 18:16         ` Giulio Benetti
2020-02-27 18:31           ` Fabio Estevam
2020-03-08 20:27   ` Lukasz Majewski
2020-03-08 21:05     ` Giulio Benetti
2020-03-09  9:11       ` Lukasz Majewski
2020-03-22 18:25         ` Giulio Benetti
2020-02-26 17:15 ` [PATCH 04/18] videomodes: add helper function to convert from ctfb to display_timing Giulio Benetti
2020-02-26 17:15 ` Giulio Benetti [this message]
2020-02-26 17:15 ` [PATCH 06/18] video: mxsfb: add support for DM CLK Giulio Benetti
2020-02-26 17:15 ` [PATCH 07/18] video: mxsfb: add support for i.MXRT Giulio Benetti
2020-02-26 17:15 ` [PATCH 08/18] video: mxsfb: refactor for using display_timings Giulio Benetti
2020-02-26 17:15 ` [PATCH 09/18] video: mxsfb: enable setting HSYNC negative polarity Giulio Benetti
2020-02-26 17:15 ` [PATCH 10/18] video: mxsfb: enable setting VSYNC " Giulio Benetti
2020-02-26 17:15 ` [PATCH 11/18] video: mxsfb: enable setting PIXDATA on negative edge Giulio Benetti
2020-02-26 17:15 ` [PATCH 12/18] video: mxsfb: enable setting ENABLE negative polarity Giulio Benetti
2020-02-26 17:15 ` [PATCH 13/18] imxrt1050_evk: add 16bpp video support if video layer enabled Giulio Benetti
2020-02-26 17:15 ` [PATCH 14/18] ARM: dts: i.mxrt1050: add lcdif node Giulio Benetti
2020-02-26 17:15 ` [PATCH 15/18] ARM: dts: imxrt1050: allow this dtsi file to be compiled in Linux Giulio Benetti
2020-02-26 17:39 ` [PATCH 00/18] i.MXRT1050 add LCDIF support Giulio Benetti
2020-03-22 18:27 ` Giulio Benetti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200226171601.31142-6-giulio.benetti@benettiengineering.com \
    --to=giulio.benetti@benettiengineering.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.