All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Beckett <bob.beckett@collabora.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 31/37] board: ge: mx53ppd: clean up DM PWM video and backlight
Date: Tue, 15 Oct 2019 16:53:44 +0100	[thread overview]
Message-ID: <37a1dcc737538c97f2259ec160eb2b9c9d4c5fe6.1571150958.git.bob.beckett@collabora.com> (raw)
In-Reply-To: <cover.1571150958.git.bob.beckett@collabora.com>

Remove old (incorrect) setup_iomux_lcd.
Enable backlight via display enable handler.
Use cls command to initiate display in HW agnostic manner.

Signed-off-by: Robert Beckett <bob.beckett@collabora.com>
---
 board/ge/mx53ppd/mx53ppd.c       |   1 -
 board/ge/mx53ppd/mx53ppd_video.c | 118 +++++++++----------------------
 configs/mx53ppd_defconfig        |   1 +
 include/configs/mx53ppd.h        |   2 +-
 4 files changed, 36 insertions(+), 86 deletions(-)

diff --git a/board/ge/mx53ppd/mx53ppd.c b/board/ge/mx53ppd/mx53ppd.c
index 17ba3a87dd..57bf03f659 100644
--- a/board/ge/mx53ppd/mx53ppd.c
+++ b/board/ge/mx53ppd/mx53ppd.c
@@ -171,7 +171,6 @@ int board_early_init_f(void)
 {
 	setup_iomux_uart();
 	setup_iomux_fec();
-	setup_iomux_lcd();
 	ppd_gpio_init();
 
 	return 0;
diff --git a/board/ge/mx53ppd/mx53ppd_video.c b/board/ge/mx53ppd/mx53ppd_video.c
index c386dc29de..3240ed62ae 100644
--- a/board/ge/mx53ppd/mx53ppd_video.c
+++ b/board/ge/mx53ppd/mx53ppd_video.c
@@ -25,69 +25,6 @@ static int detect_lcd(struct display_info_t const *dev)
 	return 1;
 }
 
-struct display_info_t const displays[] = {
-	{
-		.bus	= -1,
-		.addr	= -1,
-		.pixfmt	= IPU_PIX_FMT_RGB24,
-		.detect	= detect_lcd,
-		.enable	= NULL,
-		.mode = {
-			.name		= "NV-SPWGRGB888",
-			.refresh	= 60,
-			.xres		= 800,
-			.yres		= 480,
-			.pixclock	= 15384,
-			.left_margin	= 16,
-			.right_margin	= 210,
-			.upper_margin	= 10,
-			.lower_margin	= 22,
-			.hsync_len	= 30,
-			.vsync_len	= 13,
-			.sync		= FB_SYNC_EXT,
-			.vmode		= FB_VMODE_NONINTERLACED
-		}
-	}
-};
-
-size_t display_count = ARRAY_SIZE(displays);
-
-void setup_iomux_lcd(void)
-{
-	static const iomux_v3_cfg_t lcd_pads[] = {
-		MX53_PAD_DI0_DISP_CLK__IPU_DI0_DISP_CLK,
-		MX53_PAD_DI0_PIN15__IPU_DI0_PIN15,
-		MX53_PAD_DI0_PIN2__IPU_DI0_PIN2,
-		MX53_PAD_DI0_PIN3__IPU_DI0_PIN3,
-		MX53_PAD_DISP0_DAT0__IPU_DISP0_DAT_0,
-		MX53_PAD_DISP0_DAT1__IPU_DISP0_DAT_1,
-		MX53_PAD_DISP0_DAT2__IPU_DISP0_DAT_2,
-		MX53_PAD_DISP0_DAT3__IPU_DISP0_DAT_3,
-		MX53_PAD_DISP0_DAT4__IPU_DISP0_DAT_4,
-		MX53_PAD_DISP0_DAT5__IPU_DISP0_DAT_5,
-		MX53_PAD_DISP0_DAT6__IPU_DISP0_DAT_6,
-		MX53_PAD_DISP0_DAT7__IPU_DISP0_DAT_7,
-		MX53_PAD_DISP0_DAT8__IPU_DISP0_DAT_8,
-		MX53_PAD_DISP0_DAT9__IPU_DISP0_DAT_9,
-		MX53_PAD_DISP0_DAT10__IPU_DISP0_DAT_10,
-		MX53_PAD_DISP0_DAT11__IPU_DISP0_DAT_11,
-		MX53_PAD_DISP0_DAT12__IPU_DISP0_DAT_12,
-		MX53_PAD_DISP0_DAT13__IPU_DISP0_DAT_13,
-		MX53_PAD_DISP0_DAT14__IPU_DISP0_DAT_14,
-		MX53_PAD_DISP0_DAT15__IPU_DISP0_DAT_15,
-		MX53_PAD_DISP0_DAT16__IPU_DISP0_DAT_16,
-		MX53_PAD_DISP0_DAT17__IPU_DISP0_DAT_17,
-		MX53_PAD_DISP0_DAT18__IPU_DISP0_DAT_18,
-		MX53_PAD_DISP0_DAT19__IPU_DISP0_DAT_19,
-		MX53_PAD_DISP0_DAT20__IPU_DISP0_DAT_20,
-		MX53_PAD_DISP0_DAT21__IPU_DISP0_DAT_21,
-		MX53_PAD_DISP0_DAT22__IPU_DISP0_DAT_22,
-		MX53_PAD_DISP0_DAT23__IPU_DISP0_DAT_23,
-	};
-
-	imx_iomux_v3_setup_multiple_pads(lcd_pads, ARRAY_SIZE(lcd_pads));
-}
-
 static void lcd_enable(void)
 {
 	struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
@@ -112,34 +49,47 @@ static void lcd_enable(void)
 		&iomux->gpr[2]);
 }
 
-static int do_lcd_enable(cmd_tbl_t *cmdtp, int flag, int argc,
-			 char * const argv[])
+static void do_enable_backlight(struct display_info_t const *dev)
 {
-	lcd_enable();
-
-	int ret;
 	struct udevice *panel;
-	struct udevice *dev;
+	int ret;
+
+	lcd_enable();
 
 	ret = uclass_get_device(UCLASS_PANEL, 0, &panel);
-	if (ret)
-		return ret;
+	if (ret) {
+		printf("Could not find panel: %d\n", ret);
+		return;
+	}
 
 	panel_set_backlight(panel, 100);
 	panel_enable_backlight(panel);
+}
 
-	/* Probe, to find a video device to be used to show a message on
-	 * the vidconsole.
-	 */
-	ret = uclass_get_device(UCLASS_VIDEO, 0, &dev);
-	if (ret)
-		return ret;
+struct display_info_t const displays[] = {
+	{
+		.bus	= -1,
+		.addr	= -1,
+		.pixfmt	= IPU_PIX_FMT_RGB24,
+		.detect	= detect_lcd,
+		.enable	= do_enable_backlight,
+		.mode = {
+			.name		= "NV-SPWGRGB888",
+			.refresh	= 60,
+			.xres		= 800,
+			.yres		= 480,
+			.pixclock	= 15384,
+			.left_margin	= 16,
+			.right_margin	= 210,
+			.upper_margin	= 10,
+			.lower_margin	= 22,
+			.hsync_len	= 30,
+			.vsync_len	= 13,
+			.sync		= FB_SYNC_EXT,
+			.vmode		= FB_VMODE_NONINTERLACED
+		}
+	}
+};
 
-	return 0;
-}
+size_t display_count = ARRAY_SIZE(displays);
 
-U_BOOT_CMD(
-	ppd_lcd_enable,	1,	1,	do_lcd_enable,
-	"enable PPD LCD",
-	"no parameters"
-);
diff --git a/configs/mx53ppd_defconfig b/configs/mx53ppd_defconfig
index 4d4f93614f..2094e74c7d 100644
--- a/configs/mx53ppd_defconfig
+++ b/configs/mx53ppd_defconfig
@@ -22,6 +22,7 @@ CONFIG_CMD_DHCP=y
 CONFIG_CMD_BOOTCOUNT=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
+CONFIG_CMD_CLS=y
 CONFIG_CMD_EXT2=y
 CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
diff --git a/include/configs/mx53ppd.h b/include/configs/mx53ppd.h
index c7414213a7..3b1615338c 100644
--- a/include/configs/mx53ppd.h
+++ b/include/configs/mx53ppd.h
@@ -91,7 +91,7 @@
 		"/boot/bootcause/firstboot\0" \
 	"swappartitions=setexpr partnum 3 - ${partnum}\0" \
 	"failbootcmd=" \
-		"ppd_lcd_enable; " \
+		"cls; " \
 		"setcurs 5 4; " \
 		"lcdputs \"Monitor failed to start. " \
 		"Try again, or contact GE Service for support.\"; " \
-- 
2.20.1

  parent reply	other threads:[~2019-10-15 15:53 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-15 15:53 [U-Boot] [PATCH 00/37] convert GE boards to DM Robert Beckett
2019-10-15 15:53 ` [U-Boot] [PATCH 01/37] configs: bx50v3: Fix boot hang with video Robert Beckett
2019-10-15 15:53 ` [U-Boot] [PATCH 02/37] board: ge: bx50v3: Fix run-time warning Robert Beckett
2019-10-15 15:53 ` [U-Boot] [PATCH 03/37] board: ge: bx50v3: Fix message output to video console Robert Beckett
2019-10-15 15:53 ` [U-Boot] [PATCH 04/37] configs: ppd: DM for USB and regulators PPD Robert Beckett
2019-10-15 15:53 ` [U-Boot] [PATCH 05/37] board: ge: bx50v3: Enable DM for PCI and ethernet Robert Beckett
2019-10-15 15:53 ` [U-Boot] [PATCH 06/37] board: ge: pass rtc_status via device tree Robert Beckett
2019-10-15 15:53 ` [U-Boot] [PATCH 07/37] board: ge: bx50v3: use imx wdt Robert Beckett
2019-10-15 15:53 ` [U-Boot] [PATCH 08/37] board: ge: mx53ppd: " Robert Beckett
2019-10-15 15:53 ` [U-Boot] [PATCH 09/37] board: ge: bx50v3: Add i2c bus description Robert Beckett
2019-10-15 15:53 ` [U-Boot] [PATCH 10/37] board: ge: mx53ppd: Add i2c bus descritpion Robert Beckett
2019-10-15 15:53 ` [U-Boot] [PATCH 11/37] misc: i2c_eeprom: add fixed partitions support Robert Beckett
2019-10-15 15:53 ` [U-Boot] [PATCH 12/37] misc: i2c_eeprom: add size query Robert Beckett
2019-10-15 15:53 ` [U-Boot] [PATCH 13/37] board: ge: bx50v3: use DM I2C Robert Beckett
2019-10-15 15:53 ` [U-Boot] [PATCH 14/37] board: ge: mx53ppd: " Robert Beckett
2019-10-15 15:53 ` [U-Boot] [PATCH 15/37] board: ge: convert vpd to use i2c eeprom Robert Beckett
2019-10-15 15:53 ` [U-Boot] [PATCH 16/37] i2c: add support for offset overflow in to address Robert Beckett
2019-10-16  3:40   ` Simon Glass
2019-10-17 14:35     ` Robert Beckett
2019-10-21 23:47       ` Simon Glass
2019-10-15 15:53 ` [U-Boot] [PATCH 17/37] misc: i2c_eeprom: set offset len and chip addr offset mask Robert Beckett
2019-10-15 15:53 ` [U-Boot] [PATCH 18/37] bootcount: add a DM i2c eeprom backing store for bootcount Robert Beckett
2019-10-15 15:53 ` [U-Boot] [PATCH 19/37] board: ge: bx50v3: add i2c eeprom bootcount storage Robert Beckett
2019-10-15 15:53 ` [U-Boot] [PATCH 20/37] board: ge: mx53ppd: " Robert Beckett
2019-10-15 15:53 ` [U-Boot] [PATCH 21/37] rtc: rx8010sj: fix DM initialization Robert Beckett
2019-10-15 15:53 ` [U-Boot] [PATCH 22/37] board: ge: bx50v3, mx53ppd: use DM rtc Robert Beckett
2019-10-15 15:53 ` [U-Boot] [PATCH 23/37] board: ge: bx50v3: use DM i2c for PMIC initialization Robert Beckett
2019-10-15 15:53 ` [U-Boot] [PATCH 24/37] board: ge: mx53ppd: remove redundant power config Robert Beckett
2019-10-15 15:53 ` [U-Boot] [PATCH 25/37] board: ge: bx50v3, mx53ppd: disable I2C compatibility API Robert Beckett
2019-10-15 15:53 ` [U-Boot] [PATCH 26/37] board: ge: mx53ppd: move uart initialisation to own function Robert Beckett
2019-10-15 15:53 ` [U-Boot] [PATCH 27/37] board: ge: mx53ppd: enable DM_VIDEO Robert Beckett
2019-10-15 15:53 ` [U-Boot] [PATCH 28/37] rtc: s35392a: encode command correctly Robert Beckett
2019-10-15 15:53 ` [U-Boot] [PATCH 29/37] board: ge: mx53ppd: fix RTC compatible definition Robert Beckett
2019-10-15 15:53 ` [U-Boot] [PATCH 30/37] board: ge: bx50v3: Enable DM PWM for backlight Robert Beckett
2019-10-15 15:53 ` Robert Beckett [this message]
2019-10-15 15:53 ` [U-Boot] [PATCH 32/37] board: ge: mx53ppd: Use DM for ethernet Robert Beckett
2019-10-15 15:53 ` [U-Boot] [PATCH 33/37] board: ge: bx50v3: use DM for uart Robert Beckett
2019-10-15 15:53 ` [U-Boot] [PATCH 34/37] serial: mxc: add imx53 and imx21 compatible string Robert Beckett
2019-10-15 15:53 ` [U-Boot] [PATCH 35/37] board: ge: mx53ppd: use DM for uart Robert Beckett
2019-10-15 15:53 ` [U-Boot] [PATCH 36/37] dm: pmic: add da9063 PMIC driver and regulators Robert Beckett
2019-10-16  7:24   ` Schrempf Frieder
2019-10-16 11:11     ` Robert Beckett
2019-10-16 12:06       ` Martin Fuzzey
2019-10-15 15:53 ` [U-Boot] [PATCH 37/37] board: ge: bx50v3: use DM PMIC driver Robert Beckett

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=37a1dcc737538c97f2259ec160eb2b9c9d4c5fe6.1571150958.git.bob.beckett@collabora.com \
    --to=bob.beckett@collabora.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.