Skip to content

Commit

Permalink
docs: w1: convert to ReST and add to the kAPI group of docs
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Jonathan Corbet <[email protected]>
  • Loading branch information
mchehab authored and Jonathan Corbet committed Jul 31, 2019
1 parent f139291 commit e9bb627
Show file tree
Hide file tree
Showing 23 changed files with 308 additions and 169 deletions.
2 changes: 1 addition & 1 deletion Documentation/ABI/stable/sysfs-bus-w1
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ Description: Bus scanning interval, microseconds component.
control systems are attached/generate presence for as short as
100 ms - hence the tens-to-hundreds milliseconds scan intervals
are required.
see Documentation/w1/w1.generic for detailed information.
see Documentation/w1/w1-generic.rst for detailed information.
Users: any user space application which wants to know bus scanning
interval
4 changes: 2 additions & 2 deletions Documentation/ABI/stable/sysfs-driver-w1_ds28e04
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ What: /sys/bus/w1/devices/.../pio
Date: May 2012
Contact: Markus Franke <[email protected]>
Description: read/write the contents of the two PIO's of the DS28E04-100
see Documentation/w1/slaves/w1_ds28e04 for detailed information
see Documentation/w1/slaves/w1_ds28e04.rst for detailed information
Users: any user space application which wants to communicate with DS28E04-100


Expand All @@ -11,5 +11,5 @@ What: /sys/bus/w1/devices/.../eeprom
Date: May 2012
Contact: Markus Franke <[email protected]>
Description: read/write the contents of the EEPROM memory of the DS28E04-100
see Documentation/w1/slaves/w1_ds28e04 for detailed information
see Documentation/w1/slaves/w1_ds28e04.rst for detailed information
Users: any user space application which wants to communicate with DS28E04-100
2 changes: 1 addition & 1 deletion Documentation/ABI/stable/sysfs-driver-w1_ds28ea00
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ What: /sys/bus/w1/devices/.../w1_seq
Date: Apr 2015
Contact: Matt Campbell <[email protected]>
Description: Support for the DS28EA00 chain sequence function
see Documentation/w1/slaves/w1_therm for detailed information
see Documentation/w1/slaves/w1_therm.rst for detailed information
Users: any user space application which wants to communicate with DS28EA00
1 change: 1 addition & 0 deletions Documentation/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ needed).
target/index
timers/index
spi/index
w1/index
watchdog/index
virtual/index
input/index
Expand Down
21 changes: 21 additions & 0 deletions Documentation/w1/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
. SPDX-License-Identifier: GPL-2.0

================
1-Wire Subsystem
================

.. toctree::
:maxdepth: 1


w1-generic.rst
w1-netlink.rst
masters/index
slaves/index

.. only:: subproject and html

Indices
=======

* :ref:`genindex`
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
====================
Kernel driver ds2482
====================

Supported chips:

* Maxim DS2482-100, Maxim DS2482-800

Prefix: 'ds2482'

Addresses scanned: None

Datasheets:
http://datasheets.maxim-ic.com/en/ds/DS2482-100.pdf
http://datasheets.maxim-ic.com/en/ds/DS2482-800.pdf

- http://datasheets.maxim-ic.com/en/ds/DS2482-100.pdf
- http://datasheets.maxim-ic.com/en/ds/DS2482-800.pdf

Author: Ben Gardner <[email protected]>

Expand All @@ -23,9 +29,11 @@ General Remarks
---------------

Valid addresses are 0x18, 0x19, 0x1a, and 0x1b.

However, the device cannot be detected without writing to the i2c bus, so no
detection is done. You should instantiate the device explicitly.

$ modprobe ds2482
$ echo ds2482 0x18 > /sys/bus/i2c/devices/i2c-0/new_device
::

$ modprobe ds2482
$ echo ds2482 0x18 > /sys/bus/i2c/devices/i2c-0/new_device
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
====================
Kernel driver ds2490
====================

Supported chips:

* Maxim DS2490 based

Author: Evgeniy Polyakov <[email protected]>
Expand All @@ -18,6 +20,7 @@ which has 0x81 family ID integrated chip and DS2490
low-level operational chip.

Notes and limitations.

- The weak pullup current is a minimum of 0.9mA and maximum of 6.0mA.
- The 5V strong pullup is supported with a minimum of 5.9mA and a
maximum of 30.4 mA. (From DS2490.pdf)
Expand Down Expand Up @@ -65,4 +68,5 @@ Notes and limitations.
reattaching would clear the problem. usbmon output in the guest and
host did not explain the problem. My guess is a bug in either qemu
or the host OS and more likely the host OS.
-- 03-06-2008 David Fries <[email protected]>

03-06-2008 David Fries <[email protected]>
14 changes: 14 additions & 0 deletions Documentation/w1/masters/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
. SPDX-License-Identifier: GPL-2.0

=====================
1-wire Master Drivers
=====================

.. toctree::
:maxdepth: 1

ds2482
ds2490
mxc-w1
omap-hdq
w1-gpio
12 changes: 0 additions & 12 deletions Documentation/w1/masters/mxc-w1

This file was deleted.

17 changes: 17 additions & 0 deletions Documentation/w1/masters/mxc-w1.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
====================
Kernel driver mxc_w1
====================

Supported chips:

* Freescale MX27, MX31 and probably other i.MX SoCs

Datasheets:

- http://www.freescale.com/files/32bit/doc/data_sheet/MCIMX31.pdf?fpsp=1
- 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

Author:

Originally based on Freescale code, prepared for mainline by
Sascha Hauer <[email protected]>
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
Kernel driver for omap HDQ/1-wire module.
========================================
Kernel driver for omap HDQ/1-wire module
========================================

Supported chips:
================
HDQ/1-wire controller on the TI OMAP 2430/3430 platforms.
HDQ/1-wire controller on the TI OMAP 2430/3430 platforms.

A useful link about HDQ basics:
===============================
Expand Down Expand Up @@ -40,9 +41,10 @@ driver(drivers/w1/slaves/w1_bq27000.c) sets the ID to 1.
Please note to load both the modules with a different ID if required, but note
that the ID used should be same for both master and slave driver loading.

e.g:
insmod omap_hdq.ko W1_ID=2
inamod w1_bq27000.ko F_ID=2
e.g::

insmod omap_hdq.ko W1_ID=2
inamod w1_bq27000.ko F_ID=2

The driver also supports 1-wire mode. In this mode, there is no need to
pass slave ID as parameter. The driver will auto-detect slaves connected
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
=====================
Kernel driver w1-gpio
=====================

Expand All @@ -16,28 +17,30 @@ Documentation/devicetree/bindings/w1/w1-gpio.txt
Example (mach-at91)
-------------------

#include <linux/gpio/machine.h>
#include <linux/w1-gpio.h>
::

#include <linux/gpio/machine.h>
#include <linux/w1-gpio.h>

static struct gpiod_lookup_table foo_w1_gpiod_table = {
static struct gpiod_lookup_table foo_w1_gpiod_table = {
.dev_id = "w1-gpio",
.table = {
GPIO_LOOKUP_IDX("at91-gpio", AT91_PIN_PB20, NULL, 0,
GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN),
},
};
};

static struct w1_gpio_platform_data foo_w1_gpio_pdata = {
static struct w1_gpio_platform_data foo_w1_gpio_pdata = {
.ext_pullup_enable_pin = -EINVAL,
};
};

static struct platform_device foo_w1_device = {
static struct platform_device foo_w1_device = {
.name = "w1-gpio",
.id = -1,
.dev.platform_data = &foo_w1_gpio_pdata,
};
};

...
...
at91_set_GPIO_periph(foo_w1_gpio_pdata.pin, 1);
at91_set_multi_drive(foo_w1_gpio_pdata.pin, 1);
gpiod_add_lookup_table(&foo_w1_gpiod_table);
Expand Down
16 changes: 16 additions & 0 deletions Documentation/w1/slaves/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
. SPDX-License-Identifier: GPL-2.0

====================
1-wire Slave Drivers
====================

.. toctree::
:maxdepth: 1

w1_ds2406
w1_ds2413
w1_ds2423
w1_ds2438
w1_ds28e04
w1_ds28e17
w1_therm
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
=======================
w1_ds2406 kernel driver
=======================

Supported chips:

* Maxim DS2406 (and other family 0x12) addressable switches

Author: Scott Alfter <[email protected]>

Description
-----------

The w1_ds2406 driver allows connected devices to be switched on and off.
The w1_ds2406 driver allows connected devices to be switched on and off.
These chips also provide 128 bytes of OTP EPROM, but reading/writing it is
not supported. In TSOC-6 form, the DS2406 provides two switch outputs and
can be provided with power on a dedicated input. In TO-92 form, it provides
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
=======================
Kernel driver w1_ds2413
=======================

Supported chips:

* Maxim DS2413 1-Wire Dual Channel Addressable Switch

supported family codes:

================ ====
W1_FAMILY_DS2413 0x3A
================ ====

Author: Mariusz Bialonczyk <[email protected]>

Expand All @@ -20,11 +25,13 @@ Reading state
The "state" file provides one-byte value which is in the same format as for
the chip PIO_ACCESS_READ command (refer the datasheet for details):

======== =============================================================
Bit 0: PIOA Pin State
Bit 1: PIOA Output Latch State
Bit 2: PIOB Pin State
Bit 3: PIOB Output Latch State
Bit 4-7: Complement of Bit 3 to Bit 0 (verified by the kernel module)
======== =============================================================

This file is readonly.

Expand All @@ -34,9 +41,11 @@ You can set the PIO pins using the "output" file.
It is writable, you can write one-byte value to this sysfs file.
Similarly the byte format is the same as for the PIO_ACCESS_WRITE command:

======== ======================================
Bit 0: PIOA
Bit 1: PIOB
Bit 2-7: No matter (driver will set it to "1"s)
======== ======================================


The chip has some kind of basic protection against transmission errors.
Expand Down
47 changes: 0 additions & 47 deletions Documentation/w1/slaves/w1_ds2423

This file was deleted.

Loading

0 comments on commit e9bb627

Please sign in to comment.