From patchwork Wed Jan 6 07:12:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chris Zhong X-Patchwork-Id: 7964951 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 04203BEEE5 for ; Wed, 6 Jan 2016 07:12:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9ECEA201C0 for ; Wed, 6 Jan 2016 07:12:53 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id EE48D20165 for ; Wed, 6 Jan 2016 07:12:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 370AA6E2E7; Tue, 5 Jan 2016 23:12:48 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pa0-f53.google.com (mail-pa0-f53.google.com [209.85.220.53]) by gabe.freedesktop.org (Postfix) with ESMTPS id 333F06E2E7 for ; Tue, 5 Jan 2016 23:12:46 -0800 (PST) Received: by mail-pa0-f53.google.com with SMTP id do7so910712pab.2 for ; Tue, 05 Jan 2016 23:12:46 -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 :mime-version:content-type:content-transfer-encoding; bh=x/23+sIGWMuSnhNzg7BLoDGox1iTB2df0UsqhR7DH/A=; b=GcFebQrEBwDcDUu4lo/2PTTovt6+18s8bbxCVo6kTxLjz7hpp6hia7EUQ2WQqGkY2Z DaQbtK1G82E3aN51SxIrj9hjTobji5YbmusGRhOkbwuM9asHfypgwdcXb2jUPCRF4V7D H9G7viMWgJS2BTL2mPDaYGCUqziOq67Brp7my/u5w3K3fmcZcNwp9i5lH4iDJ+zFfPob CM+bYF6evPmwd2lq1JBvhXLEmDP+27bBPbODLDL91mWCydwRuWl4bdzb6xW3+YIvjBqt 3VK3wLEnywTjQW22Iv6VlHSKrDOaeoCa4UaaYKz4Z9QAyuXEPEi9L4jTbBxPuGo+BCpc XJ5w== X-Received: by 10.66.150.37 with SMTP id uf5mr142206314pab.30.1452064365419; Tue, 05 Jan 2016 23:12:45 -0800 (PST) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id o13sm83762736pfi.2.2016.01.05.23.12.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 05 Jan 2016 23:12:44 -0800 (PST) From: Chris Zhong To: heiko@sntech.de, linux-rockchip@lists.infradead.org, treding@nvidia.com, mark.yao@rock-chips.com Subject: [PATCH v7.1 3/5] drm: rockchip: Support Synopsys DW MIPI DSI Date: Wed, 6 Jan 2016 15:12:09 +0800 Message-Id: <1452064329-25897-1-git-send-email-zyw@rock-chips.com> X-Mailer: git-send-email 2.6.3 In-Reply-To: <568CB47B.1010205@rock-chips.com> References: <568CB47B.1010205@rock-chips.com> MIME-Version: 1.0 Cc: Chris Zhong , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.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 support for Synopsys DesignWare MIPI DSI controller which is embedded in the rk3288 SoCs. Signed-off-by: Chris Zhong Acked-by: Mark Yao --- Changes in v7.1: - make sure disable clk when drm_panel_prepare err (Mark Yao) Changes in v7: - modify the config to tristate for modules build (Mark Yao) - Pass NULL 'name' to drm_encoder_init() to fix compile err (Mark Yao) Changes in v6: - move the mipi_en gate to ockchip_drm_crtc_mode_config - Remove the atomic feature check (Mark Yao) - Add atomic API support (Heiko Stübne) - Do not use bridge driver (Thierry Reding) - Optimization the phy init sequence Changes in v5: None Changes in v4: None Changes in v3: None drivers/gpu/drm/rockchip/Kconfig | 10 + drivers/gpu/drm/rockchip/Makefile | 1 + drivers/gpu/drm/rockchip/dw-mipi-dsi.c | 1197 +++++++++++++++++++++++++++ drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 3 + 4 files changed, 1211 insertions(+) create mode 100644 drivers/gpu/drm/rockchip/dw-mipi-dsi.c diff --git a/drivers/gpu/drm/rockchip/Kconfig b/drivers/gpu/drm/rockchip/Kconfig index 35215f6..8573985 100644 --- a/drivers/gpu/drm/rockchip/Kconfig +++ b/drivers/gpu/drm/rockchip/Kconfig @@ -25,3 +25,13 @@ config ROCKCHIP_DW_HDMI for the Synopsys DesignWare HDMI driver. If you want to enable HDMI on RK3288 based SoC, you should selet this option. + +config ROCKCHIP_DW_MIPI_DSI + tristate "Rockchip specific extensions for Synopsys DW MIPI DSI" + depends on DRM_ROCKCHIP + select DRM_MIPI_DSI + help + This selects support for Rockchip SoC specific extensions + for the Synopsys DesignWare HDMI driver. If you want to + enable MIPI DSI on RK3288 based SoC, you should selet this + option. diff --git a/drivers/gpu/drm/rockchip/Makefile b/drivers/gpu/drm/rockchip/Makefile index a9d380f..d1dc0f7 100644 --- a/drivers/gpu/drm/rockchip/Makefile +++ b/drivers/gpu/drm/rockchip/Makefile @@ -6,6 +6,7 @@ rockchipdrm-y := rockchip_drm_drv.o rockchip_drm_fb.o rockchip_drm_fbdev.o \ rockchip_drm_gem.o obj-$(CONFIG_ROCKCHIP_DW_HDMI) += dw_hdmi-rockchip.o +obj-$(CONFIG_ROCKCHIP_DW_MIPI_DSI) += dw-mipi-dsi.o obj-$(CONFIG_DRM_ROCKCHIP) += rockchipdrm.o rockchip_drm_vop.o \ rockchip_vop_reg.o diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c new file mode 100644 index 0000000..a36cf60 --- /dev/null +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c @@ -0,0 +1,1197 @@ +/* + * Copyright (c) 2016, 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 +#include +#include +#include +#include +#include +#include +#include