[PATCH 2/2] i2c: mux: pca954x: Resume the mux early

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxx>
---
NOTE: This might be wrong approach
---
Cc: Peter Rosin <peda@xxxxxxxxxx>
Cc: Wolfram Sang <wsa@xxxxxxxxxx>
Cc: linux-i2c@xxxxxxxxxxxxxxx
---
 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




[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux