Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2638175ybz; Mon, 27 Apr 2020 01:21:19 -0700 (PDT) X-Google-Smtp-Source: APiQypKkOfgdUjoQbofXKwhUoVwRzAnDtShTdymfcYZu3XeT32cg8S4IG7Gp5KXVdvw4Nslp3y4H X-Received: by 2002:a50:a416:: with SMTP id u22mr11930803edb.326.1587975679371; Mon, 27 Apr 2020 01:21:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587975679; cv=none; d=google.com; s=arc-20160816; b=AaQCaMYPqg9oqWrn+ZnNSMxN2lKpeNSj/tr+Vfy1i5O49L+1BkyUGOSx//ot8AdaFj V7C1yYKNF85oqmsGuB5/22AwleLgf9L7BUUXi3uJjN7SCB9fz5+HObS8lHnf23FD6Mml Jw7GG971CXQZeCcBLS422k3DPuAga8/qAlzM4TjDu6kTjD4hWjgEA0Dnxn6KqJxGb5aU 838SBVggOwvD5gNMsO+vRhxwwCk39YLHdJR2dyo4VwZCBWfqVVhMcmyG/EdwPkn/xHfz 0Bh03EcRYGuOSOZxHurnDXM3BLTAsAdP0TQ6x9zJQV7GHB06u9TlobqhfYirFXOutg2c 17Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=7KbLrGcfwvQsMW8jhV6H2JE10Lq9siD8fuXDnrsvRlU=; b=tC1i4zNlBQSKo6pIGh/Tl9WT0cDxSrzzgBUi+055LXSuDtQZoflXE+74A4CY56N3cl Ksh/zCjP8ADAkOx6idIe1OooBBESKnvG1Om9gUmKYGVmdeiNDKvxLC21vKXM8X3xXEvE 26pX2N2/lfpqE6yAN3KQ6iYvw4OUdGVvAfCQavh24s0QO6gx+fBwwDGiIUHKZdVHZ8OW mdYP4zBEsbTuVX1lmN/nuO4DkD7AdzZ59p0hx9irJVpWcioh/jS3AW7+CFYosFA6rrat yfgk06fnQkWUiWnF0WymyHBd16uIangFsfo+AnzgY+qLeV60lspiUFyz5EkZ0JGUkUOH cPAA== 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 y21si7843078ejq.259.2020.04.27.01.20.56; Mon, 27 Apr 2020 01:21:19 -0700 (PDT) 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 S1726243AbgD0ITT (ORCPT + 99 others); Mon, 27 Apr 2020 04:19:19 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:34394 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726832AbgD0ITG (ORCPT ); Mon, 27 Apr 2020 04:19:06 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: aratiu) with ESMTPSA id 3C94C2A0C8C From: Adrian Ratiu To: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-rockchip@lists.infradead.org, Laurent Pinchart Cc: Andrzej Hajda , Jonas Karlman , Jernej Skrabec , Heiko Stuebner , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-imx@nxp.com, kernel@collabora.com, linux-stm32@st-md-mailman.stormreply.com, Adrian Pop , Arnaud Ferraris Subject: [PATCH v8 08/10] drm: stm: dw-mipi-dsi: let the bridge handle the HW version check Date: Mon, 27 Apr 2020 11:19:50 +0300 Message-Id: <20200427081952.3536741-9-adrian.ratiu@collabora.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200427081952.3536741-1-adrian.ratiu@collabora.com> References: <20200427081952.3536741-1-adrian.ratiu@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The stm mipi-dsi platform driver added a version test in commit fa6251a747b7 ("drm/stm: dsi: check hardware version") so that HW revisions other than v1.3x get rejected. The rockchip driver had no such check and just assumed register layouts are v1.3x compatible. Having such tests was a good idea because only v130/v131 layouts were supported at the time, however since adding multiple layout support in the bridge, the version is automatically checked for all drivers, compatible layouts get picked and unsupported HW is automatically rejected by the bridge, so there's no use keeping the test in the stm driver. The main reason prompting this change is that the stm driver test immediately disabled the peripheral clock after reading the version, making the bridge read version 0x0 immediately after in its own probe(), so we move the clock disabling after the bridge does the version test. Tested on STM32F769 and STM32MP1. Cc: linux-stm32@st-md-mailman.stormreply.com Reported-by: Adrian Pop Tested-by: Adrian Pop Tested-by: Arnaud Ferraris Signed-off-by: Adrian Ratiu --- New in v6. --- drivers/gpu/drm/stm/dw_mipi_dsi-stm.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c index 2e1f2664495d0..7218e405d7e2b 100644 --- a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c +++ b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c @@ -402,15 +402,6 @@ static int dw_mipi_dsi_stm_probe(struct platform_device *pdev) goto err_dsi_probe; } - dsi->hw_version = dsi_read(dsi, DSI_VERSION) & VERSION; - clk_disable_unprepare(pclk); - - if (dsi->hw_version != HWVER_130 && dsi->hw_version != HWVER_131) { - ret = -ENODEV; - DRM_ERROR("bad dsi hardware version\n"); - goto err_dsi_probe; - } - dw_mipi_dsi_stm_plat_data.base = dsi->base; dw_mipi_dsi_stm_plat_data.priv_data = dsi; @@ -423,6 +414,9 @@ static int dw_mipi_dsi_stm_probe(struct platform_device *pdev) goto err_dsi_probe; } + dsi->hw_version = dsi_read(dsi, DSI_VERSION) & VERSION; + clk_disable_unprepare(pclk); + return 0; err_dsi_probe: -- 2.26.0