Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3215506imu; Sat, 24 Nov 2018 00:17:53 -0800 (PST) X-Google-Smtp-Source: AFSGD/UN+eGjQ89hRRj038DYAQyWPi1mvDK3KzMaSWPxoq01cN1PVoye3rznfZ8Ft17ipNGuMJTd X-Received: by 2002:a17:902:7791:: with SMTP id o17mr18852864pll.60.1543047473864; Sat, 24 Nov 2018 00:17:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543047473; cv=none; d=google.com; s=arc-20160816; b=xql5lvWIqNzdC8LcZvkoRyvWYgKfwdIJRsS6P6TikLam8eaOQEmOk8FOMF+ZalAwJQ oOHwOhNrbIgYr7nLyzLd5HNE58SJXlqeUeKgT/LGu8oZsmJVCajhI0ZzOK4EojwXxzIK SsI+MlPCoYz1bH1+zWrIU/h/vm+hFG8ootxfGZ/ub8LMqZqn+U+Lo366GB5Sw5khxxRs NwMffV+a6agRJ00LBfSReDUcwhlK2qXpdsBGY1GJ85EaxP9VUHRLjT6VsjK4DKC8eeNP skqXliUIE/YMfxQs1V0VawR/bXNDTpOayaEpGqlgJtfqAjgzSzwrNykIRmrqflUVHbUk Q9Uw== 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=AqIeuUtUkTBxaAEvFc7AEUuALTvl3pdWqy0H8ReYRG8=; b=OZYyOkvJvm1J6nq/WI1u8L3X+cjMujw9ZjxrQlS4jTSlOcEaRlbkZqNqGXErY8muiw vjhhU9WhNxf79ss2fLTId5KnTPUv9sP+BbPSHeBfrxq31veSUe7gQDqHeoYiTu3IvT9J Erfl2xYsD+Fki5L8hQ04KyQG5f+DhfzGIRN9/zf8aEcYIAIYIGgdCcheFKxUJpK88Bf3 k8QfBbFtZlp9hAeZ6Zf/aiHUhp/5zb5/5AhbksCr04c9LyU7HGtKHHMXU8n1p8N8U8c/ 90qsos68YofimT9BY/wuujO5V4QLg0u/lhx+Mr9C85dkbE3SJiEVhCd6b5QharhDIWID 4Ajg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bi6si40155579plb.279.2018.11.24.00.17.39; Sat, 24 Nov 2018 00:17:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2409084AbeKWULS (ORCPT + 99 others); Fri, 23 Nov 2018 15:11:18 -0500 Received: from mail.bootlin.com ([62.4.15.54]:49469 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2409027AbeKWUKg (ORCPT ); Fri, 23 Nov 2018 15:10:36 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id 29ADF20F4A; Fri, 23 Nov 2018 10:27:08 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.2 Received: from localhost.localdomain (aaubervilliers-681-1-94-205.w90-88.abo.wanadoo.fr [90.88.35.205]) by mail.bootlin.com (Postfix) with ESMTPSA id 7CF3920F6A; Fri, 23 Nov 2018 10:26:37 +0100 (CET) From: Paul Kocialkowski To: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org Cc: Maarten Lankhorst , Maxime Ripard , Sean Paul , David Airlie , Chen-Yu Tsai , Thomas Petazzoni , linux-sunxi@googlegroups.com, Daniel Vetter Subject: [PATCH v2 38/43] drm/sun4i: Move access control before setting the register as documented Date: Fri, 23 Nov 2018 10:25:10 +0100 Message-Id: <20181123092515.2511-39-paul.kocialkowski@bootlin.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181123092515.2511-1-paul.kocialkowski@bootlin.com> References: <20181123092515.2511-1-paul.kocialkowski@bootlin.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 From: Maxime Ripard Unlike what is currently being done, the ACCESS_CTRL bit documentation asks that this bit should be set before modifying any register. The code in the BSP also does this, so make sure we do this as well. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/sun4i/sun4i_frontend.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_frontend.c b/drivers/gpu/drm/sun4i/sun4i_frontend.c index b9c18fa2fff3..2c9dcb4ffde0 100644 --- a/drivers/gpu/drm/sun4i/sun4i_frontend.c +++ b/drivers/gpu/drm/sun4i/sun4i_frontend.c @@ -74,6 +74,10 @@ static void sun4i_frontend_scaler_init(struct sun4i_frontend *frontend) { int i; + regmap_write_bits(frontend->regs, SUN4I_FRONTEND_FRM_CTRL_REG, + SUN4I_FRONTEND_FRM_CTRL_COEF_ACCESS_CTRL, + SUN4I_FRONTEND_FRM_CTRL_COEF_ACCESS_CTRL); + for (i = 0; i < 32; i++) { regmap_write(frontend->regs, SUN4I_FRONTEND_CH0_HORZCOEF0_REG(i), sun4i_frontend_horz_coef[2 * i]); @@ -89,9 +93,6 @@ static void sun4i_frontend_scaler_init(struct sun4i_frontend *frontend) sun4i_frontend_vert_coef[i]); } - regmap_update_bits(frontend->regs, SUN4I_FRONTEND_FRM_CTRL_REG, - SUN4I_FRONTEND_FRM_CTRL_COEF_ACCESS_CTRL, - SUN4I_FRONTEND_FRM_CTRL_COEF_ACCESS_CTRL); } int sun4i_frontend_init(struct sun4i_frontend *frontend) -- 2.19.1