tmp006.c (7cf15f4275f5b478035c1422a15fe049829cc34c) | tmp006.c (12a875055c15279c4f2db14cb0b593d81d16fc0b) |
---|---|
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 * 9 * (7-bit I2C slave address 0x40, changeable via ADR pins) 10 * 11 * TODO: data ready irq 12 */ 13 14#include <linux/err.h> 15#include <linux/i2c.h> 16#include <linux/delay.h> 17#include <linux/module.h> | 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 * 9 * (7-bit I2C slave address 0x40, changeable via ADR pins) 10 * 11 * TODO: data ready irq 12 */ 13 14#include <linux/err.h> 15#include <linux/i2c.h> 16#include <linux/delay.h> 17#include <linux/module.h> |
18#include <linux/mod_devicetable.h> |
|
18#include <linux/pm.h> 19#include <linux/bitops.h> 20 21#include <linux/iio/iio.h> 22#include <linux/iio/sysfs.h> 23 24#define TMP006_VOBJECT 0x00 25#define TMP006_TAMBIENT 0x01 --- 241 unchanged lines hidden (view full) --- 267 268static int tmp006_resume(struct device *dev) 269{ 270 return tmp006_power(dev, true); 271} 272 273static DEFINE_SIMPLE_DEV_PM_OPS(tmp006_pm_ops, tmp006_suspend, tmp006_resume); 274 | 19#include <linux/pm.h> 20#include <linux/bitops.h> 21 22#include <linux/iio/iio.h> 23#include <linux/iio/sysfs.h> 24 25#define TMP006_VOBJECT 0x00 26#define TMP006_TAMBIENT 0x01 --- 241 unchanged lines hidden (view full) --- 268 269static int tmp006_resume(struct device *dev) 270{ 271 return tmp006_power(dev, true); 272} 273 274static DEFINE_SIMPLE_DEV_PM_OPS(tmp006_pm_ops, tmp006_suspend, tmp006_resume); 275 |
276static const struct of_device_id tmp006_of_match[] = { 277 { .compatible = "ti,tmp006" }, 278 { } 279}; 280MODULE_DEVICE_TABLE(of, tmp006_of_match); 281 |
|
275static const struct i2c_device_id tmp006_id[] = { 276 { "tmp006", 0 }, 277 { } 278}; 279MODULE_DEVICE_TABLE(i2c, tmp006_id); 280 281static struct i2c_driver tmp006_driver = { 282 .driver = { 283 .name = "tmp006", | 282static const struct i2c_device_id tmp006_id[] = { 283 { "tmp006", 0 }, 284 { } 285}; 286MODULE_DEVICE_TABLE(i2c, tmp006_id); 287 288static struct i2c_driver tmp006_driver = { 289 .driver = { 290 .name = "tmp006", |
291 .of_match_table = tmp006_of_match, |
|
284 .pm = pm_sleep_ptr(&tmp006_pm_ops), 285 }, 286 .probe = tmp006_probe, 287 .id_table = tmp006_id, 288}; 289module_i2c_driver(tmp006_driver); 290 291MODULE_AUTHOR("Peter Meerwald <pmeerw@pmeerw.net>"); 292MODULE_DESCRIPTION("TI TMP006 IR thermopile sensor driver"); 293MODULE_LICENSE("GPL"); | 292 .pm = pm_sleep_ptr(&tmp006_pm_ops), 293 }, 294 .probe = tmp006_probe, 295 .id_table = tmp006_id, 296}; 297module_i2c_driver(tmp006_driver); 298 299MODULE_AUTHOR("Peter Meerwald <pmeerw@pmeerw.net>"); 300MODULE_DESCRIPTION("TI TMP006 IR thermopile sensor driver"); 301MODULE_LICENSE("GPL"); |