21,595
社区成员
发帖
与我相关
我的任务
分享
#ifdef CONFIG_PM
static int tca8418_keypad_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);;
disable_irq(client->irq);
dev_err(dev, "tca8418_keypad_suspend()\n");
return 0;
}
static int tca8418_keypad_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
dev_err(dev, "tca8418_keypad_resume()\n");
enable_irq(client->irq);
return 0;
}
static const struct dev_pm_ops tca8418_dev_pm_ops = {
.suspend = tca8418_keypad_suspend,
.resume = tca8418_keypad_resume,
};
#endif
static struct i2c_driver tca8418_keypad_driver = {
.driver = {
.name = TCA8418_NAME,
.owner = THIS_MODULE,
#ifdef CONFIG_PM
.pm = &tca8418_dev_pm_ops,
#endif
.of_match_table = of_match_ptr(tca8418_dt_ids),
},
.probe = tca8418_keypad_probe,
.id_table = tca8418_id,,
};