Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4982868pxb; Mon, 15 Feb 2021 06:37:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJz9Vh2Kjti6T5leVSN83L8vEjnAj0wmx6R3//hObuf8AJf8C4ypLtQP1rUDD72Hy5XN6Jo/ X-Received: by 2002:a17:907:2622:: with SMTP id aq2mr9024662ejc.470.1613399830143; Mon, 15 Feb 2021 06:37:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613399830; cv=none; d=google.com; s=arc-20160816; b=RXKPtByEwN7Udlyv4q3s1YjCJw+t9SqyCdngbGKI9kRwI0oUBWMuxziqugJ1Bx6Qf5 MS/hJ+d0hJB5DfqXGE1w5rA3kZuyMcl3GtETGh4ro13xPkv9NWeRZuUVTu6WtYpAn++E +TRcd0OlLpYjhT62ztGXopSOnVwv3xFYQzt+ePDog5Ov7vQHBT+/yqr7YGgaflXYy6Tu 7yYb0AOQCZJLl9E2TLA3KT1peG46TPhJydFd4ydxTZlc5L8VboM1Mt4HsYlvG5bb8G9c KNZFpe0xRlyPVjZCPbsglVBFPKhPE8yH3UjMBgrd3HV7Ihm+GeRx3RWUENRFs5oAs5Df j8uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=+0rQLNIJCvZcJ3h322InRJswrLL9aCl9I2Z+m20XOns=; b=olKOPZKwc0EpFlhQkhBQSwyORUgynT9nA1geZJI9ORtFhlkrP+qPyjpMnJs8DFC7Rp AAPvEnuoy0P76V+7RDEPDI+n7cLj+t5yFRZD85NB+R4s93O7JIILnAFfTx+rGXKvI29c Y/r/nuO6M3HVN+zbLqsEzWTCkHowtgJVGZMcWUalvxzlfcA2FAs80M6e8bs7gJwWW7Yw j0ZWaGr8jlzs+gmyVWybhh8o3MKQItic/30ZH/2zk1bYTSPjUQyYtmjTj9NjZi1U5vCn L7eN9sKIn3vpJeUKN9BfXbLrQhCyhey5OuB/1PS99D6j57XT3qL14gmoxbb19O5UMeAy Fzyg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z12si10977289edb.126.2021.02.15.06.36.45; Mon, 15 Feb 2021 06:37:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230055AbhBOOfn (ORCPT + 99 others); Mon, 15 Feb 2021 09:35:43 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:59418 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230196AbhBOOeg (ORCPT ); Mon, 15 Feb 2021 09:34:36 -0500 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 Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, hjc@rock-chips.com, robh+dt@kernel.org, sebastian.fricke@posteo.net, linux-media@vger.kernel.org, dafna.hirschfeld@collabora.com, ezequiel@collabora.com, cmuellner@linux.com, Heiko Stuebner 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-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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