From patchwork Thu Nov 9 07:37:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 163264 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp274512vqs; Wed, 8 Nov 2023 23:39:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IHpQsbYzhWFMM392CbBLAnLcyf+JJNnSfQinW3EqC7ELDgKHVulmSnMIG0R3KDOPoONrreS X-Received: by 2002:a05:6a21:18d:b0:181:1d71:7e27 with SMTP id le13-20020a056a21018d00b001811d717e27mr5160895pzb.43.1699515551477; Wed, 08 Nov 2023 23:39:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699515551; cv=none; d=google.com; s=arc-20160816; b=zkYnj21nB8IUKYCTAEKgo1WVqFZmcf/iKnerBe7bSXQGFZa9CC8E/jI6yLlhScEdoR Ds7qx0fG0p98Kgz1vym5rGT7NdDudNlXtAhh4Yy296cAcAfeHtWUfJ/3CZ8wsfHDLjas M9H45RtKLcnD1rv0H1Tza6IGd8aKhEUCZjhhHiBdjwlv3uj55KxOn0AvH9+9JIto/mUS +KDV1fPHT25sZm2BvfCAK1euVUUtn74OqQJOjq38Zq+V33oaf32CHxYqLaigeWZ3sLvM dabirVNsH9wBdM9VJVAiZrjHi4VEBnoKTWtDN4NTgCcC6OV/Ljg8UeScroxXD4Z5D5hW AyHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=RTfi6dGfxzeF8CieOnBNa+USmcgxkKNuN+hfD6aoDI0=; fh=ar9Kuonru+6un71Fc3+cR+miWSr4t5vPPiuWh6IeKvI=; b=LuVXDjKJA1//Ri9h/UOWD3qOjzgFBV9bDnMrtmZOUiEVR+ixN9ddFtfR/SUcSsvhOn iRkYBMC5l55omYmepzvzhnMAv9DW5Nwl7kIx9qRrDnicOcv+j5VbIQ+UnjvEX7+grdWK hRIwNC2RkzC0GAlZIgILlbVi6/W0hMR5CDHqllq+DbghydUtsjH1EUCItyhRFD3Z5rUX 3zP4BCwmfeVnSWzMQuY2hKRgIeJawc4NawQpO1Hky4oKmZiYDJUY/pQF/Hzk4Fqc+fDj m4W84ww0F+ujZ9UqjFztPbgPn0DtSx/dOgzXKmf4lY6XbiMG7C799o/PR9HYIsdnzY6i kbpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=hLtHiFr7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id br8-20020a17090b0f0800b002805aa7b138si1072909pjb.59.2023.11.08.23.39.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Nov 2023 23:39:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=hLtHiFr7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id AA686832587C; Wed, 8 Nov 2023 23:39:10 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233065AbjKIHjF (ORCPT + 32 others); Thu, 9 Nov 2023 02:39:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232808AbjKIHiw (ORCPT ); Thu, 9 Nov 2023 02:38:52 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 348092728 for ; Wed, 8 Nov 2023 23:38:50 -0800 (PST) Received: from [127.0.1.1] (91-158-149-209.elisa-laajakaista.fi [91.158.149.209]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 329FF1B44; Thu, 9 Nov 2023 08:38:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1699515505; bh=ea9sAgDoBLxTb7N3GvFQ0oKnHf7196fJPgOxmwvSZWc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=hLtHiFr71+P5vgrZ+dKQf7om6zS0BgGAJQVg9fK3rq1E4HvoTsJTnmRl3qL0TBtHP E2nTZlx12cWoAHnfLpELkmpUtVlXSVypPbWH63rOxsesdUion/OIfwPLMndqK+IyvY a+tsPd2pDcVigeq7xdjQ9dLSUoaZrnM/2xZviThg= From: Tomi Valkeinen Date: Thu, 09 Nov 2023 09:37:59 +0200 Subject: [PATCH v2 06/11] drm/tidss: Check for K2G in in dispc_softreset() MIME-Version: 1.0 Message-Id: <20231109-tidss-probe-v2-6-ac91b5ea35c0@ideasonboard.com> References: <20231109-tidss-probe-v2-0-ac91b5ea35c0@ideasonboard.com> In-Reply-To: <20231109-tidss-probe-v2-0-ac91b5ea35c0@ideasonboard.com> To: Aradhya Bhatia , Devarsh Thakkar , Jyri Sarha , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Laurent Pinchart , Francesco Dolcini , Tomi Valkeinen X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1429; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=ea9sAgDoBLxTb7N3GvFQ0oKnHf7196fJPgOxmwvSZWc=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBlTIx/zx8GTBnJK+j6YOO7FS+lZfIy9XVNj7BaH 60HV9E1MpiJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZUyMfwAKCRD6PaqMvJYe 9aoGEACKfzf+D8s4b0/ya3e1Ml+zOzyDtczeaI4kg4X8rD+yP5JMDDWJijlclGiJd57H5JiFhMH qTJkKVMU0HnA7TtYx6DZlJai9nAH6hcn6IxPk8+LWiDlYe0DbBlT/yl2C2FufIsc+q5X1Fn6O0a An/+loDGcSk+8z9fiDa/AiwwUlK0UxLNguhhheHAFRdBNHiIjvtZTrjji6uqwoQu67H+vgx9OTm C2Y1anUYygx4spYEMezC5rpm784DvRF5FEVBqsauHu4mikOO+c2gl6fXt/4Lfm+ht1S/WT6becM VZoTq4IqqW2tDJqlBbn7gtXOx+NvPxFJ+ja03OI2Ta96J0xaJ2zrVxaj19HYSJOSuUMlZVSSgxR UB5EszdFK+e12/P1mfZc8VrqPJu+SwCwYX6wnGGHUgLNgKUmtWh0HDoI5JlicXNlbS0sooEpDaR qrclD2NJ+tM8dzBcNvX28VqPURvUdOCboQsmZu7e72+Eg2BdLJ+hExUYsRCMPxZzFnT/5DmH+6r d/zLi3aYsejHE0h2ni+Tf77eb8mAKPz4gob/rYqAICVJDLgBfK3je+exd8JhoxjnRWVUnkFVYNM 90QelrNnZphKq6ggT6b4b+56GtC/EMuWNGfRV04ixGV3WkWLCNWf1HbP9uY7+onoIKdtPu/EH/W FM2bYzO6C+3GDBg== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 08 Nov 2023 23:39:10 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782071218656119922 X-GMAIL-MSGID: 1782071218656119922 K2G doesn't have softreset feature. Instead of having every caller of dispc_softreset() check for K2G, move the check into dispc_softreset(), and make dispc_softreset() return 0 in case of K2G. Reviewed-by: Laurent Pinchart Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/tidss/tidss_dispc.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/tidss/tidss_dispc.c b/drivers/gpu/drm/tidss/tidss_dispc.c index 50b475b285d9..c82fd5bc9be4 100644 --- a/drivers/gpu/drm/tidss/tidss_dispc.c +++ b/drivers/gpu/drm/tidss/tidss_dispc.c @@ -2707,6 +2707,10 @@ static int dispc_softreset(struct dispc_device *dispc) u32 val; int ret; + /* K2G display controller does not support soft reset */ + if (dispc->feat->subrev == DISPC_K2G) + return 0; + /* Soft reset */ REG_FLD_MOD(dispc, DSS_SYSCONFIG, 1, 1, 1); /* Wait for reset to complete */ @@ -2829,12 +2833,9 @@ int dispc_init(struct tidss_device *tidss) of_property_read_u32(dispc->dev->of_node, "max-memory-bandwidth", &dispc->memory_bandwidth_limit); - /* K2G display controller does not support soft reset */ - if (feat->subrev != DISPC_K2G) { - r = dispc_softreset(dispc); - if (r) - return r; - } + r = dispc_softreset(dispc); + if (r) + return r; tidss->dispc = dispc;