Re: [PATCH v4 2/2] add w1_ds28e17 driver for the DS28E17 Onewire to I2C master bridge

2017-09-18 Thread Jan Kandziora
Am 18.09.2017 um 12:57 schrieb GregKH:
> On Tue, Sep 05, 2017 at 04:19:48PM +0300, Evgeniy Polyakov wrote:
>> Hi Jan, Greg
>>
>> 19.07.2017, 23:14, "Jan Kandziora" :
>>> This subpatch adds a driver for the DS28E17 Onewire to I2C master bridge.
>>>
>>> Signed-off-by: Jan Kandziora 
>>
>> Greg, please queue this driver into your tree, it is sitting outside quite 
>> for a while and failed to be merged previously
>> since I missed it.
>>  
>> Acked-by: Evgeniy Polyakov 
> 
> Can someone please resend this, I don't have it in my queue anywhere.
> 
I just resent it directly to you, to LKML, Evgeniy and linux-i2c.

Kind regards

Jan



Re: [PATCH v4 2/2] add w1_ds28e17 driver for the DS28E17 Onewire to I2C master bridge

2017-09-18 Thread Jan Kandziora
Am 18.09.2017 um 12:57 schrieb GregKH:
> On Tue, Sep 05, 2017 at 04:19:48PM +0300, Evgeniy Polyakov wrote:
>> Hi Jan, Greg
>>
>> 19.07.2017, 23:14, "Jan Kandziora" :
>>> This subpatch adds a driver for the DS28E17 Onewire to I2C master bridge.
>>>
>>> Signed-off-by: Jan Kandziora 
>>
>> Greg, please queue this driver into your tree, it is sitting outside quite 
>> for a while and failed to be merged previously
>> since I missed it.
>>  
>> Acked-by: Evgeniy Polyakov 
> 
> Can someone please resend this, I don't have it in my queue anywhere.
> 
I just resent it directly to you, to LKML, Evgeniy and linux-i2c.

Kind regards

Jan



[PATCH v4 2/2] add w1_ds28e17 driver for the DS28E17 Onewire to I2C master bridge

2017-09-18 Thread Jan Kandziora
This subpatch adds a driver for the DS28E17 Onewire to I2C master bridge.

Signed-off-by: Jan Kandziora 
---
Changes in v4 against v3 in this subpatch:
  - adapted to linux-4.12.0

Changes in v3 against v2 in this subpatch:
  - fixed a bug in using the i2c_adapter_quirks structure

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

 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 ++
 drivers/w1/w1_family.h|   1 +
 7 files changed, 880 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

diff --git a/Documentation/ABI/testing/sysfs-driver-w1_ds28e17 
b/Documentation/ABI/testing/sysfs-driver-w1_ds28e17
new file mode 100644
index 000..b97b101
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-driver-w1_ds28e17
@@ -0,0 +1,21 @@
+What:  /sys/bus/w1/devices/19-/speed
+Date:  Jul 2016
+KernelVersion: 4.7
+Contact:   Jan Kandziora 
+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-/stretch
+Date:  Jul 2016
+KernelVersion: 4.7
+Contact:   Jan Kandziora 
+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
diff --git a/Documentation/w1/slaves/00-INDEX b/Documentation/w1/slaves/00-INDEX
index 8d76718..68946f8 100644
--- a/Documentation/w1/slaves/00-INDEX
+++ b/Documentation/w1/slaves/00-INDEX
@@ -10,3 +10,5 @@ w1_ds2438
- The Maxim/Dallas Semiconductor ds2438 smart battery monitor.
 w1_ds28e04
- The Maxim/Dallas Semiconductor ds28e04 eeprom.
+w1_ds28e17
+   - The Maxim/Dallas Semiconductor ds28e17 1-Wire-to-I2C Master Bridge.
diff --git a/Documentation/w1/slaves/w1_ds28e17 
b/Documentation/w1/slaves/w1_ds28e17
new file mode 100644
index 000..e82e16e
--- /dev/null
+++ b/Documentation/w1/slaves/w1_ds28e17
@@ -0,0 +1,68 @@
+Kernel driver w1_ds28e17
+
+
+Supported chips:
+  * Maxim DS28E17 1-Wire-to-I2C Master Bridge
+
+supported family codes:
+   W1_FAMILY_DS28E17   0x19
+
+Author: Jan Kandziora 
+
+
+Description
+---
+The DS28E17 is a Onewire slave device which acts as an I2C bus master.
+
+This driver creates a new I2C bus for any DS28E17 device detected. I2C buses
+come and go as the DS28E17 devices come and go. I2C slave devices connected to
+a DS28E17 can be accessed by the kernel or userspace tools as if they were
+connected to a "native" I2C bus master.
+
+
+An udev rule like the following
+---
+SUBSYSTEM=="i2c-dev", KERNEL=="i2c-[0-9]*", ATTRS{name}=="w1-19-*", \
+SYMLINK+="i2c-$attr{name}"
+---
+may be used to create stable /dev/i2c- entries based on the unique id of the
+DS28E17 chip.
+
+
+Driver parameters are:
+
+speed:
+   This sets up the default I2C speed a DS28E17 get configured for as soon
+   it is connected. The power-on default   of the DS28E17 is 400kBaud, but
+   chips may come and go on the Onewire bus without being de-powered and
+   as soon the "w1_ds28e17" driver notices a freshly connected, or
+   reconnected DS28E17 device on the Onewire bus, it will re-apply this
+   setting.
+
+   Valid values are 100, 400, 900 [kBaud]. Any other value means to leave
+   alone the current DS28E17 setting on detect. 

[PATCH v4 2/2] add w1_ds28e17 driver for the DS28E17 Onewire to I2C master bridge

2017-09-18 Thread Jan Kandziora
This subpatch adds a driver for the DS28E17 Onewire to I2C master bridge.

Signed-off-by: Jan Kandziora 
---
Changes in v4 against v3 in this subpatch:
  - adapted to linux-4.12.0

Changes in v3 against v2 in this subpatch:
  - fixed a bug in using the i2c_adapter_quirks structure

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

 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 ++
 drivers/w1/w1_family.h|   1 +
 7 files changed, 880 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

diff --git a/Documentation/ABI/testing/sysfs-driver-w1_ds28e17 
b/Documentation/ABI/testing/sysfs-driver-w1_ds28e17
new file mode 100644
index 000..b97b101
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-driver-w1_ds28e17
@@ -0,0 +1,21 @@
+What:  /sys/bus/w1/devices/19-/speed
+Date:  Jul 2016
+KernelVersion: 4.7
+Contact:   Jan Kandziora 
+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-/stretch
+Date:  Jul 2016
+KernelVersion: 4.7
+Contact:   Jan Kandziora 
+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
diff --git a/Documentation/w1/slaves/00-INDEX b/Documentation/w1/slaves/00-INDEX
index 8d76718..68946f8 100644
--- a/Documentation/w1/slaves/00-INDEX
+++ b/Documentation/w1/slaves/00-INDEX
@@ -10,3 +10,5 @@ w1_ds2438
- The Maxim/Dallas Semiconductor ds2438 smart battery monitor.
 w1_ds28e04
- The Maxim/Dallas Semiconductor ds28e04 eeprom.
+w1_ds28e17
+   - The Maxim/Dallas Semiconductor ds28e17 1-Wire-to-I2C Master Bridge.
diff --git a/Documentation/w1/slaves/w1_ds28e17 
b/Documentation/w1/slaves/w1_ds28e17
new file mode 100644
index 000..e82e16e
--- /dev/null
+++ b/Documentation/w1/slaves/w1_ds28e17
@@ -0,0 +1,68 @@
+Kernel driver w1_ds28e17
+
+
+Supported chips:
+  * Maxim DS28E17 1-Wire-to-I2C Master Bridge
+
+supported family codes:
+   W1_FAMILY_DS28E17   0x19
+
+Author: Jan Kandziora 
+
+
+Description
+---
+The DS28E17 is a Onewire slave device which acts as an I2C bus master.
+
+This driver creates a new I2C bus for any DS28E17 device detected. I2C buses
+come and go as the DS28E17 devices come and go. I2C slave devices connected to
+a DS28E17 can be accessed by the kernel or userspace tools as if they were
+connected to a "native" I2C bus master.
+
+
+An udev rule like the following
+---
+SUBSYSTEM=="i2c-dev", KERNEL=="i2c-[0-9]*", ATTRS{name}=="w1-19-*", \
+SYMLINK+="i2c-$attr{name}"
+---
+may be used to create stable /dev/i2c- entries based on the unique id of the
+DS28E17 chip.
+
+
+Driver parameters are:
+
+speed:
+   This sets up the default I2C speed a DS28E17 get configured for as soon
+   it is connected. The power-on default   of the DS28E17 is 400kBaud, but
+   chips may come and go on the Onewire bus without being de-powered and
+   as soon the "w1_ds28e17" driver notices a freshly connected, or
+   reconnected DS28E17 device on the Onewire bus, it will re-apply this
+   setting.
+
+   Valid values are 100, 400, 900 [kBaud]. Any other value means to leave
+   alone the current DS28E17 setting on detect. The default value is 100.
+
+stretch:
+   This 

Re: [PATCH v4 2/2] add w1_ds28e17 driver for the DS28E17 Onewire to I2C master bridge

2017-09-18 Thread GregKH
On Tue, Sep 05, 2017 at 04:19:48PM +0300, Evgeniy Polyakov wrote:
> Hi Jan, Greg
> 
> 19.07.2017, 23:14, "Jan Kandziora" :
> > This subpatch adds a driver for the DS28E17 Onewire to I2C master bridge.
> >
> > Signed-off-by: Jan Kandziora 
> 
> Greg, please queue this driver into your tree, it is sitting outside quite 
> for a while and failed to be merged previously
> since I missed it.
>  
> Acked-by: Evgeniy Polyakov 

Can someone please resend this, I don't have it in my queue anywhere.

thanks,

greg k-h


Re: [PATCH v4 2/2] add w1_ds28e17 driver for the DS28E17 Onewire to I2C master bridge

2017-09-18 Thread GregKH
On Tue, Sep 05, 2017 at 04:19:48PM +0300, Evgeniy Polyakov wrote:
> Hi Jan, Greg
> 
> 19.07.2017, 23:14, "Jan Kandziora" :
> > This subpatch adds a driver for the DS28E17 Onewire to I2C master bridge.
> >
> > Signed-off-by: Jan Kandziora 
> 
> Greg, please queue this driver into your tree, it is sitting outside quite 
> for a while and failed to be merged previously
> since I missed it.
>  
> Acked-by: Evgeniy Polyakov 

Can someone please resend this, I don't have it in my queue anywhere.

thanks,

greg k-h


Re: [PATCH v4 2/2] add w1_ds28e17 driver for the DS28E17 Onewire to I2C master bridge

2017-09-05 Thread Evgeniy Polyakov
Hi Jan, Greg

19.07.2017, 23:14, "Jan Kandziora" :
> This subpatch adds a driver for the DS28E17 Onewire to I2C master bridge.
>
> Signed-off-by: Jan Kandziora 

Greg, please queue this driver into your tree, it is sitting outside quite for 
a while and failed to be merged previously
since I missed it.
 
Acked-by: Evgeniy Polyakov 

> ---
> Changes in v4 against v3 in this subpatch:
>   - adapted to linux-4.12.0
>
> Changes in v3 against v2 in this subpatch:
>   - fixed a bug in using the i2c_adapter_quirks structure
>
> 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
>
>  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 ++
>  drivers/w1/w1_family.h | 1 +
>  7 files changed, 880 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
>
> diff --git a/Documentation/ABI/testing/sysfs-driver-w1_ds28e17 
> b/Documentation/ABI/testing/sysfs-driver-w1_ds28e17
> new file mode 100644
> index 000..b97b101
> --- /dev/null
> +++ b/Documentation/ABI/testing/sysfs-driver-w1_ds28e17
> @@ -0,0 +1,21 @@
> +What: /sys/bus/w1/devices/19-/speed
> +Date: Jul 2016
> +KernelVersion: 4.7
> +Contact: Jan Kandziora 
> +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-/stretch
> +Date: Jul 2016
> +KernelVersion: 4.7
> +Contact: Jan Kandziora 
> +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
> diff --git a/Documentation/w1/slaves/00-INDEX 
> b/Documentation/w1/slaves/00-INDEX
> index 8d76718..68946f8 100644
> --- a/Documentation/w1/slaves/00-INDEX
> +++ b/Documentation/w1/slaves/00-INDEX
> @@ -10,3 +10,5 @@ w1_ds2438
>  - The Maxim/Dallas Semiconductor ds2438 smart battery monitor.
>  w1_ds28e04
>  - The Maxim/Dallas Semiconductor ds28e04 eeprom.
> +w1_ds28e17
> + - The Maxim/Dallas Semiconductor ds28e17 1-Wire-to-I2C Master Bridge.
> diff --git a/Documentation/w1/slaves/w1_ds28e17 
> b/Documentation/w1/slaves/w1_ds28e17
> new file mode 100644
> index 000..e82e16e
> --- /dev/null
> +++ b/Documentation/w1/slaves/w1_ds28e17
> @@ -0,0 +1,68 @@
> +Kernel driver w1_ds28e17
> +
> +
> +Supported chips:
> + * Maxim DS28E17 1-Wire-to-I2C Master Bridge
> +
> +supported family codes:
> + W1_FAMILY_DS28E17 0x19
> +
> +Author: Jan Kandziora 
> +
> +
> +Description
> +---
> +The DS28E17 is a Onewire slave device which acts as an I2C bus master.
> +
> +This driver creates a new I2C bus for any DS28E17 device detected. I2C buses
> +come and go as the DS28E17 devices come and go. I2C slave devices connected 
> to
> +a DS28E17 can be accessed by the kernel or userspace tools as if they were
> +connected to a "native" I2C bus master.
> +
> +
> +An udev rule like the following
> +---
> +SUBSYSTEM=="i2c-dev", KERNEL=="i2c-[0-9]*", ATTRS{name}=="w1-19-*", \
> + SYMLINK+="i2c-$attr{name}"
> +---
> +may be used to create stable /dev/i2c- entries based on the unique id of the
> +DS28E17 chip.
> +
> +
> +Driver parameters are:
> +
> +speed:
> + This sets up the default I2C speed a DS28E17 get configured for as soon
> + it is connected. The power-on default of the DS28E17 is 400kBaud, but
> + chips may come and go on the Onewire bus without being de-powered and
> + as soon the "w1_ds28e17" driver notices a freshly connected, or
> + reconnected DS28E17 device on the Onewire bus, it will re-apply this
> + setting.
> +
> + 

Re: [PATCH v4 2/2] add w1_ds28e17 driver for the DS28E17 Onewire to I2C master bridge

2017-09-05 Thread Evgeniy Polyakov
Hi Jan, Greg

19.07.2017, 23:14, "Jan Kandziora" :
> This subpatch adds a driver for the DS28E17 Onewire to I2C master bridge.
>
> Signed-off-by: Jan Kandziora 

Greg, please queue this driver into your tree, it is sitting outside quite for 
a while and failed to be merged previously
since I missed it.
 
Acked-by: Evgeniy Polyakov 

> ---
> Changes in v4 against v3 in this subpatch:
>   - adapted to linux-4.12.0
>
> Changes in v3 against v2 in this subpatch:
>   - fixed a bug in using the i2c_adapter_quirks structure
>
> 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
>
>  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 ++
>  drivers/w1/w1_family.h | 1 +
>  7 files changed, 880 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
>
> diff --git a/Documentation/ABI/testing/sysfs-driver-w1_ds28e17 
> b/Documentation/ABI/testing/sysfs-driver-w1_ds28e17
> new file mode 100644
> index 000..b97b101
> --- /dev/null
> +++ b/Documentation/ABI/testing/sysfs-driver-w1_ds28e17
> @@ -0,0 +1,21 @@
> +What: /sys/bus/w1/devices/19-/speed
> +Date: Jul 2016
> +KernelVersion: 4.7
> +Contact: Jan Kandziora 
> +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-/stretch
> +Date: Jul 2016
> +KernelVersion: 4.7
> +Contact: Jan Kandziora 
> +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
> diff --git a/Documentation/w1/slaves/00-INDEX 
> b/Documentation/w1/slaves/00-INDEX
> index 8d76718..68946f8 100644
> --- a/Documentation/w1/slaves/00-INDEX
> +++ b/Documentation/w1/slaves/00-INDEX
> @@ -10,3 +10,5 @@ w1_ds2438
>  - The Maxim/Dallas Semiconductor ds2438 smart battery monitor.
>  w1_ds28e04
>  - The Maxim/Dallas Semiconductor ds28e04 eeprom.
> +w1_ds28e17
> + - The Maxim/Dallas Semiconductor ds28e17 1-Wire-to-I2C Master Bridge.
> diff --git a/Documentation/w1/slaves/w1_ds28e17 
> b/Documentation/w1/slaves/w1_ds28e17
> new file mode 100644
> index 000..e82e16e
> --- /dev/null
> +++ b/Documentation/w1/slaves/w1_ds28e17
> @@ -0,0 +1,68 @@
> +Kernel driver w1_ds28e17
> +
> +
> +Supported chips:
> + * Maxim DS28E17 1-Wire-to-I2C Master Bridge
> +
> +supported family codes:
> + W1_FAMILY_DS28E17 0x19
> +
> +Author: Jan Kandziora 
> +
> +
> +Description
> +---
> +The DS28E17 is a Onewire slave device which acts as an I2C bus master.
> +
> +This driver creates a new I2C bus for any DS28E17 device detected. I2C buses
> +come and go as the DS28E17 devices come and go. I2C slave devices connected 
> to
> +a DS28E17 can be accessed by the kernel or userspace tools as if they were
> +connected to a "native" I2C bus master.
> +
> +
> +An udev rule like the following
> +---
> +SUBSYSTEM=="i2c-dev", KERNEL=="i2c-[0-9]*", ATTRS{name}=="w1-19-*", \
> + SYMLINK+="i2c-$attr{name}"
> +---
> +may be used to create stable /dev/i2c- entries based on the unique id of the
> +DS28E17 chip.
> +
> +
> +Driver parameters are:
> +
> +speed:
> + This sets up the default I2C speed a DS28E17 get configured for as soon
> + it is connected. The power-on default of the DS28E17 is 400kBaud, but
> + chips may come and go on the Onewire bus without being de-powered and
> + as soon the "w1_ds28e17" driver notices a freshly connected, or
> + reconnected DS28E17 device on the Onewire bus, it will re-apply this
> + setting.
> +
> + Valid values are 100, 400, 900 [kBaud]. Any other value means to leave
> + alone the 

[PATCH v4 2/2] add w1_ds28e17 driver for the DS28E17 Onewire to I2C master bridge

2017-07-19 Thread Jan Kandziora
This subpatch adds a driver for the DS28E17 Onewire to I2C master bridge.

Signed-off-by: Jan Kandziora 
---
Changes in v4 against v3 in this subpatch:
  - adapted to linux-4.12.0

Changes in v3 against v2 in this subpatch:
  - fixed a bug in using the i2c_adapter_quirks structure

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

 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 ++
 drivers/w1/w1_family.h|   1 +
 7 files changed, 880 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

diff --git a/Documentation/ABI/testing/sysfs-driver-w1_ds28e17 
b/Documentation/ABI/testing/sysfs-driver-w1_ds28e17
new file mode 100644
index 000..b97b101
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-driver-w1_ds28e17
@@ -0,0 +1,21 @@
+What:  /sys/bus/w1/devices/19-/speed
+Date:  Jul 2016
+KernelVersion: 4.7
+Contact:   Jan Kandziora 
+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-/stretch
+Date:  Jul 2016
+KernelVersion: 4.7
+Contact:   Jan Kandziora 
+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
diff --git a/Documentation/w1/slaves/00-INDEX b/Documentation/w1/slaves/00-INDEX
index 8d76718..68946f8 100644
--- a/Documentation/w1/slaves/00-INDEX
+++ b/Documentation/w1/slaves/00-INDEX
@@ -10,3 +10,5 @@ w1_ds2438
- The Maxim/Dallas Semiconductor ds2438 smart battery monitor.
 w1_ds28e04
- The Maxim/Dallas Semiconductor ds28e04 eeprom.
+w1_ds28e17
+   - The Maxim/Dallas Semiconductor ds28e17 1-Wire-to-I2C Master Bridge.
diff --git a/Documentation/w1/slaves/w1_ds28e17 
b/Documentation/w1/slaves/w1_ds28e17
new file mode 100644
index 000..e82e16e
--- /dev/null
+++ b/Documentation/w1/slaves/w1_ds28e17
@@ -0,0 +1,68 @@
+Kernel driver w1_ds28e17
+
+
+Supported chips:
+  * Maxim DS28E17 1-Wire-to-I2C Master Bridge
+
+supported family codes:
+   W1_FAMILY_DS28E17   0x19
+
+Author: Jan Kandziora 
+
+
+Description
+---
+The DS28E17 is a Onewire slave device which acts as an I2C bus master.
+
+This driver creates a new I2C bus for any DS28E17 device detected. I2C buses
+come and go as the DS28E17 devices come and go. I2C slave devices connected to
+a DS28E17 can be accessed by the kernel or userspace tools as if they were
+connected to a "native" I2C bus master.
+
+
+An udev rule like the following
+---
+SUBSYSTEM=="i2c-dev", KERNEL=="i2c-[0-9]*", ATTRS{name}=="w1-19-*", \
+SYMLINK+="i2c-$attr{name}"
+---
+may be used to create stable /dev/i2c- entries based on the unique id of the
+DS28E17 chip.
+
+
+Driver parameters are:
+
+speed:
+   This sets up the default I2C speed a DS28E17 get configured for as soon
+   it is connected. The power-on default   of the DS28E17 is 400kBaud, but
+   chips may come and go on the Onewire bus without being de-powered and
+   as soon the "w1_ds28e17" driver notices a freshly connected, or
+   reconnected DS28E17 device on the Onewire bus, it will re-apply this
+   setting.
+
+   Valid values are 100, 400, 900 [kBaud]. Any other value means to leave
+   alone the current DS28E17 setting on detect. 

[PATCH v4 2/2] add w1_ds28e17 driver for the DS28E17 Onewire to I2C master bridge

2017-07-19 Thread Jan Kandziora
This subpatch adds a driver for the DS28E17 Onewire to I2C master bridge.

Signed-off-by: Jan Kandziora 
---
Changes in v4 against v3 in this subpatch:
  - adapted to linux-4.12.0

Changes in v3 against v2 in this subpatch:
  - fixed a bug in using the i2c_adapter_quirks structure

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

 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 ++
 drivers/w1/w1_family.h|   1 +
 7 files changed, 880 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

diff --git a/Documentation/ABI/testing/sysfs-driver-w1_ds28e17 
b/Documentation/ABI/testing/sysfs-driver-w1_ds28e17
new file mode 100644
index 000..b97b101
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-driver-w1_ds28e17
@@ -0,0 +1,21 @@
+What:  /sys/bus/w1/devices/19-/speed
+Date:  Jul 2016
+KernelVersion: 4.7
+Contact:   Jan Kandziora 
+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-/stretch
+Date:  Jul 2016
+KernelVersion: 4.7
+Contact:   Jan Kandziora 
+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
diff --git a/Documentation/w1/slaves/00-INDEX b/Documentation/w1/slaves/00-INDEX
index 8d76718..68946f8 100644
--- a/Documentation/w1/slaves/00-INDEX
+++ b/Documentation/w1/slaves/00-INDEX
@@ -10,3 +10,5 @@ w1_ds2438
- The Maxim/Dallas Semiconductor ds2438 smart battery monitor.
 w1_ds28e04
- The Maxim/Dallas Semiconductor ds28e04 eeprom.
+w1_ds28e17
+   - The Maxim/Dallas Semiconductor ds28e17 1-Wire-to-I2C Master Bridge.
diff --git a/Documentation/w1/slaves/w1_ds28e17 
b/Documentation/w1/slaves/w1_ds28e17
new file mode 100644
index 000..e82e16e
--- /dev/null
+++ b/Documentation/w1/slaves/w1_ds28e17
@@ -0,0 +1,68 @@
+Kernel driver w1_ds28e17
+
+
+Supported chips:
+  * Maxim DS28E17 1-Wire-to-I2C Master Bridge
+
+supported family codes:
+   W1_FAMILY_DS28E17   0x19
+
+Author: Jan Kandziora 
+
+
+Description
+---
+The DS28E17 is a Onewire slave device which acts as an I2C bus master.
+
+This driver creates a new I2C bus for any DS28E17 device detected. I2C buses
+come and go as the DS28E17 devices come and go. I2C slave devices connected to
+a DS28E17 can be accessed by the kernel or userspace tools as if they were
+connected to a "native" I2C bus master.
+
+
+An udev rule like the following
+---
+SUBSYSTEM=="i2c-dev", KERNEL=="i2c-[0-9]*", ATTRS{name}=="w1-19-*", \
+SYMLINK+="i2c-$attr{name}"
+---
+may be used to create stable /dev/i2c- entries based on the unique id of the
+DS28E17 chip.
+
+
+Driver parameters are:
+
+speed:
+   This sets up the default I2C speed a DS28E17 get configured for as soon
+   it is connected. The power-on default   of the DS28E17 is 400kBaud, but
+   chips may come and go on the Onewire bus without being de-powered and
+   as soon the "w1_ds28e17" driver notices a freshly connected, or
+   reconnected DS28E17 device on the Onewire bus, it will re-apply this
+   setting.
+
+   Valid values are 100, 400, 900 [kBaud]. Any other value means to leave
+   alone the current DS28E17 setting on detect. The default value is 100.
+
+stretch:
+   This 

[PATCH v4 2/2] add w1_ds28e17 driver for the DS28E17 Onewire to I2C master bridge

2017-07-10 Thread Jan Kandziora
Changes in v4 against v3 in this subpatch:
  - adapted to linux-4.12.0

Changes in v3 against v2 in this subpatch:
  - fixed a bug in using the i2c_adapter_quirks structure

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.

Signed-off-by: Jan Kandziora 
---
>From a3f8a7738db6dcd38e3d89f5ab20378cdb20d002 Mon Sep 17 00:00:00 2001
From: Jan Kandziora 
Date: Mon, 10 Jul 2017 23:54:03 +0200
Subject: [PATCH 2/2] add w1_ds28e17 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 ++
 drivers/w1/w1_family.h|   1 +
 7 files changed, 880 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

diff --git a/Documentation/ABI/testing/sysfs-driver-w1_ds28e17 
b/Documentation/ABI/testing/sysfs-driver-w1_ds28e17
new file mode 100644
index 000..b97b101
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-driver-w1_ds28e17
@@ -0,0 +1,21 @@
+What:  /sys/bus/w1/devices/19-/speed
+Date:  Jul 2016
+KernelVersion: 4.7
+Contact:   Jan Kandziora 
+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-/stretch
+Date:  Jul 2016
+KernelVersion: 4.7
+Contact:   Jan Kandziora 
+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
diff --git a/Documentation/w1/slaves/00-INDEX b/Documentation/w1/slaves/00-INDEX
index 8d76718..68946f8 100644
--- a/Documentation/w1/slaves/00-INDEX
+++ b/Documentation/w1/slaves/00-INDEX
@@ -10,3 +10,5 @@ w1_ds2438
- The Maxim/Dallas Semiconductor ds2438 smart battery monitor.
 w1_ds28e04
- The Maxim/Dallas Semiconductor ds28e04 eeprom.
+w1_ds28e17
+   - The Maxim/Dallas Semiconductor ds28e17 1-Wire-to-I2C Master Bridge.
diff --git a/Documentation/w1/slaves/w1_ds28e17 
b/Documentation/w1/slaves/w1_ds28e17
new file mode 100644
index 000..e82e16e
--- /dev/null
+++ b/Documentation/w1/slaves/w1_ds28e17
@@ -0,0 +1,68 @@
+Kernel driver w1_ds28e17
+
+
+Supported chips:
+  * Maxim DS28E17 1-Wire-to-I2C Master Bridge
+
+supported family codes:
+   W1_FAMILY_DS28E17   0x19
+
+Author: Jan Kandziora 
+
+
+Description
+---
+The DS28E17 is a Onewire slave device which acts as an I2C bus master.
+
+This driver creates a new I2C bus for any DS28E17 device detected. I2C buses
+come and go as the DS28E17 devices come and go. I2C slave devices connected to
+a DS28E17 can be accessed by the kernel or userspace tools as if they were
+connected to a "native" I2C bus master.
+
+
+An udev rule like the following
+---
+SUBSYSTEM=="i2c-dev", KERNEL=="i2c-[0-9]*", ATTRS{name}=="w1-19-*", \
+SYMLINK+="i2c-$attr{name}"
+---
+may be used to create stable /dev/i2c- entries based on the unique id of the
+DS28E17 chip.
+
+
+Driver parameters are:
+
+speed:
+   This sets up the default I2C speed a DS28E17 get configured for as soon
+   it is connected. The power-on default   of the DS28E17 is 400kBaud, but
+   chips may come and go on the Onewire bus without being de-powered and
+   as soon the "w1_ds28e17" driver notices a freshly 

[PATCH v4 2/2] add w1_ds28e17 driver for the DS28E17 Onewire to I2C master bridge

2017-07-10 Thread Jan Kandziora
Changes in v4 against v3 in this subpatch:
  - adapted to linux-4.12.0

Changes in v3 against v2 in this subpatch:
  - fixed a bug in using the i2c_adapter_quirks structure

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.

Signed-off-by: Jan Kandziora 
---
>From a3f8a7738db6dcd38e3d89f5ab20378cdb20d002 Mon Sep 17 00:00:00 2001
From: Jan Kandziora 
Date: Mon, 10 Jul 2017 23:54:03 +0200
Subject: [PATCH 2/2] add w1_ds28e17 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 ++
 drivers/w1/w1_family.h|   1 +
 7 files changed, 880 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

diff --git a/Documentation/ABI/testing/sysfs-driver-w1_ds28e17 
b/Documentation/ABI/testing/sysfs-driver-w1_ds28e17
new file mode 100644
index 000..b97b101
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-driver-w1_ds28e17
@@ -0,0 +1,21 @@
+What:  /sys/bus/w1/devices/19-/speed
+Date:  Jul 2016
+KernelVersion: 4.7
+Contact:   Jan Kandziora 
+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-/stretch
+Date:  Jul 2016
+KernelVersion: 4.7
+Contact:   Jan Kandziora 
+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
diff --git a/Documentation/w1/slaves/00-INDEX b/Documentation/w1/slaves/00-INDEX
index 8d76718..68946f8 100644
--- a/Documentation/w1/slaves/00-INDEX
+++ b/Documentation/w1/slaves/00-INDEX
@@ -10,3 +10,5 @@ w1_ds2438
- The Maxim/Dallas Semiconductor ds2438 smart battery monitor.
 w1_ds28e04
- The Maxim/Dallas Semiconductor ds28e04 eeprom.
+w1_ds28e17
+   - The Maxim/Dallas Semiconductor ds28e17 1-Wire-to-I2C Master Bridge.
diff --git a/Documentation/w1/slaves/w1_ds28e17 
b/Documentation/w1/slaves/w1_ds28e17
new file mode 100644
index 000..e82e16e
--- /dev/null
+++ b/Documentation/w1/slaves/w1_ds28e17
@@ -0,0 +1,68 @@
+Kernel driver w1_ds28e17
+
+
+Supported chips:
+  * Maxim DS28E17 1-Wire-to-I2C Master Bridge
+
+supported family codes:
+   W1_FAMILY_DS28E17   0x19
+
+Author: Jan Kandziora 
+
+
+Description
+---
+The DS28E17 is a Onewire slave device which acts as an I2C bus master.
+
+This driver creates a new I2C bus for any DS28E17 device detected. I2C buses
+come and go as the DS28E17 devices come and go. I2C slave devices connected to
+a DS28E17 can be accessed by the kernel or userspace tools as if they were
+connected to a "native" I2C bus master.
+
+
+An udev rule like the following
+---
+SUBSYSTEM=="i2c-dev", KERNEL=="i2c-[0-9]*", ATTRS{name}=="w1-19-*", \
+SYMLINK+="i2c-$attr{name}"
+---
+may be used to create stable /dev/i2c- entries based on the unique id of the
+DS28E17 chip.
+
+
+Driver parameters are:
+
+speed:
+   This sets up the default I2C speed a DS28E17 get configured for as soon
+   it is connected. The power-on default   of the DS28E17 is 400kBaud, but
+   chips may come and go on the Onewire bus without being de-powered and
+   as soon the "w1_ds28e17" driver notices a freshly connected, or
+   reconnected DS28E17 device on the Onewire bus,