summaryrefslogtreecommitdiff
path: root/Documentation/ABI/testing/sysfs-driver-w1_therm
diff options
context:
space:
mode:
authorAkira Shimahara <akira215corp@gmail.com>2020-05-11 23:36:50 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-05-15 17:28:59 +0300
commitb7bb6ca17a90f47c2fe2848531b5bbaf27a65ba7 (patch)
tree89033d9538960d02e369f5164246f455dfb545c0 /Documentation/ABI/testing/sysfs-driver-w1_therm
parentdaa3cfeb1971fd07b9c00ce452b3e3ff3298fa13 (diff)
downloadlinux-b7bb6ca17a90f47c2fe2848531b5bbaf27a65ba7.tar.xz
w1_therm: adding ext_power sysfs entry
Adding ext_power sysfs entry (RO). Return the power status of the device: - 0: device parasite powered - 1: device externally powered - xx: xx is kernel error The power status of each device is check when the device is discover by the bus master, in 'w1_therm_add_slave(struct w1_slave *)'. The status is stored in the device structure w1_therm_family_data so that the driver always knows the power state of each device, which could be used later to determine the required strong pull up to apply on the line. The power status is re evaluate each time the sysfs ext_power read by a user. The hardware function 'read_powermode(struct w1_slave *sl)' act just as per device specifications, sending W1_READ_PSUPPLY command on the bus, and issue a read time slot, reading only one bit. A helper function 'bool bus_mutex_lock(struct mutex *lock)' is introduced. It try to aquire the bus mutex several times (W1_THERM_MAX_TRY), waiting W1_THERM_RETRY_DELAY between two attempt. Updating Documentation/ABI/testing/sysfs-driver-w1_therm accordingly. Signed-off-by: Akira Shimahara <akira215corp@gmail.com> Link: https://lore.kernel.org/r/20200511203650.410439-1-akira215corp@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'Documentation/ABI/testing/sysfs-driver-w1_therm')
-rw-r--r--Documentation/ABI/testing/sysfs-driver-w1_therm12
1 files changed, 12 insertions, 0 deletions
diff --git a/Documentation/ABI/testing/sysfs-driver-w1_therm b/Documentation/ABI/testing/sysfs-driver-w1_therm
index 4a856631aaf9..99d73eeee3db 100644
--- a/Documentation/ABI/testing/sysfs-driver-w1_therm
+++ b/Documentation/ABI/testing/sysfs-driver-w1_therm
@@ -1,3 +1,15 @@
+What: /sys/bus/w1/devices/.../ext_power
+Date: May 2020
+Contact: Akira Shimahara <akira215corp@gmail.com>
+Description:
+ (RO) return the power status by asking the device
+ * '0': device parasite powered
+ * '1': device externally powered
+ * '-xx': xx is kernel error when reading power status
+Users: any user space application which wants to communicate with
+ w1_term device
+
+
What: /sys/bus/w1/devices/.../w1_slave
Date: May 2020
Contact: Akira Shimahara <akira215corp@gmail.com>