From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ACEE1C433DB for ; Mon, 15 Feb 2021 14:34:50 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 60CDD64E64 for ; Mon, 15 Feb 2021 14:34:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 60CDD64E64 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Qo8w1GodwTlb0jCcKLm8OvmkcM+BuFJG6XSsz48xfvU=; b=SMboTR/Kcm1Jb7BTFAuNvcHVH Z7IykwOc+iwJhN2JZwcvpufYCfIoNQefHeBGBW7KgWOcvuM09M5VGKAp7HL5c0eBg3jcWjqn4I4Nl fy1OdlnbK5f8k2tRYGz5ibtVA9YYY1IDaAnr6ChWd94mJBnmkH0dyQZV9zxZsHNxXxa5tC7imKKm3 wjydSWLXod5pt78tE9Lrh83UkdBerDPI6dlNLSW7uqYnuesH09BC+RfmqEMnMS2RDbjOUIbLvBajy Hg53smuPnRdDhj6ARaxc/9voVZkQrAqwGCgB+5CIdeHzGFiJi9/Fs1l+GzVMsC2KTPOW/9D/Q23Ol vnbxSpjgw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lBewS-0005TZ-IX; Mon, 15 Feb 2021 14:33:36 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lBewO-0005T5-OE; Mon, 15 Feb 2021 14:33:34 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: koike) with ESMTPSA id C14871F44DE7 Subject: Re: [PATCH 3/6] drm/rockchip: dsi: add ability to work as a phy instead of full dsi To: Heiko Stuebner , dri-devel@lists.freedesktop.org References: <20210210111020.2476369-1-heiko@sntech.de> <20210210111020.2476369-4-heiko@sntech.de> From: Helen Koike Message-ID: Date: Mon, 15 Feb 2021 11:33:19 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <20210210111020.2476369-4-heiko@sntech.de> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210215_093333_015138_7062A578 X-CRM114-Status: GOOD ( 38.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, dafna.hirschfeld@collabora.com, cmuellner@linux.com, hjc@rock-chips.com, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, robh+dt@kernel.org, sebastian.fricke@posteo.net, Heiko Stuebner , ezequiel@collabora.com, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2/10/21 8:10 AM, Heiko Stuebner wrote: > From: Heiko Stuebner > > SoCs like the rk3288 and rk3399 have 3 mipi dphys on them. One is TX- > only, one is RX-only and one can be configured to do either TX or RX. > > The RX phy is statically connected to the first Image Signal Processor, > the TX phy is statically connected to the first DSI controller and > the TXRX phy is connected to both the second DSI controller as well > as the second ISP. > > The RX dphy is controlled externally through registers in the "General > Register Files", while the other two are controlled through the > "Configuration and Test Interface" inside their DSI controller's > io-memory area. > > The Rockchip dw-dsi controller already controls these dphys for the > TX case in the driver, but when we want to also allow configuration > for RX to the ISP from the media subsystem we need to expose phy- > functionality instead. > > So add a bit of infrastructure to allow the dsi driver to work as a > phy and make sure it can be only one or the other at a time. > > Similarly as the dsi-controller will be part of the drm-graph when > active, add an empty component to the drm-graph when in phy-mode > to make the rest of the drm-graph not wait for it. > > Signed-off-by: Heiko Stuebner > Tested-by: Sebastian Fricke > --- > drivers/gpu/drm/rockchip/Kconfig | 2 + > .../gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 341 ++++++++++++++++++ > 2 files changed, 343 insertions(+) > > diff --git a/drivers/gpu/drm/rockchip/Kconfig b/drivers/gpu/drm/rockchip/Kconfig > index cb25c0e8fc9b..3094d4533ad6 100644 > --- a/drivers/gpu/drm/rockchip/Kconfig > +++ b/drivers/gpu/drm/rockchip/Kconfig > @@ -9,6 +9,8 @@ config DRM_ROCKCHIP > select DRM_ANALOGIX_DP if ROCKCHIP_ANALOGIX_DP > select DRM_DW_HDMI if ROCKCHIP_DW_HDMI > select DRM_DW_MIPI_DSI if ROCKCHIP_DW_MIPI_DSI > + select GENERIC_PHY if ROCKCHIP_DW_MIPI_DSI > + select GENERIC_PHY_MIPI_DPHY if ROCKCHIP_DW_MIPI_DSI maybe alphabetical order? > select DRM_RGB if ROCKCHIP_RGB > select SND_SOC_HDMI_CODEC if ROCKCHIP_CDN_DP && SND_SOC > help > diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c > index 18e112e30f6e..e322749a5279 100644 > --- a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c > +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c > @@ -14,6 +14,7 @@ > #include > #include > #include > +#include > #include > > #include