Received: by 2002:a17:90b:8d0:0:0:0:0 with SMTP id ds16csp4881994pjb; Mon, 27 Jul 2020 07:30:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyNiksaeG2QcHhms3F85HSG7QUXLiPPFlLMGaF4UBCmZUDYGhrgeVY9HlRpAxZrDHh9sdLV X-Received: by 2002:a17:906:cc51:: with SMTP id mm17mr1349420ejb.137.1595860249079; Mon, 27 Jul 2020 07:30:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595860249; cv=none; d=google.com; s=arc-20160816; b=qkr7eV+Xmfu2EbtRuy88UY/1bsUS2IAsOubUd3ePegIAyTcvkHPmzjrieFyuKOaM6U 7UG4TC5RgJ2dbonMT+A8dxdbYO551TRmubo+1PHg9T6h7/JY+goVeRY4IVrSfHP8D237 GaIktHrEgzObDSOA23bejO0sVQeqMV/1z3ofaCfAFoyWOsN1JMvYUzeIdrndcnquF7kz eL2Cr3SpGChvMdZjMiZmxCM1WmJDg/KnpoNWeCmEAvg3EfBAFIRfmrbRfUo+GX+tAC2J izpuqt5zBT6g776SPayXHQyxvJpOuIjSxrWBdixvcmV8fbalbZd29iX8kde/pfXe1Hbi pskA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=IZ+F99EF57faeJ+GA4pw2f/W9I4EIvlzbz/NmwHzSTo=; b=MnTE9OWOacsBvXZ2Ox8vnT5rLi+JQ4hEGHFw9aqxQ5aNHpE7wurMl4JFkGhwTAjLkt YJAnraXwsh+lWsHRK42nFVtcn+ZW6sh9gJsKUAMkVhpwdcAHPEMeU8Fci7LiGEucgTxo YHAxI3OLWsWBoiGib8kM2E9hGWlfiTSwzaRw0NYbAkQrOI+y+FcV21lQ4FlnA4fWVTB9 Qa8CHECsJTp3eDQCoQFrLmkkEQDO78ME1Gf8wd7AqKabu3i4V5wHEb7iMZFBwGc9Abtf awPjn31/2u0S8tx7486d5hYI6foZ001RRdmTRdP/J1kfrO32glD0dnjkjWyZaxFFDOMZ mQpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="qQAhzkz/"; 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 f9si6532412ejl.71.2020.07.27.07.30.26; Mon, 27 Jul 2020 07:30:49 -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; dkim=pass header.i=@kernel.org header.s=default header.b="qQAhzkz/"; 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 S1732198AbgG0O3M (ORCPT + 99 others); Mon, 27 Jul 2020 10:29:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:52732 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732092AbgG0OX2 (ORCPT ); Mon, 27 Jul 2020 10:23:28 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 923EF2083E; Mon, 27 Jul 2020 14:23:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595859808; bh=lgjCCENV00DiV1K/LA1CHrBy+wCLaLIT1uQKueyEVAI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qQAhzkz/Sidfw3dQ7yWviKafxL5k0u12esHdrjoFKtZNI7DBeNu/DBNFrflRRZ7x0 Cf621sz96vykThnMDi2ywB+pyNPpY1ax9N+gBDoJ09//Vo3RCdIBqmLdYhRFo/am3U 7GEpRug0Sk+knqNktLFbMZo2xVq4DvlCZqE6W86Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "leilk.liu" , Mark Brown , Sasha Levin Subject: [PATCH 5.7 112/179] spi: mediatek: use correct SPI_CFG2_REG MACRO Date: Mon, 27 Jul 2020 16:04:47 +0200 Message-Id: <20200727134938.110153749@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200727134932.659499757@linuxfoundation.org> References: <20200727134932.659499757@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: leilk.liu [ Upstream commit 44b37eb79e16a56cb30ba55b2da452396b941e7a ] this patch use correct SPI_CFG2_REG offset. Signed-off-by: leilk.liu Link: https://lore.kernel.org/r/20200701090020.7935-1-leilk.liu@mediatek.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-mt65xx.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi/spi-mt65xx.c index 6783e12c40c22..a556795caeef4 100644 --- a/drivers/spi/spi-mt65xx.c +++ b/drivers/spi/spi-mt65xx.c @@ -36,7 +36,6 @@ #define SPI_CFG0_SCK_LOW_OFFSET 8 #define SPI_CFG0_CS_HOLD_OFFSET 16 #define SPI_CFG0_CS_SETUP_OFFSET 24 -#define SPI_ADJUST_CFG0_SCK_LOW_OFFSET 16 #define SPI_ADJUST_CFG0_CS_HOLD_OFFSET 0 #define SPI_ADJUST_CFG0_CS_SETUP_OFFSET 16 @@ -48,6 +47,8 @@ #define SPI_CFG1_CS_IDLE_MASK 0xff #define SPI_CFG1_PACKET_LOOP_MASK 0xff00 #define SPI_CFG1_PACKET_LENGTH_MASK 0x3ff0000 +#define SPI_CFG2_SCK_HIGH_OFFSET 0 +#define SPI_CFG2_SCK_LOW_OFFSET 16 #define SPI_CMD_ACT BIT(0) #define SPI_CMD_RESUME BIT(1) @@ -283,7 +284,7 @@ static void mtk_spi_set_cs(struct spi_device *spi, bool enable) static void mtk_spi_prepare_transfer(struct spi_master *master, struct spi_transfer *xfer) { - u32 spi_clk_hz, div, sck_time, cs_time, reg_val = 0; + u32 spi_clk_hz, div, sck_time, cs_time, reg_val; struct mtk_spi *mdata = spi_master_get_devdata(master); spi_clk_hz = clk_get_rate(mdata->spi_clk); @@ -296,18 +297,18 @@ static void mtk_spi_prepare_transfer(struct spi_master *master, cs_time = sck_time * 2; if (mdata->dev_comp->enhance_timing) { + reg_val = (((sck_time - 1) & 0xffff) + << SPI_CFG2_SCK_HIGH_OFFSET); reg_val |= (((sck_time - 1) & 0xffff) - << SPI_CFG0_SCK_HIGH_OFFSET); - reg_val |= (((sck_time - 1) & 0xffff) - << SPI_ADJUST_CFG0_SCK_LOW_OFFSET); + << SPI_CFG2_SCK_LOW_OFFSET); writel(reg_val, mdata->base + SPI_CFG2_REG); - reg_val |= (((cs_time - 1) & 0xffff) + reg_val = (((cs_time - 1) & 0xffff) << SPI_ADJUST_CFG0_CS_HOLD_OFFSET); reg_val |= (((cs_time - 1) & 0xffff) << SPI_ADJUST_CFG0_CS_SETUP_OFFSET); writel(reg_val, mdata->base + SPI_CFG0_REG); } else { - reg_val |= (((sck_time - 1) & 0xff) + reg_val = (((sck_time - 1) & 0xff) << SPI_CFG0_SCK_HIGH_OFFSET); reg_val |= (((sck_time - 1) & 0xff) << SPI_CFG0_SCK_LOW_OFFSET); reg_val |= (((cs_time - 1) & 0xff) << SPI_CFG0_CS_HOLD_OFFSET); -- 2.25.1