summaryrefslogtreecommitdiff
path: root/drivers/pnp/resource.c
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 /drivers/pnp/resource.c
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 'drivers/pnp/resource.c')
0 files changed, 0 insertions, 0 deletions