From mboxrd@z Thu Jan 1 00:00:00 1970 From: cym Subject: Re: [PATCH v4 5/5] drm/rockchip: Add support for Rockchip Soc EDP Date: Tue, 23 Sep 2014 16:47:07 +0800 Message-ID: <5421338B.3020302@rock-chips.com> References: <1411382820-1615-1-git-send-email-mark.yao@rock-chips.com> <1411383728-2075-1-git-send-email-mark.yao@rock-chips.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Rob Clark , Mark yao Cc: =?UTF-8?B?SGVpa28gU3TDvGJuZXI=?= , Boris BREZILLON , David Airlie , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Randy Dunlap , Grant Likely , Greg Kroah-Hartman , John Stultz , Rom Lemarchand , "devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Linux Kernel Mailing List , "dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org" , linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, Douglas Anderson , =?UTF-8?B?U3TDqXBoYW5lIE1hcmNoZXN List-Id: devicetree@vger.kernel.org On Tuesday, September 23, 2014 03:20 AM, Rob Clark wrote: > On Mon, Sep 22, 2014 at 7:02 AM, Mark yao w= rote: >> This adds support for Rockchip soc edp found on rk3288 >> >> Signed-off-by: Mark Yao >> Signed-off-by: Jeff Chen >> --- >> Changes in v2: >> - fix code sytle >> - use some define from drm_dp_helper.h >> - use panel-simple driver for primary display. >> - remove unnecessary clock clk_24m_parent. >> >> Changes in v3: None >> >> Changes in v4: None >> >> drivers/gpu/drm/rockchip/Kconfig | 9 + >> drivers/gpu/drm/rockchip/Makefile | 2 + >> drivers/gpu/drm/rockchip/rockchip_edp_core.c | 853 ++++++++++++++= ++++ >> drivers/gpu/drm/rockchip/rockchip_edp_core.h | 309 +++++++ >> drivers/gpu/drm/rockchip/rockchip_edp_reg.c | 1202 ++++++++++++++= ++++++++++++ >> drivers/gpu/drm/rockchip/rockchip_edp_reg.h | 345 ++++++++ >> 6 files changed, 2720 insertions(+) >> create mode 100644 drivers/gpu/drm/rockchip/rockchip_edp_core.c >> create mode 100644 drivers/gpu/drm/rockchip/rockchip_edp_core.h >> create mode 100644 drivers/gpu/drm/rockchip/rockchip_edp_reg.c >> create mode 100644 drivers/gpu/drm/rockchip/rockchip_edp_reg.h >> >> diff --git a/drivers/gpu/drm/rockchip/Kconfig b/drivers/gpu/drm/rock= chip/Kconfig >> index 7146c80..04b1f8c 100644 >> --- a/drivers/gpu/drm/rockchip/Kconfig >> +++ b/drivers/gpu/drm/rockchip/Kconfig >> @@ -17,3 +17,12 @@ config DRM_ROCKCHIP >> management to userspace. This driver does not provides >> 2D or 3D acceleration; acceleration is performed by other >> IP found on the SoC. >> + >> +config ROCKCHIP_EDP >> + bool "Rockchip edp support" >> + depends on DRM_ROCKCHIP >> + help >> + Choose this option if you have a Rockchip eDP. >> + Rockchip rk3288 SoC has eDP TX Controller can be used. >> + If you have an Embedded DisplayPort Panel, say Y to enable= its >> + driver. >> diff --git a/drivers/gpu/drm/rockchip/Makefile b/drivers/gpu/drm/roc= kchip/Makefile >> index 6e6d468..a0fc3a1 100644 >> --- a/drivers/gpu/drm/rockchip/Makefile >> +++ b/drivers/gpu/drm/rockchip/Makefile >> @@ -7,4 +7,6 @@ ccflags-y :=3D -Iinclude/drm -Idrivers/gpu/drm/rockc= hip >> rockchipdrm-y :=3D rockchip_drm_drv.o rockchip_drm_fb.o rockchip_d= rm_fbdev.o \ >> rockchip_drm_gem.o rockchip_drm_vop.o >> >> +rockchipdrm-$(CONFIG_ROCKCHIP_EDP) +=3D rockchip_edp_core.o rockchi= p_edp_reg.o >> + >> obj-$(CONFIG_DRM_ROCKCHIP) +=3D rockchipdrm.o >> diff --git a/drivers/gpu/drm/rockchip/rockchip_edp_core.c b/drivers/= gpu/drm/rockchip/rockchip_edp_core.c >> new file mode 100644 >> index 0000000..5450d1fa >> --- /dev/null >> +++ b/drivers/gpu/drm/rockchip/rockchip_edp_core.c >> @@ -0,0 +1,853 @@ >> +/* >> +* Copyright (C) Fuzhou Rockchip Electronics Co.Ltd >> +* Author: >> +* Andy yan >> +* Jeff chen >> +* >> +* based on exynos_dp_core.c >> +* > hmm, did you look at all at drm_dp_helpers? The exynos code probably > pre-dates the helpers, so might not be the best example to work off > of.. > > If there is actually a valid reason not to use the dp-helpers, then > you should mention the reasons, at least in the commit msg if not the > code > > BR, > -R Thanks Rob,Because RK3288 eDP controller IP design is similar to=20 exynos.They from same IP vendors but have some difference. So we choosed exynos_dp as example to work off of.exynos_dp only used=20 some defines from drm_dp_helper.h like DPCD. > >> +* This program is free software; you can redistribute it and/or mod= ify 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