jc42.c (eacc48ce3accfc9092594794b009a40f91331b0e) jc42.c (803deccec2513379ff0873a386d955af6f43d005)
1/*
2 * jc42.c - driver for Jedec JC42.4 compliant temperature sensors
3 *
4 * Copyright (c) 2010 Ericsson AB.
5 *
6 * Derived from lm77.c by Andras BALI <drewie@freemail.hu>.
7 *
8 * JC42.4 compliant temperature sensors are typically used on memory modules.

--- 17 unchanged lines hidden (view full) ---

26#include <linux/init.h>
27#include <linux/slab.h>
28#include <linux/jiffies.h>
29#include <linux/i2c.h>
30#include <linux/hwmon.h>
31#include <linux/hwmon-sysfs.h>
32#include <linux/err.h>
33#include <linux/mutex.h>
1/*
2 * jc42.c - driver for Jedec JC42.4 compliant temperature sensors
3 *
4 * Copyright (c) 2010 Ericsson AB.
5 *
6 * Derived from lm77.c by Andras BALI <drewie@freemail.hu>.
7 *
8 * JC42.4 compliant temperature sensors are typically used on memory modules.

--- 17 unchanged lines hidden (view full) ---

26#include <linux/init.h>
27#include <linux/slab.h>
28#include <linux/jiffies.h>
29#include <linux/i2c.h>
30#include <linux/hwmon.h>
31#include <linux/hwmon-sysfs.h>
32#include <linux/err.h>
33#include <linux/mutex.h>
34#include <linux/of.h>
34
35/* Addresses to scan */
36static const unsigned short normal_i2c[] = {
37 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, I2C_CLIENT_END };
38
39/* JC42 registers. All registers are 16 bit. */
40#define JC42_REG_CAP 0x00
41#define JC42_REG_CONFIG 0x01

--- 494 unchanged lines hidden (view full) ---

536#endif /* CONFIG_PM */
537
538static const struct i2c_device_id jc42_id[] = {
539 { "jc42", 0 },
540 { }
541};
542MODULE_DEVICE_TABLE(i2c, jc42_id);
543
35
36/* Addresses to scan */
37static const unsigned short normal_i2c[] = {
38 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, I2C_CLIENT_END };
39
40/* JC42 registers. All registers are 16 bit. */
41#define JC42_REG_CAP 0x00
42#define JC42_REG_CONFIG 0x01

--- 494 unchanged lines hidden (view full) ---

537#endif /* CONFIG_PM */
538
539static const struct i2c_device_id jc42_id[] = {
540 { "jc42", 0 },
541 { }
542};
543MODULE_DEVICE_TABLE(i2c, jc42_id);
544
545#ifdef CONFIG_OF
546static const struct of_device_id jc42_of_ids[] = {
547 { .compatible = "jedec,jc-42.4-temp", },
548 { }
549};
550MODULE_DEVICE_TABLE(of, jc42_of_ids);
551#endif
552
544static struct i2c_driver jc42_driver = {
545 .class = I2C_CLASS_SPD | I2C_CLASS_HWMON,
546 .driver = {
547 .name = "jc42",
548 .pm = JC42_DEV_PM_OPS,
553static struct i2c_driver jc42_driver = {
554 .class = I2C_CLASS_SPD | I2C_CLASS_HWMON,
555 .driver = {
556 .name = "jc42",
557 .pm = JC42_DEV_PM_OPS,
558 .of_match_table = of_match_ptr(jc42_of_ids),
549 },
550 .probe = jc42_probe,
551 .remove = jc42_remove,
552 .id_table = jc42_id,
553 .detect = jc42_detect,
554 .address_list = normal_i2c,
555};
556
557module_i2c_driver(jc42_driver);
558
559MODULE_AUTHOR("Guenter Roeck <linux@roeck-us.net>");
560MODULE_DESCRIPTION("JC42 driver");
561MODULE_LICENSE("GPL");
559 },
560 .probe = jc42_probe,
561 .remove = jc42_remove,
562 .id_table = jc42_id,
563 .detect = jc42_detect,
564 .address_list = normal_i2c,
565};
566
567module_i2c_driver(jc42_driver);
568
569MODULE_AUTHOR("Guenter Roeck <linux@roeck-us.net>");
570MODULE_DESCRIPTION("JC42 driver");
571MODULE_LICENSE("GPL");