diff --git a/drivers/usb/typec/tcpm/tcpci_husb311.c b/drivers/usb/typec/tcpm/tcpci_husb311.c index 574588e419f5..74f45f581ca6 100644 --- a/drivers/usb/typec/tcpm/tcpci_husb311.c +++ b/drivers/usb/typec/tcpm/tcpci_husb311.c @@ -36,6 +36,7 @@ struct husb311_chip { bool vbus_on; bool charge_on; bool suspended; + bool wakeup; }; static int husb311_read8(struct husb311_chip *chip, unsigned int reg, u8 *val) @@ -295,6 +296,7 @@ static int husb311_probe(struct i2c_client *client, return ret; } + chip->wakeup = device_property_read_bool(chip->dev, "wakeup-source"); device_init_wakeup(chip->dev, true); return 0; @@ -324,7 +326,7 @@ static int husb311_pm_suspend(struct device *dev) struct husb311_chip *chip = dev->driver_data; struct i2c_client *client = to_i2c_client(dev); - if (device_may_wakeup(dev) && !chip->vbus_on) + if (device_may_wakeup(dev) && (!chip->vbus_on || chip->wakeup)) enable_irq_wake(client->irq); else disable_irq(client->irq); @@ -344,7 +346,7 @@ static int husb311_pm_resume(struct device *dev) int ret = 0; u8 filter; - if (device_may_wakeup(dev) && !chip->vbus_on) + if (device_may_wakeup(dev) && (!chip->vbus_on || chip->wakeup)) disable_irq_wake(client->irq); else enable_irq(client->irq);