+#ifdef CONFIG_PM
+static int s5m87xx_suspend(struct device *dev)
+{
+ struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
+ struct s5m87xx_dev *s5m87xx = i2c_get_clientdata(i2c);
+
+ if (device_may_wakeup(dev))
+ enable_irq_wake(s5m87xx->irq);
+
+ return 0;
+}
+
+static int s5m87xx_resume(struct device *dev)
+{
+ struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
+ struct s5m87xx_dev *s5m87xx = i2c_get_clientdata(i2c);
+
+ if (device_may_wakeup(dev))
+ disable_irq_wake(s5m87xx->irq);
+
+ s5m_irq_resume(s5m87xx);
+ return 0;
+}
+
+const struct dev_pm_ops s5m87xx_pm = {
+ .suspend = s5m87xx_suspend,
+ .resume = s5m87xx_resume,
+};
+#endif
+