Skip to contentSkip to conversation

add w1_ds28e17 driver for the DS28E17 Onewire to I2C master bridge

PATCH Superseded Jan Kandziora 1 participant 1 message Jul 25, 2016

Subsystems (3)

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 2/2 add w1_ds28e17 driver for the DS28E17 Onewire to I2C master bridge

Changes in v2 against v1 in this subpatch:
- added error handling in w1_f19_error()
- added struct i2c_adapter_quirks
- removed unnecessary checks of I2C address and read count
- cleaned up error codes
+ EOPNOTSUPP for read/write count == 0
+ ETIMEDOUT for busy timeout
+ ENXIO for no reply of I2C slave
+ EAGAIN for I2C invalid start condition
+ EIO for all w1 errors
- devm_kzalloc() instead of kzalloc()
- i2c speed to be set as 100, 400, 900 instead of 0, 1, 2
- added driver parameter documentation
- added sysfs documentation
- Kconfig fixed

This subpatch adds a driver for the DS28E17 Onewire to I2C master bridge.

---
 Documentation/ABI/testing/sysfs-driver-w1_ds28e17 |  21 +
 Documentation/w1/slaves/00-INDEX                  |   2 +
 Documentation/w1/slaves/w1_ds28e17                |  68 ++
 drivers/w1/slaves/Kconfig                         |  15 +
 drivers/w1/slaves/Makefile                        |   1 +
 drivers/w1/slaves/w1_ds28e17.c                    | 772 ++++++++++++++++++++++
 6 files changed, 879 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-driver-w1_ds28e17
 create mode 100644 Documentation/w1/slaves/w1_ds28e17
 create mode 100644 drivers/w1/slaves/w1_ds28e17.c
Documentation/ABI/testing/sysfs-driver-w1_ds28e17 new file +21 -0
new file mode 100644
index 0000000..b97b101
@@ -0,0 +1,21 @@
+What:		/sys/bus/w1/devices/19-<id>/speed
+Date:		Jul 2016
+KernelVersion:	4.7
+Contact:	Jan Kandziora <[email protected]>
+Description:	When written, this file sets the I2C speed on the connected
+		DS28E17 chip. When read, it reads the current setting from
+		the DS28E17 chip.
+		Valid values: 100, 400, 900 [kBaud].
+		Default 100, can be set by w1_ds28e17.speed= module parameter.
+Users:		w1_ds28e17 driver
+
+What:		/sys/bus/w1/devices/19-<id>/stretch
+Date:		Jul 2016
+KernelVersion:	4.7
+Contact:	Jan Kandziora <[email protected]>
+Description:	When written, this file sets the multiplier used to calculate
+		the busy timeout for I2C operations on the connected DS28E17
+		chip. When read, returns the current setting.
+		Valid values: 1 to 9.
+		Default 1, can be set by w1_ds28e17.stretch= module parameter.
+Users:		w1_ds28e17 driver
Documentation/w1/slaves/00-INDEX +2 -0
index 6e18c70..587f4b4 100644
@@ -6,3 +6,5 @@ w1_ds2423
 	- The Maxim/Dallas Semiconductor ds2423 counter device.
 w1_ds28e04
 	- The Maxim/Dallas Semiconductor ds28e04 eeprom.
+w1_ds28e17
+	- The Maxim/Dallas Semiconductor ds28e17 1-Wire-to-I2C Master Bridge.
Documentation/w1/slaves/w1_ds28e17 new file +68 -0

68 lines not on this page · raw message

drivers/w1/slaves/Kconfig +15 -0
index cfe74d0..c7ffe25 100644
@@ -126,6 +126,21 @@ config W1_SLAVE_DS28E04
 
 	  If you are unsure, say N.
 
+config W1_SLAVE_DS28E17
+	tristate "1-wire-to-I2C master bridge (DS28E17)"
+	select CRC16
+	depends on I2C
+	help
+	  Say Y here if you want to use the DS28E17 1-wire-to-I2C master bridge.
+	  For each DS28E17 detected, a new I2C adapter is created within the
+	  kernel. I2C devices on that bus can be configured to be used by the
+	  kernel and userspace tools as on any other "native" I2C bus.
+
+	  This driver is also available as a module. If so, the module
+	  will be called w1_ds28e17.
+
+	  If you are unsure, say N.
+
 config W1_SLAVE_BQ27000
 	tristate "BQ27000 slave support"
 	help
drivers/w1/slaves/Makefile +1 -0
index 1e9989a..3fa1625 100644
@@ -15,3 +15,4 @@ obj-$(CONFIG_W1_SLAVE_DS2780)	+= w1_ds2780.o
 obj-$(CONFIG_W1_SLAVE_DS2781)	+= w1_ds2781.o
 obj-$(CONFIG_W1_SLAVE_BQ27000)	+= w1_bq27000.o
 obj-$(CONFIG_W1_SLAVE_DS28E04)	+= w1_ds28e04.o
+obj-$(CONFIG_W1_SLAVE_DS28E17)	+= w1_ds28e17.o
drivers/w1/slaves/w1_ds28e17.c new file +772 -0

772 lines not on this page · raw message

Signature · 1 line
2.1.4