<feed xmlns='http://www.w3.org/2005/Atom'>
<title>lwn.git/drivers/w1, branch docs-5.13</title>
<subtitle>Linux kernel documentation tree maintained by Jonathan Corbet</subtitle>
<id>http://mirrors.hust.edu.cn/git/lwn.git/atom?h=docs-5.13</id>
<link rel='self' href='http://mirrors.hust.edu.cn/git/lwn.git/atom?h=docs-5.13'/>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/'/>
<updated>2021-01-27T13:59:16+00:00</updated>
<entry>
<title>w1: w1_therm: Fix conversion result for negative temperatures</title>
<updated>2021-01-27T13:59:16+00:00</updated>
<author>
<name>Ivan Zaentsev</name>
<email>ivan.zaentsev@wirenboard.ru</email>
</author>
<published>2021-01-21T09:30:21+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=2f6055c26f1913763eabc66c7c27d0693561e966'/>
<id>urn:sha1:2f6055c26f1913763eabc66c7c27d0693561e966</id>
<content type='text'>
DS18B20 device driver returns an incorrect value for negative temperatures
due to a missing sign-extension in w1_DS18B20_convert_temp().

Fix by using s16 temperature value when converting to int.

Fixes: 9ace0b4dab1c (w1: w1_therm: Add support for GXCAS GX20MH01 device.)
Cc: stable &lt;stable@vger.kernel.org&gt;
Reported-by: Paweł Marciniak &lt;sunwire@gmail.com&gt;
Signed-off-by: Ivan Zaentsev &lt;ivan.zaentsev@wirenboard.ru&gt;
Link: https://lore.kernel.org/r/20210121093021.224764-1-ivan.zaentsev@wirenboard.ru
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>w1/masters/ds2490: queue up found IDs during scan</title>
<updated>2021-01-20T17:50:21+00:00</updated>
<author>
<name>Christian Vogel</name>
<email>vogelchr@vogel.cx</email>
</author>
<published>2021-01-13T19:50:18+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=e3fe0e89fec6965342434e7acae7ed6e6f021d08'/>
<id>urn:sha1:e3fe0e89fec6965342434e7acae7ed6e6f021d08</id>
<content type='text'>
Queue up found IDs in a buffer and run the callback once for each found ID
at the end. This is necessary because we hold the bus_mutex during the
whole scan, and some of the "add-device" callbacks deadlock as they
themselves want to mutex_lock(bus_mutex).

Acked-by: Evgeniy Polyakov &lt;zbr@ioremap.net&gt;
Signed-off-by: Christian Vogel &lt;vogelchr@vogel.cx&gt;
Link: https://lore.kernel.org/r/20210113195018.7498-3-vogelchr@vogel.cx
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>w1/w1.c: w1 address crc quick for DS28E04 eeproms</title>
<updated>2021-01-20T17:50:21+00:00</updated>
<author>
<name>Christian Vogel</name>
<email>vogelchr@vogel.cx</email>
</author>
<published>2021-01-13T19:50:17+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=48b7de6687f6ed597ef7162151f1c35469775545'/>
<id>urn:sha1:48b7de6687f6ed597ef7162151f1c35469775545</id>
<content type='text'>
Onewire addresses are 64bit family(8bit), unique_id(48bit), crc(8bit)
(LSBt to MSB) and self-consistent: crc = crc8(family, unique).

DS28E04-100 4096-Bit Addressable 1-Wire EEPROM with PIO have strap pins
to set 7 LSB of the address, unfortunately without updating the crc
part of the address. It is only consistent if all strap pins float high.
[see datasheet 19-6134; Rev 12/11 page 6: 64-bit device id number]

We therefore introduce a special handling of family 0x1c (DS28E04) to
check address consistency with 7 LSBs of the unique_id set to 1.

Acked-by: Evgeniy Polyakov &lt;zbr@ioremap.net&gt;
Signed-off-by: Christian Vogel &lt;vogelchr@vogel.cx&gt;
Link: https://lore.kernel.org/r/20210113195018.7498-2-vogelchr@vogel.cx
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>w1: w1_therm: Rename conflicting sysfs attribute 'eeprom' to 'eeprom_cmd'</title>
<updated>2020-11-12T07:50:13+00:00</updated>
<author>
<name>Ivan Zaentsev</name>
<email>ivan.zaentsev@wirenboard.ru</email>
</author>
<published>2020-11-12T06:49:31+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=439e8f6f1e5d1ca973da278499078e213dad63bb'/>
<id>urn:sha1:439e8f6f1e5d1ca973da278499078e213dad63bb</id>
<content type='text'>
Duplicate attribute 'eeprom' is defined in:
1) Documentation/ABI/testing/sysfs-driver-w1_therm
2) Documentation/ABI/stable/sysfs-driver-w1_ds28e04

Both drivers define an attribute: /sys/bus/w1/devices/.../eeprom
with conflicting behavior.

Fix by renaming the newer one in w1_therm.c to 'eeprom_cmd'.

Reported-by: Mauro Carvalho Chehab &lt;mchehab+huawei@kernel.org&gt;
Suggested-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Link: https://lore.kernel.org/lkml/20201029152845.6bbb39ce@coco.lan/
Signed-off-by: Ivan Zaentsev &lt;ivan.zaentsev@wirenboard.ru&gt;
Link: https://lore.kernel.org/r/20201112064931.8471-1-ivan.zaentsev@wirenboard.ru
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>w1: w1_therm: make w1_poll_completion static</title>
<updated>2020-10-05T12:49:24+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2020-10-05T12:37:03+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=05dbb62853351cd90a538bff213aacc070dc1550'/>
<id>urn:sha1:05dbb62853351cd90a538bff213aacc070dc1550</id>
<content type='text'>
kernel test robot rightly points out that w1_poll_completion() should be
static, so mark it as such.

Cc: Ivan Zaentsev &lt;ivan.zaentsev@wirenboard.ru&gt;
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Link: https://lore.kernel.org/r/20201005123703.GA800532@kroah.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>w1: Constify static w1_family_ops structs</title>
<updated>2020-10-05T11:21:49+00:00</updated>
<author>
<name>Rikard Falkeborn</name>
<email>rikard.falkeborn@gmail.com</email>
</author>
<published>2020-10-04T19:32:01+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=57de2dfcabba91daedd66ac006b71734983975d6'/>
<id>urn:sha1:57de2dfcabba91daedd66ac006b71734983975d6</id>
<content type='text'>
The only usage of these structs is to assign their address to the fops
field in the w1_family struct, which is a const pointer. Make them const
to allow the compiler to put them in read-only memory.

This was done with the following Coccinelle semantic patch
(http://coccinelle.lip6.fr/):

// &lt;smpl&gt;
@r1 disable optional_qualifier @
identifier i;
position p;
@@
static struct w1_family_ops i@p = {...};

@ok1@
identifier r1.i;
position p;
identifier s;
@@
static struct w1_family s = {
	.fops=&amp;i@p,
};

@bad1@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i@p

@depends on !bad1 disable optional_qualifier@
identifier r1.i;
@@
static
+const
struct w1_family_ops i={};
// &lt;/smpl&gt;

Signed-off-by: Rikard Falkeborn &lt;rikard.falkeborn@gmail.com&gt;
Link: https://lore.kernel.org/r/20201004193202.4044-3-rikard.falkeborn@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>w1: Constify struct w1_family_ops</title>
<updated>2020-10-05T11:21:49+00:00</updated>
<author>
<name>Rikard Falkeborn</name>
<email>rikard.falkeborn@gmail.com</email>
</author>
<published>2020-10-04T19:32:00+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=07f8569fbe44f35e53c7a5946fbb348432c68377'/>
<id>urn:sha1:07f8569fbe44f35e53c7a5946fbb348432c68377</id>
<content type='text'>
The fops field in the w1_family struct is never modified. Make it const
to indicate that. Constifying the pointer makes it possible for drivers
to declare static w1_family_ops structs const, which in turn will allow
the compiler to put it in read-only memory.

Reviewed-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
Signed-off-by: Rikard Falkeborn &lt;rikard.falkeborn@gmail.com&gt;
Link: https://lore.kernel.org/r/20201004193202.4044-2-rikard.falkeborn@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>w1: mxc_w1: Fix timeout resolution problem leading to bus error</title>
<updated>2020-10-02T13:53:25+00:00</updated>
<author>
<name>Martin Fuzzey</name>
<email>martin.fuzzey@flowbird.group</email>
</author>
<published>2020-09-30T08:36:46+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=c9723750a699c3bd465493ac2be8992b72ccb105'/>
<id>urn:sha1:c9723750a699c3bd465493ac2be8992b72ccb105</id>
<content type='text'>
On my platform (i.MX53) bus access sometimes fails with
	w1_search: max_slave_count 64 reached, will continue next search.

The reason is the use of jiffies to implement a 200us timeout in
mxc_w1_ds2_touch_bit().
On some platforms the jiffies timer resolution is insufficient for this.

Fix by replacing jiffies by ktime_get().

For consistency apply the same change to the other use of jiffies in
mxc_w1_ds2_reset_bus().

Fixes: f80b2581a706 ("w1: mxc_w1: Optimize mxc_w1_ds2_touch_bit()")
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Martin Fuzzey &lt;martin.fuzzey@flowbird.group&gt;
Link: https://lore.kernel.org/r/1601455030-6607-1-git-send-email-martin.fuzzey@flowbird.group
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>w1: w1_therm: Add support for GXCAS GX20MH01 device.</title>
<updated>2020-10-02T09:49:54+00:00</updated>
<author>
<name>Ivan Zaentsev</name>
<email>ivan.zaentsev@wirenboard.ru</email>
</author>
<published>2020-09-04T16:00:04+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=9ace0b4dab1c3913810c50948d714afcbd2c767e'/>
<id>urn:sha1:9ace0b4dab1c3913810c50948d714afcbd2c767e</id>
<content type='text'>
GX20MH01 device shares family number 0x28 with DS18B20. The device
is generally compatible with DS18B20. Added are the lowest 2^-5, 2^-6
temperature bits in Config register; R2 bit in Config register
enabling 13 and 14 bit resolutions. It is powered up in 14 bit mode.

Signed-off-by: Ivan Zaentsev &lt;ivan.zaentsev@wirenboard.ru&gt;
Link: https://lore.kernel.org/r/20200904160004.87710-2-ivan.zaentsev@wirenboard.ru
Acked-by: Evgeniy Polyakov &lt;zbr@ioremap.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>w1: w1_therm: Add sysfs entries to control conversion time and driver features</title>
<updated>2020-10-02T09:49:50+00:00</updated>
<author>
<name>Ivan Zaentsev</name>
<email>ivan.zaentsev@wirenboard.ru</email>
</author>
<published>2020-09-04T16:00:03+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=021da53e65fdd0e1b8492c2670dd075c0ea910fc'/>
<id>urn:sha1:021da53e65fdd0e1b8492c2670dd075c0ea910fc</id>
<content type='text'>
The conversion time of common DS18B20 clones deviates from
datasheet specs. Allow adjustment and automatic measure of the
conversion time.

Add 'conv_time' sysfs attribute:
  *read*: Current conversion time in milliseconds.
  *write*:
     '0': Set default conversion time.
     '1': Measure and set the conversion time. Make a
          single temperature conversion, poll and measure
          an actual value. Measured value is increased
          by 20% for temperature drift. A new conversion
          time is returned by reading the same attribute.
     other positive value:
        Set the conversion time in milliseconds.

The setting is active until a resolution change. Then it is reset to
default conversion time for a new resolution.

Add 'features' sysfs attribute to control optional driver settings
per device. Bit masks to read/write (logical OR):
  1: Enable check for conversion success. If byte 6 of
     scratchpad memory is 0xC after conversion, and
     temperature reads 85.00 (powerup value) or 127.94
     (insufficient power) - return a conversion error.

  2: Enable poll for conversion completion. Generate read cycles
     after the conversion start and wait for 1's. In parasite
     power mode this feature is not available.

There are some clones of DS18B20 with fixed 12 bit resolution. Make the
driver verify the resolution by reading back the device after resolution
change.

Signed-off-by: Ivan Zaentsev &lt;ivan.zaentsev@wirenboard.ru&gt;
Acked-by: Evgeniy Polyakov &lt;zbr@ioremap.net&gt;
Link: https://lore.kernel.org/r/20200904160004.87710-1-ivan.zaentsev@wirenboard.ru
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
