I was having issues configuring the AM335X LCDC for my specific LCD panel (Kyocera TCG035QVL). Turns out it was the Invert Output Enable of lcd_ac pin option in the LCDC_RASTER_TIMING_2 register that needed to be set. The Linux driver in the SDK did not support configuring this option so I patched the driver to support configuring it from the device tree. Would be great if the change could be integrated into the SDK. Patch is attached.
Cheers,
Chris
diff --git a/Documentation/devicetree/bindings/drm/tilcdc/panel.txt b/Documentation/devicetree/bindings/drm/tilcdc/panel.txt
index 4ab9e23..f2d7370 100644
--- a/Documentation/devicetree/bindings/drm/tilcdc/panel.txt
+++ b/Documentation/devicetree/bindings/drm/tilcdc/panel.txt
@@ -12,6 +12,7 @@ Required properties:
- 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
+ - invert-ac-bias (optional): Invert Output Enable: 0=active high 1=active low
- display-timings: typical videomode of lcd panel. Multiple video modes
can be listed if the panel supports multiple timings, but the 'native-mode'
should be the preferred/default resolution. Refer to
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
index 3a3f4c6..faed7b6 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
@@ -401,6 +401,11 @@ static int tilcdc_crtc_mode_set(struct drm_crtc *crtc,
tilcdc_set(dev, LCDC_RASTER_TIMING_2_REG, LCDC_INVERT_PIXEL_CLOCK);
else
tilcdc_clear(dev, LCDC_RASTER_TIMING_2_REG, LCDC_INVERT_PIXEL_CLOCK);
+
+ if (info->invert_ac_bias)
+ tilcdc_set(dev, LCDC_RASTER_TIMING_2_REG, LCDC_INVERT_AC_BIAS);
+ else
+ tilcdc_clear(dev, LCDC_RASTER_TIMING_2_REG, LCDC_INVERT_AC_BIAS);
if (info->sync_ctrl)
tilcdc_set(dev, LCDC_RASTER_TIMING_2_REG, LCDC_SYNC_CTRL);
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.h b/drivers/gpu/drm/tilcdc/tilcdc_drv.h
index 4c4aa4e..91bcfbd 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.h
+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.h
@@ -130,6 +130,9 @@ struct tilcdc_panel_info {
/* AC Bias Pin Transitions per Interrupt */
uint32_t ac_bias_intrpt;
+ /* Invert output enable */
+ uint32_t invert_ac_bias;
+
/* DMA burst size */
uint32_t dma_burst_sz;
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_panel.c b/drivers/gpu/drm/tilcdc/tilcdc_panel.c
index 7a03158..41cb645 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_panel.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_panel.c
@@ -334,6 +334,7 @@ static struct tilcdc_panel_info *of_get_panel_info(struct device_node *np)
/* optional: */
info->tft_alt_mode = of_property_read_bool(info_np, "tft-alt-mode");
info->invert_pxl_clk = of_property_read_bool(info_np, "invert-pxl-clk");
+ info->invert_ac_bias = of_property_read_bool(info_np, "invert-ac-bias");
if (ret) {
pr_err("%s: error reading panel-info properties\n", __func__);
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_regs.h b/drivers/gpu/drm/tilcdc/tilcdc_regs.h
index 1bf5e25..7a0f42e 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_regs.h
+++ b/drivers/gpu/drm/tilcdc/tilcdc_regs.h
@@ -77,6 +77,7 @@
#define LCDC_AC_BIAS_FREQUENCY(x) ((x) << 8)
#define LCDC_SYNC_CTRL BIT(25)
#define LCDC_SYNC_EDGE BIT(24)
+#define LCDC_INVERT_AC_BIAS BIT(23)
#define LCDC_INVERT_PIXEL_CLOCK BIT(22)
#define LCDC_INVERT_HSYNC BIT(21)
#define LCDC_INVERT_VSYNC BIT(20)