diff mbox series

pinctrl: mcp23s08: Enable device links to consumers

Message ID 20190523074625.15294-1-linus.walleij@linaro.org
State New
Headers show
Series pinctrl: mcp23s08: Enable device links to consumers | expand

Commit Message

Linus Walleij May 23, 2019, 7:46 a.m. UTC
A recent core change makes it possible to create device links
between a pin controller and its consumers. This is necessary
to ascertain the right suspend/resume order for the devices:
if a device is using a certain pin control state and want
to switch that before/after going to suspend, then the pin
controller may not be suspended already, and conversely
on the resume path.

Make sure any MCP23s08 consumers are suspended before the
MCP23s08 is suspended.

The MCP23s08 does not implement suspend/resume callbacks,
but the device links are hierarchical, and this also makes
sure that the I2C master where the MCP23s08 is in turn
connected will not suspend before any clients of the pin
control settings are suspended (and conversely for resume).

Cc: Jan Kundrát <jan.kundrat@cesnet.cz>
Cc: Lars Poeschel <poeschel@lemonage.de>
Cc: Jason Kridner <jkridner@gmail.com>
Cc: Marco Felsch <m.felsch@pengutronix.de>
Cc: Phil Reid <preid@electromag.com.au>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

 drivers/pinctrl/pinctrl-mcp23s08.c | 1 +
 1 file changed, 1 insertion(+)

diff mbox series


diff --git a/drivers/pinctrl/pinctrl-mcp23s08.c b/drivers/pinctrl/pinctrl-mcp23s08.c
index f0cdb5234e49..9025835c0ec4 100644
--- a/drivers/pinctrl/pinctrl-mcp23s08.c
+++ b/drivers/pinctrl/pinctrl-mcp23s08.c
@@ -831,6 +831,7 @@  static int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev,
 	else if (mcp->pinctrl_desc.npins == 16)
 		mcp->pinctrl_desc.pins = mcp23x17_pins;
 	mcp->pinctrl_desc.owner = THIS_MODULE;
+	mcp->pinctrl_desc.link_consumers = true;
 	mcp->pctldev = devm_pinctrl_register(dev, &mcp->pinctrl_desc, mcp);
 	if (IS_ERR(mcp->pctldev)) {