pinctrl: mcp23s08: Enable device links to consumers

Message ID
State New
Headers show
  • pinctrl: mcp23s08: Enable device links to consumers
Related show

Commit Message

Linus Walleij May 23, 2019, 7:46 a.m.
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 <>
Cc: Lars Poeschel <>
Cc: Jason Kridner <>
Cc: Marco Felsch <>
Cc: Phil Reid <>
Signed-off-by: Linus Walleij <>

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



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)) {