Skip to content
Permalink
Grzegorz-Jaszc…
Switch branches/tags

Commits on Jun 16, 2021

  1. watchdog: imx2_wdg: notify wdog subsystem about wdog suspend/resume

    Suspend routine disables wdog clk. Nevertheless, the watchdog subsystem
    is not aware of that and can still try to ping wdog through
    watchdog_ping_work. In order to prevent such condition and therefore
    prevent from system hang (caused by the wdog register access issued
    while the wdog clock is disabled) take advantage of
    watchdog_dev_suspend/resume routines which will take care of watchdog
    ping worker cancel and restore.
    
    Additionally remove hw ping from suspend/resume since it will be
    issued by watchdog_dev_suspend/resume routines.
    
    Signed-off-by: Michal Koziel <michal.koziel@emlogic.no>
    Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
    Grzegorz-J authored and intel-lab-lkp committed Jun 16, 2021
  2. watchdog: introduce watchdog_dev_suspend/resume

    The watchdog drivers often disable wdog clock during suspend and then
    enable it again during resume. Nevertheless the ping worker is still
    running and can issue low-level ping while the wdog clock is disabled
    causing the system hang. To prevent such condition introduce
    watchdog_dev_suspend/resume which can be used by any wdog driver and
    actually cancel ping worker during suspend and restore it back, if
    needed, during resume.
    
    Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
    Grzegorz-J authored and intel-lab-lkp committed Jun 16, 2021

Commits on Jun 14, 2021

  1. hwmon: (ntc_thermistor) Drop unused headers.

    The IIO usage in this driver is purely consumer so it should only
    be including linux/iio/consumer.h  Whilst here drop pm_runtime.h
    as there is no runtime power management in the driver.
    
    Found using include-what-you-use and manual inspection of the
    suggestions.
    
    Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
    Cc: Guenter Roeck <linux@roeck-us.net>
    Link: https://lore.kernel.org/r/20210611142257.103094-1-jic23@kernel.org
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    jic23 authored and groeck committed Jun 14, 2021
  2. MAINTAINERS: Add Delta DPS920AB PSU driver

    Add maintainers entry for the Delta DPS920AB PSU driver.
    
    Signed-off-by: Robert Marko <robert.marko@sartura.hr>
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    robimarko authored and groeck committed Jun 14, 2021
  3. dt-bindings: trivial-devices: Add Delta DPS920AB

    Add trivial device entry for Delta DPS920AB PSU.
    
    Signed-off-by: Robert Marko <robert.marko@sartura.hr>
    Link: https://lore.kernel.org/r/20210607103431.2039073-2-robert.marko@sartura.hr
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    robimarko authored and groeck committed Jun 14, 2021
  4. hwmon: (pmbus) Add driver for Delta DPS-920AB PSU

    This adds support for the Delta DPS-920AB PSU.
    
    Only missing feature is fan control which the PSU supports.
    
    Signed-off-by: Robert Marko <robert.marko@sartura.hr>
    Link: https://lore.kernel.org/r/20210607103431.2039073-1-robert.marko@sartura.hr
    [groeck: Add MODULE_IMPORT_NS(PMBUS);]
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    robimarko authored and groeck committed Jun 14, 2021
  5. hwmon: (pmbus/pim4328) Add documentation for the pim4328 PMBus driver

    Add documentation and index link for pim4328 PMBus driver.
    
    Signed-off-by: Erik Rosen <erik.rosen@metormote.com>
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    metormote authored and groeck committed Jun 14, 2021
  6. hwmon: (pmbus/pim4328) Add PMBus driver for PIM4006, PIM4328 and PIM4820

    Add hardware monitoring support for Flex power interface modules PIM4006,
    PIM4328 and PIM4820.
    
    Signed-off-by: Erik Rosen <erik.rosen@metormote.com>
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    metormote authored and groeck committed Jun 14, 2021
  7. hwmon: (pmbus) Allow phase function even if it's not on page

    Allow the use of a phase function even if it does not exist on
    the associated page.
    
    Signed-off-by: Erik Rosen <erik.rosen@metormote.com>
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    metormote authored and groeck committed Jun 14, 2021
  8. hwmon: (pmbus) Add support for reading direct mode coefficients

    Add support for reading and decoding direct format coefficients to
    the PMBus core driver. If the new flag PMBUS_USE_COEFFICIENTS_CMD
    is set, the driver will use the COEFFICIENTS register together with
    the information in the pmbus_sensor_attr structs to initialize
    relevant coefficients for the direct mode format.
    
    Signed-off-by: Erik Rosen <erik.rosen@metormote.com>
    [groeck: Initialize ret with -EINVAL in pmbus_init_coefficients()]
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    metormote authored and groeck committed Jun 14, 2021
  9. hwmon: (pmbus) Add new pmbus flag NO_WRITE_PROTECT

    Some PMBus chips respond with invalid data when reading the WRITE_PROTECT
    register. For such chips, this flag should be set so that the PMBus core
    driver doesn't use the WRITE_PROTECT command to determine its behavior.
    
    Signed-off-by: Erik Rosen <erik.rosen@metormote.com>
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    metormote authored and groeck committed Jun 14, 2021
  10. docs: hwmon: adm1177.rst: avoid using ReSt :doc:foo markup

    The :doc:`foo` tag is auto-generated via automarkup.py.
    So, use the filename at the sources, instead of :doc:`foo`.
    
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
    Link: https://lore.kernel.org/r/32b0db7e79a3ed0e817213113c607a1b819e3867.1622898327.git.mchehab+huawei@kernel.org
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    mchehab authored and groeck committed Jun 14, 2021
  11. hwmon: (pmbus_core) Check adapter PEC support

    Currently, for Packet Error Checking (PEC) only the controller
    is checked for support. This causes problems on the cisco-8000
    platform where a SMBUS transaction errors are observed. This is
    because PEC has to be enabled only if both controller and
    adapter support it.
    
    Added code to check PEC capability for adapter and enable it
    only if both controller and adapter supports PEC.
    
    Signed-off-by: Madhava Reddy Siddareddygari <msiddare@cisco.com>
    [Upstream from SONiC sonic-net/sonic-linux-kernel#215]
    Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
    Link: https://lore.kernel.org/r/20210605052700.541455-1-pmenzel@molgen.mpg.de
    [groeck: Dropped unnecessary continuation line]
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    msiddare authored and groeck committed Jun 14, 2021
  12. hwmon: (ina3221) use CVRF only for single-shot conversion

    As per current logic the wait time per conversion is arouns 430ms
    for 512 samples and around 860ms for 1024 samples for 3 channels
    considering 140us as the bus voltage and shunt voltage sampling
    conversion time.
    
    This waiting time is a lot for the continuous mode and even for
    the single shot mode. For continuous mode when moving average is
    considered the waiting for CVRF bit is not required and the data
    from the previous conversion is sufficuent. As mentioned in the
    datasheet the conversion ready bit is provided to help coordinate
    single-shot conversions, we can restrict the use to single-shot
    mode only.
    
    Also, the conversion time is for the averaged samples, the wait
    time for the polling can omit the number of samples consideration.
    
    Signed-off-by: Ninad Malwade <nmalwade@nvidia.com>
    Link: https://lore.kernel.org/r/1622789683-30931-1-git-send-email-nmalwade@nvidia.com
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    Ninad Malwade authored and groeck committed Jun 14, 2021
  13. hwmon: (max31790) Detect and report zero fan speed

    If a fan is not running or not connected, of if fan monitoring is disabled,
    the fan count register returns a fixed value of 0xffe0. So far this is then
    translated to a RPM value larger than 0. Since this is misleading and does
    not really make much sense, report a fan RPM of 0 in this situation.
    
    Cc: Jan Kundrát <jan.kundrat@cesnet.cz>
    Cc: Václav Kubernát <kubernat@cesnet.cz>
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    Tested-by: Václav Kubernát <kubernat@cesnet.cz>
    Link: https://lore.kernel.org/r/20210526154022.3223012-7-linux@roeck-us.net
    groeck committed Jun 14, 2021
  14. hwmon: (max31790) Clear fan fault after reporting it

    Fault bits in MAX31790 are sticky and have to be cleared explicitly.
    A write operation into either the 'Target Duty Cycle' register or the
    'Target Count' register is necessary to clear a fault.
    
    At the same time, we can never clear cached fault status values before
    reading them because the companion fault status for any given fan is
    cleared as well when clearing a fault.
    
    Cc: Jan Kundrát <jan.kundrat@cesnet.cz>
    Cc: Václav Kubernát <kubernat@cesnet.cz>
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    Tested-by: Václav Kubernát <kubernat@cesnet.cz>
    Link: https://lore.kernel.org/r/20210526154022.3223012-6-linux@roeck-us.net
    groeck committed Jun 14, 2021
  15. hwmon: (max31790) Fix pwmX_enable attributes

    pwmX_enable supports three possible values:
    
    0: Fan control disabled. Duty cycle is fixed to 0%
    1: Fan control enabled, pwm mode. Duty cycle is determined by
       values written into Target Duty Cycle registers.
    2: Fan control enabled, rpm mode
       Duty cycle is adjusted such that fan speed matches
       the values in Target Count registers
    
    The current code does not do this; instead, it mixes pwm control
    configuration with fan speed monitoring configuration. Worse, it
    reports that pwm control would be disabled (pwmX_enable==0) when
    it is in fact enabled in pwm mode. Part of the problem may be that
    the chip sets the "TACH input enable" bit on its own whenever the
    mode bit is set to RPM mode, but that doesn't mean that "TACH input
    enable" accurately reflects the pwm mode.
    
    Fix it up and only handle pwm control with the pwmX_enable attributes.
    In the documentation, clarify that disabling pwm control (pwmX_enable=0)
    sets the pwm duty cycle to 0%. In the code, explain why TACH_INPUT_EN
    is set together with RPM_MODE.
    
    While at it, only update the configuration register if the configuration
    has changed, and only update the cached configuration if updating the
    chip configuration was successful.
    
    Cc: Jan Kundrát <jan.kundrat@cesnet.cz>
    Cc: Václav Kubernát <kubernat@cesnet.cz>
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    Tested-by: Václav Kubernát <kubernat@cesnet.cz>
    Reviewed-by: Jan Kundrát <jan.kundrat@cesnet.cz>
    Link: https://lore.kernel.org/r/20210526154022.3223012-4-linux@roeck-us.net
    groeck committed Jun 14, 2021
  16. hwmon: (max31790) Report correct current pwm duty cycles

    The MAX31790 has two sets of registers for pwm duty cycles, one to request
    a duty cycle and one to read the actual current duty cycle. Both do not
    have to be the same.
    
    When reporting the pwm duty cycle to the user, the actual pwm duty cycle
    from pwm duty cycle registers needs to be reported. When setting it, the
    pwm target duty cycle needs to be written. Since we don't know the actual
    pwm duty cycle after a target pwm duty cycle has been written, set the
    valid flag to false to indicate that actual pwm duty cycle should be read
    from the chip instead of using cached values.
    
    Cc: Jan Kundrát <jan.kundrat@cesnet.cz>
    Cc: Václav Kubernát <kubernat@cesnet.cz>
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    Tested-by: Václav Kubernát <kubernat@ceesnet.cz>
    Reviewed-by: Jan Kundrát <jan.kundrat@cesnet.cz>
    Link: https://lore.kernel.org/r/20210526154022.3223012-3-linux@roeck-us.net
    groeck committed Jun 14, 2021
  17. hwmon: (max31790) Fix fan speed reporting for fan7..12

    Fans 7..12 do not have their own set of configuration registers.
    So far the code ignored that and read beyond the end of the configuration
    register range to get the tachometer period. This resulted in more or less
    random fan speed values for those fans.
    
    The datasheet is quite vague when it comes to defining the tachometer
    period for fans 7..12. Experiments confirm that the period is the same
    for both fans associated with a given set of configuration registers.
    
    Fixes: 54187ff ("hwmon: (max31790) Convert to use new hwmon registration API")
    Fixes: 195a4b4 ("hwmon: Driver for Maxim MAX31790")
    Cc: Jan Kundrát <jan.kundrat@cesnet.cz>
    Reviewed-by: Jan Kundrát <jan.kundrat@cesnet.cz>
    Cc: Václav Kubernát <kubernat@cesnet.cz>
    Reviewed-by: Jan Kundrát <jan.kundrat@cesnet.cz>
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    Link: https://lore.kernel.org/r/20210526154022.3223012-2-linux@roeck-us.net
    groeck committed Jun 14, 2021
  18. hwmon: (sht4x) Fix sht4x_read_values return value

    Kernel doc for sht4x_read_values() shows 0 on success, 1 on failure but
    the return value on success is actually always positive as it is set to
    SHT4X_RESPONSE_LENGTH by a successful call to i2c_master_recv().
    
    Miscellanea:
    
    o Update the kernel doc for sht4x_read_values to 0 for success or -ERRNO
    o Remove incorrectly used kernel doc /** header for other _read functions
    o Typo fix succesfull->successful
    o Reverse a test to unindent a block and use goto unlock
    o Declare cmd[SHT4X_CMD_LEN] rather than cmd[]
    
    At least for gcc 10.2, object size is reduced a tiny bit.
    
    $ size drivers/hwmon/sht4x.o*
       text	   data	    bss	    dec	    hex	filename
       1752	    404	    256	   2412	    96c	drivers/hwmon/sht4x.o.new
       1825	    404	    256	   2485	    9b5	drivers/hwmon/sht4x.o.old
    
    Signed-off-by: Joe Perches <joe@perches.com>
    Link: https://lore.kernel.org/r/60eedce497137eb34448c0c77e01ec9d9c972ad7.camel@perches.com
    Reviewed by: Navin Sankar Velliangiri <navin@linumiz.com>
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    JoePerches authored and groeck committed Jun 14, 2021
  19. hwmon: Add sht4x Temperature and Humidity Sensor Driver

    This patch adds a hwmon driver for the SHT4x Temperature and
    Humidity sensor.
    
    Signed-off-by: Navin Sankar Velliangiri <navin@linumiz.com>
    [groeck: dropped unnecessary empty line and continuation lines]
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    Navin-Sankar authored and groeck committed Jun 14, 2021
  20. docs: hwmon: Add an entry for mp2888

    The entry for mp2888 is missing and it causes the following
    'make htmldocs' build warning:
    
    Documentation/hwmon/mp2888.rst: WARNING: document isn't included in any toctree
    
    Add the mp2888 entry.
    
    Signed-off-by: Fabio Estevam <festevam@gmail.com>
    Link: https://lore.kernel.org/r/20210521172218.37592-1-festevam@gmail.com
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    fabioestevam authored and groeck committed Jun 14, 2021
  21. hwmon: (adm1275) enable adm1272 temperature reporting

    adm1272 supports temperature reporting but it is disabled by default.
    
    Tested:
    ls temp1_*
    temp1_crit           temp1_highest        temp1_max
    temp1_crit_alarm     temp1_input          temp1_max_alarm
    
    cat temp1_input
    26642
    
    Signed-off-by: Chu Lin <linchuyuan@google.com>
    Link: https://lore.kernel.org/r/20210512171043.2433694-1-linchuyuan@google.com
    [groeck: Updated subject to reflect correct driver]
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    linchuyuan authored and groeck committed Jun 14, 2021
  22. dt-bindings: Add MP2888 voltage regulator device

    Monolithic Power Systems, Inc. (MPS) dual-loop, digital, multi-phase
    controller.
    
    Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
    Acked-by: Rob Herring <robh@kernel.org>
    Link: https://lore.kernel.org/r/20210511055619.118104-4-vadimp@nvidia.com
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    vadimp-nvidia authored and groeck committed Jun 14, 2021
  23. hwmon: (pmbus) Add support for MPS Multi-phase mp2888 controller

    Add support for mp2888 device from Monolithic Power Systems, Inc. (MPS)
    vendor. This is a digital, multi-phase, pulse-width modulation
    controller.
    
    This device supports:
    - One power rail.
    - Programmable Multi-Phase up to 10 Phases.
    - PWM-VID Interface
    - One pages 0 for telemetry.
    - Programmable pins for PMBus Address.
    - Built-In EEPROM to Store Custom Configurations.
    - Can configured VOUT readout in direct or VID format and allows
      setting of different formats on rails 1 and 2. For VID the following
      protocols are available: VR13 mode with 5-mV DAC; VR13 mode with
      10-mV DAC, IMVP9 mode with 5-mV DAC.
    
    Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
    Reported-by: kernel test robot <lkp@intel.com>
    Link: https://lore.kernel.org/r/20210511055619.118104-3-vadimp@nvidia.com
    [groeck: Add MODULE_IMPORT_NS]
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    vadimp-nvidia authored and groeck committed Jun 14, 2021
  24. hwmon: (pmbus) Increase maximum number of phases per page

    Increase maximum number of phases from 8 to 10 to support multi-phase
    devices allowing up to 10 phases.
    
    Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
    Link: https://lore.kernel.org/r/20210511055619.118104-2-vadimp@nvidia.com
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    vadimp-nvidia authored and groeck committed Jun 14, 2021
  25. hwmon: (bt1-pvt) Remove redundant error printing in pvt_request_regs()

    When devm_ioremap_resource() fails, a clear enough error message will be
    printed by its subfunction __devm_ioremap_resource(). The error
    information contains the device name, failure cause, and possibly resource
    information.
    
    Therefore, remove the error printing here to simplify code and reduce the
    binary size.
    
    Reported-by: Hulk Robot <hulkci@huawei.com>
    Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
    Link: https://lore.kernel.org/r/20210511091843.4561-1-thunder.leizhen@huawei.com
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    Zhen Lei authored and groeck committed Jun 14, 2021
  26. hwmon: (pmbus) Add support for additional Flex BMR converters to pmbus

    Add support for Flex BMR310, BMR456, BMR457, BMR458, BMR480, BMR490,
    BMR491 and BMR492 to the pmbus driver
    
    Signed-off-by: Erik Rosen <erik.rosen@metormote.com>
    Link: https://lore.kernel.org/r/20210507194023.61138-4-erik.rosen@metormote.com
    [groeck: Fixed minor whitespace error]
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    metormote authored and groeck committed Jun 14, 2021
  27. hwmon: (pmbus) Add documentation for new flags

    Add documentation for the new pmbus flags PMBUS_WRITE_PROTECTED,
    PMBUS_NO_CAPABILITY and PMBUS_READ_STATUS_AFTER_FAILED_CHECK
    
    Signed-off-by: Erik Rosen <erik.rosen@metormote.com>
    Link: https://lore.kernel.org/r/20210507194023.61138-3-erik.rosen@metormote.com
    [groeck: Added newline at end of file]
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    metormote authored and groeck committed Jun 14, 2021
  28. hwmon: (pmbus) Add new flag PMBUS_READ_STATUS_AFTER_FAILED_CHECK

    Some PMBus chips end up in an undefined state when trying to read an
    unsupported register. For such chips, it is necessary to reset the
    chip pmbus controller to a known state after a failed register check.
    This can be done by reading a known register. By setting this flag the
    driver will try to read the STATUS register after each failed
    register check. This read may fail, but it will put the chip into a
    known state.
    
    Signed-off-by: Erik Rosen <erik.rosen@metormote.com>
    Link: https://lore.kernel.org/r/20210507194023.61138-2-erik.rosen@metormote.com
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    metormote authored and groeck committed Jun 14, 2021
  29. hwmon: (sch56xx-common) Simplify sch56xx_device_add

    Use platform_device_register_simple() instead of
    manually calling platform_device_alloc()/platform_device_add().
    
    Signed-off-by: Armin Wolf <W_Armin@gmx.de>
    Link: https://lore.kernel.org/r/20210508131457.12780-5-W_Armin@gmx.de
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    Wer-Wolf authored and groeck committed Jun 14, 2021
  30. hwmon: (sch56xx-common) Use helper function

    Use watchdog_set_nowayout() to process param
    setting and change param type to bool.
    
    Signed-off-by: Armin Wolf <W_Armin@gmx.de>
    Link: https://lore.kernel.org/r/20210508131457.12780-4-W_Armin@gmx.de
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    Wer-Wolf authored and groeck committed Jun 14, 2021
  31. hwmon: (sch56xx-common) Use strscpy

    strlcpy is considered deprecated.
    Replace it with strscpy.
    
    Signed-off-by: Armin Wolf <W_Armin@gmx.de>
    Link: https://lore.kernel.org/r/20210508131457.12780-3-W_Armin@gmx.de
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    Wer-Wolf authored and groeck committed Jun 14, 2021
  32. hwmon: (sch56xx) Use devres functions for watchdog

    Use devm_kzalloc()/devm_watchdog_register() for
    watchdog registration since it allows us to remove
    the sch56xx_watchdog_data struct from the drivers
    own data structs.
    Remove sch56xx_watchdog_unregister since devres
    takes care of that now.
    
    Signed-off-by: Armin Wolf <W_Armin@gmx.de>
    Link: https://lore.kernel.org/r/20210508131457.12780-2-W_Armin@gmx.de
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    [groeck: Dropped unnecessary return; at end of void function]
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    Wer-Wolf authored and groeck committed Jun 14, 2021
  33. hwmon: (lm70) Use SPI_MODE_X_MASK

    Use SPI_MODE_X_MASK instead of open coded variant.
    
    Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
    Link: https://lore.kernel.org/r/20210510141331.56736-1-andriy.shevchenko@linux.intel.com
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    andy-shev authored and groeck committed Jun 14, 2021
Older