Skip to contentSkip to conversation

video: ti: am335x: drop pre-driver-model code

RFC PATCH Superseded Dario Binacchi 2 participants 6 messages Dec 19, 2022 – Dec 20, 2022

Subsystems (4)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover video: ti: am335x: drop pre-driver-model code

The commit [1] also removed the code with driver model support, I preferred to start from a revert and apply the necessary changes in a second commit, rather than restore the removed modules.

[1] 82f7b869f5d7a ("video: Drop CONFIG_AM335X_LCD")

Dario Binacchi (2):
Revert "video: Drop CONFIG_AM335X_LCD"
video: ti: am335x: drop pre-driver-model code

 drivers/video/Kconfig           |   2 +
 drivers/video/Makefile          |   1 +
 drivers/video/ti/Kconfig        |   8 +
 drivers/video/ti/Makefile       |   6 +
 drivers/video/ti/tilcdc-panel.c | 172 +++++++++++++
 drivers/video/ti/tilcdc-panel.h |  14 ++
 drivers/video/ti/tilcdc.c       | 426 ++++++++++++++++++++++++++++++++
 drivers/video/ti/tilcdc.h       |  38 +++
 8 files changed, 667 insertions(+)
 create mode 100644 drivers/video/ti/Kconfig
 create mode 100644 drivers/video/ti/Makefile
 create mode 100644 drivers/video/ti/tilcdc-panel.c
 create mode 100644 drivers/video/ti/tilcdc-panel.h
 create mode 100644 drivers/video/ti/tilcdc.c
 create mode 100644 drivers/video/ti/tilcdc.h
Signature · 1 line
2.32.0
#1 lore raw

RFC PATCH 1/2 Revert "video: Drop CONFIG_AM335X_LCD"

This reverts commit 82f7b869f5d7aad246a4621a18a5ad04475815ba.

It also removed code with driver model support.
The commit [1], as described in its message, was also designed to make it easy to remove pre-driver-model code in the near future.

[1] 35ab1b6ef7f3a ("video: omap: split the legacy code from the DM code")

---

 arch/arm/mach-omap2/am33xx/clock_am33xx.c |   4 +
 board/bosch/guardian/board.c              |  70 ++++
 configs/am335x_guardian_defconfig         |   1 +
 drivers/video/Kconfig                     |   2 +
 drivers/video/Makefile                    |   1 +
 drivers/video/ti/Kconfig                  |   8 +
 drivers/video/ti/Makefile                 |  10 +
 drivers/video/ti/am335x-fb.c              | 318 ++++++++++++++++
 drivers/video/ti/am335x-fb.h              |  71 ++++
 drivers/video/ti/tilcdc-panel.c           | 172 +++++++++
 drivers/video/ti/tilcdc-panel.h           |  14 +
 drivers/video/ti/tilcdc.c                 | 426 ++++++++++++++++++++++
 drivers/video/ti/tilcdc.h                 |  38 ++
 13 files changed, 1135 insertions(+)
 create mode 100644 drivers/video/ti/Kconfig
 create mode 100644 drivers/video/ti/Makefile
 create mode 100644 drivers/video/ti/am335x-fb.c
 create mode 100644 drivers/video/ti/am335x-fb.h
 create mode 100644 drivers/video/ti/tilcdc-panel.c
 create mode 100644 drivers/video/ti/tilcdc-panel.h
 create mode 100644 drivers/video/ti/tilcdc.c
 create mode 100644 drivers/video/ti/tilcdc.h
arch/arm/mach-omap2/am33xx/clock_am33xx.c +4 -0
index cd3b34bf56bf..3a7ac6026405 100644
@@ -227,6 +227,10 @@ void enable_basic_clocks(void)
 		&cmper->usb0clkctrl,
 		&cmper->emiffwclkctrl,
 		&cmper->emifclkctrl,
+#if CONFIG_IS_ENABLED(AM335X_LCD) && !CONFIG_IS_ENABLED(DM_VIDEO)
+		&cmper->lcdclkctrl,
+		&cmper->lcdcclkstctrl,
+#endif
 		0
 	};
 
board/bosch/guardian/board.c +70 -0

82 lines not on this page · raw message

configs/am335x_guardian_defconfig +1 -0
index fef4fd155100..8eeb8555312d 100644
@@ -131,6 +131,7 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0451
 CONFIG_USB_GADGET_PRODUCT_NUM=0xd022
 CONFIG_USB_ETHER=y
 CONFIG_SYS_WHITE_ON_BLACK=y
+CONFIG_AM335X_LCD=y
 CONFIG_BMP_16BPP=y
 CONFIG_SPL_WDT=y
 # CONFIG_SPL_USE_TINY_PRINTF is not set
drivers/video/Kconfig +2 -0
index c841b99bb30d..54fa93adb4f8 100644
@@ -573,6 +573,8 @@ config ATMEL_HLCD
 	help
 	   HLCDC supports video output to an attached LCD panel.
 
+source "drivers/video/ti/Kconfig"
+
 source "drivers/video/exynos/Kconfig"
 
 config LOGICORE_DP_TX
drivers/video/Makefile +1 -0
index 40a871d638e9..b359b0784050 100644
@@ -26,6 +26,7 @@ obj-${CONFIG_EXYNOS_FB} += exynos/
 obj-${CONFIG_VIDEO_ROCKCHIP} += rockchip/
 obj-${CONFIG_VIDEO_STM32} += stm32/
 obj-${CONFIG_VIDEO_TEGRA124} += tegra124/
+obj-y += ti/
 
 obj-$(CONFIG_ATMEL_HLCD) += atmel_hlcdfb.o
 obj-$(CONFIG_ATMEL_LCD) += atmel_lcdfb.o
drivers/video/ti/Kconfig new file +8 -0
new file mode 100644
index 000000000000..3081e9e8c09b
@@ -0,0 +1,8 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Copyright (C) 2020 Dario Binacchi <[email protected]>
+#
+config AM335X_LCD
+	bool "Enable AM335x video support"
+	help
+	   Supports video output to an attached LCD panel.
drivers/video/ti/Makefile new file +10 -0
new file mode 100644
index 000000000000..ddddd592167b
@@ -0,0 +1,10 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Copyright (C) 2020 Dario Binacchi <[email protected]>
+#
+
+ifdef CONFIG_DM_VIDEO
+obj-$(CONFIG_AM335X_LCD) += tilcdc.o tilcdc-panel.o
+else
+obj-$(CONFIG_AM335X_LCD) += am335x-fb.o
+endif
drivers/video/ti/am335x-fb.c new file +318 -0

318 lines not on this page · raw message

drivers/video/ti/am335x-fb.h new file +71 -0

71 lines not on this page · raw message

drivers/video/ti/tilcdc-panel.c new file +172 -0

172 lines not on this page · raw message

drivers/video/ti/tilcdc-panel.h new file +14 -0
new file mode 100644
index 000000000000..6bcfbf8a8b4c
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2020 Dario Binacchi <[email protected]>
+ */
+
+#ifndef _TILCDC_PANEL_H
+#define _TILCDC_PANEL_H
+
+#include "tilcdc.h"
+
+int tilcdc_panel_get_display_info(struct udevice *dev,
+				  struct tilcdc_panel_info *info);
+
+#endif /* _TILCDC_PANEL_H */
drivers/video/ti/tilcdc.c new file +426 -0

426 lines not on this page · raw message

drivers/video/ti/tilcdc.h new file +38 -0
new file mode 100644
index 000000000000..2645921df651
@@ -0,0 +1,38 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2020 Dario Binacchi <[email protected]>
+ */
+
+#ifndef _TILCDC_H
+#define _TILCDC_H
+
+/**
+ * tilcdc_panel_info: Panel parameters
+ *
+ * @ac_bias: AC Bias Pin Frequency
+ * @ac_bias_intrpt: AC Bias Pin Transitions per Interrupt
+ * @dma_burst_sz: DMA burst size
+ * @bpp: Bits per pixel
+ * @fdd: FIFO DMA Request Delay
+ * @tft_alt_mode: TFT Alternative Signal Mapping (Only for active)
+ * @invert_pxl_clk: Invert pixel clock
+ * @sync_edge: Horizontal and Vertical Sync Edge: 0=rising 1=falling
+ * @sync_ctrl: Horizontal and Vertical Sync: Control: 0=ignore
+ * @raster_order: Raster Data Order Select: 1=Most-to-least 0=Least-to-most
+ * @fifo_th: DMA FIFO threshold
+ */
+struct tilcdc_panel_info {
+	u32 ac_bias;
+	u32 ac_bias_intrpt;
+	u32 dma_burst_sz;
+	u32 bpp;
+	u32 fdd;
+	bool tft_alt_mode;
+	bool invert_pxl_clk;
+	u32 sync_edge;
+	u32 sync_ctrl;
+	u32 raster_order;
+	u32 fifo_th;
+};
+
+#endif /* _TILCDC_H */
Signature · 1 line
2.32.0
Reviewed-by on v1 1/2
#2 lore raw

Re: [RESEND RFC PATCH 1/2] Revert "video: Drop CONFIG_AM335X_LCD"

Hi Dario,

Quoted 25 lines · Dario Binacchi

This reverts commit 82f7b869f5d7aad246a4621a18a5ad04475815ba.

It also removed code with driver model support.
The commit [1], as described in its message, was also designed to make it easy to remove pre-driver-model code in the near future.

[1] 35ab1b6ef7f3a ("video: omap: split the legacy code from the DM code")

---

 arch/arm/mach-omap2/am33xx/clock_am33xx.c |   4 +
 board/bosch/guardian/board.c              |  70 ++++
 configs/am335x_guardian_defconfig         |   1 +
 drivers/video/Kconfig                     |   2 +
 drivers/video/Makefile                    |   1 +
 drivers/video/ti/Kconfig                  |   8 +
 drivers/video/ti/Makefile                 |  10 +
 drivers/video/ti/am335x-fb.c              | 318 ++++++++++++++++
 drivers/video/ti/am335x-fb.h              |  71 ++++
 drivers/video/ti/tilcdc-panel.c           | 172 +++++++++
 drivers/video/ti/tilcdc-panel.h           |  14 +
 drivers/video/ti/tilcdc.c                 | 426 ++++++++++++++++++++++
 drivers/video/ti/tilcdc.h                 |  38 ++
 13 files changed, 1135 insertions(+)
Quoted 8 lines
 create mode 100644 drivers/video/ti/Kconfig
 create mode 100644 drivers/video/ti/Makefile
 create mode 100644 drivers/video/ti/am335x-fb.c
 create mode 100644 drivers/video/ti/am335x-fb.h
 create mode 100644 drivers/video/ti/tilcdc-panel.c
 create mode 100644 drivers/video/ti/tilcdc-panel.h
 create mode 100644 drivers/video/ti/tilcdc.c
 create mode 100644 drivers/video/ti/tilcdc.h

I'm sorry if I messed something up there. Can you add back just the DM code? We don't have lcd.h anymore.

But if this is the way you want to do it:

Regards,
Simon

#3 lore raw

Re: [RESEND RFC PATCH 1/2] Revert "video: Drop CONFIG_AM335X_LCD"

Hi Simon,

Quoted 39 lines · Simon Glass

Hi Dario,

Quoted 25 lines · Dario Binacchi

This reverts commit 82f7b869f5d7aad246a4621a18a5ad04475815ba.

It also removed code with driver model support.
The commit [1], as described in its message, was also designed to make it easy to remove pre-driver-model code in the near future.

[1] 35ab1b6ef7f3a ("video: omap: split the legacy code from the DM code")

---

 arch/arm/mach-omap2/am33xx/clock_am33xx.c |   4 +
 board/bosch/guardian/board.c              |  70 ++++
 configs/am335x_guardian_defconfig         |   1 +
 drivers/video/Kconfig                     |   2 +
 drivers/video/Makefile                    |   1 +
 drivers/video/ti/Kconfig                  |   8 +
 drivers/video/ti/Makefile                 |  10 +
 drivers/video/ti/am335x-fb.c              | 318 ++++++++++++++++
 drivers/video/ti/am335x-fb.h              |  71 ++++
 drivers/video/ti/tilcdc-panel.c           | 172 +++++++++
 drivers/video/ti/tilcdc-panel.h           |  14 +
 drivers/video/ti/tilcdc.c                 | 426 ++++++++++++++++++++++
 drivers/video/ti/tilcdc.h                 |  38 ++
 13 files changed, 1135 insertions(+)
Quoted 8 lines
 create mode 100644 drivers/video/ti/Kconfig
 create mode 100644 drivers/video/ti/Makefile
 create mode 100644 drivers/video/ti/am335x-fb.c
 create mode 100644 drivers/video/ti/am335x-fb.h
 create mode 100644 drivers/video/ti/tilcdc-panel.c
 create mode 100644 drivers/video/ti/tilcdc-panel.h
 create mode 100644 drivers/video/ti/tilcdc.c
 create mode 100644 drivers/video/ti/tilcdc.h
Quoted 2 lines

I'm sorry if I messed something up there. Can you add back just the DM code? We don't have lcd.h anymore.

Yes, you are right. I will submit v2, collapsing the two patches in one only that
restores the DM code.
Furthermore, the two patches failed the compilation.

Thanks and regards,
Dario

Quoted 7 lines

But if this is the way you want to do it:

Regards,
Simon

Signature · 17 lines
Dario Binacchi

Embedded Linux Developer

[email protected]

__________________________________


Amarula Solutions SRL

Via Le Canevare 30, 31100 Treviso, Veneto, IT

T. +39 042 243 5310
[email protected]

www.amarulasolutions.com
#4 lore raw

RFC PATCH 2/2 video: ti: am335x: drop pre-driver-model code

In reply to Dario Binacchi

The patch removes the pre-driver-model implementation and keeps the code with driver model support.

---

 arch/arm/mach-omap2/am33xx/clock_am33xx.c |   4 -
 board/bosch/guardian/board.c              |  70 -----
 configs/am335x_guardian_defconfig         |   1 -
 drivers/video/ti/Makefile                 |   4 -
 drivers/video/ti/am335x-fb.c              | 318 ----------------------
 drivers/video/ti/am335x-fb.h              |  71 -----
 6 files changed, 468 deletions(-)
 delete mode 100644 drivers/video/ti/am335x-fb.c
 delete mode 100644 drivers/video/ti/am335x-fb.h
arch/arm/mach-omap2/am33xx/clock_am33xx.c +0 -4
index 3a7ac6026405..cd3b34bf56bf 100644
@@ -227,10 +227,6 @@ void enable_basic_clocks(void)
 		&cmper->usb0clkctrl,
 		&cmper->emiffwclkctrl,
 		&cmper->emifclkctrl,
-#if CONFIG_IS_ENABLED(AM335X_LCD) && !CONFIG_IS_ENABLED(DM_VIDEO)
-		&cmper->lcdclkctrl,
-		&cmper->lcdcclkstctrl,
-#endif
 		0
 	};
 
board/bosch/guardian/board.c +0 -70

82 lines not on this page · raw message

configs/am335x_guardian_defconfig +0 -1
index 8eeb8555312d..fef4fd155100 100644
@@ -131,7 +131,6 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0451
 CONFIG_USB_GADGET_PRODUCT_NUM=0xd022
 CONFIG_USB_ETHER=y
 CONFIG_SYS_WHITE_ON_BLACK=y
-CONFIG_AM335X_LCD=y
 CONFIG_BMP_16BPP=y
 CONFIG_SPL_WDT=y
 # CONFIG_SPL_USE_TINY_PRINTF is not set
drivers/video/ti/Makefile +0 -4
index ddddd592167b..1f551c84f347 100644
@@ -3,8 +3,4 @@
 # Copyright (C) 2020 Dario Binacchi <[email protected]>
 #
 
-ifdef CONFIG_DM_VIDEO
 obj-$(CONFIG_AM335X_LCD) += tilcdc.o tilcdc-panel.o
-else
-obj-$(CONFIG_AM335X_LCD) += am335x-fb.o
-endif
drivers/video/ti/am335x-fb.c deleted +0 -318

318 lines not on this page · raw message

drivers/video/ti/am335x-fb.h deleted +0 -71

71 lines not on this page · raw message

Signature · 1 line
2.32.0
Reviewed-by on v1 2/2
#5 lore raw
Quoted 8 lines · Dario Binacchi

The patch removes the pre-driver-model implementation and keeps the code with driver model support.

---

Quoted 9 lines
 arch/arm/mach-omap2/am33xx/clock_am33xx.c |   4 -
 board/bosch/guardian/board.c              |  70 -----
 configs/am335x_guardian_defconfig         |   1 -
 drivers/video/ti/Makefile                 |   4 -
 drivers/video/ti/am335x-fb.c              | 318 ----------------------
 drivers/video/ti/am335x-fb.h              |  71 -----
 6 files changed, 468 deletions(-)
 delete mode 100644 drivers/video/ti/am335x-fb.c
 delete mode 100644 drivers/video/ti/am335x-fb.h