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=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, URIBL_BLOCKED,USER_AGENT_SANE_1 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 6B083C4361A for ; Fri, 4 Dec 2020 09:15:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 244D322795 for ; Fri, 4 Dec 2020 09:15:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729154AbgLDJPx (ORCPT ); Fri, 4 Dec 2020 04:15:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726636AbgLDJPx (ORCPT ); Fri, 4 Dec 2020 04:15:53 -0500 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C801CC061A4F for ; Fri, 4 Dec 2020 01:15:12 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id B79A01F45EFB Subject: Re: [PATCH 1/2] platform/chrome: cros_ec_spi: Don't overwrite spi::mode To: Stephen Boyd , Benson Leung Cc: linux-kernel@vger.kernel.org, Simon Glass , Gwendal Grignou , Douglas Anderson , Alexandru M Stan References: <20201203011649.1405292-1-swboyd@chromium.org> <20201203011649.1405292-2-swboyd@chromium.org> From: Enric Balletbo i Serra Message-ID: <03518a00-c30c-a3ba-d26e-10bae4060640@collabora.com> Date: Fri, 4 Dec 2020 10:15:08 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20201203011649.1405292-2-swboyd@chromium.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Stephen, Thank you for your patch. On 3/12/20 2:16, Stephen Boyd wrote: > There isn't any need to overwrite the mode here in the driver with what > has been detected by the firmware, such as DT or ACPI. In fact, if we > use the SPI CS gpio descriptor feature we will overwrite the mode with > SPI_MODE_0 where it already contains SPI_MODE_0 and more importantly > SPI_CS_HIGH. Clearing the SPI_CS_HIGH bit causes the CS line to toggle > when the device is probed when it shouldn't change, confusing the driver > and making it fail to probe. Drop the assignment and let the spi core > take care of it. > > Fixes: a17d94f0b6e1 ("mfd: Add ChromeOS EC SPI driver") > Cc: Simon Glass > Cc: Gwendal Grignou > Cc: Douglas Anderson > Cc: Alexandru M Stan > Signed-off-by: Stephen Boyd > --- Acked-by: Enric Balletbo i Serra > drivers/platform/chrome/cros_ec_spi.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/drivers/platform/chrome/cros_ec_spi.c b/drivers/platform/chrome/cros_ec_spi.c > index dfa1f816a45f..f9df218fc2bb 100644 > --- a/drivers/platform/chrome/cros_ec_spi.c > +++ b/drivers/platform/chrome/cros_ec_spi.c > @@ -742,7 +742,6 @@ static int cros_ec_spi_probe(struct spi_device *spi) > int err; > > spi->bits_per_word = 8; > - spi->mode = SPI_MODE_0; > spi->rt = true; > err = spi_setup(spi); > if (err < 0) >