From patchwork Thu Mar 23 17:30:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 74142 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp3046008wrt; Thu, 23 Mar 2023 10:38:22 -0700 (PDT) X-Google-Smtp-Source: AK7set/5jy0ARkjmcJyhf3FU4cbN8rxLaqM6vhmskECzPPTrvLuzDo9CCVnIt9PozQc8agkyG9jB X-Received: by 2002:a17:90b:3b4b:b0:23a:ad68:25a7 with SMTP id ot11-20020a17090b3b4b00b0023aad6825a7mr8299519pjb.2.1679593102509; Thu, 23 Mar 2023 10:38:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679593102; cv=none; d=google.com; s=arc-20160816; b=TzCDMpq5/UhlzUfm05XgQKpqqJKRpQZUJijnL2J/7arCJVOceom8zNijO+KSVPwp8a JeCY/Ti0xpRA2bjkiEdytR06n/m8dc4qgx1reP6nqEXqahQHXGj93bM2/BJENGK020BU x6d/QHXKpnoWA4suUSIzfxB180EFFMc+c2mN7btGIqpWTm5ZakF3F2KWIi11a7lucPCd USnwwTSWosAaaf2W3otgi0I8p80UukGO2lXri35sv43L6M0IXXWh5BPddv1x/2tDYqmA Fw3g13LEQoefO2rAxqtH1cztjZ3JH6/HjVQilJZN9DJNGLNzM8PjXTJLzlTTn+gF0Lsw DRGQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=axzKHWKEv5YVhGt7OnDPPiY6mPvXZ76IZmLOehTivRM=; b=DqqxYJCiVpynX6LeFhUE0UukpG+IC0+RXlu+YpzlBZl7GrqgAq54nDDb+VAxASezw0 HRIC64GLPUSy8Q6hAldydQZh12HE8Xy+2jeyxTpCug/xCzDsIExwPE3Z64Mbxnilzff6 5w6xusym5GmIDByQJNmr0G9x5ko9PKp5NHKiMQGQuoP+7oi3/VEJtsjaeQo1N0oCHUCM Gi6OyGqW+6WvIMmwkoqKKynFwZe8bTHHdDhWRXhf0posyhV/5TOz1uH2f4DoSOA4VZlj kG+FzL/4SfuDhkG9iMnYlTAAfsNBprp2RHkoyg6N6xl4jqc4js6cXwyUXbqTgi40Yo8Q N/AQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Hr6ofu6o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n4-20020a17090a670400b002296a8ff568si2189765pjj.152.2023.03.23.10.38.06; Thu, 23 Mar 2023 10:38:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Hr6ofu6o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232430AbjCWRbi (ORCPT + 99 others); Thu, 23 Mar 2023 13:31:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232279AbjCWRbY (ORCPT ); Thu, 23 Mar 2023 13:31:24 -0400 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40DBB2B610 for ; Thu, 23 Mar 2023 10:31:20 -0700 (PDT) Received: by mail-pj1-x1036.google.com with SMTP id j13so22123384pjd.1 for ; Thu, 23 Mar 2023 10:31:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1679592680; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=axzKHWKEv5YVhGt7OnDPPiY6mPvXZ76IZmLOehTivRM=; b=Hr6ofu6oqBQij15HDorCxP6qJd/DFWqt6l/Ey7WIKytvKq0Hg1t6qCmeE664vXR+Z9 N59aPdWEExquxwyH812aZNz20iZjJTt5Bk3jJvB2U7kgSZVLQutKqiBNL36uDXjSqWfU jL5NAUAv3Uxd6DivSrdFnrub1l7TcPWrtBjyk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679592680; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=axzKHWKEv5YVhGt7OnDPPiY6mPvXZ76IZmLOehTivRM=; b=Fapam9n1hU33HLmaQal6BVKoYe0exM/msG5KjY20NfWEssm1/Ujzqd/M5zbdXjf2+r FBBAXJEqD5lrE7SE9uQefBUKlPc9fPVLPLrp4I+L1fsZ62XIgd0qgb0TD86jN+jNLsW3 he9lT2RYZJDb4Fs5o5cEcmmxtxvxEYpeSzNc+g5aMBEIy+AdN75e28NXtET0XGmXH0r8 9aT8EG6E8tHNclT2Lj2rKhs7z2UcxN47x0OOtiqY8dANMmBh5jyLKZqwGoYtddsdQATq 2kjk/QG8BCHUbu1X5P/pBMGkBgnOLnoE9TLhX0STn/8NqabTgLQT0KB+FWH1aHq6AAQu DKMw== X-Gm-Message-State: AO0yUKVV4zzYtQx9/Vr4jz+ztN/wmHwcNJyo472pjLciZn4mvxHp5p/2 YEv/x/Supgz0wRUy9cDY7K6zmQ== X-Received: by 2002:a05:6a20:8b14:b0:d9:840f:79c2 with SMTP id l20-20020a056a208b1400b000d9840f79c2mr464959pzh.2.1679592679750; Thu, 23 Mar 2023 10:31:19 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:9d:2:16d3:ef20:206a:6521]) by smtp.gmail.com with ESMTPSA id x13-20020a62fb0d000000b0061a6f4c1b2bsm12613546pfm.171.2023.03.23.10.31.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Mar 2023 10:31:18 -0700 (PDT) From: Douglas Anderson To: Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , Mark Brown , Linus Walleij Cc: Matthias Kaehlcke , Konrad Dybcio , linux-gpio@vger.kernel.org, Stephen Boyd , devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-spi@vger.kernel.org, Douglas Anderson , Andy Gross , linux-kernel@vger.kernel.org Subject: [PATCH 05/14] spi: spi-qcom-qspi: Support pinctrl sleep states Date: Thu, 23 Mar 2023 10:30:09 -0700 Message-Id: <20230323102605.5.I79544b9486033bd7b27f2be55adda6d36f62a366@changeid> X-Mailer: git-send-email 2.40.0.348.gf938b09366-goog In-Reply-To: <20230323173019.3706069-1-dianders@chromium.org> References: <20230323173019.3706069-1-dianders@chromium.org> MIME-Version: 1.0 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761181017109450613?= X-GMAIL-MSGID: =?utf-8?q?1761181017109450613?= It's fairly common practice for drivers to switch to a "sleep" pinctrl state at the end of its runtime_suspend function and then back to "default" at the beginning of runtime_resume. Let's do that for spi-qcom-qspi. Signed-off-by: Douglas Anderson --- drivers/spi/spi-qcom-qspi.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/spi/spi-qcom-qspi.c b/drivers/spi/spi-qcom-qspi.c index c334dfec4117..7851cf1986cc 100644 --- a/drivers/spi/spi-qcom-qspi.c +++ b/drivers/spi/spi-qcom-qspi.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -581,6 +582,8 @@ static int __maybe_unused qcom_qspi_runtime_suspend(struct device *dev) return ret; } + pinctrl_pm_select_sleep_state(dev); + return 0; } @@ -590,6 +593,8 @@ static int __maybe_unused qcom_qspi_runtime_resume(struct device *dev) struct qcom_qspi *ctrl = spi_master_get_devdata(master); int ret; + pinctrl_pm_select_default_state(dev); + ret = icc_enable(ctrl->icc_path_cpu_to_qspi); if (ret) { dev_err_ratelimited(ctrl->dev, "%s: ICC enable failed for cpu: %d\n",