From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751317AbcGNDIf (ORCPT ); Wed, 13 Jul 2016 23:08:35 -0400 Received: from regular1.263xmail.com ([211.150.99.135]:38949 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751050AbcGNDIW (ORCPT ); Wed, 13 Jul 2016 23:08:22 -0400 X-263anti-spam: KSV:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 4 X-ADDR-CHECKED: 0 X-RL-SENDER: zyw@rock-chips.com X-FST-TO: linux-arm-kernel@lists.infradead.org X-SENDER-IP: 103.29.142.67 X-LOGIN-NAME: zyw@rock-chips.com X-UNIQUE-TAG: X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 Subject: Re: [v5 PATCH 5/5] drm/rockchip: cdn-dp: add cdn DP support for rk3399 To: Sean Paul References: <1468336188-565-1-git-send-email-zyw@rock-chips.com> <1468336188-565-6-git-send-email-zyw@rock-chips.com> Cc: Douglas Anderson , Tomasz Figa , =?UTF-8?Q?Heiko_St=c3=bcbner?= , =?UTF-8?B?5aea5pm65oOF?= , groeck@chromium.org, ??? , cw00.choi@samsung.com, wulf@rock-chips.com, =?UTF-8?Q?St=c3=a9phane_Marchesin?= , Linux Kernel Mailing List , dri-devel , linux-rockchip@lists.infradead.org, Linux ARM Kernel From: Chris Zhong Message-ID: <57870210.4020307@rock-chips.com> Date: Thu, 14 Jul 2016 11:08:00 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sean Thanks for your detailed review. I'm working to modify most of code according to comment. And there is reply for some comment On 07/13/2016 09:59 PM, Sean Paul wrote: > On Tue, Jul 12, 2016 at 8:09 AM, 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 >> >> --- >> >> Changes in v5: >> - alphabetical order >> - do not use long, use u32 or u64 >> - return MODE_CLOCK_HIGH when requested > actual >> - Optimized Coding Style >> - add a formula to get better tu size and symbol value. >> >> Changes in v4: >> - use phy framework to control DP phy >> - support 2 phys >> >> Changes in v3: >> - use EXTCON_DISP_DP and EXTCON_DISP_DP_ALT cable to get dp port state. >> - reset spdif before config it >> - modify the firmware clk to 100Mhz >> - retry load firmware if fw file is requested too early >> >> Changes in v2: >> - Alphabetic order >> - remove excess error message >> - use define clk_rate >> - check all return value >> - remove dev_set_name(dp->dev, "cdn-dp"); >> - use schedule_delayed_work >> - remove never-called functions >> - remove some unnecessary () >> >> 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 | 761 ++++++++++++++++++++++++++++ >> drivers/gpu/drm/rockchip/cdn-dp-core.h | 113 +++++ >> drivers/gpu/drm/rockchip/cdn-dp-reg.c | 740 +++++++++++++++++++++++++++ >> drivers/gpu/drm/rockchip/cdn-dp-reg.h | 409 +++++++++++++++ > Could you explain the file naming convention in the rk driver? We've > got analogix_dp-rockchip.c, dw_hdmi-rockchip.c, dw-mipi-dsi.c, and now > cdn-dp-(core|reg).[ch]. I'm honestly not sure whether these filenames > are consistent with the rest, but bleh. > cdn is the IP vendor's name dp is the controller's name. >> 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, 2042 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 > s/Dp/DP/ > >> + RK3399 based SoC, you should selet this > s/selet/select/ > >> + 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..5b8a15e >> --- /dev/null >> +++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c >> @@ -0,0 +1,761 @@ >> +/* >> + * 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 >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> + >> +#include >> + >> +#include