From patchwork Fri Jan 18 14:51:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Kocialkowski X-Patchwork-Id: 10770631 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BA2B517FB for ; Fri, 18 Jan 2019 15:10:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A91752E0B0 for ; Fri, 18 Jan 2019 15:10:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9CE042EC60; Fri, 18 Jan 2019 15:10:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6E9D72EBFF for ; Fri, 18 Jan 2019 15:10:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ccSSYkaFQXWYrvrKDjQdGiOrrevgAk62uzt337rYIbQ=; b=soDKGjvfNVg/Ze qcKPw2MpGBHiiUOCA0eM5TtK8NfDYRsYV3zzcEYyi45hWllNanRRX+f8LQb5jWIUSN/Sfv2jDSWW0 I9WfbYhYbuh3PUxjcQDotAOOVDjLB3j32Od1FHmKDX5ZxJY0h008/z/AGFbF5WjHdCDDMyRySE+W0 G92vOsO+wVvk/8KPjkuCaLl+t2JuIc30VnMMiP6GNOP/rZLEHIP956ogxbjjeGNMnQ2gohMo4cwRi /+iaO1SUG6S+0x14/vsw+FU2GGilMGtH9sBNZ2A0WJaKfrS4eJ5a1FfoMH39Gbf3lvk4GivgoCpyn Gyx5hVTR9io4WpnvGdfQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gkVnA-0003Qp-M0; Fri, 18 Jan 2019 15:10:44 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gkVn9-0003Qe-MX for linux-arm-kernel@bombadil.infradead.org; Fri, 18 Jan 2019 15:10:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=epTpH5zH5jqgobY5oBf0z8GAsXh5Z1VOIherPIeJQwE=; b=mZoe0h9d3uKE6aMjxcNWEIJdrB IpnzbFA5ZOYut+GSHfCegRsFe9yXEYaqDjhD78oOptnVDeb+NccvEvLNijN+bLS2SID6tGX7qBJ9Z VlappgKhVb28TKvJPrHrOxn5cA6NIu6vm7oNVpm/tbi9UVYUCy3oUZgBWI65B087J+bSS3fymdACY gCk4CCXAEQG7H/DkBnILq+ycDbNxfJvRc3ZUrwCP39Zw15UjcozimK05gwmNsXDnAQGaGfNKPQk+/ ej6zkPW3eFjMWHw9hC/B2Dgkoukebjkk8nj/jS5n17S2wgu0GViP5QX5t7NNz0drlE+3A+7Ff6s7m F3Il57WA==; Received: from mail.bootlin.com ([62.4.15.54]) by merlin.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gkVV5-0003OR-UK for linux-arm-kernel@lists.infradead.org; Fri, 18 Jan 2019 14:52:04 +0000 Received: by mail.bootlin.com (Postfix, from userid 110) id 80CC5224CE; Fri, 18 Jan 2019 15:51:56 +0100 (CET) Received: from localhost.localdomain (aaubervilliers-681-1-37-87.w90-88.abo.wanadoo.fr [90.88.156.87]) by mail.bootlin.com (Postfix) with ESMTPSA id 5F2E120C2D; Fri, 18 Jan 2019 15:51:45 +0100 (CET) From: Paul Kocialkowski To: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com Subject: [PATCH RESEND v5 17/23] drm/sun4i: Move access control before setting the register as documented Date: Fri, 18 Jan 2019 15:51:27 +0100 Message-Id: <20190118145133.21281-18-paul.kocialkowski@bootlin.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190118145133.21281-1-paul.kocialkowski@bootlin.com> References: <20190118145133.21281-1-paul.kocialkowski@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190118_095204_113129_435540FC X-CRM114-Status: UNSURE ( 9.78 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni , Maxime Ripard , Maarten Lankhorst , Paul Kocialkowski , David Airlie , Chen-Yu Tsai , Daniel Vetter , Sean Paul Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Signed-off-by: Paul Kocialkowski --- 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 1153539f3aef..88ac77518610 100644 --- a/drivers/gpu/drm/sun4i/sun4i_frontend.c +++ b/drivers/gpu/drm/sun4i/sun4i_frontend.c @@ -75,6 +75,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]); @@ -90,9 +94,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)