From patchwork Fri Dec 4 19:35:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 11952215 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=-20.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=unavailable 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 843CBC4361A for ; Fri, 4 Dec 2020 19:37:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 52DDD22582 for ; Fri, 4 Dec 2020 19:37:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729721AbgLDThB (ORCPT ); Fri, 4 Dec 2020 14:37:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727913AbgLDThA (ORCPT ); Fri, 4 Dec 2020 14:37:00 -0500 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6D3AC061A55 for ; Fri, 4 Dec 2020 11:35:44 -0800 (PST) Received: by mail-pj1-x1043.google.com with SMTP id m5so3768142pjv.5 for ; Fri, 04 Dec 2020 11:35:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xIokUz/0OVF9KG6gBm+1eG1ys/IbCXUboIQpNSvv5NM=; b=equO24iQTqLTdvV7288zmDksfFX6JcjVKYoJr9Nky72wptFmzZ8Kb2wzGtP1fOujRn /o4mCZyYqLCna+CENya0y2C/NxKg27vQt/41XLQ50xrLH/zmUx3GYflCr/s1j7aXKkxf JFFDx9Y/+wNSK9vki5W7ZDbbGVb99w5Z10qtw= 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=xIokUz/0OVF9KG6gBm+1eG1ys/IbCXUboIQpNSvv5NM=; b=IKs/3/L6ClId92R6hw/DltXGSfXaBRT+xGAjLkdTMHIlOy1MGL9WizE03dLim/U3WB abTwPdFbMbe/jlFlM3SzcwRO/yGpGOEwX5HcjipMxtvl1Bk4TAaGGgQBDEx39l91/aC0 UEV56OygO1I1k65869SFoHRQBjSJwxT9CG0FrWg0HUhXNOZJstOO/QHvlmloxJ1NyuQJ k4tpdCGwNeBLDFScLMQb2cfvwyk/fvmXoC0sZiTWrNPPSjYj4lwHs9Mcbd2oK85mYHTa NW4UB/NZDiPgrX2TczyRQJT4C+B72MfyqUHW6nGjlz6Pl7q11+EdMzHjv44xA4wSCgna X7kA== X-Gm-Message-State: AOAM533esryCz+Fez4wiIkzeabQ0Js0MvdsXYBU5g6ky45AdTQdGdPIC HhGQCpBMad+8x7djvtfwG/qYqw== X-Google-Smtp-Source: ABdhPJzPajPzoNsIkmyEDPn/62aoVLG6vuuhIl7/F6eaFy7j8d/eu/NHkUMP9N9glp/CYLfh+ZlFdQ== X-Received: by 2002:a17:902:ff03:b029:da:6fca:7422 with SMTP id f3-20020a170902ff03b02900da6fca7422mr5153919plj.13.1607110544242; Fri, 04 Dec 2020 11:35:44 -0800 (PST) Received: from smtp.gmail.com ([2620:15c:202:201:3e52:82ff:fe6c:83ab]) by smtp.gmail.com with ESMTPSA id g8sm4576548pgn.47.2020.12.04.11.35.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2020 11:35:43 -0800 (PST) From: Stephen Boyd To: Mark Brown Cc: linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, Benson Leung , linux-arm-msm@vger.kernel.org, Enric Balletbo i Serra , Simon Glass , Gwendal Grignou , Douglas Anderson , Alexandru M Stan Subject: [PATCH 1/3] platform/chrome: cros_ec_spi: Don't overwrite spi::mode Date: Fri, 4 Dec 2020 11:35:38 -0800 Message-Id: <20201204193540.3047030-2-swboyd@chromium.org> X-Mailer: git-send-email 2.29.2.576.ga3fc446d84-goog In-Reply-To: <20201204193540.3047030-1-swboyd@chromium.org> References: <20201204193540.3047030-1-swboyd@chromium.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org 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 Reviewed-by: Douglas Anderson Tested-by: Douglas Anderson Acked-by: Enric Balletbo i Serra Cc: Alexandru M Stan Signed-off-by: Stephen Boyd Reviewed-by: Simon Glass --- 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) From patchwork Fri Dec 4 19:35:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 11952217 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=-20.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 3CB78C433FE for ; Fri, 4 Dec 2020 19:37:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EEDD522C9C for ; Fri, 4 Dec 2020 19:37:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730670AbgLDThF (ORCPT ); Fri, 4 Dec 2020 14:37:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727913AbgLDThF (ORCPT ); Fri, 4 Dec 2020 14:37:05 -0500 Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECAB5C08E85E for ; Fri, 4 Dec 2020 11:35:45 -0800 (PST) Received: by mail-pl1-x641.google.com with SMTP id p6so3689942plo.6 for ; Fri, 04 Dec 2020 11:35:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OLsx5vVuUCPRsEhZl6FaNYVhvrSnAx3P4TPwOM+YKjI=; b=EIj5KpgF9tseDgO+Vv6rRaCFuZLSRi9JZbJm4JZSurBPJ+8A2N9qHkTQ9q2eNsk8uo i2fm+pGhYslCHJoEqkv2Km4XZFq095EU+0QlmnLYOi5CDRXxecQ1WeHnFDX/Mb5MR2hS abrArIEdHM3VcxdsG8L3q/i8V8HFEGxMHWZO4= 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=OLsx5vVuUCPRsEhZl6FaNYVhvrSnAx3P4TPwOM+YKjI=; b=KUeKbdXOt/FJRbulN17oY+LCTLDsnDxxROpiUCY9MLmevqj2vQG32E2SlUbF0LbdYh sCJKwLeH3EUS99Xcgk/TrjVL+8FymxyNEv7TcDihY6SSAHgVwlJ37y8UuyMAcX6V3xpY i9EBIz+o7ur5JU8epVh2YKC4jNX0PPts+VkNldyLJ/ixAEHubBiGXhMicNr93wHTQHqS Kw79C/S9z7qn0UJZ5PpYTzYkpufJAnUvBQjKItxsW9rgKzMYZWUB6YvfpGcShG/Sdota GH76tSMuveWvd5Kkm5XPd400Q6GePxvYotLoJCXfEpRA5eiLQUlXpQhYiQnrHjF75uXT aN7A== X-Gm-Message-State: AOAM533o0sPJoz3CcnWv60NY1hpkJhVptXqnpKco6kguO9npIz3O3M1A zbrSUgmeoBqXonle1sa8C8elZA== X-Google-Smtp-Source: ABdhPJyLxHobwqXis3U8gHN9sAqxP1e9stcIpd/P4vWXMjWVB05VxeGgscZGw83QTCfowLd+/lvpAQ== X-Received: by 2002:a17:90b:2285:: with SMTP id kx5mr5596316pjb.104.1607110545594; Fri, 04 Dec 2020 11:35:45 -0800 (PST) Received: from smtp.gmail.com ([2620:15c:202:201:3e52:82ff:fe6c:83ab]) by smtp.gmail.com with ESMTPSA id g8sm4576548pgn.47.2020.12.04.11.35.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2020 11:35:45 -0800 (PST) From: Stephen Boyd To: Mark Brown Cc: linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, Benson Leung , linux-arm-msm@vger.kernel.org, Enric Balletbo i Serra , Simon Glass , Gwendal Grignou , Douglas Anderson , Alexandru M Stan Subject: [PATCH 2/3] platform/chrome: cros_ec_spi: Drop bits_per_word assignment Date: Fri, 4 Dec 2020 11:35:39 -0800 Message-Id: <20201204193540.3047030-3-swboyd@chromium.org> X-Mailer: git-send-email 2.29.2.576.ga3fc446d84-goog In-Reply-To: <20201204193540.3047030-1-swboyd@chromium.org> References: <20201204193540.3047030-1-swboyd@chromium.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org This is already handed by default in spi_setup() if the bits_per_word is 0, so just drop it to shave off a line. Cc: Simon Glass Cc: Gwendal Grignou Reviewed-by: Douglas Anderson Tested-by: Douglas Anderson Acked-by: Enric Balletbo i Serra Cc: Alexandru M Stan Signed-off-by: Stephen Boyd Reviewed-by: Simon Glass --- 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 f9df218fc2bb..14c4046fa04d 100644 --- a/drivers/platform/chrome/cros_ec_spi.c +++ b/drivers/platform/chrome/cros_ec_spi.c @@ -741,7 +741,6 @@ static int cros_ec_spi_probe(struct spi_device *spi) struct cros_ec_spi *ec_spi; int err; - spi->bits_per_word = 8; spi->rt = true; err = spi_setup(spi); if (err < 0) From patchwork Fri Dec 4 19:35:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 11952219 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=-20.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 7F758C4361B for ; Fri, 4 Dec 2020 19:37:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3E08422CA2 for ; Fri, 4 Dec 2020 19:37:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730713AbgLDThJ (ORCPT ); Fri, 4 Dec 2020 14:37:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727913AbgLDThJ (ORCPT ); Fri, 4 Dec 2020 14:37:09 -0500 Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 652F4C08E860 for ; Fri, 4 Dec 2020 11:35:47 -0800 (PST) Received: by mail-pl1-x644.google.com with SMTP id j1so3703063pld.3 for ; Fri, 04 Dec 2020 11:35:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=z02bYpW+7Mv3ChAgiAsPawwOKuNxCdLfLFsK6QR3N2g=; b=Vs++OpkolBidQ0q+Ilza0Lha2VWjdSfRUa0ZzyaK0DdwopqPCGjYsRuljefTYyN41n SMbziRk4cUbUTZSxJGFsasYy+OuGga4sEI/YuO+UYsdrtDxNFg3bzdS01K0AMf1PNPgy XqWplByD5XICWPph7gUl2ablIZ35/fL5KvA5g= 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=z02bYpW+7Mv3ChAgiAsPawwOKuNxCdLfLFsK6QR3N2g=; b=Zm588qxoAspsgUD7kRANJQVHPz1ZR0EJg0SXw6UXEj94NQCGpxpiM4Mb4LrNwGdX/B 20Rv/EL64CVcnDm9+8Jcq9O8Wp0KMUzf/04ycIeXyLB0vQG0r76p64XpogXafjbqNtxk 9gbB/EMtlRo9CpfXMh6iXQPxrnj/EMOT2WHtyukP0o/EPeJz5BnUvFEztoI9xaZzLliH Z9poMvrYaobPQu0r0l4JhRpL53ipuJv9s9Z7ncJ5ITkNHhGPw8b2W9xzNcnzwFUVzfKS ViCK9MZxzvTtTDm4spIxaPZH4mKLhiNq/Y7MST6n7gGFMYlq5qSuirJlbAJatdo4YmBy KCtw== X-Gm-Message-State: AOAM530EDjMf/17AjEaPURgZVdS3M3crhLRuOjXhHEVYCleNs79lIbGE O6dIyIjAGrVzCzkwLTTUSH33kA== X-Google-Smtp-Source: ABdhPJyziCeNS5BAMuYMAdrbPbkMe9VU91eJnl2PsGv9X03ZA9VevMGtTFXoltaP7nkzPeYtn8UPzw== X-Received: by 2002:a17:902:aa4b:b029:d8:f87e:1f3c with SMTP id c11-20020a170902aa4bb02900d8f87e1f3cmr5331771plr.23.1607110546995; Fri, 04 Dec 2020 11:35:46 -0800 (PST) Received: from smtp.gmail.com ([2620:15c:202:201:3e52:82ff:fe6c:83ab]) by smtp.gmail.com with ESMTPSA id g8sm4576548pgn.47.2020.12.04.11.35.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2020 11:35:46 -0800 (PST) From: Stephen Boyd To: Mark Brown Cc: linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, Benson Leung , linux-arm-msm@vger.kernel.org, Enric Balletbo i Serra , Akash Asthana , Bjorn Andersson , Douglas Anderson , Alexandru M Stan Subject: [PATCH 3/3] spi: spi-geni-qcom: Use the new method of gpio CS control Date: Fri, 4 Dec 2020 11:35:40 -0800 Message-Id: <20201204193540.3047030-4-swboyd@chromium.org> X-Mailer: git-send-email 2.29.2.576.ga3fc446d84-goog In-Reply-To: <20201204193540.3047030-1-swboyd@chromium.org> References: <20201204193540.3047030-1-swboyd@chromium.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Let's set the 'use_gpio_descriptors' field so that we use the new way of requesting the CS GPIOs in the core. This allows us to avoid having to configure the CS pins in "output" mode with an 'output-enable' pinctrl setting. Cc: Akash Asthana Cc: Bjorn Andersson Reviewed-by: Douglas Anderson Cc: Alexandru M Stan Signed-off-by: Stephen Boyd --- drivers/spi/spi-geni-qcom.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/spi/spi-geni-qcom.c b/drivers/spi/spi-geni-qcom.c index 25810a7eef10..c4c88984abc9 100644 --- a/drivers/spi/spi-geni-qcom.c +++ b/drivers/spi/spi-geni-qcom.c @@ -636,6 +636,7 @@ static int spi_geni_probe(struct platform_device *pdev) spi->auto_runtime_pm = true; spi->handle_err = handle_fifo_timeout; spi->set_cs = spi_geni_set_cs; + spi->use_gpio_descriptors = true; init_completion(&mas->cs_done); init_completion(&mas->cancel_done);