pinctrl: sx150x: Enable device links to consumers

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

Commit Message

Linus Walleij May 23, 2019, 7:51 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 SX150X consumers are suspended before the
SX150X is suspended.

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

Cc: Peter Rosin <>
Cc: Neil Armstrong <>
Cc: Andrey Smirnov <>
Cc: Benjamin Gaignard <>
Signed-off-by: Linus Walleij <>

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



diff --git a/drivers/pinctrl/pinctrl-sx150x.c b/drivers/pinctrl/pinctrl-sx150x.c
index 4d87d75b9c6e..8b954f74a63a 100644
--- a/drivers/pinctrl/pinctrl-sx150x.c
+++ b/drivers/pinctrl/pinctrl-sx150x.c
@@ -1151,6 +1151,7 @@  static int sx150x_probe(struct i2c_client *client,
 	pctl->pinctrl_desc.pins = pctl->data->pins;
 	pctl->pinctrl_desc.npins = pctl->data->npins;
 	pctl->pinctrl_desc.owner = THIS_MODULE;
+	pctl->pinctrl_desc.link_consumers = true;
 	ret = devm_pinctrl_register_and_init(dev, &pctl->pinctrl_desc,
 					     pctl, &pctl->pctldev);