From patchwork Fri May 27 06:02:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Zhong X-Patchwork-Id: 9137735 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 56E4760467 for ; Fri, 27 May 2016 06:48:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4586C28093 for ; Fri, 27 May 2016 06:48:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3A16C28173; Fri, 27 May 2016 06:48:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2545B28093 for ; Fri, 27 May 2016 06:48:12 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 232312661CD; Fri, 27 May 2016 08:48:11 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 228FD265455; Fri, 27 May 2016 08:47:15 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 777052652D7; Fri, 27 May 2016 08:03:18 +0200 (CEST) Received: from mail-pf0-f193.google.com (mail-pf0-f193.google.com [209.85.192.193]) by alsa0.perex.cz (Postfix) with ESMTP id BAE83265238 for ; Fri, 27 May 2016 08:03:10 +0200 (CEST) Received: by mail-pf0-f193.google.com with SMTP id g132so4805861pfb.3 for ; Thu, 26 May 2016 23:03:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=WgmgNtSz/UScYsKJNaf6WsmShv4XVVK+RMlCiCPKha4=; b=Z7snTZA/eqmzHKbVaFGwg33JhURGn/nm9hXQdbIgn8Q+bHEBH5wFiU4Zc1bqbRM0eh uxbtxbRzrkMbxWT9yIOjArq3Q0jAT5ypmoLFghPyG4SdAxN/ZNOkKgLEIL7K+jPiGVAd t5ITKnLz5N8Eeg1TcpQZr3W9xDKLdypGBJV0pUMxWB5+z517oBOdYpg/YRuyj921Bzcn l9htQM+Fv/6XQulzZdc3aHfmCwuCyeVZGxUmvcLmbgbggwGr28EJByZLkjQW2S2UbbM/ FMdndR88t/vj8OzvT4hFES5DiLiJT133Gg8qxg3AftsUihlF6/w+oCV4mkXQSKGwGdYT QYjg== X-Gm-Message-State: ALyK8tKD6NVgWgM54pst4RHvN8BVB9HAAj0CsyRgpJMHsyk9hMcb1pXOfSb3MtT9ukwgcA== X-Received: by 10.98.25.147 with SMTP id 141mr11076506pfz.60.1464328989008; Thu, 26 May 2016 23:03:09 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id yp9sm24787497pab.42.2016.05.26.23.03.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 May 2016 23:03:07 -0700 (PDT) From: Chris Zhong To: dianders@chromium.org, tfiga@chromium.org, heiko@sntech.de, yzq@rock-chips.com Date: Fri, 27 May 2016 14:02:16 +0800 Message-Id: <1464328939-8073-4-git-send-email-zyw@rock-chips.com> X-Mailer: git-send-email 2.6.3 In-Reply-To: <1464328939-8073-1-git-send-email-zyw@rock-chips.com> References: <1464328939-8073-1-git-send-email-zyw@rock-chips.com> X-Mailman-Approved-At: Fri, 27 May 2016 08:47:13 +0200 Cc: alsa-devel@alsa-project.org, David Airlie , Takashi Iwai , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, Chris Zhong , linux-arm-kernel@lists.infradead.org, Mark Yao Subject: [alsa-devel] [PATCH 3/6] drm/rockchip: vop: add cdn DP support for rk3399 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Add support for cdn DP controller which is embedded in the rk3399 SoCs. The DP is compliant with DisplayPort Specification, Version 1.3, This IP is compatible with the rockchip type-c PHY IP. There is a uCPU in DP controller, it need a firmware to work, please put the firmware file to /lib/firmware/cdn/dptx.bin. The uCPU in charge of aux communication and link training, the host use mailbox to communicate with the ucpu. The dclk pin_pol of vop must not be invert for DP. Signed-off-by: Chris Zhong --- drivers/gpu/drm/rockchip/Kconfig | 9 + drivers/gpu/drm/rockchip/Makefile | 1 + drivers/gpu/drm/rockchip/cdn-dp-core.c | 620 +++++++++++++++++++++++ drivers/gpu/drm/rockchip/cdn-dp-core.h | 95 ++++ drivers/gpu/drm/rockchip/cdn-dp-reg.c | 730 ++++++++++++++++++++++++++++ drivers/gpu/drm/rockchip/cdn-dp-reg.h | 404 +++++++++++++++ drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 9 +- drivers/gpu/drm/rockchip/rockchip_drm_vop.h | 2 + drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 2 + include/sound/cdn-dp-audio.h | 51 ++ 10 files changed, 1922 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/rockchip/cdn-dp-core.c create mode 100644 drivers/gpu/drm/rockchip/cdn-dp-core.h create mode 100644 drivers/gpu/drm/rockchip/cdn-dp-reg.c create mode 100644 drivers/gpu/drm/rockchip/cdn-dp-reg.h create mode 100644 include/sound/cdn-dp-audio.h diff --git a/drivers/gpu/drm/rockchip/Kconfig b/drivers/gpu/drm/rockchip/Kconfig index d30bdc3..20da9a8 100644 --- a/drivers/gpu/drm/rockchip/Kconfig +++ b/drivers/gpu/drm/rockchip/Kconfig @@ -25,6 +25,15 @@ config ROCKCHIP_ANALOGIX_DP for the Analogix Core DP driver. If you want to enable DP on RK3288 based SoC, you should selet this option. +config ROCKCHIP_CDN_DP + tristate "Rockchip cdn DP" + depends on DRM_ROCKCHIP + help + This selects support for Rockchip SoC specific extensions + for the cdn Dp driver. If you want to enable Dp on + RK3399 based SoC, you should selet this + option. + config ROCKCHIP_DW_HDMI tristate "Rockchip specific extensions for Synopsys DW HDMI" depends on DRM_ROCKCHIP diff --git a/drivers/gpu/drm/rockchip/Makefile b/drivers/gpu/drm/rockchip/Makefile index 05d0713..abdecd5 100644 --- a/drivers/gpu/drm/rockchip/Makefile +++ b/drivers/gpu/drm/rockchip/Makefile @@ -7,6 +7,7 @@ rockchipdrm-y := rockchip_drm_drv.o rockchip_drm_fb.o \ rockchipdrm-$(CONFIG_DRM_FBDEV_EMULATION) += rockchip_drm_fbdev.o obj-$(CONFIG_ROCKCHIP_ANALOGIX_DP) += analogix_dp-rockchip.o +obj-$(CONFIG_ROCKCHIP_CDN_DP) += cdn-dp-core.o cdn-dp-reg.o obj-$(CONFIG_ROCKCHIP_DW_HDMI) += dw_hdmi-rockchip.o obj-$(CONFIG_ROCKCHIP_DW_MIPI_DSI) += dw-mipi-dsi.o obj-$(CONFIG_ROCKCHIP_INNO_HDMI) += inno_hdmi.o diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c b/drivers/gpu/drm/rockchip/cdn-dp-core.c new file mode 100644 index 0000000..fdf99f5 --- /dev/null +++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c @@ -0,0 +1,620 @@ +/* + * cdn dp controller core driver + * + * Copyright (C) 2016 Chris Zhong + * Copyright (C) 2016 ROCKCHIP, Inc. + * + * 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. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include