162306a36Sopenharmony_ci======================== 262306a36Sopenharmony_ciKernel driver w1_ds28e17 362306a36Sopenharmony_ci======================== 462306a36Sopenharmony_ci 562306a36Sopenharmony_ciSupported chips: 662306a36Sopenharmony_ci 762306a36Sopenharmony_ci * Maxim DS28E17 1-Wire-to-I2C Master Bridge 862306a36Sopenharmony_ci 962306a36Sopenharmony_cisupported family codes: 1062306a36Sopenharmony_ci 1162306a36Sopenharmony_ci ================= ==== 1262306a36Sopenharmony_ci W1_FAMILY_DS28E17 0x19 1362306a36Sopenharmony_ci ================= ==== 1462306a36Sopenharmony_ci 1562306a36Sopenharmony_ciAuthor: Jan Kandziora <jjj@gmx.de> 1662306a36Sopenharmony_ci 1762306a36Sopenharmony_ci 1862306a36Sopenharmony_ciDescription 1962306a36Sopenharmony_ci----------- 2062306a36Sopenharmony_ciThe DS28E17 is a Onewire slave device which acts as an I2C bus master. 2162306a36Sopenharmony_ci 2262306a36Sopenharmony_ciThis driver creates a new I2C bus for any DS28E17 device detected. I2C buses 2362306a36Sopenharmony_cicome and go as the DS28E17 devices come and go. I2C slave devices connected to 2462306a36Sopenharmony_cia DS28E17 can be accessed by the kernel or userspace tools as if they were 2562306a36Sopenharmony_ciconnected to a "native" I2C bus master. 2662306a36Sopenharmony_ci 2762306a36Sopenharmony_ci 2862306a36Sopenharmony_ciAn udev rule like the following:: 2962306a36Sopenharmony_ci 3062306a36Sopenharmony_ci SUBSYSTEM=="i2c-dev", KERNEL=="i2c-[0-9]*", ATTRS{name}=="w1-19-*", \ 3162306a36Sopenharmony_ci SYMLINK+="i2c-$attr{name}" 3262306a36Sopenharmony_ci 3362306a36Sopenharmony_cimay be used to create stable /dev/i2c- entries based on the unique id of the 3462306a36Sopenharmony_ciDS28E17 chip. 3562306a36Sopenharmony_ci 3662306a36Sopenharmony_ci 3762306a36Sopenharmony_ciDriver parameters are: 3862306a36Sopenharmony_ci 3962306a36Sopenharmony_cispeed: 4062306a36Sopenharmony_ci This sets up the default I2C speed a DS28E17 get configured for as soon 4162306a36Sopenharmony_ci it is connected. The power-on default of the DS28E17 is 400kBaud, but 4262306a36Sopenharmony_ci chips may come and go on the Onewire bus without being de-powered and 4362306a36Sopenharmony_ci as soon the "w1_ds28e17" driver notices a freshly connected, or 4462306a36Sopenharmony_ci reconnected DS28E17 device on the Onewire bus, it will re-apply this 4562306a36Sopenharmony_ci setting. 4662306a36Sopenharmony_ci 4762306a36Sopenharmony_ci Valid values are 100, 400, 900 [kBaud]. Any other value means to leave 4862306a36Sopenharmony_ci alone the current DS28E17 setting on detect. The default value is 100. 4962306a36Sopenharmony_ci 5062306a36Sopenharmony_cistretch: 5162306a36Sopenharmony_ci This sets up the default stretch value used for freshly connected 5262306a36Sopenharmony_ci DS28E17 devices. It is a multiplier used on the calculation of the busy 5362306a36Sopenharmony_ci wait time for an I2C transfer. This is to account for I2C slave devices 5462306a36Sopenharmony_ci which make heavy use of the I2C clock stretching feature and thus, the 5562306a36Sopenharmony_ci needed timeout cannot be pre-calculated correctly. As the w1_ds28e17 5662306a36Sopenharmony_ci driver checks the DS28E17's busy flag in a loop after the precalculated 5762306a36Sopenharmony_ci wait time, it should be hardly needed to tweak this setting. 5862306a36Sopenharmony_ci 5962306a36Sopenharmony_ci Leave it at 1 unless you get ETIMEDOUT errors and a "w1_slave_driver 6062306a36Sopenharmony_ci 19-00000002dbd8: busy timeout" in the kernel log. 6162306a36Sopenharmony_ci 6262306a36Sopenharmony_ci Valid values are 1 to 9. The default is 1. 6362306a36Sopenharmony_ci 6462306a36Sopenharmony_ci 6562306a36Sopenharmony_ciThe driver creates sysfs files /sys/bus/w1/devices/19-<id>/speed and 6662306a36Sopenharmony_ci/sys/bus/w1/devices/19-<id>/stretch for each device, preloaded with the default 6762306a36Sopenharmony_cisettings from the driver parameters. They may be changed anytime. In addition a 6862306a36Sopenharmony_cidirectory /sys/bus/w1/devices/19-<id>/i2c-<nnn> for the I2C bus master sysfs 6962306a36Sopenharmony_cistructure is created. 7062306a36Sopenharmony_ci 7162306a36Sopenharmony_ci 7262306a36Sopenharmony_ciSee https://github.com/ianka/w1_ds28e17 for even more information. 73