tmp006.c (762f99f4f3cb41a775b5157dd761217beba65873) | tmp006.c (1ef7361fec0bbc7d67939f10986895cd6aec7a80) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * tmp006.c - Support for TI TMP006 IR thermopile sensor 4 * 5 * Copyright (c) 2013 Peter Meerwald <pmeerw@pmeerw.net> 6 * 7 * Driver for the Texas Instruments I2C 16-bit IR thermopile sensor 8 * --- 247 unchanged lines hidden (view full) --- 256 ret = devm_add_action_or_reset(&client->dev, tmp006_powerdown_cleanup, 257 &client->dev); 258 if (ret < 0) 259 return ret; 260 261 return devm_iio_device_register(&client->dev, indio_dev); 262} 263 | 1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * tmp006.c - Support for TI TMP006 IR thermopile sensor 4 * 5 * Copyright (c) 2013 Peter Meerwald <pmeerw@pmeerw.net> 6 * 7 * Driver for the Texas Instruments I2C 16-bit IR thermopile sensor 8 * --- 247 unchanged lines hidden (view full) --- 256 ret = devm_add_action_or_reset(&client->dev, tmp006_powerdown_cleanup, 257 &client->dev); 258 if (ret < 0) 259 return ret; 260 261 return devm_iio_device_register(&client->dev, indio_dev); 262} 263 |
264#ifdef CONFIG_PM_SLEEP | |
265static int tmp006_suspend(struct device *dev) 266{ 267 return tmp006_power(dev, false); 268} 269 270static int tmp006_resume(struct device *dev) 271{ 272 return tmp006_power(dev, true); 273} | 264static int tmp006_suspend(struct device *dev) 265{ 266 return tmp006_power(dev, false); 267} 268 269static int tmp006_resume(struct device *dev) 270{ 271 return tmp006_power(dev, true); 272} |
274#endif | |
275 | 273 |
276static SIMPLE_DEV_PM_OPS(tmp006_pm_ops, tmp006_suspend, tmp006_resume); | 274static DEFINE_SIMPLE_DEV_PM_OPS(tmp006_pm_ops, tmp006_suspend, tmp006_resume); |
277 278static const struct i2c_device_id tmp006_id[] = { 279 { "tmp006", 0 }, 280 { } 281}; 282MODULE_DEVICE_TABLE(i2c, tmp006_id); 283 284static struct i2c_driver tmp006_driver = { 285 .driver = { 286 .name = "tmp006", | 275 276static const struct i2c_device_id tmp006_id[] = { 277 { "tmp006", 0 }, 278 { } 279}; 280MODULE_DEVICE_TABLE(i2c, tmp006_id); 281 282static struct i2c_driver tmp006_driver = { 283 .driver = { 284 .name = "tmp006", |
287 .pm = &tmp006_pm_ops, | 285 .pm = pm_sleep_ptr(&tmp006_pm_ops), |
288 }, 289 .probe = tmp006_probe, 290 .id_table = tmp006_id, 291}; 292module_i2c_driver(tmp006_driver); 293 294MODULE_AUTHOR("Peter Meerwald <pmeerw@pmeerw.net>"); 295MODULE_DESCRIPTION("TI TMP006 IR thermopile sensor driver"); 296MODULE_LICENSE("GPL"); | 286 }, 287 .probe = tmp006_probe, 288 .id_table = tmp006_id, 289}; 290module_i2c_driver(tmp006_driver); 291 292MODULE_AUTHOR("Peter Meerwald <pmeerw@pmeerw.net>"); 293MODULE_DESCRIPTION("TI TMP006 IR thermopile sensor driver"); 294MODULE_LICENSE("GPL"); |