From: Manikanta Guntupalli <manikanta.guntupalli@amd.com>
To: <git@amd.com>, <michal.simek@amd.com>, <andi.shyti@kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-i2c@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: <radhey.shyam.pandey@amd.com>, <srinivas.goud@amd.com>,
<shubhrajyoti.datta@amd.com>, <manion05gk@gmail.com>,
Manikanta Guntupalli <manikanta.guntupalli@amd.com>
Subject: [PATCH 1/2] i2c: xiic: Relocate xiic_i2c_runtime_suspend and xiic_i2c_runtime_resume to facilitate atomic mode
Date: Fri, 11 Oct 2024 16:11:30 +0530 [thread overview]
Message-ID: <20241011104131.733736-2-manikanta.guntupalli@amd.com> (raw)
In-Reply-To: <20241011104131.733736-1-manikanta.guntupalli@amd.com>
Relocate xiic_i2c_runtime_suspend and xiic_i2c_runtime_resume functions
to avoid prototype statements in atomic mode changes.
Signed-off-by: Manikanta Guntupalli <manikanta.guntupalli@amd.com>
---
drivers/i2c/busses/i2c-xiic.c | 46 +++++++++++++++++------------------
1 file changed, 23 insertions(+), 23 deletions(-)
diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
index 4c89aad02451..052bae4fc664 100644
--- a/drivers/i2c/busses/i2c-xiic.c
+++ b/drivers/i2c/busses/i2c-xiic.c
@@ -238,6 +238,29 @@ static const struct timing_regs timing_reg_values[] = {
static int xiic_start_xfer(struct xiic_i2c *i2c, struct i2c_msg *msgs, int num);
static void __xiic_start_xfer(struct xiic_i2c *i2c);
+static int __maybe_unused xiic_i2c_runtime_suspend(struct device *dev)
+{
+ struct xiic_i2c *i2c = dev_get_drvdata(dev);
+
+ clk_disable(i2c->clk);
+
+ return 0;
+}
+
+static int __maybe_unused xiic_i2c_runtime_resume(struct device *dev)
+{
+ struct xiic_i2c *i2c = dev_get_drvdata(dev);
+ int ret;
+
+ ret = clk_enable(i2c->clk);
+ if (ret) {
+ dev_err(dev, "Cannot enable clock.\n");
+ return ret;
+ }
+
+ return 0;
+}
+
/*
* For the register read and write functions, a little-endian and big-endian
* version are necessary. Endianness is detected during the probe function.
@@ -1365,29 +1388,6 @@ static void xiic_i2c_remove(struct platform_device *pdev)
pm_runtime_dont_use_autosuspend(&pdev->dev);
}
-static int __maybe_unused xiic_i2c_runtime_suspend(struct device *dev)
-{
- struct xiic_i2c *i2c = dev_get_drvdata(dev);
-
- clk_disable(i2c->clk);
-
- return 0;
-}
-
-static int __maybe_unused xiic_i2c_runtime_resume(struct device *dev)
-{
- struct xiic_i2c *i2c = dev_get_drvdata(dev);
- int ret;
-
- ret = clk_enable(i2c->clk);
- if (ret) {
- dev_err(dev, "Cannot enable clock.\n");
- return ret;
- }
-
- return 0;
-}
-
static const struct dev_pm_ops xiic_dev_pm_ops = {
SET_RUNTIME_PM_OPS(xiic_i2c_runtime_suspend,
xiic_i2c_runtime_resume, NULL)
--
2.34.1
next prev parent reply other threads:[~2024-10-11 10:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-11 10:41 [PATCH 0/2] Add atomic transfer support to i2c-xiic Manikanta Guntupalli
2024-10-11 10:41 ` Manikanta Guntupalli [this message]
2024-10-11 10:41 ` [PATCH 2/2] i2c: xiic: Add atomic transfer support Manikanta Guntupalli
2024-11-22 21:29 ` Kees Bakker
2024-11-24 15:03 ` Wolfram Sang
2024-11-25 19:22 ` Andi Shyti
2024-11-14 9:54 ` [PATCH 0/2] Add atomic transfer support to i2c-xiic Michal Simek
2024-11-19 23:05 ` Andi Shyti
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241011104131.733736-2-manikanta.guntupalli@amd.com \
--to=manikanta.guntupalli@amd.com \
--cc=andi.shyti@kernel.org \
--cc=git@amd.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=manion05gk@gmail.com \
--cc=michal.simek@amd.com \
--cc=radhey.shyam.pandey@amd.com \
--cc=shubhrajyoti.datta@amd.com \
--cc=srinivas.goud@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox