From: Marek Vasut <marex@denx.de>
To: linux-i2c@vger.kernel.org
Cc: Marek Vasut <marex@denx.de>, Peter Rosin <peda@axentia.se>,
Wolfram Sang <wsa@kernel.org>
Subject: [PATCH 2/2] i2c: mux: pca954x: Resume the mux early
Date: Thu, 31 Aug 2023 20:17:53 +0200 [thread overview]
Message-ID: <20230831181753.154787-2-marex@denx.de> (raw)
In-Reply-To: <20230831181753.154787-1-marex@denx.de>
The mux resumes alongside its subdevices, which means the subdevices may
resume while the mux is not yet fully configured and those subdevices may
fail to access I2C registers through the mux. Use resume_early to resume
the mux before any of the other i2c devices.
Signed-off-by: Marek Vasut <marex@denx.de>
---
NOTE: This might be wrong approach
---
Cc: Peter Rosin <peda@axentia.se>
Cc: Wolfram Sang <wsa@kernel.org>
Cc: linux-i2c@vger.kernel.org
---
drivers/i2c/muxes/i2c-mux-pca954x.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/i2c/muxes/i2c-mux-pca954x.c b/drivers/i2c/muxes/i2c-mux-pca954x.c
index 97cf475dde0f4..87fd8d3ba56b2 100644
--- a/drivers/i2c/muxes/i2c-mux-pca954x.c
+++ b/drivers/i2c/muxes/i2c-mux-pca954x.c
@@ -627,12 +627,14 @@ static int pca954x_resume(struct device *dev)
return ret;
}
-static DEFINE_SIMPLE_DEV_PM_OPS(pca954x_pm, NULL, pca954x_resume);
+static const struct dev_pm_ops pca954x_pm = {
+ .resume_early = pca954x_resume,
+};
static struct i2c_driver pca954x_driver = {
.driver = {
.name = "pca954x",
- .pm = pm_sleep_ptr(&pca954x_pm),
+ .pm = &pca954x_pm,
.of_match_table = pca954x_of_match,
},
.probe = pca954x_probe,
--
2.40.1
next prev parent reply other threads:[~2023-08-31 18:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-31 18:17 [PATCH 1/2] i2c: mux: pca954x: Make sure the mux remains configured the same as before resume Marek Vasut
2023-08-31 18:17 ` Marek Vasut [this message]
2023-08-31 21:24 ` Peter Rosin
2023-08-31 21:50 ` Marek Vasut
2023-09-01 8:07 ` Peter Rosin
2023-09-01 17:36 ` Marek Vasut
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=20230831181753.154787-2-marex@denx.de \
--to=marex@denx.de \
--cc=linux-i2c@vger.kernel.org \
--cc=peda@axentia.se \
--cc=wsa@kernel.org \
/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