From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1423514AbcFHWOP (ORCPT ); Wed, 8 Jun 2016 18:14:15 -0400 Received: from bh-25.webhostbox.net ([208.91.199.152]:49327 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161205AbcFHWOL (ORCPT ); Wed, 8 Jun 2016 18:14:11 -0400 Date: Wed, 8 Jun 2016 15:13:54 -0700 From: Guenter Roeck To: Chris Zhong Cc: dianders@chromium.org, tfiga@chromium.org, heiko@sntech.de, yzq@rock-chips.com, linux-rockchip@lists.infradead.org, Mark Yao , David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org Subject: Re: [v1,4/4] drm/rockchip: cdn-dp: add cdn DP support for rk3399 Message-ID: <20160608221354.GA25675@roeck-us.net> References: <1464966911-18949-5-git-send-email-zyw@rock-chips.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1464966911-18949-5-git-send-email-zyw@rock-chips.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Authenticated_sender: guenter@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: guenter@roeck-us.net X-Authenticated-Sender: bh-25.webhostbox.net: guenter@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 03, 2016 at 11:15:11PM +0800, Chris Zhong wrote: > 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 Disclaimer: I am not familiar with drm code, so this is a very generic review, and it may miss some (or lots of) problems. > --- > > Changes in v1: > - use extcon API > - use hdmi-codec for the DP Asoc > - do not initialize the "ret" > - printk a err log when drm_of_encoder_active_endpoint_id > - modify the dclk pin_pol to a single line > > drivers/gpu/drm/rockchip/Kconfig | 9 + > drivers/gpu/drm/rockchip/Makefile | 1 + > drivers/gpu/drm/rockchip/cdn-dp-core.c | 709 +++++++++++++++++++++++++++ > drivers/gpu/drm/rockchip/cdn-dp-core.h | 110 +++++ > drivers/gpu/drm/rockchip/cdn-dp-reg.c | 721 ++++++++++++++++++++++++++++ > drivers/gpu/drm/rockchip/cdn-dp-reg.h | 404 ++++++++++++++++ > drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 6 +- > drivers/gpu/drm/rockchip/rockchip_drm_vop.h | 2 + > drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 2 + > 9 files changed, 1963 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 > > 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 > > Please make sure that this builds with CONFIG_ROCKCHIP_CDN_DP=m. > Hint: Probably it won't build, because it will generate two modules, > and the global functions are not exported. > > 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..d51e65a > --- /dev/null > +++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c > @@ -0,0 +1,709 @@ > +/* > + * Copyright (C) Fuzhou Rockchip Electronics Co.Ltd > + * Author: Chris Zhong > + * > + * This software is licensed under the terms of the GNU General Public > + * License version 2, as published by the Free Software Foundation, and > + * may be copied, distributed, and modified under those terms. > + * > + * 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 Alphabetic order > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include