Re: [PATCH v3 2/5] w1_therm: adding sysfs entry to check device power

From: Evgeniy Polyakov
Date: Wed Apr 29 2020 - 11:21:46 EST


Hi

29.04.2020, 16:47, "Greg KH" <greg@xxxxxxxxx>:

>> Â+What: /sys/bus/w1/devices/.../w1_slave
>> Â+Date: Apr 2020
>> Â+Contact: Akira Shimahara <akira215corp@xxxxxxxxx>
>> Â+Description:
>> Â+ (RW) return the temperature in 1/1000 degC.
>> Â+ *read*: return 2 lines with the hexa output data sent on the
>> Â+ bus, return the CRC check and temperature in 1/1000 degC
>
> the w1_slave file returns a temperature???
>
> And sysfs is 1 value-per-file, not multiple lines.

It was 'content crc' previously, and probably a good idea would be to add just one file with 'content'

> And as this is a temperature, what's wrong with the iio interface that
> handles temperature already? Don't go making up new userspace apis when
> we already have good ones today :)

What is that?
w1 always had a sysfs files for its contents whether it is converted temperature or raw bytes data,
there is also netlink interface which is there since the day one.

>> Â+ *write* :
>> Â+ * `0` : save the 2 or 3 bytes to the device EEPROM
>> Â+ (i.e. TH, TL and config register)
>> Â+ * `9..12` : set the device resolution in RAM
>> Â+ (if supported)
>
> I don't understand these write values, how do they match up to a
> temperature readin?

You kind of writing to device about how to convert its raw content into readable content, which will eventually become a temperature