if (err < 0)
goto err1;
+ device_set_wakeup_capable(tcpci->dev, true);
+
return 0;
err1:
tcpm_unregister_port(tcpci->port);
return 0;
}
+static int tcpci_suspend(struct device *dev)
+{
+ struct tcpci *tcpci = dev_get_drvdata(dev);
+
+ if (device_may_wakeup(dev))
+ enable_irq_wake(tcpci->client->irq);
+
+ return 0;
+}
+
+static int tcpci_resume(struct device *dev)
+{
+ struct tcpci *tcpci = dev_get_drvdata(dev);
+
+ if (device_may_wakeup(dev))
+ disable_irq_wake(tcpci->client->irq);
+
+ return 0;
+}
+
+static const struct dev_pm_ops tcpci_pm_ops = {
+ SET_SYSTEM_SLEEP_PM_OPS(tcpci_suspend, tcpci_resume)
+};
+
static const struct i2c_device_id tcpci_id[] = {
{ "tcpci", 0 },
{ }
static struct i2c_driver tcpci_i2c_driver = {
.driver = {
.name = "tcpci",
+ .pm = &tcpci_pm_ops,
.of_match_table = of_match_ptr(tcpci_of_match),
},
.probe = tcpci_probe,