Skip to content

Commit bbecb07

Browse files
Uwe Kleine-Königgregkh
authored andcommitted
siox: new driver framework for eckelmann SIOX
SIOX is a bus system invented at Eckelmann AG to control their building management and refrigeration systems. Traditionally the bus was implemented on custom microcontrollers, today Linux based machines are in use, too. The topology on a SIOX bus looks as follows: ,------->--DCLK-->---------------+----------------------. ^ v v ,--------. ,----------------------. ,------ | | | ,--------------. | | | |--->--DOUT-->---|->-|shift register|->-|--->---| | | | `--------------' | | | master | | device | | device | | | ,--------------. | | | |---<--DIN---<---|-<-|shift register|-<-|---<---| | | | `--------------' | | `--------' `----------------------' `------ v ^ ^ `----------DLD-------------------+----------------------' There are two control lines (DCLK and DLD) driven from the bus master to all devices in parallel and two daisy chained data lines, one for input and one for output. DCLK is the clock to shift both chains by a single bit. On an edge of DLD the devices latch both their input and output shift registers. This patch adds a framework for this bus type. Acked-by: Gavin Schenk <g.schenk@eckelmann.de> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 0ba002b commit bbecb07

File tree

8 files changed

+1148
-0
lines changed

8 files changed

+1148
-0
lines changed
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
What: /sys/bus/siox/devices/siox-X/active
2+
KernelVersion: 4.16
3+
Contact: Gavin Schenk <g.schenk@eckelmann.de>, Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
4+
Description:
5+
On reading represents the current state of the bus. If it
6+
contains a "0" the bus is stopped and connected devices are
7+
expected to not do anything because their watchdog triggered.
8+
When the file contains a "1" the bus is operated and periodically
9+
does a push-pull cycle to write and read data from the
10+
connected devices.
11+
When writing a "0" or "1" the bus moves to the described state.
12+
13+
What: /sys/bus/siox/devices/siox-X/device_add
14+
KernelVersion: 4.16
15+
Contact: Gavin Schenk <g.schenk@eckelmann.de>, Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
16+
Description:
17+
Write-only file. Write
18+
19+
<type> <inbytes> <outbytes> <statustype>
20+
21+
to add a new device dynamically. <type> is the name that is used to match
22+
to a driver (similar to the platform bus). <inbytes> and <outbytes> define
23+
the length of the input and output shift register in bytes respectively.
24+
<statustype> defines the 4 bit device type that is check to identify connection
25+
problems.
26+
The new device is added to the end of the existing chain.
27+
28+
What: /sys/bus/siox/devices/siox-X/device_remove
29+
KernelVersion: 4.16
30+
Contact: Gavin Schenk <g.schenk@eckelmann.de>, Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
31+
Description:
32+
Write-only file. A single write removes the last device in the siox chain.
33+
34+
What: /sys/bus/siox/devices/siox-X/poll_interval_ns
35+
KernelVersion: 4.16
36+
Contact: Gavin Schenk <g.schenk@eckelmann.de>, Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
37+
Description:
38+
Defines the interval between two poll cycles in nano seconds.
39+
Note this is rounded to jiffies on writing. On reading the current value
40+
is returned.
41+
42+
What: /sys/bus/siox/devices/siox-X-Y/connected
43+
KernelVersion: 4.16
44+
Contact: Gavin Schenk <g.schenk@eckelmann.de>, Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
45+
Description:
46+
Read-only value. "0" means the Yth device on siox bus X isn't "connected" i.e.
47+
communication with it is not ensured. "1" signals a working connection.
48+
49+
What: /sys/bus/siox/devices/siox-X-Y/inbytes
50+
KernelVersion: 4.16
51+
Contact: Gavin Schenk <g.schenk@eckelmann.de>, Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
52+
Description:
53+
Read-only value reporting the inbytes value provided to siox-X/device_add
54+
55+
What: /sys/bus/siox/devices/siox-X-Y/status_errors
56+
KernelVersion: 4.16
57+
Contact: Gavin Schenk <g.schenk@eckelmann.de>, Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
58+
Description:
59+
Counts the number of time intervals when the read status byte doesn't yield the
60+
expected value.
61+
62+
What: /sys/bus/siox/devices/siox-X-Y/type
63+
KernelVersion: 4.16
64+
Contact: Gavin Schenk <g.schenk@eckelmann.de>, Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
65+
Description:
66+
Read-only value reporting the type value provided to siox-X/device_add.
67+
68+
What: /sys/bus/siox/devices/siox-X-Y/watchdog
69+
KernelVersion: 4.16
70+
Contact: Gavin Schenk <g.schenk@eckelmann.de>, Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
71+
Description:
72+
Read-only value reporting if the watchdog of the siox device is
73+
active. "0" means the watchdog is not active and the device is expected to
74+
be operational. "1" means the watchdog keeps the device in reset.
75+
76+
What: /sys/bus/siox/devices/siox-X-Y/watchdog_errors
77+
KernelVersion: 4.16
78+
Contact: Gavin Schenk <g.schenk@eckelmann.de>, Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
79+
Description:
80+
Read-only value reporting the number to time intervals when the
81+
watchdog was active.
82+
83+
What: /sys/bus/siox/devices/siox-X-Y/outbytes
84+
KernelVersion: 4.16
85+
Contact: Gavin Schenk <g.schenk@eckelmann.de>, Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
86+
Description:
87+
Read-only value reporting the outbytes value provided to siox-X/device_add.

drivers/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,4 +211,6 @@ source "drivers/mux/Kconfig"
211211

212212
source "drivers/opp/Kconfig"
213213

214+
source "drivers/siox/Kconfig"
215+
214216
endmenu

drivers/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,3 +184,4 @@ obj-$(CONFIG_FPGA) += fpga/
184184
obj-$(CONFIG_FSI) += fsi/
185185
obj-$(CONFIG_TEE) += tee/
186186
obj-$(CONFIG_MULTIPLEXER) += mux/
187+
obj-$(CONFIG_SIOX) += siox/

drivers/siox/Kconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
menuconfig SIOX
2+
tristate "Eckelmann SIOX Support"
3+
help
4+
SIOX stands for Serial Input Output eXtension and is a synchronous
5+
bus system invented by Eckelmann AG. It is used in their control and
6+
remote monitoring systems for commercial and industrial refrigeration
7+
to drive additional I/O units.
8+
9+
Unless you know better, it is probably safe to say "no" here.

drivers/siox/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
obj-$(CONFIG_SIOX) += siox-core.o

0 commit comments

Comments
 (0)