Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp778190pxb; Tue, 5 Apr 2022 22:57:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyx/TMTPPJNTw1GnnUrwP6tOxwYd1P+uqPrHIosusub5uPJG61H31SQh6myVyuuxKKrcazR X-Received: by 2002:a17:90a:b00f:b0:1c9:9205:433 with SMTP id x15-20020a17090ab00f00b001c992050433mr8000892pjq.116.1649224636007; Tue, 05 Apr 2022 22:57:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649224636; cv=none; d=google.com; s=arc-20160816; b=b7Rg+KSOiq4QAP9tvX4EXKvdxj2k4MGPMBKQqvr3UhXhtQoB9qUkWy2YcMWRrVPt92 DEnd5E0jRUl1BeMPVZeISKwLcQOctb0lXaWTpkDN4snLsyvrbrwJkM1BUe4dVxjl5u1n JIsxGoplteb9bZzJyhIgcIwM36mQHw+si2mXcchHFTtIznHNCUdX2vbgzpyoKPGHb8+k ushYYl1mEAI/gUZJWp90qizzFL1H6qKs39FdULGs6rESYMlXgE+SNBS8t4sLgwJYdcRt 0uABEb00nRVATk5+lQvAjjEL6tdZRzWSDskyP9TWgr1vK7P0NM0Y/F4+ov4Bw86hRjm2 KYlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YBcF/QeJCBZ2Oz0RB1FjZyGFDL+xdf3mVe0PuHAYVIc=; b=as0uTIoC8SNgKvdg9hOiuPZfaohfYWioyMX68CKkyU+5QPtVGvYksjvHYXEQf++2U0 U+s86kxcD5fw/c2pRJuGFOPgrKfsNF+C7lFf65XDUhBaaiX4AUPGYkqr0f+mvQY1RZUI Vc7fqaPByDGXKem+X5dcOsd0tjUClO3h1YJb+EFj4bSwG3hjHRLjQgcS+Wik4RrHA8mc 3PywNj53+9v/yM7GUxYHGreFHxPA5dLoCF8U5MzYK1Zx16VeKKDizCYFxb9qRkJE5aa2 vCjTsWDPW93So6PmTdjffqH1O6wKugD118XoLH5oXE82UoyIKlhIX4wt1RLDaR2CFJRS /0JQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jF8upd03; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id lk8-20020a17090b33c800b001c6560c94b4si4417785pjb.29.2022.04.05.22.57.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 22:57:15 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jF8upd03; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7260549A95F; Tue, 5 Apr 2022 22:21:27 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239746AbiDEXU4 (ORCPT + 99 others); Tue, 5 Apr 2022 19:20:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354228AbiDEKMT (ORCPT ); Tue, 5 Apr 2022 06:12:19 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13D4C5C855; Tue, 5 Apr 2022 02:59:20 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A3FB6616DC; Tue, 5 Apr 2022 09:59:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC3F0C385A1; Tue, 5 Apr 2022 09:59:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649152759; bh=/yt+JKhK1iOBl6Kc9z8/VMaIFaoyhQMuQvEUN61MtuY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jF8upd03V8jXjIqfUla7O/rWBmib81jZtL7oLHTmMyFdNR7L1e/inM6cNFrk1jRyk sf6qXW/pJMXtuB8VOLcLeuvornOgsl/7BYIhkaqCi2lJeG1yaASn3qVrYeEa6TDsAJ aiaE8svDF90k9jU/oblocnAnCD+kZe/vIeK2Rl7A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Leilk Liu , AngeloGioacchino Del Regno , Mark Brown Subject: [PATCH 5.15 892/913] spi: mediatek: support tick_delay without enhance_timing Date: Tue, 5 Apr 2022 09:32:34 +0200 Message-Id: <20220405070406.559580966@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Leilk Liu commit 03b1be379dcee2e9c866c2a455a1a4a9581b3efd upstream. this patch support tick_delay bit[31:30] without enhance_timing feature. Fixes: f84d866ab43f("spi: mediatek: add tick_delay support") Signed-off-by: Leilk Liu Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220315032411.2826-2-leilk.liu@mediatek.com Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- drivers/spi/spi-mt65xx.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) --- a/drivers/spi/spi-mt65xx.c +++ b/drivers/spi/spi-mt65xx.c @@ -43,8 +43,11 @@ #define SPI_CFG1_PACKET_LOOP_OFFSET 8 #define SPI_CFG1_PACKET_LENGTH_OFFSET 16 #define SPI_CFG1_GET_TICK_DLY_OFFSET 29 +#define SPI_CFG1_GET_TICK_DLY_OFFSET_V1 30 #define SPI_CFG1_GET_TICK_DLY_MASK 0xe0000000 +#define SPI_CFG1_GET_TICK_DLY_MASK_V1 0xc0000000 + #define SPI_CFG1_CS_IDLE_MASK 0xff #define SPI_CFG1_PACKET_LOOP_MASK 0xff00 #define SPI_CFG1_PACKET_LENGTH_MASK 0x3ff0000 @@ -346,9 +349,15 @@ static int mtk_spi_prepare_message(struc /* tick delay */ reg_val = readl(mdata->base + SPI_CFG1_REG); - reg_val &= ~SPI_CFG1_GET_TICK_DLY_MASK; - reg_val |= ((chip_config->tick_delay & 0x7) - << SPI_CFG1_GET_TICK_DLY_OFFSET); + if (mdata->dev_comp->enhance_timing) { + reg_val &= ~SPI_CFG1_GET_TICK_DLY_MASK; + reg_val |= ((chip_config->tick_delay & 0x7) + << SPI_CFG1_GET_TICK_DLY_OFFSET); + } else { + reg_val &= ~SPI_CFG1_GET_TICK_DLY_MASK_V1; + reg_val |= ((chip_config->tick_delay & 0x3) + << SPI_CFG1_GET_TICK_DLY_OFFSET_V1); + } writel(reg_val, mdata->base + SPI_CFG1_REG); /* set hw cs timing */