From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F30AAC6377A for ; Fri, 16 Jul 2021 13:39:33 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id B56DB613CF for ; Fri, 16 Jul 2021 13:39:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B56DB613CF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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:References:In-Reply-To: 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: List-Owner; bh=BVHkgsZFj9Mh5xe+1AGPS/AfObGGKJovHTElJcK2Btk=; b=396lu7aDIULcP0 dTFdwIL3+WvSwFYOL5Klb56Dr6Db/mmFmgt6uL9EPwXDlPPa3YyiKrsnFXDpm/LD/NFimxHTfswy7 ELhIq8bDYXqeXun2RWIoV38TjKfSG8GWCNbCvqOKIzOYTZNhLGbCSZJPp0lJCkVgeGNj1Dlv4Qn7n Cv1i6+6Ozmox1IA5jNAShGyPzDbteFm4Hx/HBxYz1uaY9R1lSJCFbJz3XIr2M7tyvKBiDqe0kpPNj wwFteJwP0R4wCi+GVEXcVDmc+AnWCyPVTtWmrNSgvBqwkXdUmwMPocyAZ9E+Czmy45tgq6959+fKV t+2gyTkgSxpsKFKp2vOw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m4O2K-004UqV-66; Fri, 16 Jul 2021 13:37:52 +0000 Received: from mail-vs1-xe2f.google.com ([2607:f8b0:4864:20::e2f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m4O24-004UmS-OP for linux-arm-kernel@lists.infradead.org; Fri, 16 Jul 2021 13:37:38 +0000 Received: by mail-vs1-xe2f.google.com with SMTP id u14so4994216vsc.8 for ; Fri, 16 Jul 2021 06:37:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=e+b+YZB0J+Z+FsMULJLucLmoDRkBdodPjdAffOuK1Bo=; b=rbDLWYpFZAUSaH2e/k3pGB5sPO9LsadfUEoKE+7OTFdrJnO+fPuojMKZumdhTeFfU8 84DtNIg8jxGSZayQvg42ronAhPukFqRQN3J3KvRi1G8J1ZNKaWNP+KWv7E5tLhAWrj6M oAk2I/+qIVWRvEf2xaQIILMraxrVbFsbEPUZEOnOjB5Ab/cQ6BiMsQ9tOYyrSF0mdVU0 FUUXXi/5LjO/7J6idITxB8+FpFttT5DUdVSRIEW/cpeq8gDCTOJQE3W5s4eqO7t2YagW tMmPZedzZHFviog6gkwpuAW/fW/EZ7/6r/5l/hvKXbqtqWmmHHl7HDov6O1g89NwB/TB 2brw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=e+b+YZB0J+Z+FsMULJLucLmoDRkBdodPjdAffOuK1Bo=; b=Faan9qOLV5oPZclenrIAmYouj25vY/8kDbMT2hXY6ZMsDzh6r2u1wrpEsRREhHJK0c oT9z1aedYXOOczZd7K7FI1Qk5ENiElXSg12XFLOiyPIv1RGBVSAOt3m1Jn9WXTDLkH+q p4wOAmTmLnT46HJ9VmGe/FpK9YNTa4PSTKzrCV5lNzbxuZyiEwekpr5L4U0GFDhr90mj mOuLvzW02Uwv9SLc/zKK5L7tZVY5rBibriF2899lbGsVm5dzlmGOC5mgVALFGGpaULLX dOBaIJlXLphf8kB7QWz7ZVP/0exKoj8VFlsviqPp3iPMe9Lo8dAiANo8M9LKD9Jkz3cl 3iMQ== X-Gm-Message-State: AOAM530fXb5vBZPh8aS+d5SfqVRBZ6AcJImK94lX2lmtDVu6G2fUR6zB BGUA/LM3VodQYv1H1Eg/a1M= X-Google-Smtp-Source: ABdhPJzg32FxIFujiM5cy9gq4+vAVf1mWBdRTWS7P9c9H/mPxeygwK1hKHMnI5vaZcQ8l2BxJoaO5g== X-Received: by 2002:a67:ec8a:: with SMTP id h10mr12015618vsp.56.1626442654856; Fri, 16 Jul 2021 06:37:34 -0700 (PDT) Received: from localhost.localdomain ([2804:14c:485:504a:9f0b:cb12:835a:e9f9]) by smtp.gmail.com with ESMTPSA id 184sm1352572vks.33.2021.07.16.06.37.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Jul 2021 06:37:34 -0700 (PDT) From: Fabio Estevam To: shawnguo@kernel.org Cc: linux-arm-kernel@lists.infradead.org, o.rempel@pengutronix.de, Markus.Niebel@tq-group.com, Fabio Estevam Subject: [PATCH 2/4] ARM: dts: imx6qp-prtwd3: Fix the SPI chipselect polarity Date: Fri, 16 Jul 2021 10:36:57 -0300 Message-Id: <20210716133659.3372047-2-festevam@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210716133659.3372047-1-festevam@gmail.com> References: <20210716133659.3372047-1-festevam@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210716_063736_852696_C45AACA9 X-CRM114-Status: GOOD ( 16.53 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The conversion of the spi-imx driver to use GPIO descriptors in commit 8cdcd8aeee28 ("spi: imx/fsl-lpspi: Convert to GPIO descriptors") helped to detect the following SPI chipselect polarity mismatch on an imx6q-sabresd for example: [ 4.854337] m25p80@0 enforce active low on chipselect handle Prior to the above commit, the chipselect polarity passed via cs-gpios property was ignored and considered active-low. The reason for such mismatch is clearly explained in the comments inside drivers/gpio/gpiolib-of.c: * SPI children have active low chip selects * by default. This can be specified negatively * by just omitting "spi-cs-high" in the * device node, or actively by tagging on * GPIO_ACTIVE_LOW as flag in the device * tree. If the line is simultaneously * tagged as active low in the device tree * and has the "spi-cs-high" set, we get a * conflict and the "spi-cs-high" flag will * take precedence. To properly represent the SPI chipselect polarity, change it to active-low when the "spi-cs-high" property is absent. The conversion of the spi-imx driver to use GPIO descriptors in commit 8cdcd8aeee28 ("spi: imx/fsl-lpspi: Convert to GPIO descriptors") helped to detect the following SPI chipselect polarity mismatch on an imx6q-sabresd for example: [ 4.854337] m25p80@0 enforce active low on chipselect handle Prior to the above commit, the chipselect polarity passed via cs-gpios property was ignored and considered active-low. The reason for such mismatch is clearly explained in the comments inside drivers/gpio/gpiolib-of.c: * SPI children have active low chip selects * by default. This can be specified negatively * by just omitting "spi-cs-high" in the * device node, or actively by tagging on * GPIO_ACTIVE_LOW as flag in the device * tree. If the line is simultaneously * tagged as active low in the device tree * and has the "spi-cs-high" set, we get a * conflict and the "spi-cs-high" flag will * take precedence. To properly represent the SPI chipselect polarity, change it to active-low when the "spi-cs-high" property is absent. Signed-off-by: Fabio Estevam --- arch/arm/boot/dts/imx6qp-prtwd3.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/imx6qp-prtwd3.dts b/arch/arm/boot/dts/imx6qp-prtwd3.dts index c42723989bc0..1a334918f9ca 100644 --- a/arch/arm/boot/dts/imx6qp-prtwd3.dts +++ b/arch/arm/boot/dts/imx6qp-prtwd3.dts @@ -123,7 +123,7 @@ &can1 { }; &ecspi2 { - cs-gpios = <&gpio2 26 GPIO_ACTIVE_HIGH>; + cs-gpios = <&gpio2 26 GPIO_ACTIVE_LOW>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_ecspi2>; status = "okay"; @@ -189,7 +189,7 @@ fixed-link { }; &ecspi3 { - cs-gpios = <&gpio4 24 GPIO_ACTIVE_HIGH>; + cs-gpios = <&gpio4 24 GPIO_ACTIVE_LOW>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_ecspi3>; status = "okay"; -- 2.25.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel