w1_therm: adding ext_power sysfs entry
PATCH v4 4/9 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.
Updating Documentation/ABI/testing/sysfs-driver-w1_therm accordingly.
--- .../ABI/testing/sysfs-driver-w1_therm | 12 +++ drivers/w1/slaves/w1_therm.c | 94 ++++++++++++++++++- drivers/w1/slaves/w1_therm.h | 43 ++++++++- 3 files changed, 146 insertions(+), 3 deletions(-)
Documentation/ABI/testing/sysfs-driver-w1_therm +12 -0
@@ -1,3 +1,15 @@ +What: /sys/bus/w1/devices/.../ext_power +Date: Apr 2020 +Contact: Akira Shimahara <[email protected]> +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: Apr 2020 Contact: Akira Shimahara <[email protected]>
drivers/w1/slaves/w1_therm.c +93 -1
136 lines not on this page · raw message
drivers/w1/slaves/w1_therm.h +41 -2
86 lines not on this page · raw message
Signature · 1 line
2.26.2