Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4353916pxj; Tue, 25 May 2021 06:14:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9CFC62HNDsfyMsJhALtnahpstkMFr089e13/afE54WpNerp05TBl+jYhuB8mT2D5jbGlJ X-Received: by 2002:a02:c98a:: with SMTP id b10mr32174251jap.103.1621948440975; Tue, 25 May 2021 06:14:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621948440; cv=none; d=google.com; s=arc-20160816; b=nzivM6BEVAYtT0HwmjRKGevtEX5/q0jlHeIxE1nh43khiXFYN8zOpfz5RSJJfpdpZM gNAruwiRJZD7NVbWAiIaqJt8a9qKB8eg1bMuMYaJA7OJk6zB4WDrCVXnPTIjouVnQsm/ 46v5rgREtDpUwDZTSgo6y6/zMcEArSwqCWVJlUgExujtGgtsmFNRK1aWIRfHBJ3AncoA 9OHnfnPgEmGUb3SbOC0LrBGqgwk3elusPlfCU20cSo5azq01sW/0RbKPrCvteUfhglDp imIGvEYzQaw9TrhAs3EcOrK8Uatx6rS/s4cII3RTKhDQd+mMC+wK8s/8oBfYR5WEOFmh htHg== 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; bh=BAQVNZR67Mzgd/Anrtuw8CuSEgWJEc2mGgs6aj4hRPo=; b=cBzTVOtX4ptQClTOD/NGkqZ34ZlQPzHZxdmRh0kssNmx+fxOIm9C7pNjNifAYOt8fn JtJPRwZMXamFK+hYZDlc+juS1dAK84u+uy5RLXhYUDgfaV271AISD+sb69t9oKH012Dm y2F4cjH2/G81LGU3QmgtpGzv8nty/whvZ/fsD/Hp8bjWOmhje1qOxDTk9ZQFFMrw5e9F TKpbea7t3Z4z7ATtzGvBApoG+94v87vnJOwBnxOcYWi3Pvl0nqHajyVAXueuAc2N7qoj OEojy3rwv3+iaS6lp2D25hmrm8odQpowhVISDiQQBXxaeNqYEaukKZU5F+UJDGK1zoPX yUzQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e1si18286513jap.46.2021.05.25.06.13.47; Tue, 25 May 2021 06:14:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233128AbhEYNNy (ORCPT + 99 others); Tue, 25 May 2021 09:13:54 -0400 Received: from alexa-out.qualcomm.com ([129.46.98.28]:25080 "EHLO alexa-out.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233057AbhEYNN0 (ORCPT ); Tue, 25 May 2021 09:13:26 -0400 Received: from ironmsg-lv-alpha.qualcomm.com ([10.47.202.13]) by alexa-out.qualcomm.com with ESMTP; 25 May 2021 06:11:41 -0700 X-QCInternal: smtphost Received: from ironmsg01-blr.qualcomm.com ([10.86.208.130]) by ironmsg-lv-alpha.qualcomm.com with ESMTP/TLS/AES256-SHA; 25 May 2021 06:11:39 -0700 X-QCInternal: smtphost Received: from c-rojay-linux.qualcomm.com ([10.206.21.80]) by ironmsg01-blr.qualcomm.com with ESMTP; 25 May 2021 18:40:58 +0530 Received: by c-rojay-linux.qualcomm.com (Postfix, from userid 88981) id 262F6334E; Tue, 25 May 2021 18:40:57 +0530 (IST) From: Roja Rani Yarubandi To: wsa@kernel.org Cc: swboyd@chromium.org, dianders@chromium.org, saiprakash.ranjan@codeaurora.org, gregkh@linuxfoundation.org, mka@chromium.org, skananth@codeaurora.org, msavaliy@qti.qualcomm.com, skakit@codeaurora.org, rnayak@codeaurora.org, agross@kernel.org, bjorn.andersson@linaro.org, linux-arm-msm@vger.kernel.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, sumit.semwal@linaro.org, linux-media@vger.kernel.org, Roja Rani Yarubandi Subject: [PATCH V11 2/2] i2c: i2c-qcom-geni: Suspend and resume the bus during SYSTEM_SLEEP_PM ops Date: Tue, 25 May 2021 18:40:51 +0530 Message-Id: <20210525131051.31250-3-rojay@codeaurora.org> X-Mailer: git-send-email 2.29.0 In-Reply-To: <20210525131051.31250-1-rojay@codeaurora.org> References: <20210525131051.31250-1-rojay@codeaurora.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Mark bus as suspended during system suspend to block the future transfers. Implement geni_i2c_resume_noirq() to resume the bus. Fixes: 37692de5d523 ("i2c: i2c-qcom-geni: Add bus driver for the Qualcomm GENI I2C controller") Signed-off-by: Roja Rani Yarubandi --- Changes in V11: - This is newly added patch in this V11 series. drivers/i2c/busses/i2c-qcom-geni.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c index c3ae66ba6345..671f4a52275e 100644 --- a/drivers/i2c/busses/i2c-qcom-geni.c +++ b/drivers/i2c/busses/i2c-qcom-geni.c @@ -698,6 +698,8 @@ static int __maybe_unused geni_i2c_suspend_noirq(struct device *dev) { struct geni_i2c_dev *gi2c = dev_get_drvdata(dev); + i2c_mark_adapter_suspended(&gi2c->adap); + if (!gi2c->suspended) { geni_i2c_runtime_suspend(dev); pm_runtime_disable(dev); @@ -707,8 +709,16 @@ static int __maybe_unused geni_i2c_suspend_noirq(struct device *dev) return 0; } +static int __maybe_unused geni_i2c_resume_noirq(struct device *dev) +{ + struct geni_i2c_dev *gi2c = dev_get_drvdata(dev); + + i2c_mark_adapter_resumed(&gi2c->adap); + return 0; +} + static const struct dev_pm_ops geni_i2c_pm_ops = { - SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(geni_i2c_suspend_noirq, NULL) + SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(geni_i2c_suspend_noirq, geni_i2c_resume_noirq) SET_RUNTIME_PM_OPS(geni_i2c_runtime_suspend, geni_i2c_runtime_resume, NULL) }; -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation