Merge branch 'drm-next-4.12' of git://people.freedesktop.org/~agd5f/linux into drm...
[GitHub/MotorolaMobilityLLC/kernel-slsi.git] / Documentation / w1 / slaves / w1_ds2438
CommitLineData
6d691550
MB
1Kernel driver w1_ds2438
2=======================
3
4Supported chips:
5 * Maxim DS2438 Smart Battery Monitor
6
7supported family codes:
8 W1_FAMILY_DS2438 0x26
9
10Author: Mariusz Bialonczyk <manio@skyboo.net>
11
12Description
13-----------
14
15The DS2438 chip provides several functions that are desirable to carry in
16a battery pack. It also has a 40 bytes of nonvolatile EEPROM.
17Because the ability of temperature, current and voltage measurement, the chip
18is also often used in weather stations and applications such as: rain gauge,
19wind speed/direction measuring, humidity sensing, etc.
20
21Current support is provided through the following sysfs files (all files
22except "iad" are readonly):
23
24"iad"
25-----
26This file controls the 'Current A/D Control Bit' (IAD) in the
27Status/Configuration Register.
28Writing a zero value will clear the IAD bit and disables the current
29measurements.
30Writing value "1" is setting the IAD bit (enables the measurements).
31The IAD bit is enabled by default in the DS2438.
32
33When writing to sysfs file bits 2-7 are ignored, so it's safe to write ASCII.
34An I/O error is returned when there is a problem setting the new value.
35
36"page0"
37-------
38This file provides full 8 bytes of the chip Page 0 (00h).
39This page contains the most frequently accessed information of the DS2438.
40Internally when this file is read, the additional CRC byte is also obtained
41from the slave device. If it is correct, the 8 bytes page data are passed
42to userspace, otherwise an I/O error is returned.
43
44"temperature"
45-------------
46Opening and reading this file initiates the CONVERT_T (temperature conversion)
47command of the chip, afterwards the temperature is read from the device
48registers and provided as an ASCII decimal value.
49
50Important: The returned value has to be divided by 256 to get a real
51temperature in degrees Celsius.
52
53"vad", "vdd"
54------------
55Opening and reading this file initiates the CONVERT_V (voltage conversion)
56command of the chip.
57
58Depending on a sysfs filename a different input for the A/D will be selected:
59vad: general purpose A/D input (VAD)
60vdd: battery input (VDD)
61
62After the voltage conversion the value is returned as decimal ASCII.
63Note: The value is in mV, so to get a volts the value has to be divided by 10.