Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp645261pxb; Tue, 5 Apr 2022 17:08:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyF7j0W1RYPcSVbWxmBqVqUp7YhSuU3OafOe0tj68ion+ThWdliwaQzL8Or5Msk6r+BHZ0k X-Received: by 2002:a17:90b:4b02:b0:1c7:1bc3:690b with SMTP id lx2-20020a17090b4b0200b001c71bc3690bmr7003235pjb.174.1649203697510; Tue, 05 Apr 2022 17:08:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649203697; cv=none; d=google.com; s=arc-20160816; b=TUfkEhMfhRGzWvoslrpYv73XdI9TLBP13URm0rP8kjNEqRCWK4LmBK2b8cewSbu736 Lblk0zri3TMiiyDzaNpyii13cA+WQRjtZiVRsYYzQXTmy4qv8uxIuryRT2rEwI0hhKFN vCwO76jqvlQ1yQFKIyWH+Sb06syOd/5qom6ICAfOogZPupgPEhXvzAsPgcx9F/maWLuN KleEcZAxS9fo5vR8WZPGwvNoE3YeGLs3U59Frxz48FRkkQqiVkRUdchrDkH+rMcO08Nu 2+oka3Bcrci9w/rbmed6IbCRbAYqSFFcaxQyr8emgNm7u3PiMu8Dg9Ze/y84sYKtJyqA 0gqg== 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=fzscp9lVQ8rhjbgO/HdDIyvmxuFAYj8/MKmnCsgoBYd3DhmIQ0XUGw+LJ2gEmTt7Z8 /BD7cDXXg5pwYPM7tQG95RErjMMl1vRceQUFc2ovJXH9AOwiyhbvWJx0RdMzNZeogmOZ gvwXL2fG1ZtTuKmzSyT9VzTDARoWn7rhFEqdz3fKgN9iqJap9e7wMzjVLtObyuJfm0Zw USsi2XFX34d8g9tXmpD0DxQz1/q1O6VI7yf/Xiak36Z3yG562fweo6beJgUrDjUHzaZ7 KMJk+lokfUvbUI53yY7VrcJ4LZtRz56P/LL9s4aHDwm516P+h1jbssdqOd1Y1WPOAYPb p63g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=h2YphGft; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id 1-20020a170902c24100b00156984a1cb4si8056508plg.306.2022.04.05.17.08.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 17:08:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=h2YphGft; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 583C9181790; Tue, 5 Apr 2022 16:52:42 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352694AbiDEOB6 (ORCPT + 99 others); Tue, 5 Apr 2022 10:01:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235369AbiDEJaT (ORCPT ); Tue, 5 Apr 2022 05:30:19 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65B18E2F74; Tue, 5 Apr 2022 02:17:06 -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 ams.source.kernel.org (Postfix) with ESMTPS id 1C5D4B81BBF; Tue, 5 Apr 2022 09:17:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7D5FDC385A2; Tue, 5 Apr 2022 09:17:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649150223; bh=/yt+JKhK1iOBl6Kc9z8/VMaIFaoyhQMuQvEUN61MtuY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h2YphGftFuLvIdQ98ZfEIAajm/A1yFiDMLWh1hTy/XPm90OJuvpezSREgftI54gbo 34xanM4GwFqBIwQmuGZRTLxF+GWgUftQQFZHzaBfApaWvGEATPUvlGaB3vgJR1+8MP jyAh+z9Cv1WQFpKCX1zmNJLWWaLI1sz2f+Jx4eSQ= 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.16 0997/1017] spi: mediatek: support tick_delay without enhance_timing Date: Tue, 5 Apr 2022 09:31:50 +0200 Message-Id: <20220405070423.796153423@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@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 */