aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaphael Assenat <raph@8d.com>2012-08-16 12:56:40 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-08-16 15:33:59 -0400
commitf3261dfb5538e2ff0264fde3050dbd4e922fa296 (patch)
treee7c0181d1178efb6d0ec26f4bbd426e510e998f0
parentf3d9d365ff7f36c4e3491ef31788449f419b781b (diff)
1-Wire: Add support for the maxim ds1825 temperature sensor
This patch adds support for maxim ds1825 based 1-wire temperature sensors. Signed-off-by: Raphael Assenat <raph@8d.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--Documentation/w1/slaves/w1_therm2
-rw-r--r--drivers/w1/slaves/w1_therm.c9
-rw-r--r--drivers/w1/w1_family.h1
3 files changed, 12 insertions, 0 deletions
diff --git a/Documentation/w1/slaves/w1_therm b/Documentation/w1/slaves/w1_therm
index 0403aaaba878..874a8ca93feb 100644
--- a/Documentation/w1/slaves/w1_therm
+++ b/Documentation/w1/slaves/w1_therm
@@ -3,6 +3,7 @@ Kernel driver w1_therm
3 3
4Supported chips: 4Supported chips:
5 * Maxim ds18*20 based temperature sensors. 5 * Maxim ds18*20 based temperature sensors.
6 * Maxim ds1825 based temperature sensors.
6 7
7Author: Evgeniy Polyakov <johnpol@2ka.mipt.ru> 8Author: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
8 9
@@ -15,6 +16,7 @@ supported family codes:
15W1_THERM_DS18S20 0x10 16W1_THERM_DS18S20 0x10
16W1_THERM_DS1822 0x22 17W1_THERM_DS1822 0x22
17W1_THERM_DS18B20 0x28 18W1_THERM_DS18B20 0x28
19W1_THERM_DS1825 0x3B
18 20
19Support is provided through the sysfs w1_slave file. Each open and 21Support is provided through the sysfs w1_slave file. Each open and
20read sequence will initiate a temperature conversion then provide two 22read sequence will initiate a temperature conversion then provide two
diff --git a/drivers/w1/slaves/w1_therm.c b/drivers/w1/slaves/w1_therm.c
index d90062b211f8..92d08e7fcba2 100644
--- a/drivers/w1/slaves/w1_therm.c
+++ b/drivers/w1/slaves/w1_therm.c
@@ -91,6 +91,11 @@ static struct w1_family w1_therm_family_DS28EA00 = {
91 .fops = &w1_therm_fops, 91 .fops = &w1_therm_fops,
92}; 92};
93 93
94static struct w1_family w1_therm_family_DS1825 = {
95 .fid = W1_THERM_DS1825,
96 .fops = &w1_therm_fops,
97};
98
94struct w1_therm_family_converter 99struct w1_therm_family_converter
95{ 100{
96 u8 broken; 101 u8 broken;
@@ -120,6 +125,10 @@ static struct w1_therm_family_converter w1_therm_families[] = {
120 .f = &w1_therm_family_DS28EA00, 125 .f = &w1_therm_family_DS28EA00,
121 .convert = w1_DS18B20_convert_temp 126 .convert = w1_DS18B20_convert_temp
122 }, 127 },
128 {
129 .f = &w1_therm_family_DS1825,
130 .convert = w1_DS18B20_convert_temp
131 }
123}; 132};
124 133
125static inline int w1_DS18B20_convert_temp(u8 rom[9]) 134static inline int w1_DS18B20_convert_temp(u8 rom[9])
diff --git a/drivers/w1/w1_family.h b/drivers/w1/w1_family.h
index b00ada44a89b..a1f0ce151d53 100644
--- a/drivers/w1/w1_family.h
+++ b/drivers/w1/w1_family.h
@@ -39,6 +39,7 @@
39#define W1_EEPROM_DS2431 0x2D 39#define W1_EEPROM_DS2431 0x2D
40#define W1_FAMILY_DS2760 0x30 40#define W1_FAMILY_DS2760 0x30
41#define W1_FAMILY_DS2780 0x32 41#define W1_FAMILY_DS2780 0x32
42#define W1_THERM_DS1825 0x3B
42#define W1_FAMILY_DS2781 0x3D 43#define W1_FAMILY_DS2781 0x3D
43#define W1_THERM_DS28EA00 0x42 44#define W1_THERM_DS28EA00 0x42
44 45