Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752970AbbKZHvM (ORCPT ); Thu, 26 Nov 2015 02:51:12 -0500 Received: from mail-io0-f194.google.com ([209.85.223.194]:32886 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752936AbbKZHvG (ORCPT ); Thu, 26 Nov 2015 02:51:06 -0500 From: Chris Zhong To: heiko@sntech.de, linux-rockchip@lists.infradead.org, mark.yao@rock-chips.com, treding@nvidia.com Cc: Chris Zhong , Liu Ying , David Airlie , Inki Dae , Russell King , Ajay Kumar , Andy Yan , Vincent Palatin , Takashi Iwai , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH v5 07/11] drm/bridge: Add Synopsys DesignWare MIPI DSI host controller driver Date: Thu, 26 Nov 2015 15:50:21 +0800 Message-Id: <1448524225-5489-8-git-send-email-zyw@rock-chips.com> X-Mailer: git-send-email 2.6.3 In-Reply-To: <1448524225-5489-1-git-send-email-zyw@rock-chips.com> References: <1448524225-5489-1-git-send-email-zyw@rock-chips.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 33588 Lines: 1197 add Synopsys DesignWare MIPI DSI host controller driver support. Signed-off-by: Chris Zhong Signed-off-by: Liu Ying --- Changes in v5: Adviced by Thierry - use hyphens instead of underscore - use encoder in drm_bridge - reformatting the dptdin table - use readx_poll_timeout to check register - use msleep to wait - add a comment to explain how to program phy - change the program code to symbolic names - check this for validity of find_panel and clk_prepare_enable - eliminate the configuration clock - some optimization for coding style Changes in v4: - eliminate some warnning Changes in v3: None Changes in v2: None drivers/gpu/drm/bridge/Kconfig | 10 + drivers/gpu/drm/bridge/Makefile | 1 + drivers/gpu/drm/bridge/dw-mipi-dsi.c | 1084 ++++++++++++++++++++++++++++++++++ include/drm/bridge/dw_mipi_dsi.h | 28 + 4 files changed, 1123 insertions(+) create mode 100644 drivers/gpu/drm/bridge/dw-mipi-dsi.c create mode 100644 include/drm/bridge/dw_mipi_dsi.h diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig index 6dddd39..d9ca7b4 100644 --- a/drivers/gpu/drm/bridge/Kconfig +++ b/drivers/gpu/drm/bridge/Kconfig @@ -22,6 +22,16 @@ config DRM_DW_HDMI_AHB_AUDIO Designware HDMI block. This is used in conjunction with the i.MX6 HDMI driver. +config DRM_DW_MIPI_DSI + tristate "Synopsys DesignWare MIPI DSI host controller bridge" + depends on DRM + select DRM_KMS_HELPER + select DRM_MIPI_DSI + select DRM_PANEL + help + Choose this if you want to use the Synopsys DesignWare MIPI DSI host + controller bridge. If M is selected, the module will be + called dw-mipi-dsi. config DRM_NXP_PTN3460 tristate "NXP PTN3460 DP/LVDS bridge" diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile index d4e28be..96c54af 100644 --- a/drivers/gpu/drm/bridge/Makefile +++ b/drivers/gpu/drm/bridge/Makefile @@ -2,5 +2,6 @@ ccflags-y := -Iinclude/drm obj-$(CONFIG_DRM_DW_HDMI) += dw_hdmi.o obj-$(CONFIG_DRM_DW_HDMI_AHB_AUDIO) += dw_hdmi-ahb-audio.o +obj-$(CONFIG_DRM_DW_MIPI_DSI) += dw-mipi-dsi.o obj-$(CONFIG_DRM_NXP_PTN3460) += nxp-ptn3460.o obj-$(CONFIG_DRM_PARADE_PS8622) += parade-ps8622.o diff --git a/drivers/gpu/drm/bridge/dw-mipi-dsi.c b/drivers/gpu/drm/bridge/dw-mipi-dsi.c new file mode 100644 index 0000000..26b96e8 --- /dev/null +++ b/drivers/gpu/drm/bridge/dw-mipi-dsi.c @@ -0,0 +1,1084 @@ +/* + * Copyright (c) 2014, Fuzhou Rockchip Electronics Co., Ltd + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include