w1: add support for MAX31826 digital temperature sensor with 1Kb eeprom
PATCH 1/1 w1: add support for MAX31826 digital temperature sensor with 1Kb eeprom
From: "Lad, Prabhakar" <[email protected]>
this patch adds support for max31826 temperature sensor with 1Kb eeprom.
the temprature values can be read from file:/sys/bus/w1/devices/3b-0000003c0cfe/w1_slave
and the eeprom can be read/written from file:/sys/bus/w1/devices/3b-0000003c0cfe/eeprom
Signed-off-by Lad, Prabhakar <[email protected]>
---
Datasheet: https://datasheets.maximintegrated.com/en/ds/MAX31826.pdf
Temperature reading example:
/sys/bus/w1/devices/3b-0000003c0cfe$ cat w1_slave 87 02 ff ff f0 ff ff ff b0 : crc=b0 YES 87 02 ff ff f0 ff ff ff b0 t=40437
Reading the eeprom contents:
/sys/bus/w1/devices/3b-0000003c0cfe$ cat eeprom | hexdump -Cv
00000000 48 65 6c 6c 6f 20 57 6f 72 6c 64 20 4d 41 78 33 |Hello World MAx3| 00000010 31 38 32 36 20 74 65 6d 70 65 72 61 74 75 72 65 |1826 temperature| 00000020 20 73 65 6e 73 6f 72 20 77 69 74 68 20 31 4b 20 | sensor with 1K | 00000030 65 65 70 72 6f 6d 20 0a 00 00 00 00 00 00 00 00 |eeprom .........| 00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000080
drivers/w1/slaves/Kconfig | 9 + drivers/w1/slaves/Makefile | 1 + drivers/w1/slaves/w1_max31826.c | 490 ++++++++++++++++++++++++++++++++++++++++ drivers/w1/w1_family.h | 1 + 4 files changed, 501 insertions(+) create mode 100644 drivers/w1/slaves/w1_max31826.c
drivers/w1/slaves/Kconfig +9 -0
@@ -132,4 +132,13 @@ config W1_SLAVE_BQ27000 Say Y here if you want to use a hdq bq27000 slave support. +config W1_SLAVE_MAX31826 + tristate "MAX31826 slave support" + help + If you enable this you will have the MAX31826 + chip support. + + Say Y here if you want to use a 1-wire + digital temperature sensor with 1kb EEPROM + endmenu
drivers/w1/slaves/Makefile +1 -0
@@ -15,3 +15,4 @@ obj-$(CONFIG_W1_SLAVE_DS2780) += w1_ds2780.o obj-$(CONFIG_W1_SLAVE_DS2781) += w1_ds2781.o obj-$(CONFIG_W1_SLAVE_BQ27000) += w1_bq27000.o obj-$(CONFIG_W1_SLAVE_DS28E04) += w1_ds28e04.o +obj-$(CONFIG_W1_SLAVE_MAX31826) += w1_max31826.o
drivers/w1/slaves/w1_max31826.c new file +490 -0
490 lines not on this page · raw message
drivers/w1/w1_family.h +1 -0
@@ -43,6 +43,7 @@#define W1_FAMILY_DS2413 0x3A#define W1_FAMILY_DS2406 0x12#define W1_THERM_DS1825 0x3B +#define W1_FAMILY_MAX31826 0x3B#define W1_FAMILY_DS2781 0x3D#define W1_THERM_DS28EA00 0x42
Signature · 1 line
2.7.4