From patchwork Tue Aug 9 17:20:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amjad Ouled-Ameur X-Patchwork-Id: 12939821 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 111BAC19F2D for ; Tue, 9 Aug 2022 17:22:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=kHRoQnt5tWSgt40/MWPGWx1GKDJor4RgsjdL4YifhEY=; b=EyuzbjrPyqvUpu SVNgWedzs2WimF6AahBA/Es8sOJm/u8Y3eXwVmUcb+aVR7YmgDg19t3tUpVCVI/R1ApMPZYk4qc2O MWk2YTVffoFkSQup2mC5eUQIajHwIwNou06F2I2ZAiZtbV8c4IAqoYyUEfflv9v7/iKtV6JYvfKeb MoqkjfCp5I/FJMbv3i/rSYliAA4q6SdYtJkXoMpEzVpRsz8Ocg9Za+jWwSYjOIOFXtgtpJmjvkfHi B/D9Uo2a6Vrf4dXPFVce2gfP32FiKDHSlU7JXpJNO+3qs+zDwqQ4A2PeI1FMRjjkFC9/+tduneXiU 5I5f5GT6luzEBKp5JrBQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oLSuX-005EJH-0S; Tue, 09 Aug 2022 17:20:57 +0000 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oLSuT-005EHc-VD for linux-arm-kernel@lists.infradead.org; Tue, 09 Aug 2022 17:20:56 +0000 Received: by mail-wr1-x435.google.com with SMTP id j1so15094600wrw.1 for ; Tue, 09 Aug 2022 10:20:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc; bh=sHMkwp3NTmTV/xVMwqTRrDVuL8/D/PiDUhfkbp4j2rc=; b=XtroOFWIeD/FFHW2xP+1bOcSThi+rmn9mJ57T/c3OIXw1gF+5WvaBOcwq5GwjKbJ0P is9NMLJzP/Qo/p6/8iXdSm6+JQPrg73dE0eWaaIW2N/icGvmUlZQK2/H4X4GDDps9UOB 0kq14E1slsCe5YfVVjY6uPjOB4GrpTUDlQrwWUgJaDNKxrmKBjkjiR006B6RTVLHx9px iXaTq1doW6zm1vb74VyQuQyCVMvCgMWzarx8FpBaq5t/tExGEd1lCi3R4Y7HwfxAAuP2 LJ3ziyTKqhA4Q0ROIZJcq4NReSDGBKi0O8I9c8KvH1wIZQVxtBWJydL+43Hr43sTOkog fgmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc; bh=sHMkwp3NTmTV/xVMwqTRrDVuL8/D/PiDUhfkbp4j2rc=; b=SicYwPqwKnk/sxJyY75+2MtiG5ZNr+fvJLxvIEeFvo22cyitUoxs77ikzlqu6m6X1D jlIOLDxJRZaOPGDpmz6RrokJa4BVh21gdiNvcGnlX4xvTuo3e8ZJ1N0k7sqVL6KsPNOj ZG+sVpW3YqtXZmKNvd59TGELuGFleEbc8V/ax+LiVFlBnmmKHpl7n/M+9ttnRXdEhLRM XQ8pPJMOmJrSUuNyr5iBbJzMvEogf7TibqCo9A3HHkIrWFgF5Txhb6rEB6UtBxlFnRnR 7SBAt9ncq5QP6/IPHoqlo/AWWZ4hsh2io/RjrEYN7te4zpiMsujft4dSbWweNzRcegBu BwdA== X-Gm-Message-State: ACgBeo008KCoxRDTXV6H6IcxNM/0rhohqbme/cKIdG3cRmT+KFKyLoug buJR7y02lJiZLNooNmYaYtPD5A== X-Google-Smtp-Source: AA6agR7te7yif/yib4C7IySe6UqMjagxvMgnKemsdomvzBKdmWEkXfKrO5pAusHmStkPSJnzDSwiKw== X-Received: by 2002:a5d:595f:0:b0:220:619d:da07 with SMTP id e31-20020a5d595f000000b00220619dda07mr14966336wri.10.1660065650358; Tue, 09 Aug 2022 10:20:50 -0700 (PDT) Received: from localhost.localdomain (210.145.15.109.rev.sfr.net. [109.15.145.210]) by smtp.googlemail.com with ESMTPSA id b3-20020a05600010c300b002206261cb6esm13915030wrx.66.2022.08.09.10.20.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Aug 2022 10:20:49 -0700 (PDT) From: Amjad Ouled-Ameur To: broonie@kernel.org Cc: linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-spi@vger.kernel.org, narmstrong@baylibre.com, Amjad Ouled-Ameur Subject: [PATCH 0/2] spi: amlogic: meson-spicc: Use pinctrl to drive CLK line when idle Date: Tue, 9 Aug 2022 19:20:15 +0200 Message-Id: <20220809172017.215412-1-aouledameur@baylibre.com> X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220809_102054_012850_A7BF0FD5 X-CRM114-Status: GOOD ( 12.60 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Between SPI transactions, all SPI pins are in HiZ state. When using the SS signal from the SPICC controller it's not an issue because when the transaction resumes all pins come back to the right state at the same time as SS. The problem is when we use CS as a GPIO. In fact, between the GPIO CS state change and SPI pins state change from idle, you can have a missing or spurious clock transition. Set a bias on the clock depending on the clock polarity requested before CS goes active, by passing a special "idle-low" and "idle-high" pinctrl state and setting the right state at a start of a message. Amjad Ouled-Ameur (2): spi: dt-bindings: amlogic, meson-gx-spicc: Add pinctrl names for SPI signal states spi: meson-spicc: Use pinctrl to drive CLK line when idle .../bindings/spi/amlogic,meson-gx-spicc.yaml | 15 +++++++ arch/arm64/boot/dts/amlogic/meson-gxl.dtsi | 14 +++++++ drivers/spi/spi-meson-spicc.c | 39 ++++++++++++++++++- 3 files changed, 67 insertions(+), 1 deletion(-)