Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp654918pxb; Tue, 2 Feb 2021 14:31:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJyb1U30tVTlMta+lGzZ1u6xoE6eUAQf0Gsffs5rtAckU0e6rDH0egGGs3JRC7G4KNMmLTea X-Received: by 2002:a50:ef0f:: with SMTP id m15mr257979eds.175.1612305062504; Tue, 02 Feb 2021 14:31:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612305062; cv=none; d=google.com; s=arc-20160816; b=RiDSNsyfaO5mfYICgzMOoMYb6+uHyNa3Xrez1At8y7+xcDhpAUZmXcDANrI9BBOXdE 9VRGhx56/HFHexn0vxh1AitYUSPZNHVwA+xMF3p32syKITk6FRGBUIWSKkGdi2Exa/R0 yH/JWbZF4SSlXEn7t8H2kEZul/CR1qEgC372cNyTIU/SoUK8wMABH8DdILaaNL+Am+Uv bliqldd2SKBg6GqbxLNB23WSr6LRS0UuinVvqyRXvK6H5+dBJn70vqcOayHq3dqjXrJO BkZREH2v6S22LpOeT0MSeNferIWXHjB3XdfPaNU4N32RHt/hvz9Iw3jJ6m3HaCgwFqqy A5Zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Bu2HBN9COsZhiU6mv5QQ9r31yL6QTcQgcmD4T67mKiA=; b=sGV49Tma7xcetxziYeacS/BfGNmIna3Fxc8M8oWglSY3FHtUsdKY1UqFdFn7dzDHNg UpLvqnlPf3yWznaC3WIhquJof+FRCOlHwZlzibdax3kDRFmZxED0XEk7sQ0ukenE9fJK sSWeLSfT7Fp2MArPeWrhGgUT9ZwRd+Kj1zo6gwMv3whDa8EnAbu0ekyNapVBG33wAPHC tyu/6KvJRmAVERSedz//eEWAqwfQlaegRk1PEVnTPIy30vY4e3khUr0lsiMlCYdG2v1T vzoaRUlGDcQtCuUBUV6CEF2QYmTY4dYcuAeuIUJrggwkoKts6i+oQIK8Y9mP9XSU9Ke6 5Ceg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v23si81612edl.211.2021.02.02.14.30.35; Tue, 02 Feb 2021 14:31:02 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234803AbhBBPAv (ORCPT + 99 others); Tue, 2 Feb 2021 10:00:51 -0500 Received: from gloria.sntech.de ([185.11.138.130]:48858 "EHLO gloria.sntech.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234880AbhBBO5q (ORCPT ); Tue, 2 Feb 2021 09:57:46 -0500 Received: from ip5f5aa64a.dynamic.kabel-deutschland.de ([95.90.166.74] helo=phil.lan) by gloria.sntech.de with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l6x6n-00020V-1m; Tue, 02 Feb 2021 15:56:49 +0100 From: Heiko Stuebner To: 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, heiko@sntech.de, robh+dt@kernel.org, sebastian.fricke@posteo.net, linux-media@vger.kernel.org, dafna.hirschfeld@collabora.com, helen.koike@collabora.com, ezequiel@collabora.com, cmuellner@linux.com, Heiko Stuebner Subject: [PATCH 3/6] drm/rockchip: dsi: add ability to work as a phy instead of full dsi Date: Tue, 2 Feb 2021 15:56:29 +0100 Message-Id: <20210202145632.1263136-4-heiko@sntech.de> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210202145632.1263136-1-heiko@sntech.de> References: <20210202145632.1263136-1-heiko@sntech.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/gpu/drm/rockchip/Kconfig | 2 + .../gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 334 ++++++++++++++++++ 2 files changed, 336 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 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..5988a105c141 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