summaryrefslogtreecommitdiff
path: root/drivers/w1/w1.h
diff options
context:
space:
mode:
authorBen Sen <0.x29a.0@gmail.com>2016-05-01 23:23:33 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-05-01 14:37:49 -0700
commit0a19f129d71f18e73249d54de96c835186b8607e (patch)
tree70932d81781981285d03768deaf0bc8fb4cfd36b /drivers/w1/w1.h
parentae53e3740036b5350c4a10dc6fd00fbe3f5134ff (diff)
downloadlwn-0a19f129d71f18e73249d54de96c835186b8607e.tar.gz
lwn-0a19f129d71f18e73249d54de96c835186b8607e.zip
w1: add ability to set (SRAM) and store (EEPROM) configuration for temp sensors like DS18B20
Since many temperature sensors come "preconfigured" with a lower precision, people are stuck at that precision when running on a kernel based device (unlike the Dallas 1Wire library for e.g. Arduino, which supports writing the configuration/scratchpad). This patch adds write support for the scratchpad/precision registers via w1_slave sysfs. Signed-off-by: Ben Sen <0.x29a.0@gmail.com> Acked-by: Evgeniy Polyakov <zbr@ioremap.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/w1/w1.h')
-rw-r--r--drivers/w1/w1.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/w1/w1.h b/drivers/w1/w1.h
index 56a49ba41d83..129895f562b0 100644
--- a/drivers/w1/w1.h
+++ b/drivers/w1/w1.h
@@ -58,6 +58,8 @@ struct w1_reg_num
#define W1_ALARM_SEARCH 0xEC
#define W1_CONVERT_TEMP 0x44
#define W1_SKIP_ROM 0xCC
+#define W1_COPY_SCRATCHPAD 0x48
+#define W1_WRITE_SCRATCHPAD 0x4E
#define W1_READ_SCRATCHPAD 0xBE
#define W1_READ_ROM 0x33
#define W1_READ_PSUPPLY 0xB4