From patchwork Thu Nov 26 07:50:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Zhong X-Patchwork-Id: 7704881 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 953E79F1D3 for ; Thu, 26 Nov 2015 07:51:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 52A0620785 for ; Thu, 26 Nov 2015 07:51:11 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 7AB0D20764 for ; Thu, 26 Nov 2015 07:51:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9314E6EA0D; Wed, 25 Nov 2015 23:51:07 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-io0-f194.google.com (mail-io0-f194.google.com [209.85.223.194]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6E99D6EA0D for ; Wed, 25 Nov 2015 23:51:06 -0800 (PST) Received: by ioef137 with SMTP id f137so7134961ioe.0 for ; Wed, 25 Nov 2015 23:51:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=MEmpPnrpcqmCKVApty3Ql7A3nPmqjRMjsLFkqPxDbGQ=; b=SCcyHZZU9kDTOG1fJ8Hpp0OIvECWHYWPw/cBSLP6XzWVWWDTWe7b8ZTP9xMCu9mzFr /wKsS5wI3GobdjzCgEPZbG539ub82OFZjuv6O7bSwoyTqwJjvXw3OD1oNUYN3VHY7Qsh u4Hekw2kcuTntBiHmpYmb3Uw2Nms08/Xs54KMbgmfyDNoT43QYlg1VQV0nCnhYBTzBt5 6KdjVRmUG6qibafLmcX5g4HEBJQEXgPhwkQ96hmTjdh7HpgsyAyS3vNb8vx3U7+3802l io9t0sWUNF/2cOoNnKWY7nWJXfe9T1k8iJjWvqjyxFYHkQCXmZB4FVi5hrWc/ejBvcqc e2QA== X-Received: by 10.66.248.106 with SMTP id yl10mr57060538pac.140.1448524265833; Wed, 25 Nov 2015 23:51:05 -0800 (PST) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id w1sm25396819pfa.57.2015.11.25.23.51.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Nov 2015 23:51:04 -0800 (PST) From: Chris Zhong To: heiko@sntech.de, linux-rockchip@lists.infradead.org, mark.yao@rock-chips.com, treding@nvidia.com 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> Cc: Vincent Palatin , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Andy Yan , Chris Zhong , Russell King , Ajay Kumar X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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