06 Apr, 2018

1 commit

  • Pull ARM SoC platform updates from Arnd Bergmann:
    "This release brings up a new platform based on the old ARM9 core: the
    Nuvoton NPCM is used as a baseboard management controller, competing
    with the better known ASpeed AST2xx series.

    Another important change is the addition of ARMv7-A based chips in
    mach-stm32. The older parts in this platform are ARMv7-M based
    microcontrollers, now they are expanding to general-purpose workloads.

    The other changes are the usual defconfig updates to enable additional
    drivers, lesser bugfixes. The largest updates as often are the ongoing
    OMAP cleanups, but we also have a number of changes for the older PXA
    and davinci platforms this time.

    For the Renesas shmobile/r-car platform, some new infrastructure is
    needed to make the watchdog work correctly.

    Supporting Multiprocessing on Allwinner A80 required a significant
    amount of new code, but is not doing anything unexpected"

    * tag 'armsoc-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (179 commits)
    arm: npcm: modify configuration for the NPCM7xx BMC.
    MAINTAINERS: update entry for ARM/berlin
    ARM: omap2: fix am43xx build without L2X0
    ARM: davinci: da8xx: simplify CFGCHIP regmap_config
    ARM: davinci: da8xx: fix oops in USB PHY driver due to stack allocated platform_data
    ARM: multi_v7_defconfig: add NXP FlexCAN IP support
    ARM: multi_v7_defconfig: enable thermal driver for i.MX devices
    ARM: multi_v7_defconfig: add RN5T618 PMIC family support
    ARM: multi_v7_defconfig: add NXP graphics drivers
    ARM: multi_v7_defconfig: add GPMI NAND controller support
    ARM: multi_v7_defconfig: add OCOTP driver for NXP SoCs
    ARM: multi_v7_defconfig: configure I2C driver built-in
    arm64: defconfig: add CONFIG_UNIPHIER_THERMAL and CONFIG_SNI_AVE
    ARM: imx: fix imx6sll-only build
    ARM: imx: select ARM_CPU_SUSPEND for CPU_IDLE as well
    ARM: mxs_defconfig: Re-sync defconfig
    ARM: imx_v4_v5_defconfig: Use the generic fsl-asoc-card driver
    ARM: imx_v4_v5_defconfig: Re-sync defconfig
    arm64: defconfig: enable stmmac ethernet to defconfig
    ARM: EXYNOS: Simplify code in coupled CPU idle hot path
    ...

    Linus Torvalds
     

04 Apr, 2018

1 commit

  • Pull power supply and reset updates from Sebastian Reichel:

    - Microsemi Ocelot reset support

    - Spreadtrum SC27xx reset support

    - generic gpio charger: lot's of cleanups

    - axp20x fuel gauge: add AXP813 support

    - misc fixes, including one devicetree change for the Nokia N900, that
    has been Acked-by Tony Lindgren

    * tag 'for-v4.17' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (27 commits)
    power: reset: at91-reset: Switch from the pr_*() to the dev_*() logging functions
    power: reset: at91-poweroff: Remove redundant dev_err call in at91_poweroff_probe()
    power: reset: at91-poweroff: Switch from the pr_*() to the dev_*() logging functions
    power: reset: make function sc27xx_poweroff_shutdown static
    power: supply: da9150-fg: remove VLA usage
    ARM: dts: omap3-n900: Add link between battery and charger
    power: supply: bq2415x: add DT referencing support
    power: supply: bq27xxx: support missing supplier device
    max17042: propagate of_node to power supply device
    power: supply: axp288_fuel_gauge: Fix full status reporting
    power: supply: axp288_fuel_gauge: Do not register FG on ECS EF20EA
    power: reset: gpio-poweroff: Support for timeout from device property
    dt-bindings: power: reset: gpio-poweroff: Add 'timeout-ms' property
    power: reset: Add Spreadtrum SC27xx PMIC power off support
    power: supply: axp20x_battery: add support for AXP813
    dt-bindings: power: supply: axp20x: add AXP813 battery DT binding
    power: supply: axp20x_battery: use data struct for variant specific code
    power: supply: gpio-charger: Remove pdata from gpio_charger
    power: supply: gpio-charger: Use GPIOF_ACTIVE_LOW for legacy setup
    power: supply: gpio-charger: Remove redundant dev_err call in probe function
    ...

    Linus Torvalds
     

20 Mar, 2018

3 commits


13 Mar, 2018

1 commit

  • The function sc27xx_poweroff_shutdown is local to the source and does
    not need to be in global scope, so make it static.

    Cleans up sparse warning:
    drivers/power/reset/sc27xx-poweroff.c:28:6: warning: symbol
    'sc27xx_poweroff_shutdown' was not declared. Should it be static?

    Signed-off-by: Colin Ian King
    Signed-off-by: Sebastian Reichel

    Colin Ian King
     

12 Mar, 2018

5 commits


10 Mar, 2018

4 commits

  • Commit 2b5a4b4bf222 ("power: supply: axp288_fuel_gauge: Rework
    get_status()"), switched from 0A current detection to using the capacity
    register for full detection.

    It turns out this fixes full reporting on some devices which keep trickle
    charging long after the capacity register reach 100%, but breaks it on
    some other devices where the charger stops charging before the capacity
    register reaches 100%. This commit fixes this by also checking for
    0A current when the reported capacity is above 90%.

    Fixes: 2b5a4b4bf222 ("psy: axp288_fuel_gauge: Rework get_status()")
    Signed-off-by: Hans de Goede
    Signed-off-by: Sebastian Reichel

    Hans de Goede
     
  • The ECS EF20EA laptop ships an AXP288 but it is actually using a
    different, separate FG chip for AC and battery monitoring. On this
    laptop we need to keep using the regular ACPI driver and disable the
    AXP288 FG to avoid reporting two batteries to userspace.

    Signed-off-by: Carlo Caione
    Signed-off-by: Sebastian Reichel

    Carlo Caione
     
  • Add support for reading a timeout value from device property.
    Fall back to previous default of 3s if nothing is specified.

    Signed-off-by: Moritz Fischer
    Signed-off-by: Sebastian Reichel

    Moritz Fischer
     
  • On Spreadtrum platform, we need power off system through external SC27xx
    series PMICs including the SC2720, SC2721, SC2723, SC2730 and SC2731 chips.
    Thus this patch adds SC27xx series PMICs power-off support.

    Signed-off-by: Baolin Wang
    Signed-off-by: Sebastian Reichel

    Baolin Wang
     

09 Mar, 2018

5 commits


01 Mar, 2018

1 commit

  • We are currently probing smartreflex with omap_device while we are
    already probing smartreflex related interconnect target module with
    ti-sysc driver and dts data.

    Before we can flip things on for ti-sysc, we need to prepare the
    smartreflex driver a bit:

    1. The smartreflex clock is really for the whole interconnect target
    module. So it may be configured at the parent device level with
    ti-sysc

    2. With ti-sysc, we have the child device manage interconnect target
    module directly if pm_runtime_irq_safe() is set and there is only
    one child. In that case nobody else is going to call pm_runtime_get
    and put, so we need to add these calls to idle smartreflex properly
    after probe if not fully configured

    3. With ti-sysc, the parent driver may rebind. So we want to use
    platform_driver_register() and don't want probe to be __init

    Note that this patch depends on the related changes to ti-sysc driver
    and omap_device probing to prevent both ti-sysc and omap_device to
    try to probe smartreflex.

    Cc: linux-pm@vger.kernel.org
    Cc: Rafael J. Wysocki
    Acked-by: Kevin Hilman
    Signed-off-by: Tony Lindgren

    Tony Lindgren
     

23 Feb, 2018

2 commits

  • On the D-Link DIR-685 we get spurious poweroff from
    infrared. Since that block (CIR) doesn't even have a
    driver this can be safely ignored, we can revisit this
    code once we have a device supporting CIR.

    On the D-Link DNS-313 we get spurious poweroff from
    the power button. This appears to be an initialization
    issue: we need to enable the block (start the state
    machine) before we clear any dangling IRQ.

    This patch fixes both issues.

    Fixes: f7a388d6cd1c ("power: reset: Add a driver for the Gemini poweroff")
    Signed-off-by: Linus Walleij
    Signed-off-by: Sebastian Reichel

    Linus Walleij
     
  • Temperature is measured in tenths of degree Celsius.

    Fixes: 085bc24d1553 ("Add LTC2941/LTC2943 Battery Gauge Driver")
    Signed-off-by: Ladislav Michl
    Signed-off-by: Sebastian Reichel

    Ladislav Michl
     

22 Feb, 2018

1 commit

  • This patch adds the to_power_supply macro to upcast
    a device to a power_supply struct.

    This is needed because the same piece of code using
    container_of is used in various other places, so we
    abstract away such low-level operations via a macro.

    Suggested-by: Andy Shevchenko
    Reviewed-by: Andy Shevchenko
    Signed-off-by: Ognjen Galic
    Reviewed-by: Sebastian Reichel
    Signed-off-by: Rafael J. Wysocki

    Ognjen Galic
     

13 Feb, 2018

2 commits


12 Feb, 2018

2 commits


01 Feb, 2018

1 commit

  • Pull power supply and reset updates from Sebastian Reichel:

    - bq27xxx: add bq27521 support

    - drop unused imx-snvs-poweroff driver

    - improve axp288 driver

    - misc fixes

    * tag 'for-v4.16' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (32 commits)
    power: supply: max17042_battery: Always fall back to default platform-data
    power: supply: max17042_battery: Check battery current for status when supplied
    MAINTAINERS: Add AXP288 PMIC entry
    power: supply: axp288_fuel_gauge: Do not register our psy on (some) HDMI sticks
    power: supply: axp288_fuel_gauge: Optimize get_current()
    power: supply: axp288_fuel_gauge: Rework get_status()
    power: reset: account for const type of of_device_id.data
    power: supply: account for const type of of_device_id.data
    bq24190: Simplify code in property_is_writeable
    power: supply: axp288_fuel_gauge: Get iio-channels once during boot
    power: supply: axp288_charger: Properly stop work on probe-error / remove
    power: supply: axp288_charger: Simplify extcon cable handling
    power: supply: axp288_charger: Use the right property for the input current limit
    power: supply: axp288_charger: Pick lower input current limit not higher
    power: supply: axp288_charger: Do not cache input current limit value
    power: supply: axp288_charger: Remove no longer needed locking
    power: supply: axp288_charger: Use regmap_update_bits to set the input limits
    power: supply: axp288_charger: Cleanup some double empty lines
    power: supply: axp288_charger: Remove charger-enabled state tracking
    power: supply: axp288_charger: Add missing newlines to some messages
    ...

    Linus Torvalds
     

23 Jan, 2018

2 commits


10 Jan, 2018

3 commits

  • The Intel Compute Stick (Cherry Trail version) and the Meegopad T08 HDMI
    stick, both use an axp288 PMIC. They also both have this wired up in such
    a way that the detection logic in the PMIC claims that a valid battery is
    present, resuling in GNOME and KDE showing a full-battery in their status
    bar and power-settings, while these devices do not have a battery.

    For lack of a better fix add a DMI blacklist and do not register the
    axp288_fuel_gauge psy on devices on the blacklist.

    Reviewed-by: Chen-Yu Tsai
    Signed-off-by: Hans de Goede
    Signed-off-by: Sebastian Reichel

    Hans de Goede
     
  • First check the discharge current, and when that is non 0 use that without
    also checking the charge current (which will be 0 then). This makes
    get_current() do only 1 i2c read instead of 2 when on battery.

    This is esp. important given the pmic i2c bus mutex stuff used on boards
    with an axp288 because the SoC's own punit also may access the axp288,
    which makes i2c accesses more expensive then normal.

    Signed-off-by: Hans de Goede
    Reviewed-by: Chen-Yu Tsai
    Signed-off-by: Sebastian Reichel

    Hans de Goede
     
  • Relying on the (dis)charge current reporting for reporting FULL back to
    userspace does not work really well and often leads to the reported status
    getting stuck at e.g. 98/99% (the fuelgauge is not perfect) for hours.

    What happens is that when the battery is full the axp288 keeps charging it
    with a very low current. Until it is really really full and once really
    really full, some inaccuracies in the adc lead to it then sometimes
    reporting a small discharging rate, even though an external pwr source is
    used. So we end up with a status of "charging" for hours after the battery
    is actually already full and sometimes this then flip-flops to discharging.

    This commit fixes this by first checking if a valid Vbus is present and if
    it is present using the fuel-gauge's reported percentage to check for a
    full battery.

    This commit also changes how get_status() determines if the battery is
    charging or discharging when not reporting it as full. We still use the
    current direction for this, but instead of reading 4 extra registers for
    this (2 16 bit regs), simplify things by using the current-direction bit
    in the power-status register, which already gets read anyways.

    This also reduces the amount of i2c reads to 1 when on battery and 2
    when a valid Vbus is present.

    Signed-off-by: Hans de Goede
    Reviewed-by: Chen-Yu Tsai
    Signed-off-by: Sebastian Reichel

    Hans de Goede
     

09 Jan, 2018

6 commits

  • This driver creates a const structure that it stores in the data
    field of an of_device_id array.

    Add const to the declaration of the location that receives a value
    from the data field to ensure that the compiler will continue to check
    that the value is not modified and remove the const-dropping cast on
    the access to the data field.

    Done using Coccinelle.

    Signed-off-by: Julia Lawall
    Acked-by: Alexandre Belloni
    Signed-off-by: Sebastian Reichel

    Julia Lawall
     
  • This driver creates two const structures that it stores in the data
    field of an of_device_id array.

    The data field of an of_device_id structure has type const void *, so
    there is no need for a const-discarding cast when putting const values
    into such a structure.

    Furthermore, adding const to the declaration of the location that
    receives a const value from such a field ensures that the compiler
    will continue to check that the value is not modified. The
    const-discarding cast on the extraction from the data field is thus
    no longer needed.

    Done using Coccinelle.

    Signed-off-by: Julia Lawall
    Signed-off-by: Sebastian Reichel

    Julia Lawall
     
  • Simplify function that should be trivial.

    Signed-off-by: Pavel machek
    Signed-off-by: Sebastian Reichel

    Pavel Machek
     
  • Get iio-channels once during boot, delaying the probe if the axp288_adc
    drivers has not loaded yet, instead of getting them on demand each time
    we need them.

    This fixes the following errors in dmesg:

    axp288_fuel_gauge axp288_fuel_gauge: ADC charge current read failed:-19

    Which were caused by the ondemand iio-channel read code not finding the
    channel when the axp288_adc driver had not loaded yet.

    Reviewed-by: Chen-Yu Tsai
    Signed-off-by: Hans de Goede
    Signed-off-by: Sebastian Reichel

    Hans de Goede
     
  • Properly stop any work we may have queued on probe-errors / remove.

    Rather then adding a remove driver callback for this, and goto style
    error handling to probe, use a devm_action for this.

    The devm_action gets registered before we register any of the extcon
    notifiers which may queue the work, devm does cleanup in reverse order,
    so this ensures that the notifiers are removed before we cancel the work.

    Reviewed-by: Chen-Yu Tsai
    Signed-off-by: Hans de Goede
    Signed-off-by: Sebastian Reichel

    Hans de Goede
     
  • Simplify extcon cable handling using the new
    devm_extcon_register_notifier_all function to listen to all cables
    in one go.

    Reviewed-by: Chen-Yu Tsai
    Signed-off-by: Hans de Goede
    Signed-off-by: Sebastian Reichel

    Hans de Goede