09 Feb, 2020

1 commit

  • Pull ARM SoC platform updates from Olof Johansson:
    "Most of these are smaller fixes that have accrued, and some continued
    cleanup of OMAP platforms towards shared frameworks.

    One new SoC from Atmel/Microchip: sam9x60"

    * tag 'armsoc-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (35 commits)
    ARM: OMAP2+: Fix undefined reference to omap_secure_init
    ARM: s3c64xx: Drop unneeded select of TIMER_OF
    ARM: exynos: Drop unneeded select of MIGHT_HAVE_CACHE_L2X0
    ARM: s3c24xx: Switch to atomic pwm API in rx1950
    ARM: OMAP2+: sleep43xx: Call secure suspend/resume handlers
    ARM: OMAP2+: Use ARM SMC Calling Convention when OP-TEE is available
    ARM: OMAP2+: Introduce check for OP-TEE in omap_secure_init()
    ARM: OMAP2+: Add omap_secure_init callback hook for secure initialization
    ARM: at91: Documentation: add sam9x60 product and datasheet
    ARM: at91: pm: use of_device_id array to find the proper shdwc node
    ARM: at91: pm: use SAM9X60 PMC's compatible
    ARM: imx: only select ARM_ERRATA_814220 for ARMv7-A
    ARM: zynq: use physical cpuid in zynq_slcr_cpu_stop/start
    ARM: tegra: Use clk_m CPU on Tegra124 LP1 resume
    ARM: tegra: Modify reshift divider during LP1
    ARM: tegra: Enable PLLP bypass during Tegra124 LP1
    ARM: samsung: Rename Samsung and Exynos to lowercase
    ARM: exynos: Correct the help text for platform Kconfig option
    ARM: bcm: Select ARM_AMBA for ARCH_BRCMSTB
    ARM: brcmstb: Add debug UART entry for 7216
    ...

    Linus Torvalds
     

08 Feb, 2020

1 commit

  • Pull more power management updates from Rafael Wysocki:

    - Update the recently merged CPR (Core Power Reduction) support in the
    AVS (Adaptive Voltage Scaling) subsystem (Brendan Higgins, Nathan
    Chancellor, Niklas Cassel)

    - Update the rockchip-io AVS driver (Heiko Stuebner)

    - Add two more module parameters to intel_idle on top of the recently
    merged material (Rafael Wysocki)

    - Clean up a piece of cpuidle documentation and consolidate system
    sleep states documentation (Rafael Wysocki)

    * tag 'pm-5.6-rc1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
    cpuidle: Documentation: Clean up PM QoS description
    Documentation: admin-guide: PM: Update sleep states documentation
    intel_idle: Introduce 'states_off' module parameter
    intel_idle: Introduce 'use_acpi' module parameter
    power: avs: qcom-cpr: Avoid clang -Wsometimes-uninitialized in cpr_scale
    power: avs: qcom-cpr: add unspecified HAS_IOMEM dependency
    PM / AVS: rockchip-io: fix the supply naming for the emmc supply on px30
    power: avs: qcom-cpr: add a printout after the driver has been initialized

    Linus Torvalds
     

07 Feb, 2020

1 commit

  • * pm-avs:
    power: avs: qcom-cpr: Avoid clang -Wsometimes-uninitialized in cpr_scale
    power: avs: qcom-cpr: add unspecified HAS_IOMEM dependency
    PM / AVS: rockchip-io: fix the supply naming for the emmc supply on px30
    power: avs: qcom-cpr: add a printout after the driver has been initialized

    * pm-cpuidle:
    cpuidle: Documentation: Clean up PM QoS description
    intel_idle: Introduce 'states_off' module parameter
    intel_idle: Introduce 'use_acpi' module parameter

    Rafael J. Wysocki
     

04 Feb, 2020

1 commit

  • …ernel/git/chrome-platform/linux

    Pull chrome platform updates from Benson Leung:
    "CrOS EC:

    - Refactoring of some of cros_ec's headers:

    include/linux/mfd/cros_ec.h now removed, new cros_ec.h added to
    drivers/platform/chrome which contains shared operations of cros_ec
    transport drivers.

    - Response tracing in cros_ec_proto

    Wilco EC:

    - Fix unregistration order.

    - Fix keyboard backlight probing on systems without keyboard
    backlight

    - Minor cleanup (newlines in printks, COMPILE_TEST)

    Misc:

    - chromeos_laptop converted to use i2c_new_scanned_device instead of
    i2c_new_probed_device"

    * tag 'tag-chrome-platform-for-v5.6' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux:
    platform/chrome: cros_ec: Match implementation with headers
    platform/chrome: cros_ec: Drop unaligned.h include
    platform/chrome: wilco_ec: Allow wilco to be compiled in COMPILE_TEST
    platform/chrome: wilco_ec: Add newlines to printks
    platform/chrome: wilco_ec: Fix unregistration order
    cros_ec: treewide: Remove 'include/linux/mfd/cros_ec.h'
    platform/chrome: cros_ec_ishtp: Make init_lock static
    platform/chrome: chromeos_laptop: Convert to i2c_new_scanned_device
    platform/chrome: cros_ec_lpc: Use platform_get_irq_optional() for optional IRQs
    platform/chrome: cros_ec_proto: Add response tracing
    platform/chrome: cros_ec_trace: Match trace commands with EC commands

    Linus Torvalds
     

31 Jan, 2020

4 commits

  • Clang warns (trimmed for brevity):

    ../drivers/power/avs/qcom-cpr.c:570:13: warning: variable 'reg_mask' is
    used uninitialized whenever 'if' condition is false
    [-Wsometimes-uninitialized]

    ../drivers/power/avs/qcom-cpr.c:520:13: warning: variable 'new_uV' is
    used uninitialized whenever 'if' condition is false
    [-Wsometimes-uninitialized]

    Due to the fact that Clang's static analysis happens before any
    optimization passes are taken into account, it cannot see that both
    branches in the if statement must be taken because dir cannot be
    something other than UP or DOWN due to the check at the top of this
    function. Change the else if condition to else to fix this false
    positive.

    Fixes: bf6910abf548 ("power: avs: Add support for CPR (Core Power Reduction)")
    Link: https://github.com/ClangBuiltLinux/linux/issues/840
    Signed-off-by: Nathan Chancellor
    Acked-by: Kevin Hilman
    Signed-off-by: Rafael J. Wysocki

    Nathan Chancellor
     
  • Currently CONFIG_QCOM_CPR=y implicitly depends on CONFIG_HAS_IOMEM=y;
    consequently, on architectures without IOMEM we get the following build
    error:

    /usr/bin/ld: drivers/power/avs/qcom-cpr.o: in function `cpr_probe':
    drivers/power/avs/qcom-cpr.c:1690: undefined reference to `devm_ioremap_resource'

    Fix the build error by adding the unspecified dependency.

    Signed-off-by: Brendan Higgins
    Signed-off-by: Rafael J. Wysocki

    Brendan Higgins
     
  • The supply going to the emmc/flash is named vccio6, not vccio0 and while
    the code does this correctly already, the comments and error output do not.

    So just change these values to the correct ones.

    Signed-off-by: Heiko Stuebner
    Signed-off-by: Rafael J. Wysocki

    Heiko Stuebner
     
  • In order to easier inform the user that the driver has been initialized
    successfully, add a printout after the driver has been initialized.

    At the same time, remove a dev_dbg() that is now redundant.

    Signed-off-by: Niklas Cassel
    Reviewed-by: Bjorn Andersson
    Signed-off-by: Rafael J. Wysocki

    Niklas Cassel
     

30 Jan, 2020

1 commit

  • Pull power supply and reset updates from Sebastian Reichel:
    "Core:
    - Add battery internal resistance temperature table support

    Drivers:
    - sc27xx: Optimize the battery resistance with measuring temperature
    - max17042-battery: Add MAX17055 support
    - bq25890-charger: Add support of BQ25892 and BQ25896 chips
    - misc fixes"

    * tag 'for-v5.6' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (44 commits)
    power: supply: ipaq_micro_battery: remove unneeded semicolon
    power: supply: bq25890_charger: fix incorrect error return when bq25890_field_read fails
    power: supply: axp20x_usb_power: Only poll while offline
    power: supply: axp20x_usb_power: Add wakeup control
    power: supply: axp20x_usb_power: Allow offlining
    power: supply: axp20x_usb_power: Use a match structure
    power: suppy: ucs1002: Make the symbol 'ucs1002_regulator_enable' static
    power: reset: at91-poweroff: use proper master clock register offset
    power: reset: at91-poweroff: introduce struct shdwc_reg_config
    power: supply: bq25890_charger: Add DT and I2C ids for all supported chips
    dt-bindings: Add new chips to bq25890 binding documentation
    power: supply: bq25890_charger: Add support of BQ25892 and BQ25896 chips
    power: supply: core: Update sysfs-class-power ABI document
    power: supply: sbs-battery: Fix a signedness bug in sbs_get_battery_capacity()
    power: supply: ltc2941-battery-gauge: fix use-after-free
    power: supply: max17040: Correct IRQ wake handling
    power: supply: axp20x_usb_power: Remove unused device_node
    power: supply: axp20x_ac_power: Add wakeup control
    power: supply: axp20x_ac_power: Allow offlining
    power: supply: axp20x_ac_power: Fix reporting online status
    ...

    Linus Torvalds
     

17 Jan, 2020

2 commits


16 Jan, 2020

5 commits

  • Investigation on the AXP803 shows that VBUS_PLUGIN/VBUS_REMOVAL IRQs are
    triggered on the rising/falling edge of AXP20X_PWR_STATUS_VBUS_USED. The
    reason IRQs do not arrive while N_VBUSEN/DRIVEVBUS is high is because
    AXP20X_PWR_STATUS_VBUS_USED also never goes high.

    This also means that if VBUS is online, a VBUS_REMOVAL IRQ is received
    immediately on setting N_VBUSEN/DRIVEVBUS high (and VBUS_PLUGIN shortly
    after it is set back low). This was also verified to be the case when
    manually offlining VBUS through AXP20X_VBUS_PATH_SELECT.

    As long as VBUS is online, a present->absent transition necessarily
    implies an online->offline transition. Since will cause an IRQ, there is
    no need to poll while VBUS is online.

    To ensure the driver's view of VBUS online status remains accurate,
    unconditionally poll once when receiving an IRQ and when resuming. If
    VBUS is still online at that time, polling will cease until the next
    VBUS_REMOVAL IRQ.

    Reviewed-by: Chen-Yu Tsai
    Signed-off-by: Samuel Holland
    Signed-off-by: Sebastian Reichel

    Samuel Holland
     
  • The USB power supply input can be used as a wakeup source. Hook up the
    VBUS_PLUGIN IRQ to trigger wakeup based on userspace configuration.

    To do this, we must remember the list of IRQs for the life of the
    device. To know how much space to allocate for the flexible array
    member, we switch from using a NULL sentinel to using an array length.

    Because we now depend on the specific order of the IRQs (we assume
    VBUS_PLUGIN is first and always present), failing to acquire an IRQ
    during probe must be a fatal error.

    To avoid spuriously waking up the system when the USB power supply is
    not configured as a wakeup source, we must explicitly disable all non-
    wake IRQs during system suspend. This is because the SoC's NMI input is
    shared among all IRQs on the AXP PMIC. Due to the use of regmap-irq, the
    individual IRQs within the PMIC are nested threaded interrupts, and are
    therefore not automatically disabled during system suspend.

    The upshot is that if any other device within the MFD (such as the power
    key) is an enabled wakeup source, all enabled IRQs within the PMIC will
    cause wakeup. We still need to call enable_irq_wake() when we *do* want
    wakeup, in case those other wakeup sources on the PMIC are all disabled.

    Reviewed-by: Chen-Yu Tsai
    Signed-off-by: Samuel Holland
    Signed-off-by: Sebastian Reichel

    Samuel Holland
     
  • AXP803/AXP813 have a flag that enables/disables the USB power supply
    input. Allow control of this flag via the ONLINE property on those
    variants.

    It may be necessary to offline the USB power supply input when using
    the USB port in OTG mode, or to allow userspace to disable charging.

    When the USB VBUS input is disabled via the PATH_SEL bit, the VBUS_USED
    bit in PWR_INPUT_STATUS is cleared, so there is no change needed when
    getting the property.

    Reviewed-by: Chen-Yu Tsai
    Signed-off-by: Samuel Holland
    Signed-off-by: Sebastian Reichel

    Samuel Holland
     
  • Instead of ad-hoc variant ID checks throughout the code, let's start
    moving the variant-specific details to a match structure. This allows
    for future flexibility, and it better matches the other axp20x power
    supply drivers.

    This commit removes most variant checks from axp20x_usb_power_probe().
    Other parts of the driver still do ID matching; they are left unchanged
    for now.

    Reviewed-by: Chen-Yu Tsai
    Signed-off-by: Samuel Holland
    Signed-off-by: Sebastian Reichel

    Samuel Holland
     
  • Fix the following sparse warning:

    drivers/power/supply/ucs1002_power.c:492:5: warning: symbol 'ucs1002_regulator_enable' was not declared. Should it be static?

    Fixes: a3d70dacc727 ("power: suppy: ucs1002: disable power when max current is 0")
    Signed-off-by: Chen Wandun
    Signed-off-by: Sebastian Reichel

    Chen Wandun
     

15 Jan, 2020

4 commits


14 Jan, 2020

7 commits

  • The "mode" variable is an enum and in this context GCC treats it as an
    unsigned int so the error handling is never triggered.

    Fixes: 51d075660457 ("bq20z75: Add support for charge properties")
    Signed-off-by: Dan Carpenter
    Signed-off-by: Sebastian Reichel

    Dan Carpenter
     
  • This driver's remove path calls cancel_delayed_work().
    However, that function does not wait until the work function
    finishes. This could mean that the work function is still
    running after the driver's remove function has finished,
    which would result in a use-after-free.

    Fix by calling cancel_delayed_work_sync(), which ensures that
    that the work is properly cancelled, no longer running, and
    unable to re-schedule itself.

    This issue was detected with the help of Coccinelle.

    Cc: stable
    Signed-off-by: Sven Van Asbroeck
    Signed-off-by: Sebastian Reichel

    Sven Van Asbroeck
     
  • Don't disable IRQ wake feature without prior enabling it.

    This fixes following warning observed on Exynos3250-based Rinato board:
    ------------[ cut here ]------------
    WARNING: CPU: 0 PID: 1288 at kernel/irq/manage.c:724 irq_set_irq_wake+0xfc/0x134
    Unbalanced IRQ 83 wake disable
    Modules linked in:
    CPU: 0 PID: 1288 Comm: rtcwake Not tainted 5.5.0-rc5-next-20200110-00031-g6289fffbb3f5 #7266
    Hardware name: Samsung Exynos (Flattened Device Tree)
    [] (unwind_backtrace) from [] (show_stack+0x10/0x14)
    [] (show_stack) from [] (dump_stack+0xa4/0xd0)
    [] (dump_stack) from [] (__warn+0xf4/0x10c)
    [] (__warn) from [] (warn_slowpath_fmt+0x74/0xb8)
    [] (warn_slowpath_fmt) from [] (irq_set_irq_wake+0xfc/0x134)
    [] (irq_set_irq_wake) from [] (max17040_suspend+0x50/0x58)
    [] (max17040_suspend) from [] (dpm_run_callback+0xb4/0x400)
    [] (dpm_run_callback) from [] (__device_suspend+0x140/0x814)
    [] (__device_suspend) from [] (dpm_suspend+0x16c/0x564)
    [] (dpm_suspend) from [] (dpm_suspend_start+0x90/0x98)
    [] (dpm_suspend_start) from [] (suspend_devices_and_enter+0xec/0xc0c)
    [] (suspend_devices_and_enter) from [] (pm_suspend+0x318/0x3e8)
    [] (pm_suspend) from [] (state_store+0x68/0xc8)
    [] (state_store) from [] (kernfs_fop_write+0x10c/0x220)
    [] (kernfs_fop_write) from [] (__vfs_write+0x2c/0x1c4)
    [] (__vfs_write) from [] (vfs_write+0xa4/0x180)
    [] (vfs_write) from [] (ksys_write+0x58/0xcc)
    [] (ksys_write) from [] (ret_fast_syscall+0x0/0x28)
    Exception stack(0xd6e83fa8 to 0xd6e83ff0)
    ...
    irq event stamp: 18028
    hardirqs last enabled at (18027): [] cancel_delayed_work+0x84/0xf8
    hardirqs last disabled at (18028): [] _raw_spin_lock_irqsave+0x1c/0x58
    softirqs last enabled at (17876): [] __do_softirq+0x4f0/0x5e4
    softirqs last disabled at (17869): [] irq_exit+0x16c/0x170
    ---[ end trace 0728005730004e60 ]---

    Fixes: 2e17ed94de68 ("power: supply: max17040: Add IRQ handler for low SOC alert")
    Signed-off-by: Marek Szyprowski
    Reviewed-by: Krzysztof Kozlowski
    Signed-off-by: Sebastian Reichel

    Marek Szyprowski
     
  • This member of struct axp20x_usb_power is not used anywhere.
    Remove it.

    Reviewed-by: Chen-Yu Tsai
    Signed-off-by: Samuel Holland
    Signed-off-by: Sebastian Reichel

    Samuel Holland
     
  • The AC power supply input can be used as a wakeup source. Hook up the
    ACIN_PLUGIN IRQ to trigger wakeup based on userspace configuration.

    To do this, we must remember the list of IRQs for the life of the
    device. To know how much space to allocate for the flexible array
    member, we switch from using a NULL sentinel to using an array length.

    Because we now depend on the specific order of the IRQs (we assume
    ACIN_PLUGIN is first and always present), failing to acquire an IRQ
    during probe must be a fatal error.

    To avoid spuriously waking up the system when the AC power supply is
    not configured as a wakeup source, we must explicitly disable all non-
    wake IRQs during system suspend. This is because the SoC's NMI input is
    shared among all IRQs on the AXP PMIC. Due to the use of regmap-irq, the
    individual IRQs within the PMIC are nested threaded interrupts, and are
    therefore not automatically disabled during system suspend.

    The upshot is that if any other device within the MFD (such as the power
    key) is an enabled wakeup source, all enabled IRQs within the PMIC will
    cause wakeup. We still need to call enable_irq_wake() when we *do* want
    wakeup, in case those other wakeup sources on the PMIC are all disabled.

    Reviewed-by: Chen-Yu Tsai
    Signed-off-by: Samuel Holland
    Signed-off-by: Sebastian Reichel

    Samuel Holland
     
  • AXP803/AXP813 have a flag that enables/disables the AC power supply
    input. Allow control of this flag via the ONLINE property on those
    variants.

    Reviewed-by: Chen-Yu Tsai
    Signed-off-by: Samuel Holland
    Signed-off-by: Sebastian Reichel

    Samuel Holland
     
  • AXP803/AXP813 have a flag that enables/disables the AC power supply
    input. This flag does not affect the status bits in PWR_INPUT_STATUS.
    Its effect can be verified by checking the battery charge/discharge
    state (bit 2 of PWR_INPUT_STATUS), or by examining the current draw on
    the AC input.

    Take this flag into account when getting the ONLINE property of the AC
    input, on PMICs where this flag is present.

    Fixes: 7693b5643fd2 ("power: supply: add AC power supply driver for AXP813")
    Cc: stable@vger.kernel.org
    Signed-off-by: Samuel Holland
    Reviewed-by: Chen-Yu Tsai
    Signed-off-by: Sebastian Reichel

    Samuel Holland
     

09 Jan, 2020

1 commit


08 Jan, 2020

1 commit

  • This header file now only includes the cros_ec_dev struct, however, is the
    'include/linux/platform_data/cros_ec_proto.h' who contains the definition of
    all the Chrome OS EC related structs. There is no reason to have a
    separate include for this struct so move to the place where other
    structs are defined. That way, we can remove the include itself, but also
    simplify the common pattern

    #include
    #include

    for a single include

    #include

    The changes to remove the cros_ec.h include were generated with the
    following shell script:

    git grep -l "" | xargs sed -i '//d'

    Signed-off-by: Enric Balletbo i Serra
    Acked-by: Lee Jones
    Acked-by: Alexandre Belloni
    Acked-by: Jonathan Cameron
    Acked-by: Sebastian Reichel
    Acked-by: Hans Verkuil

    Enric Balletbo i Serra
     

07 Jan, 2020

1 commit

  • Currently when the call cpr_read_fuse_uV returns an error the value in the
    uninitialized variable ret is returned. Fix this by instread returning the
    error value in the variable uV.

    Addresses-Coverity: ("Uninitialized scalar variable")
    Fixes: bf6910abf548 ("power: avs: Add support for CPR (Core Power Reduction)")
    Signed-off-by: Colin Ian King
    Reviewed-by: Bjorn Andersson
    Signed-off-by: Rafael J. Wysocki

    Colin Ian King
     

30 Dec, 2019

5 commits


20 Dec, 2019

4 commits

  • CPR (Core Power Reduction) is a technology that reduces core power on a
    CPU or other device. It reads voltage settings in efuse from product
    test process as initial settings.
    Each OPP corresponds to a "corner" that has a range of valid voltages
    for a particular frequency. While the device is running at a particular
    frequency, CPR monitors dynamic factors such as temperature, etc. and
    adjusts the voltage for that frequency accordingly to save power
    and meet silicon characteristic requirements.

    This driver is based on an RFC by Stephen Boyd[1], which in turn is
    based on work by others on codeaurora.org[2].

    [1] https://lkml.org/lkml/2015/9/18/833
    [2] https://source.codeaurora.org/quic/la/kernel/msm-4.14/tree/drivers/regulator/cpr-regulator.c?h=msm-4.14

    Co-developed-by: Jorge Ramirez-Ortiz
    Signed-off-by: Jorge Ramirez-Ortiz
    Signed-off-by: Niklas Cassel
    Reviewed-by: Bjorn Andersson
    Reviewed-by: Ulf Hansson
    Signed-off-by: Rafael J. Wysocki

    Niklas Cassel
     
  • Fixes coccicheck warning:

    drivers/power/supply/abx500_chargalg.c:1826:2-3: Unneeded semicolon

    Reported-by: Hulk Robot
    Signed-off-by: Ma Feng
    Signed-off-by: Sebastian Reichel

    Ma Feng
     
  • Fixes coccicheck warning:

    drivers/power/supply/ab8500_charger.c:1082:2-3: Unneeded semicolon
    drivers/power/supply/ab8500_charger.c:792:2-3: Unneeded semicolon
    drivers/power/supply/ab8500_charger.c:2430:2-3: Unneeded semicolon

    Reported-by: Hulk Robot
    Signed-off-by: Ma Feng
    Signed-off-by: Sebastian Reichel

    Ma Feng
     
  • Fixes coccicheck warning:

    drivers/power/supply/ab8500_fg.c:2224:5-6: Unneeded semicolon
    drivers/power/supply/ab8500_fg.c:2227:4-5: Unneeded semicolon
    drivers/power/supply/ab8500_fg.c:2334:3-4: Unneeded semicolon
    drivers/power/supply/ab8500_fg.c:2342:3-4: Unneeded semicolon
    drivers/power/supply/ab8500_fg.c:2350:3-4: Unneeded semicolon
    drivers/power/supply/ab8500_fg.c:2358:3-4: Unneeded semicolon
    drivers/power/supply/ab8500_fg.c:2366:3-4: Unneeded semicolon

    Reported-by: Hulk Robot
    Signed-off-by: Ma Feng
    Signed-off-by: Sebastian Reichel

    Ma Feng
     

19 Dec, 2019

1 commit