From 230f7f061036a99fc02d2cd7d20f66f7f0efae99 Mon Sep 17 00:00:00 2001 From: Wyon Bi Date: Fri, 27 Apr 2018 17:58:15 +0800 Subject: [PATCH] drm/bridge: Add support for Lontium LT8912 The Lontium LT8912 MIPI-DSI to LVDS and HDMI/MHL bridge features a single-channel MIPI D-PHY receiver front-end configuration with 4 data lanes per channel operating at 1.5Gbps per data lane and a maximum input bandwidth of 6Gbps. Change-Id: I7733ea5f33094151bb62e62406561cc0025cf900 Signed-off-by: Wyon Bi --- .../display/bridge/lontium,lt8912.txt | 41 ++ .../devicetree/bindings/vendor-prefixes.txt | 1 + drivers/gpu/drm/bridge/Kconfig | 8 + drivers/gpu/drm/bridge/Makefile | 1 + drivers/gpu/drm/bridge/lt8912.c | 500 ++++++++++++++++++ 5 files changed, 551 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/bridge/lontium,lt8912.txt create mode 100644 drivers/gpu/drm/bridge/lt8912.c diff --git a/Documentation/devicetree/bindings/display/bridge/lontium,lt8912.txt b/Documentation/devicetree/bindings/display/bridge/lontium,lt8912.txt new file mode 100644 index 000000000000..0d0378febadb --- /dev/null +++ b/Documentation/devicetree/bindings/display/bridge/lontium,lt8912.txt @@ -0,0 +1,41 @@ +Lontium LT8912 MIPI-DSI to LVDS and HDMI/MHL bridge bindings + +Required properties: + - compatible: "lontium,lt8912" + - reg: virtual channel id + - reset-gpios: a GPIO spec for the reset pin + - i2c-bus: phandle of an I2C controller used for register access + - display-timings : Refer to binding doc display-timing.txt for details + +Example: + +&dsi { + status = "okay"; + + lt8912@0 { + compatible = "lontium,lt8912"; + reg = <0>; + reset-gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_LOW>; + i2c-bus = <&i2c1>; + + display-timings { + native-mode = <&timing0>; + + timing0: timing0 { + clock-frequency = <74250000>; + hactive = <1280>; + vactive = <720>; + hfront-porch = <110>; + hsync-len = <40>; + hback-porch = <220>; + vfront-porch = <5>; + vsync-len = <5>; + vback-porch = <20>; + hsync-active = <0>; + vsync-active = <0>; + de-active = <0>; + pixelclk-active = <0>; + }; + }; + }; +}; diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt index 435c8993e63d..79435048f722 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt @@ -131,6 +131,7 @@ lenovo Lenovo Group Ltd. lg LG Corporation linaro Linaro Limited linux Linux-specific binding +lontium Lontium Semiconductor Corporation lsi LSI Corp. (LSI Logic) lltc Linear Technology Corporation marvell Marvell Technology Group Ltd. diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig index cefe2fa55aa2..b4537addaf39 100644 --- a/drivers/gpu/drm/bridge/Kconfig +++ b/drivers/gpu/drm/bridge/Kconfig @@ -40,6 +40,14 @@ config DRM_DUMB_VGA_DAC help Support for RGB to VGA DAC based bridges +config DRM_LONTIUM_LT8912 + tristate "Lontium LT8912 MIPI-DSI to LVDS and HDMI/MHL bridge" + depends on OF + select DRM_KMS_HELPER + select REGMAP_I2C + help + Lontium LT8912 MIPI-DSI to LVDS and HDMI/MHL bridge chip driver. + source "drivers/gpu/drm/bridge/analogix/Kconfig" source "drivers/gpu/drm/bridge/synopsys/Kconfig" diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile index 5117061a4e0f..f8e1c05b4fe4 100644 --- a/drivers/gpu/drm/bridge/Makefile +++ b/drivers/gpu/drm/bridge/Makefile @@ -5,4 +5,5 @@ obj-$(CONFIG_DRM_PARADE_PS8622) += parade-ps8622.o obj-$(CONFIG_DRM_ANALOGIX_DP) += analogix/ obj-$(CONFIG_DRM_RK1000) += rk1000.o obj-$(CONFIG_DRM_DUMB_VGA_DAC) += dumb-vga-dac.o +obj-$(CONFIG_DRM_LONTIUM_LT8912) += lt8912.o obj-y += synopsys/ diff --git a/drivers/gpu/drm/bridge/lt8912.c b/drivers/gpu/drm/bridge/lt8912.c new file mode 100644 index 000000000000..76a28625b2ce --- /dev/null +++ b/drivers/gpu/drm/bridge/lt8912.c @@ -0,0 +1,500 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (c) 2018 Rockchip Electronics Co. Ltd. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include