Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bbecb07f authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Greg Kroah-Hartman
Browse files

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: default avatarGavin Schenk <g.schenk@eckelmann.de>
Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0ba002bc
Loading
Loading
Loading
Loading
+87 −0
Original line number Diff line number Diff line
What:		/sys/bus/siox/devices/siox-X/active
KernelVersion:	4.16
Contact:	Gavin Schenk <g.schenk@eckelmann.de>, Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Description:
		On reading represents the current state of the bus. If it
		contains a "0" the bus is stopped and connected devices are
		expected to not do anything because their watchdog triggered.
		When the file contains a "1" the bus is operated and periodically
		does a push-pull cycle to write and read data from the
		connected devices.
		When writing a "0" or "1" the bus moves to the described state.

What:		/sys/bus/siox/devices/siox-X/device_add
KernelVersion:	4.16
Contact:	Gavin Schenk <g.schenk@eckelmann.de>, Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Description:
		Write-only file. Write

			<type> <inbytes> <outbytes> <statustype>

		to add a new device dynamically. <type> is the name that is used to match
		to a driver (similar to the platform bus). <inbytes> and <outbytes> define
		the length of the input and output shift register in bytes respectively.
		<statustype> defines the 4 bit device type that is check to identify connection
		problems.
		The new device is added to the end of the existing chain.

What:		/sys/bus/siox/devices/siox-X/device_remove
KernelVersion:	4.16
Contact:	Gavin Schenk <g.schenk@eckelmann.de>, Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Description:
		Write-only file. A single write removes the last device in the siox chain.

What:		/sys/bus/siox/devices/siox-X/poll_interval_ns
KernelVersion:	4.16
Contact:	Gavin Schenk <g.schenk@eckelmann.de>, Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Description:
		Defines the interval between two poll cycles in nano seconds.
		Note this is rounded to jiffies on writing. On reading the current value
		is returned.

What:		/sys/bus/siox/devices/siox-X-Y/connected
KernelVersion:	4.16
Contact:	Gavin Schenk <g.schenk@eckelmann.de>, Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Description:
		Read-only value. "0" means the Yth device on siox bus X isn't "connected" i.e.
		communication with it is not ensured. "1" signals a working connection.

What:		/sys/bus/siox/devices/siox-X-Y/inbytes
KernelVersion:	4.16
Contact:	Gavin Schenk <g.schenk@eckelmann.de>, Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Description:
		Read-only value reporting the inbytes value provided to siox-X/device_add

What:		/sys/bus/siox/devices/siox-X-Y/status_errors
KernelVersion:	4.16
Contact:	Gavin Schenk <g.schenk@eckelmann.de>, Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Description:
		Counts the number of time intervals when the read status byte doesn't yield the
		expected value.

What:		/sys/bus/siox/devices/siox-X-Y/type
KernelVersion:	4.16
Contact:	Gavin Schenk <g.schenk@eckelmann.de>, Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Description:
		Read-only value reporting the type value provided to siox-X/device_add.

What:		/sys/bus/siox/devices/siox-X-Y/watchdog
KernelVersion:	4.16
Contact:	Gavin Schenk <g.schenk@eckelmann.de>, Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Description:
		Read-only value reporting if the watchdog of the siox device is
		active. "0" means the watchdog is not active and the device is expected to
		be operational. "1" means the watchdog keeps the device in reset.

What:		/sys/bus/siox/devices/siox-X-Y/watchdog_errors
KernelVersion:	4.16
Contact:	Gavin Schenk <g.schenk@eckelmann.de>, Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Description:
		Read-only value reporting the number to time intervals when the
		watchdog was active.

What:		/sys/bus/siox/devices/siox-X-Y/outbytes
KernelVersion:	4.16
Contact:	Gavin Schenk <g.schenk@eckelmann.de>, Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Description:
		Read-only value reporting the outbytes value provided to siox-X/device_add.
+2 −0
Original line number Diff line number Diff line
@@ -211,4 +211,6 @@ source "drivers/mux/Kconfig"

source "drivers/opp/Kconfig"

source "drivers/siox/Kconfig"

endmenu
+1 −0
Original line number Diff line number Diff line
@@ -184,3 +184,4 @@ obj-$(CONFIG_FPGA) += fpga/
obj-$(CONFIG_FSI)		+= fsi/
obj-$(CONFIG_TEE)		+= tee/
obj-$(CONFIG_MULTIPLEXER)	+= mux/
obj-$(CONFIG_SIOX)		+= siox/

drivers/siox/Kconfig

0 → 100644
+9 −0
Original line number Diff line number Diff line
menuconfig SIOX
	tristate "Eckelmann SIOX Support"
	help
	  SIOX stands for Serial Input Output eXtension and is a synchronous
	  bus system invented by Eckelmann AG. It is used in their control and
	  remote monitoring systems for commercial and industrial refrigeration
	  to drive additional I/O units.

	  Unless you know better, it is probably safe to say "no" here.

drivers/siox/Makefile

0 → 100644
+1 −0
Original line number Diff line number Diff line
obj-$(CONFIG_SIOX) += siox-core.o
Loading