summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-07-31 16:08:53 -0400
committerJonathan Corbet <corbet@lwn.net>2019-07-31 16:16:17 -0400
commite9bb627561535dd584b43a8c0afe93a67bc6a2c5 (patch)
treeca91d46418c232f56b7f36010d6fe4317eb9d2ad
parentf139291c713069b5fa826ff509190efb5df83860 (diff)
docs: w1: convert to ReST and add to the kAPI group of docs
The 1wire documentation was written with w1 developers in mind, so, it makes sense to add it together with the driver-api set. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
-rw-r--r--Documentation/ABI/stable/sysfs-bus-w12
-rw-r--r--Documentation/ABI/stable/sysfs-driver-w1_ds28e044
-rw-r--r--Documentation/ABI/stable/sysfs-driver-w1_ds28ea002
-rw-r--r--Documentation/index.rst1
-rw-r--r--Documentation/w1/index.rst21
-rw-r--r--Documentation/w1/masters/ds2482.rst (renamed from Documentation/w1/masters/ds2482)16
-rw-r--r--Documentation/w1/masters/ds2490.rst (renamed from Documentation/w1/masters/ds2490)6
-rw-r--r--Documentation/w1/masters/index.rst14
-rw-r--r--Documentation/w1/masters/mxc-w112
-rw-r--r--Documentation/w1/masters/mxc-w1.rst17
-rw-r--r--Documentation/w1/masters/omap-hdq.rst (renamed from Documentation/w1/masters/omap-hdq)12
-rw-r--r--Documentation/w1/masters/w1-gpio.rst (renamed from Documentation/w1/masters/w1-gpio)21
-rw-r--r--Documentation/w1/slaves/index.rst16
-rw-r--r--Documentation/w1/slaves/w1_ds2406.rst (renamed from Documentation/w1/slaves/w1_ds2406)4
-rw-r--r--Documentation/w1/slaves/w1_ds2413.rst (renamed from Documentation/w1/slaves/w1_ds2413)9
-rw-r--r--Documentation/w1/slaves/w1_ds242347
-rw-r--r--Documentation/w1/slaves/w1_ds2423.rst54
-rw-r--r--Documentation/w1/slaves/w1_ds2438.rst (renamed from Documentation/w1/slaves/w1_ds2438)10
-rw-r--r--Documentation/w1/slaves/w1_ds28e04.rst (renamed from Documentation/w1/slaves/w1_ds28e04)5
-rw-r--r--Documentation/w1/slaves/w1_ds28e17.rst (renamed from Documentation/w1/slaves/w1_ds28e17)16
-rw-r--r--Documentation/w1/slaves/w1_therm.rst (renamed from Documentation/w1/slaves/w1_therm)11
-rw-r--r--Documentation/w1/w1-generic.rst (renamed from Documentation/w1/w1.generic)88
-rw-r--r--Documentation/w1/w1-netlink.rst (renamed from Documentation/w1/w1.netlink)89
23 files changed, 308 insertions, 169 deletions
diff --git a/Documentation/ABI/stable/sysfs-bus-w1 b/Documentation/ABI/stable/sysfs-bus-w1
index 140d85b4ae92..992dfb183ed0 100644
--- a/Documentation/ABI/stable/sysfs-bus-w1
+++ b/Documentation/ABI/stable/sysfs-bus-w1
@@ -6,6 +6,6 @@ Description: Bus scanning interval, microseconds component.
6 control systems are attached/generate presence for as short as 6 control systems are attached/generate presence for as short as
7 100 ms - hence the tens-to-hundreds milliseconds scan intervals 7 100 ms - hence the tens-to-hundreds milliseconds scan intervals
8 are required. 8 are required.
9 see Documentation/w1/w1.generic for detailed information. 9 see Documentation/w1/w1-generic.rst for detailed information.
10Users: any user space application which wants to know bus scanning 10Users: any user space application which wants to know bus scanning
11 interval 11 interval
diff --git a/Documentation/ABI/stable/sysfs-driver-w1_ds28e04 b/Documentation/ABI/stable/sysfs-driver-w1_ds28e04
index 26579ee868c9..3e1c1fa8d54d 100644
--- a/Documentation/ABI/stable/sysfs-driver-w1_ds28e04
+++ b/Documentation/ABI/stable/sysfs-driver-w1_ds28e04
@@ -2,7 +2,7 @@ What: /sys/bus/w1/devices/.../pio
2Date: May 2012 2Date: May 2012
3Contact: Markus Franke <franm@hrz.tu-chemnitz.de> 3Contact: Markus Franke <franm@hrz.tu-chemnitz.de>
4Description: read/write the contents of the two PIO's of the DS28E04-100 4Description: read/write the contents of the two PIO's of the DS28E04-100
5 see Documentation/w1/slaves/w1_ds28e04 for detailed information 5 see Documentation/w1/slaves/w1_ds28e04.rst for detailed information
6Users: any user space application which wants to communicate with DS28E04-100 6Users: any user space application which wants to communicate with DS28E04-100
7 7
8 8
@@ -11,5 +11,5 @@ What: /sys/bus/w1/devices/.../eeprom
11Date: May 2012 11Date: May 2012
12Contact: Markus Franke <franm@hrz.tu-chemnitz.de> 12Contact: Markus Franke <franm@hrz.tu-chemnitz.de>
13Description: read/write the contents of the EEPROM memory of the DS28E04-100 13Description: read/write the contents of the EEPROM memory of the DS28E04-100
14 see Documentation/w1/slaves/w1_ds28e04 for detailed information 14 see Documentation/w1/slaves/w1_ds28e04.rst for detailed information
15Users: any user space application which wants to communicate with DS28E04-100 15Users: any user space application which wants to communicate with DS28E04-100
diff --git a/Documentation/ABI/stable/sysfs-driver-w1_ds28ea00 b/Documentation/ABI/stable/sysfs-driver-w1_ds28ea00
index e928def14f28..534e63731a49 100644
--- a/Documentation/ABI/stable/sysfs-driver-w1_ds28ea00
+++ b/Documentation/ABI/stable/sysfs-driver-w1_ds28ea00
@@ -2,5 +2,5 @@ What: /sys/bus/w1/devices/.../w1_seq
2Date: Apr 2015 2Date: Apr 2015
3Contact: Matt Campbell <mattrcampbell@gmail.com> 3Contact: Matt Campbell <mattrcampbell@gmail.com>
4Description: Support for the DS28EA00 chain sequence function 4Description: Support for the DS28EA00 chain sequence function
5 see Documentation/w1/slaves/w1_therm for detailed information 5 see Documentation/w1/slaves/w1_therm.rst for detailed information
6Users: any user space application which wants to communicate with DS28EA00 6Users: any user space application which wants to communicate with DS28EA00
diff --git a/Documentation/index.rst b/Documentation/index.rst
index 472b8abe52e9..0a564f3c336e 100644
--- a/Documentation/index.rst
+++ b/Documentation/index.rst
@@ -117,6 +117,7 @@ needed).
117 target/index 117 target/index
118 timers/index 118 timers/index
119 spi/index 119 spi/index
120 w1/index
120 watchdog/index 121 watchdog/index
121 virtual/index 122 virtual/index
122 input/index 123 input/index
diff --git a/Documentation/w1/index.rst b/Documentation/w1/index.rst
new file mode 100644
index 000000000000..57cba81865e2
--- /dev/null
+++ b/Documentation/w1/index.rst
@@ -0,0 +1,21 @@
1. SPDX-License-Identifier: GPL-2.0
2
3================
41-Wire Subsystem
5================
6
7.. toctree::
8 :maxdepth: 1
9
10
11 w1-generic.rst
12 w1-netlink.rst
13 masters/index
14 slaves/index
15
16.. only:: subproject and html
17
18 Indices
19 =======
20
21 * :ref:`genindex`
diff --git a/Documentation/w1/masters/ds2482 b/Documentation/w1/masters/ds2482.rst
index 56f8edace6ac..17ebe8f660cd 100644
--- a/Documentation/w1/masters/ds2482
+++ b/Documentation/w1/masters/ds2482.rst
@@ -1,13 +1,19 @@
1====================
1Kernel driver ds2482 2Kernel driver ds2482
2==================== 3====================
3 4
4Supported chips: 5Supported chips:
6
5 * Maxim DS2482-100, Maxim DS2482-800 7 * Maxim DS2482-100, Maxim DS2482-800
8
6 Prefix: 'ds2482' 9 Prefix: 'ds2482'
10
7 Addresses scanned: None 11 Addresses scanned: None
12
8 Datasheets: 13 Datasheets:
9 http://datasheets.maxim-ic.com/en/ds/DS2482-100.pdf 14
10 http://datasheets.maxim-ic.com/en/ds/DS2482-800.pdf 15 - http://datasheets.maxim-ic.com/en/ds/DS2482-100.pdf
16 - http://datasheets.maxim-ic.com/en/ds/DS2482-800.pdf
11 17
12Author: Ben Gardner <bgardner@wabtec.com> 18Author: Ben Gardner <bgardner@wabtec.com>
13 19
@@ -23,9 +29,11 @@ General Remarks
23--------------- 29---------------
24 30
25Valid addresses are 0x18, 0x19, 0x1a, and 0x1b. 31Valid addresses are 0x18, 0x19, 0x1a, and 0x1b.
32
26However, the device cannot be detected without writing to the i2c bus, so no 33However, the device cannot be detected without writing to the i2c bus, so no
27detection is done. You should instantiate the device explicitly. 34detection is done. You should instantiate the device explicitly.
28 35
29$ modprobe ds2482 36::
30$ echo ds2482 0x18 > /sys/bus/i2c/devices/i2c-0/new_device
31 37
38 $ modprobe ds2482
39 $ echo ds2482 0x18 > /sys/bus/i2c/devices/i2c-0/new_device
diff --git a/Documentation/w1/masters/ds2490 b/Documentation/w1/masters/ds2490.rst
index 3e091151dd80..7e5b50f9c0f5 100644
--- a/Documentation/w1/masters/ds2490
+++ b/Documentation/w1/masters/ds2490.rst
@@ -1,7 +1,9 @@
1====================
1Kernel driver ds2490 2Kernel driver ds2490
2==================== 3====================
3 4
4Supported chips: 5Supported chips:
6
5 * Maxim DS2490 based 7 * Maxim DS2490 based
6 8
7Author: Evgeniy Polyakov <johnpol@2ka.mipt.ru> 9Author: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
@@ -18,6 +20,7 @@ which has 0x81 family ID integrated chip and DS2490
18low-level operational chip. 20low-level operational chip.
19 21
20Notes and limitations. 22Notes and limitations.
23
21- The weak pullup current is a minimum of 0.9mA and maximum of 6.0mA. 24- The weak pullup current is a minimum of 0.9mA and maximum of 6.0mA.
22- The 5V strong pullup is supported with a minimum of 5.9mA and a 25- The 5V strong pullup is supported with a minimum of 5.9mA and a
23 maximum of 30.4 mA. (From DS2490.pdf) 26 maximum of 30.4 mA. (From DS2490.pdf)
@@ -65,4 +68,5 @@ Notes and limitations.
65 reattaching would clear the problem. usbmon output in the guest and 68 reattaching would clear the problem. usbmon output in the guest and
66 host did not explain the problem. My guess is a bug in either qemu 69 host did not explain the problem. My guess is a bug in either qemu
67 or the host OS and more likely the host OS. 70 or the host OS and more likely the host OS.
68-- 03-06-2008 David Fries <David@Fries.net> 71
7203-06-2008 David Fries <David@Fries.net>
diff --git a/Documentation/w1/masters/index.rst b/Documentation/w1/masters/index.rst
new file mode 100644
index 000000000000..4442a98850ad
--- /dev/null
+++ b/Documentation/w1/masters/index.rst
@@ -0,0 +1,14 @@
1. SPDX-License-Identifier: GPL-2.0
2
3=====================
41-wire Master Drivers
5=====================
6
7.. toctree::
8 :maxdepth: 1
9
10 ds2482
11 ds2490
12 mxc-w1
13 omap-hdq
14 w1-gpio
diff --git a/Documentation/w1/masters/mxc-w1 b/Documentation/w1/masters/mxc-w1
deleted file mode 100644
index 38be1ad65532..000000000000
--- a/Documentation/w1/masters/mxc-w1
+++ /dev/null
@@ -1,12 +0,0 @@
1Kernel driver mxc_w1
2====================
3
4Supported chips:
5 * Freescale MX27, MX31 and probably other i.MX SoCs
6 Datasheets:
7 http://www.freescale.com/files/32bit/doc/data_sheet/MCIMX31.pdf?fpsp=1
8 http://cache.freescale.com/files/dsp/doc/archive/MCIMX27.pdf?fsrch=1&WT_TYPE=
9 Data%20Sheets&WT_VENDOR=FREESCALE&WT_FILE_FORMAT=pdf&WT_ASSET=Documentation
10
11Author: Originally based on Freescale code, prepared for mainline by
12 Sascha Hauer <s.hauer@pengutronix.de>
diff --git a/Documentation/w1/masters/mxc-w1.rst b/Documentation/w1/masters/mxc-w1.rst
new file mode 100644
index 000000000000..334f9893103f
--- /dev/null
+++ b/Documentation/w1/masters/mxc-w1.rst
@@ -0,0 +1,17 @@
1====================
2Kernel driver mxc_w1
3====================
4
5Supported chips:
6
7 * Freescale MX27, MX31 and probably other i.MX SoCs
8
9 Datasheets:
10
11 - http://www.freescale.com/files/32bit/doc/data_sheet/MCIMX31.pdf?fpsp=1
12 - http://cache.freescale.com/files/dsp/doc/archive/MCIMX27.pdf?fsrch=1&WT_TYPE=Data%20Sheets&WT_VENDOR=FREESCALE&WT_FILE_FORMAT=pdf&WT_ASSET=Documentation
13
14Author:
15
16 Originally based on Freescale code, prepared for mainline by
17 Sascha Hauer <s.hauer@pengutronix.de>
diff --git a/Documentation/w1/masters/omap-hdq b/Documentation/w1/masters/omap-hdq.rst
index 234522709a5f..345298a59e50 100644
--- a/Documentation/w1/masters/omap-hdq
+++ b/Documentation/w1/masters/omap-hdq.rst
@@ -1,9 +1,10 @@
1Kernel driver for omap HDQ/1-wire module. 1========================================
2Kernel driver for omap HDQ/1-wire module
2======================================== 3========================================
3 4
4Supported chips: 5Supported chips:
5================ 6================
6 HDQ/1-wire controller on the TI OMAP 2430/3430 platforms. 7HDQ/1-wire controller on the TI OMAP 2430/3430 platforms.
7 8
8A useful link about HDQ basics: 9A useful link about HDQ basics:
9=============================== 10===============================
@@ -40,9 +41,10 @@ driver(drivers/w1/slaves/w1_bq27000.c) sets the ID to 1.
40Please note to load both the modules with a different ID if required, but note 41Please note to load both the modules with a different ID if required, but note
41that the ID used should be same for both master and slave driver loading. 42that the ID used should be same for both master and slave driver loading.
42 43
43e.g: 44e.g::
44insmod omap_hdq.ko W1_ID=2 45
45inamod w1_bq27000.ko F_ID=2 46 insmod omap_hdq.ko W1_ID=2
47 inamod w1_bq27000.ko F_ID=2
46 48
47The driver also supports 1-wire mode. In this mode, there is no need to 49The driver also supports 1-wire mode. In this mode, there is no need to
48pass slave ID as parameter. The driver will auto-detect slaves connected 50pass slave ID as parameter. The driver will auto-detect slaves connected
diff --git a/Documentation/w1/masters/w1-gpio b/Documentation/w1/masters/w1-gpio.rst
index 623961d9e83f..18fdb7366372 100644
--- a/Documentation/w1/masters/w1-gpio
+++ b/Documentation/w1/masters/w1-gpio.rst
@@ -1,3 +1,4 @@
1=====================
1Kernel driver w1-gpio 2Kernel driver w1-gpio
2===================== 3=====================
3 4
@@ -16,28 +17,30 @@ Documentation/devicetree/bindings/w1/w1-gpio.txt
16Example (mach-at91) 17Example (mach-at91)
17------------------- 18-------------------
18 19
19#include <linux/gpio/machine.h> 20::
20#include <linux/w1-gpio.h> 21
22 #include <linux/gpio/machine.h>
23 #include <linux/w1-gpio.h>
21 24
22static struct gpiod_lookup_table foo_w1_gpiod_table = { 25 static struct gpiod_lookup_table foo_w1_gpiod_table = {
23 .dev_id = "w1-gpio", 26 .dev_id = "w1-gpio",
24 .table = { 27 .table = {
25 GPIO_LOOKUP_IDX("at91-gpio", AT91_PIN_PB20, NULL, 0, 28 GPIO_LOOKUP_IDX("at91-gpio", AT91_PIN_PB20, NULL, 0,
26 GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN), 29 GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN),
27 }, 30 },
28}; 31 };
29 32
30static struct w1_gpio_platform_data foo_w1_gpio_pdata = { 33 static struct w1_gpio_platform_data foo_w1_gpio_pdata = {
31 .ext_pullup_enable_pin = -EINVAL, 34 .ext_pullup_enable_pin = -EINVAL,
32}; 35 };
33 36
34static struct platform_device foo_w1_device = { 37 static struct platform_device foo_w1_device = {
35 .name = "w1-gpio", 38 .name = "w1-gpio",
36 .id = -1, 39 .id = -1,
37 .dev.platform_data = &foo_w1_gpio_pdata, 40 .dev.platform_data = &foo_w1_gpio_pdata,
38}; 41 };
39 42
40... 43 ...
41 at91_set_GPIO_periph(foo_w1_gpio_pdata.pin, 1); 44 at91_set_GPIO_periph(foo_w1_gpio_pdata.pin, 1);
42 at91_set_multi_drive(foo_w1_gpio_pdata.pin, 1); 45 at91_set_multi_drive(foo_w1_gpio_pdata.pin, 1);
43 gpiod_add_lookup_table(&foo_w1_gpiod_table); 46 gpiod_add_lookup_table(&foo_w1_gpiod_table);
diff --git a/Documentation/w1/slaves/index.rst b/Documentation/w1/slaves/index.rst
new file mode 100644
index 000000000000..d0697b202f09
--- /dev/null
+++ b/Documentation/w1/slaves/index.rst
@@ -0,0 +1,16 @@
1. SPDX-License-Identifier: GPL-2.0
2
3====================
41-wire Slave Drivers
5====================
6
7.. toctree::
8 :maxdepth: 1
9
10 w1_ds2406
11 w1_ds2413
12 w1_ds2423
13 w1_ds2438
14 w1_ds28e04
15 w1_ds28e17
16 w1_therm
diff --git a/Documentation/w1/slaves/w1_ds2406 b/Documentation/w1/slaves/w1_ds2406.rst
index 8137fe6f6c3d..d3e68266084f 100644
--- a/Documentation/w1/slaves/w1_ds2406
+++ b/Documentation/w1/slaves/w1_ds2406.rst
@@ -1,7 +1,9 @@
1=======================
1w1_ds2406 kernel driver 2w1_ds2406 kernel driver
2======================= 3=======================
3 4
4Supported chips: 5Supported chips:
6
5 * Maxim DS2406 (and other family 0x12) addressable switches 7 * Maxim DS2406 (and other family 0x12) addressable switches
6 8
7Author: Scott Alfter <scott@alfter.us> 9Author: Scott Alfter <scott@alfter.us>
@@ -9,7 +11,7 @@ Author: Scott Alfter <scott@alfter.us>
9Description 11Description
10----------- 12-----------
11 13
12The w1_ds2406 driver allows connected devices to be switched on and off. 14The w1_ds2406 driver allows connected devices to be switched on and off.
13These chips also provide 128 bytes of OTP EPROM, but reading/writing it is 15These chips also provide 128 bytes of OTP EPROM, but reading/writing it is
14not supported. In TSOC-6 form, the DS2406 provides two switch outputs and 16not supported. In TSOC-6 form, the DS2406 provides two switch outputs and
15can be provided with power on a dedicated input. In TO-92 form, it provides 17can be provided with power on a dedicated input. In TO-92 form, it provides
diff --git a/Documentation/w1/slaves/w1_ds2413 b/Documentation/w1/slaves/w1_ds2413.rst
index 936263a8ccb4..c15bb5b919b7 100644
--- a/Documentation/w1/slaves/w1_ds2413
+++ b/Documentation/w1/slaves/w1_ds2413.rst
@@ -1,11 +1,16 @@
1=======================
1Kernel driver w1_ds2413 2Kernel driver w1_ds2413
2======================= 3=======================
3 4
4Supported chips: 5Supported chips:
6
5 * Maxim DS2413 1-Wire Dual Channel Addressable Switch 7 * Maxim DS2413 1-Wire Dual Channel Addressable Switch
6 8
7supported family codes: 9supported family codes:
10
11 ================ ====
8 W1_FAMILY_DS2413 0x3A 12 W1_FAMILY_DS2413 0x3A
13 ================ ====
9 14
10Author: Mariusz Bialonczyk <manio@skyboo.net> 15Author: Mariusz Bialonczyk <manio@skyboo.net>
11 16
@@ -20,11 +25,13 @@ Reading state
20The "state" file provides one-byte value which is in the same format as for 25The "state" file provides one-byte value which is in the same format as for
21the chip PIO_ACCESS_READ command (refer the datasheet for details): 26the chip PIO_ACCESS_READ command (refer the datasheet for details):
22 27
28======== =============================================================
23Bit 0: PIOA Pin State 29Bit 0: PIOA Pin State
24Bit 1: PIOA Output Latch State 30Bit 1: PIOA Output Latch State
25Bit 2: PIOB Pin State 31Bit 2: PIOB Pin State
26Bit 3: PIOB Output Latch State 32Bit 3: PIOB Output Latch State
27Bit 4-7: Complement of Bit 3 to Bit 0 (verified by the kernel module) 33Bit 4-7: Complement of Bit 3 to Bit 0 (verified by the kernel module)
34======== =============================================================
28 35
29This file is readonly. 36This file is readonly.
30 37
@@ -34,9 +41,11 @@ You can set the PIO pins using the "output" file.
34It is writable, you can write one-byte value to this sysfs file. 41It is writable, you can write one-byte value to this sysfs file.
35Similarly the byte format is the same as for the PIO_ACCESS_WRITE command: 42Similarly the byte format is the same as for the PIO_ACCESS_WRITE command:
36 43
44======== ======================================
37Bit 0: PIOA 45Bit 0: PIOA
38Bit 1: PIOB 46Bit 1: PIOB
39Bit 2-7: No matter (driver will set it to "1"s) 47Bit 2-7: No matter (driver will set it to "1"s)
48======== ======================================
40 49
41 50
42The chip has some kind of basic protection against transmission errors. 51The chip has some kind of basic protection against transmission errors.
diff --git a/Documentation/w1/slaves/w1_ds2423 b/Documentation/w1/slaves/w1_ds2423
deleted file mode 100644
index 3f98b505a0ee..000000000000
--- a/Documentation/w1/slaves/w1_ds2423
+++ /dev/null
@@ -1,47 +0,0 @@
1Kernel driver w1_ds2423
2=======================
3
4Supported chips:
5 * Maxim DS2423 based counter devices.
6
7supported family codes:
8 W1_THERM_DS2423 0x1D
9
10Author: Mika Laitio <lamikr@pilppa.org>
11
12Description
13-----------
14
15Support is provided through the sysfs w1_slave file. Each opening and
16read sequence of w1_slave file initiates the read of counters and ram
17available in DS2423 pages 12 - 15.
18
19Result of each page is provided as an ASCII output where each counter
20value and associated ram buffer is outpputed to own line.
21
22Each lines will contain the values of 42 bytes read from the counter and
23memory page along the crc=YES or NO for indicating whether the read operation
24was successful and CRC matched.
25If the operation was successful, there is also in the end of each line
26a counter value expressed as an integer after c=
27
28Meaning of 42 bytes represented is following:
29 - 1 byte from ram page
30 - 4 bytes for the counter value
31 - 4 zero bytes
32 - 2 bytes for crc16 which was calculated from the data read since the previous crc bytes
33 - 31 remaining bytes from the ram page
34 - crc=YES/NO indicating whether read was ok and crc matched
35 - c=<int> current counter value
36
37example from the successful read:
3800 02 00 00 00 00 00 00 00 6d 38 00 ff ff 00 00 fe ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff crc=YES c=2
3900 02 00 00 00 00 00 00 00 e0 1f 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff crc=YES c=2
4000 29 c6 5d 18 00 00 00 00 04 37 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff crc=YES c=408798761
4100 05 00 00 00 00 00 00 00 8d 39 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff crc=YES c=5
42
43example from the read with crc errors:
4400 02 00 00 00 00 00 00 00 6d 38 00 ff ff 00 00 fe ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff crc=YES c=2
4500 02 00 00 22 00 00 00 00 e0 1f 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff crc=NO
4600 e1 61 5d 19 00 00 00 00 df 0b 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff crc=NO
4700 05 00 00 20 00 00 00 00 8d 39 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff crc=NO
diff --git a/Documentation/w1/slaves/w1_ds2423.rst b/Documentation/w1/slaves/w1_ds2423.rst
new file mode 100644
index 000000000000..755d659ad997
--- /dev/null
+++ b/Documentation/w1/slaves/w1_ds2423.rst
@@ -0,0 +1,54 @@
1Kernel driver w1_ds2423
2=======================
3
4Supported chips:
5
6 * Maxim DS2423 based counter devices.
7
8supported family codes:
9
10 =============== ====
11 W1_THERM_DS2423 0x1D
12 =============== ====
13
14Author: Mika Laitio <lamikr@pilppa.org>
15
16Description
17-----------
18
19Support is provided through the sysfs w1_slave file. Each opening and
20read sequence of w1_slave file initiates the read of counters and ram
21available in DS2423 pages 12 - 15.
22
23Result of each page is provided as an ASCII output where each counter
24value and associated ram buffer is outpputed to own line.
25
26Each lines will contain the values of 42 bytes read from the counter and
27memory page along the crc=YES or NO for indicating whether the read operation
28was successful and CRC matched.
29If the operation was successful, there is also in the end of each line
30a counter value expressed as an integer after c=
31
32Meaning of 42 bytes represented is following:
33
34 - 1 byte from ram page
35 - 4 bytes for the counter value
36 - 4 zero bytes
37 - 2 bytes for crc16 which was calculated from the data read since the previous crc bytes
38 - 31 remaining bytes from the ram page
39 - crc=YES/NO indicating whether read was ok and crc matched
40 - c=<int> current counter value
41
42example from the successful read::
43
44 00 02 00 00 00 00 00 00 00 6d 38 00 ff ff 00 00 fe ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff crc=YES c=2
45 00 02 00 00 00 00 00 00 00 e0 1f 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff crc=YES c=2
46 00 29 c6 5d 18 00 00 00 00 04 37 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff crc=YES c=408798761
47 00 05 00 00 00 00 00 00 00 8d 39 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff crc=YES c=5
48
49example from the read with crc errors::
50
51 00 02 00 00 00 00 00 00 00 6d 38 00 ff ff 00 00 fe ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff crc=YES c=2
52 00 02 00 00 22 00 00 00 00 e0 1f 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff crc=NO
53 00 e1 61 5d 19 00 00 00 00 df 0b 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff crc=NO
54 00 05 00 00 20 00 00 00 00 8d 39 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff crc=NO
diff --git a/Documentation/w1/slaves/w1_ds2438 b/Documentation/w1/slaves/w1_ds2438.rst
index e64f65a09387..a29309a3f8e5 100644
--- a/Documentation/w1/slaves/w1_ds2438
+++ b/Documentation/w1/slaves/w1_ds2438.rst
@@ -2,10 +2,13 @@ Kernel driver w1_ds2438
2======================= 2=======================
3 3
4Supported chips: 4Supported chips:
5
5 * Maxim DS2438 Smart Battery Monitor 6 * Maxim DS2438 Smart Battery Monitor
6 7
7supported family codes: 8supported family codes:
9 ================ ====
8 W1_FAMILY_DS2438 0x26 10 W1_FAMILY_DS2438 0x26
11 ================ ====
9 12
10Author: Mariusz Bialonczyk <manio@skyboo.net> 13Author: Mariusz Bialonczyk <manio@skyboo.net>
11 14
@@ -56,8 +59,11 @@ Opening and reading this file initiates the CONVERT_V (voltage conversion)
56command of the chip. 59command of the chip.
57 60
58Depending on a sysfs filename a different input for the A/D will be selected: 61Depending on a sysfs filename a different input for the A/D will be selected:
59vad: general purpose A/D input (VAD) 62
60vdd: battery input (VDD) 63vad:
64 general purpose A/D input (VAD)
65vdd:
66 battery input (VDD)
61 67
62After the voltage conversion the value is returned as decimal ASCII. 68After the voltage conversion the value is returned as decimal ASCII.
63Note: To get a volts the value has to be divided by 100. 69Note: To get a volts the value has to be divided by 100.
diff --git a/Documentation/w1/slaves/w1_ds28e04 b/Documentation/w1/slaves/w1_ds28e04.rst
index 7819b65cfa48..b12b118890d3 100644
--- a/Documentation/w1/slaves/w1_ds28e04
+++ b/Documentation/w1/slaves/w1_ds28e04.rst
@@ -1,11 +1,16 @@
1========================
1Kernel driver w1_ds28e04 2Kernel driver w1_ds28e04
2======================== 3========================
3 4
4Supported chips: 5Supported chips:
6
5 * Maxim DS28E04-100 4096-Bit Addressable 1-Wire EEPROM with PIO 7 * Maxim DS28E04-100 4096-Bit Addressable 1-Wire EEPROM with PIO
6 8
7supported family codes: 9supported family codes:
10
11 ================= ====
8 W1_FAMILY_DS28E04 0x1C 12 W1_FAMILY_DS28E04 0x1C
13 ================= ====
9 14
10Author: Markus Franke, <franke.m@sebakmt.com> <franm@hrz.tu-chemnitz.de> 15Author: Markus Franke, <franke.m@sebakmt.com> <franm@hrz.tu-chemnitz.de>
11 16
diff --git a/Documentation/w1/slaves/w1_ds28e17 b/Documentation/w1/slaves/w1_ds28e17.rst
index 7fcfad5b4a37..e2d9f96d8f2c 100644
--- a/Documentation/w1/slaves/w1_ds28e17
+++ b/Documentation/w1/slaves/w1_ds28e17.rst
@@ -1,11 +1,16 @@
1========================
1Kernel driver w1_ds28e17 2Kernel driver w1_ds28e17
2======================== 3========================
3 4
4Supported chips: 5Supported chips:
6
5 * Maxim DS28E17 1-Wire-to-I2C Master Bridge 7 * Maxim DS28E17 1-Wire-to-I2C Master Bridge
6 8
7supported family codes: 9supported family codes:
10
11 ================= ====
8 W1_FAMILY_DS28E17 0x19 12 W1_FAMILY_DS28E17 0x19
13 ================= ====
9 14
10Author: Jan Kandziora <jjj@gmx.de> 15Author: Jan Kandziora <jjj@gmx.de>
11 16
@@ -20,11 +25,11 @@ a DS28E17 can be accessed by the kernel or userspace tools as if they were
20connected to a "native" I2C bus master. 25connected to a "native" I2C bus master.
21 26
22 27
23An udev rule like the following 28An udev rule like the following::
24------------------------------------------------------------------------------- 29
25SUBSYSTEM=="i2c-dev", KERNEL=="i2c-[0-9]*", ATTRS{name}=="w1-19-*", \ 30 SUBSYSTEM=="i2c-dev", KERNEL=="i2c-[0-9]*", ATTRS{name}=="w1-19-*", \
26 SYMLINK+="i2c-$attr{name}" 31 SYMLINK+="i2c-$attr{name}"
27------------------------------------------------------------------------------- 32
28may be used to create stable /dev/i2c- entries based on the unique id of the 33may be used to create stable /dev/i2c- entries based on the unique id of the
29DS28E17 chip. 34DS28E17 chip.
30 35
@@ -65,4 +70,3 @@ structure is created.
65 70
66 71
67See https://github.com/ianka/w1_ds28e17 for even more information. 72See https://github.com/ianka/w1_ds28e17 for even more information.
68
diff --git a/Documentation/w1/slaves/w1_therm b/Documentation/w1/slaves/w1_therm.rst
index d1f93af36f38..90531c340a07 100644
--- a/Documentation/w1/slaves/w1_therm
+++ b/Documentation/w1/slaves/w1_therm.rst
@@ -1,7 +1,9 @@
1======================
1Kernel driver w1_therm 2Kernel driver w1_therm
2==================== 3======================
3 4
4Supported chips: 5Supported chips:
6
5 * Maxim ds18*20 based temperature sensors. 7 * Maxim ds18*20 based temperature sensors.
6 * Maxim ds1825 based temperature sensors. 8 * Maxim ds1825 based temperature sensors.
7 9
@@ -13,12 +15,16 @@ Description
13 15
14w1_therm provides basic temperature conversion for ds18*20 devices, and the 16w1_therm provides basic temperature conversion for ds18*20 devices, and the
15ds28ea00 device. 17ds28ea00 device.
16supported family codes: 18
19Supported family codes:
20
21==================== ====
17W1_THERM_DS18S20 0x10 22W1_THERM_DS18S20 0x10
18W1_THERM_DS1822 0x22 23W1_THERM_DS1822 0x22
19W1_THERM_DS18B20 0x28 24W1_THERM_DS18B20 0x28
20W1_THERM_DS1825 0x3B 25W1_THERM_DS1825 0x3B
21W1_THERM_DS28EA00 0x42 26W1_THERM_DS28EA00 0x42
27==================== ====
22 28
23Support is provided through the sysfs w1_slave file. Each open and 29Support is provided through the sysfs w1_slave file. Each open and
24read sequence will initiate a temperature conversion then provide two 30read sequence will initiate a temperature conversion then provide two
@@ -51,6 +57,7 @@ If so, it will activate the master's strong pullup.
51In case the detection of parasite devices using this command fails 57In case the detection of parasite devices using this command fails
52(seems to be the case with some DS18S20) the strong pullup can 58(seems to be the case with some DS18S20) the strong pullup can
53be force-enabled. 59be force-enabled.
60
54If the strong pullup is enabled, the master's strong pullup will be 61If the strong pullup is enabled, the master's strong pullup will be
55driven when the conversion is taking place, provided the master driver 62driven when the conversion is taking place, provided the master driver
56does support the strong pullup (or it falls back to a pullup 63does support the strong pullup (or it falls back to a pullup
diff --git a/Documentation/w1/w1.generic b/Documentation/w1/w1-generic.rst
index c51b1ab012d0..da4e8b4e9b01 100644
--- a/Documentation/w1/w1.generic
+++ b/Documentation/w1/w1-generic.rst
@@ -1,5 +1,7 @@
1The 1-wire (w1) subsystem 1=========================================
2------------------------------------------------------------------ 2Introduction to the 1-wire (w1) subsystem
3=========================================
4
3The 1-wire bus is a simple master-slave bus that communicates via a single 5The 1-wire bus is a simple master-slave bus that communicates via a single
4signal wire (plus ground, so two wires). 6signal wire (plus ground, so two wires).
5 7
@@ -12,14 +14,16 @@ communication with slaves.
12All w1 slave devices must be connected to a w1 bus master device. 14All w1 slave devices must be connected to a w1 bus master device.
13 15
14Example w1 master devices: 16Example w1 master devices:
15 DS9490 usb device 17
16 W1-over-GPIO 18 - DS9490 usb device
17 DS2482 (i2c to w1 bridge) 19 - W1-over-GPIO
18 Emulated devices, such as a RS232 converter, parallel port adapter, etc 20 - DS2482 (i2c to w1 bridge)
21 - Emulated devices, such as a RS232 converter, parallel port adapter, etc
19 22
20 23
21What does the w1 subsystem do? 24What does the w1 subsystem do?
22------------------------------------------------------------------ 25------------------------------
26
23When a w1 master driver registers with the w1 subsystem, the following occurs: 27When a w1 master driver registers with the w1 subsystem, the following occurs:
24 28
25 - sysfs entries for that w1 master are created 29 - sysfs entries for that w1 master are created
@@ -43,24 +47,28 @@ be read, since no device was selected.
43 47
44 48
45W1 device families 49W1 device families
46------------------------------------------------------------------ 50------------------
51
47Slave devices are handled by a driver written for a family of w1 devices. 52Slave devices are handled by a driver written for a family of w1 devices.
48 53
49A family driver populates a struct w1_family_ops (see w1_family.h) and 54A family driver populates a struct w1_family_ops (see w1_family.h) and
50registers with the w1 subsystem. 55registers with the w1 subsystem.
51 56
52Current family drivers: 57Current family drivers:
53w1_therm - (ds18?20 thermal sensor family driver) 58
59w1_therm
60 - (ds18?20 thermal sensor family driver)
54 provides temperature reading function which is bound to ->rbin() method 61 provides temperature reading function which is bound to ->rbin() method
55 of the above w1_family_ops structure. 62 of the above w1_family_ops structure.
56 63
57w1_smem - driver for simple 64bit memory cell provides ID reading method. 64w1_smem
65 - driver for simple 64bit memory cell provides ID reading method.
58 66
59You can call above methods by reading appropriate sysfs files. 67You can call above methods by reading appropriate sysfs files.
60 68
61 69
62What does a w1 master driver need to implement? 70What does a w1 master driver need to implement?
63------------------------------------------------------------------ 71-----------------------------------------------
64 72
65The driver for w1 bus master must provide at minimum two functions. 73The driver for w1 bus master must provide at minimum two functions.
66 74
@@ -75,25 +83,26 @@ See struct w1_bus_master definition in w1.h for details.
75 83
76 84
77w1 master sysfs interface 85w1 master sysfs interface
78------------------------------------------------------------------ 86-------------------------
79<xx-xxxxxxxxxxxx> - A directory for a found device. The format is family-serial 87
80bus - (standard) symlink to the w1 bus 88========================= =====================================================
81driver - (standard) symlink to the w1 driver 89<xx-xxxxxxxxxxxx> A directory for a found device. The format is
82w1_master_add - (rw) manually register a slave device 90 family-serial
83w1_master_attempts - (ro) the number of times a search was attempted 91bus (standard) symlink to the w1 bus
84w1_master_max_slave_count 92driver (standard) symlink to the w1 driver
85 - (rw) maximum number of slaves to search for at a time 93w1_master_add (rw) manually register a slave device
86w1_master_name - (ro) the name of the device (w1_bus_masterX) 94w1_master_attempts (ro) the number of times a search was attempted
87w1_master_pullup - (rw) 5V strong pullup 0 enabled, 1 disabled 95w1_master_max_slave_count (rw) maximum number of slaves to search for at a time
88w1_master_remove - (rw) manually remove a slave device 96w1_master_name (ro) the name of the device (w1_bus_masterX)
89w1_master_search - (rw) the number of searches left to do, 97w1_master_pullup (rw) 5V strong pullup 0 enabled, 1 disabled
90 -1=continual (default) 98w1_master_remove (rw) manually remove a slave device
91w1_master_slave_count 99w1_master_search (rw) the number of searches left to do,
92 - (ro) the number of slaves found 100 -1=continual (default)
93w1_master_slaves - (ro) the names of the slaves, one per line 101w1_master_slave_count (ro) the number of slaves found
94w1_master_timeout - (ro) the delay in seconds between searches 102w1_master_slaves (ro) the names of the slaves, one per line
95w1_master_timeout_us 103w1_master_timeout (ro) the delay in seconds between searches
96 - (ro) the delay in microseconds beetwen searches 104w1_master_timeout_us (ro) the delay in microseconds beetwen searches
105========================= =====================================================
97 106
98If you have a w1 bus that never changes (you don't add or remove devices), 107If you have a w1 bus that never changes (you don't add or remove devices),
99you can set the module parameter search_count to a small positive number 108you can set the module parameter search_count to a small positive number
@@ -111,11 +120,14 @@ decrements w1_master_search by 1 (down to 0) and increments
111w1_master_attempts by 1. 120w1_master_attempts by 1.
112 121
113w1 slave sysfs interface 122w1 slave sysfs interface
114------------------------------------------------------------------ 123------------------------
115bus - (standard) symlink to the w1 bus 124
116driver - (standard) symlink to the w1 driver 125=================== ============================================================
117name - the device name, usually the same as the directory name 126bus (standard) symlink to the w1 bus
118w1_slave - (optional) a binary file whose meaning depends on the 127driver (standard) symlink to the w1 driver
119 family driver 128name the device name, usually the same as the directory name
120rw - (optional) created for slave devices which do not have 129w1_slave (optional) a binary file whose meaning depends on the
121 appropriate family driver. Allows to read/write binary data. 130 family driver
131rw (optional) created for slave devices which do not have
132 appropriate family driver. Allows to read/write binary data.
133=================== ============================================================
diff --git a/Documentation/w1/w1.netlink b/Documentation/w1/w1-netlink.rst
index 94ad4c420828..aaa13243a5e4 100644
--- a/Documentation/w1/w1.netlink
+++ b/Documentation/w1/w1-netlink.rst
@@ -1,22 +1,26 @@
1Userspace communication protocol over connector [1]. 1===============================================
2Userspace communication protocol over connector
3===============================================
2 4
3 5Message types
4Message types.
5============= 6=============
6 7
7There are three types of messages between w1 core and userspace: 8There are three types of messages between w1 core and userspace:
9
81. Events. They are generated each time a new master or slave device 101. Events. They are generated each time a new master or slave device
9 is found either due to automatic or requested search. 11 is found either due to automatic or requested search.
102. Userspace commands. 122. Userspace commands.
113. Replies to userspace commands. 133. Replies to userspace commands.
12 14
13 15
14Protocol. 16Protocol
15======== 17========
16 18
17[struct cn_msg] - connector header. 19::
20
21 [struct cn_msg] - connector header.
18 Its length field is equal to size of the attached data 22 Its length field is equal to size of the attached data
19[struct w1_netlink_msg] - w1 netlink header. 23 [struct w1_netlink_msg] - w1 netlink header.
20 __u8 type - message type. 24 __u8 type - message type.
21 W1_LIST_MASTERS 25 W1_LIST_MASTERS
22 list current bus masters 26 list current bus masters
@@ -40,7 +44,7 @@ Protocol.
40 } mst; 44 } mst;
41 } id; 45 } id;
42 46
43[struct w1_netlink_cmd] - command for given master or slave device. 47 [struct w1_netlink_cmd] - command for given master or slave device.
44 __u8 cmd - command opcode. 48 __u8 cmd - command opcode.
45 W1_CMD_READ - read command 49 W1_CMD_READ - read command
46 W1_CMD_WRITE - write command 50 W1_CMD_WRITE - write command
@@ -71,18 +75,18 @@ when it is added to w1 core.
71Currently replies to userspace commands are only generated for read 75Currently replies to userspace commands are only generated for read
72command request. One reply is generated exactly for one w1_netlink_cmd 76command request. One reply is generated exactly for one w1_netlink_cmd
73read request. Replies are not combined when sent - i.e. typical reply 77read request. Replies are not combined when sent - i.e. typical reply
74messages looks like the following: 78messages looks like the following::
75 79
76[cn_msg][w1_netlink_msg][w1_netlink_cmd] 80 [cn_msg][w1_netlink_msg][w1_netlink_cmd]
77cn_msg.len = sizeof(struct w1_netlink_msg) + 81 cn_msg.len = sizeof(struct w1_netlink_msg) +
78 sizeof(struct w1_netlink_cmd) + 82 sizeof(struct w1_netlink_cmd) +
79 cmd->len; 83 cmd->len;
80w1_netlink_msg.len = sizeof(struct w1_netlink_cmd) + cmd->len; 84 w1_netlink_msg.len = sizeof(struct w1_netlink_cmd) + cmd->len;
81w1_netlink_cmd.len = cmd->len; 85 w1_netlink_cmd.len = cmd->len;
82 86
83Replies to W1_LIST_MASTERS should send a message back to the userspace 87Replies to W1_LIST_MASTERS should send a message back to the userspace
84which will contain list of all registered master ids in the following 88which will contain list of all registered master ids in the following
85format: 89format::
86 90
87 cn_msg (CN_W1_IDX.CN_W1_VAL as id, len is equal to sizeof(struct 91 cn_msg (CN_W1_IDX.CN_W1_VAL as id, len is equal to sizeof(struct
88 w1_netlink_msg) plus number of masters multiplied by 4) 92 w1_netlink_msg) plus number of masters multiplied by 4)
@@ -90,39 +94,47 @@ format:
90 number of masters multiplied by 4 (u32 size)) 94 number of masters multiplied by 4 (u32 size))
91 id0 ... idN 95 id0 ... idN
92 96
93 Each message is at most 4k in size, so if number of master devices 97Each message is at most 4k in size, so if number of master devices
94 exceeds this, it will be split into several messages. 98exceeds this, it will be split into several messages.
95 99
96W1 search and alarm search commands. 100W1 search and alarm search commands.
97request:
98[cn_msg]
99 [w1_netlink_msg type = W1_MASTER_CMD
100 id is equal to the bus master id to use for searching]
101 [w1_netlink_cmd cmd = W1_CMD_SEARCH or W1_CMD_ALARM_SEARCH]
102 101
103reply: 102request::
103
104 [cn_msg]
105 [w1_netlink_msg type = W1_MASTER_CMD
106 id is equal to the bus master id to use for searching]
107 [w1_netlink_cmd cmd = W1_CMD_SEARCH or W1_CMD_ALARM_SEARCH]
108
109reply::
110
104 [cn_msg, ack = 1 and increasing, 0 means the last message, 111 [cn_msg, ack = 1 and increasing, 0 means the last message,
105 seq is equal to the request seq] 112 seq is equal to the request seq]
106 [w1_netlink_msg type = W1_MASTER_CMD] 113 [w1_netlink_msg type = W1_MASTER_CMD]
107 [w1_netlink_cmd cmd = W1_CMD_SEARCH or W1_CMD_ALARM_SEARCH 114 [w1_netlink_cmd cmd = W1_CMD_SEARCH or W1_CMD_ALARM_SEARCH
108 len is equal to number of IDs multiplied by 8] 115 len is equal to number of IDs multiplied by 8]
109 [64bit-id0 ... 64bit-idN] 116 [64bit-id0 ... 64bit-idN]
117
110Length in each header corresponds to the size of the data behind it, so 118Length in each header corresponds to the size of the data behind it, so
111w1_netlink_cmd->len = N * 8; where N is number of IDs in this message. 119w1_netlink_cmd->len = N * 8; where N is number of IDs in this message.
112 Can be zero. 120Can be zero.
113w1_netlink_msg->len = sizeof(struct w1_netlink_cmd) + N * 8; 121
114cn_msg->len = sizeof(struct w1_netlink_msg) + 122::
123
124 w1_netlink_msg->len = sizeof(struct w1_netlink_cmd) + N * 8;
125 cn_msg->len = sizeof(struct w1_netlink_msg) +
115 sizeof(struct w1_netlink_cmd) + 126 sizeof(struct w1_netlink_cmd) +
116 N*8; 127 N*8;
117 128
118W1 reset command. 129W1 reset command::
119[cn_msg]
120 [w1_netlink_msg type = W1_MASTER_CMD
121 id is equal to the bus master id to use for searching]
122 [w1_netlink_cmd cmd = W1_CMD_RESET]
123 130
131 [cn_msg]
132 [w1_netlink_msg type = W1_MASTER_CMD
133 id is equal to the bus master id to use for searching]
134 [w1_netlink_cmd cmd = W1_CMD_RESET]
124 135
125Command status replies. 136
137Command status replies
126====================== 138======================
127 139
128Each command (either root, master or slave with or without w1_netlink_cmd 140Each command (either root, master or slave with or without w1_netlink_cmd
@@ -150,7 +162,7 @@ All w1_netlink_cmd command structures are handled in every w1_netlink_msg,
150even if there were errors, only length mismatch interrupts message processing. 162even if there were errors, only length mismatch interrupts message processing.
151 163
152 164
153Operation steps in w1 core when new command is received. 165Operation steps in w1 core when new command is received
154======================================================= 166=======================================================
155 167
156When new message (w1_netlink_msg) is received w1 core detects if it is 168When new message (w1_netlink_msg) is received w1 core detects if it is
@@ -167,7 +179,7 @@ When all commands (w1_netlink_cmd) are processed master device is unlocked
167and next w1_netlink_msg header processing started. 179and next w1_netlink_msg header processing started.
168 180
169 181
170Connector [1] specific documentation. 182Connector [1] specific documentation
171==================================== 183====================================
172 184
173Each connector message includes two u32 fields as "address". 185Each connector message includes two u32 fields as "address".
@@ -180,10 +192,11 @@ Sequence number for reply is the same as was in request, and
180acknowledge number is set to seq+1. 192acknowledge number is set to seq+1.
181 193
182 194
183Additional documantion, source code examples. 195Additional documentation, source code examples
184============================================ 196==============================================
185 197
1861. Documentation/driver-api/connector.rst 1981. Documentation/driver-api/connector.rst
1872. http://www.ioremap.net/archive/w1 1992. http://www.ioremap.net/archive/w1
188This archive includes userspace application w1d.c which uses 200
189read/write/search commands for all master/slave devices found on the bus. 201 This archive includes userspace application w1d.c which uses
202 read/write/search commands for all master/slave devices found on the bus.