1. 19 May, 2020 28 commits
  2. 17 May, 2020 9 commits
  3. 15 May, 2020 3 commits
    • Akira Shimahara's avatar
      w1_therm: adding bulk read support to trigger multiple conversion on bus · 57c76221
      Akira Shimahara authored
      Adding bulk read support:
      Sending a 'trigger' command in the dedicated sysfs entry of bus master
      device send a conversion command for all the slaves on the bus. The sysfs
      entry is added as soon as at least one device supporting this feature
      is detected on the bus.
      
      The behavior of the sysfs reading temperature on the device is as follow:
       * If no bulk read pending, trigger a conversion on the device, wait for
       the conversion to be done, read the temperature in device RAM
       * If a bulk read has been trigger, access directly the device RAM
      This behavior is the same on the 2 sysfs entries ('temperature' and
      'w1_slave').
      
      Reading the therm_bulk_read sysfs give the status of bulk operations:
       * '-1': conversion in progress on at least 1 sensor
       * '1': conversion complete but at least one sensor has not been read yet
       * '0': no bulk operation. Reading temperature on ecah device will trigger
      a conversion
      
      As not all devices support bulk read feature, it has been added in device
      family structure.
      
      The attribute is set at master level as soon as a supporting device is
      discover. It is removed when the last supported device leave the bus.
      The count of supported device is kept with the static counter
      bulk_read_device_counter.
      
      A strong pull up is apply on the line if at least one device required it.
      The duration of the pull up is the max time required by a device on the
      line, which depends on the resolution settings of each device. The strong
      pull up could be adjust with the a module parameter.
      
      Updating documentation in Documentation/ABI/testing/sysfs-driver-w1_therm
      and Documentation/w1/slaves/w1_therm.rst accordingly.
      Signed-off-by: default avatarAkira Shimahara <akira215corp@gmail.com>
      Link: https://lore.kernel.org/r/20200511203820.411483-1-akira215corp@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      57c76221
    • Akira Shimahara's avatar
      w1_therm: adding alarm sysfs entry · e2c94d6f
      Akira Shimahara authored
      Adding device alarms settings by a dedicated sysfs entry alarms (RW):
      read or write TH and TL in the device RAM. Checking devices in alarm
      state could be performed using the master search command.
      
      As alarms temperature level are store in a 8 bit register on the device
      and are signed values, a safe cast shall be performed using the min and
      max temperature that device are able to measure. This is done by
      int_to_short inline function.
      
      A 'write_data' field is added in the device structure, to bind the
      correct writing function, as some devices may have 2 or 3 bytes RAM.
      
      Updating Documentation/ABI/testing/sysfs-driver-w1_therm accordingly.
      Signed-off-by: default avatarAkira Shimahara <akira215corp@gmail.com>
      Link: https://lore.kernel.org/r/20200511203801.411253-1-akira215corp@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e2c94d6f
    • Akira Shimahara's avatar
      w1_therm: optimizing temperature read timings · 67b392f7
      Akira Shimahara authored
      Optimizing temperature reading by reducing waiting conversion time
      according to device resolution settings, as per device specification.
      This is device dependent as not all the devices supports resolution
      setting, so it has been added in device family structures.
      
      The process to read the temperature on the device has been adapted in a
      new function 'convert_t()', which replace the former 'read_therm()', is
      introduce to deal with this timing. Strong pull up is also applied during
      the required time, according to device power status needs and
      'strong_pullup' module parameter.
      
      'temperature_from_RAM()' function is introduced to get the correct
      temperature computation (device dependent) from device RAM data.
      
      An new sysfs entry has been added to ouptut only temperature. The old
      entry w1_slave has been kept for compatibility, without changing its
      output format.
      
      Updating Documentation/ABI/testing/sysfs-driver-w1_therm accordingly.
      Signed-off-by: default avatarAkira Shimahara <akira215corp@gmail.com>
      Link: https://lore.kernel.org/r/20200511203742.411039-1-akira215corp@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      67b392f7