30 Mar, 2020

5 commits

  • RK805 has the same kind of dual-role sleep/shutdown pin as RK809/RK817,
    so it makes little sense for the driver to have to have two completely
    different mechanisms to handle essentially the same thing. Move RK805
    over to the shutdown/suspend flow to clean things up.

    Signed-off-by: Robin Murphy
    Signed-off-by: Lee Jones

    Robin Murphy
     
  • Rather than having 3 almost-identical functions plus the machinery to
    keep track of them, it's far simpler to just dynamically select the
    appropriate register field per variant.

    Signed-off-by: Robin Murphy
    Signed-off-by: Lee Jones

    Robin Murphy
     
  • Setting the SLEEP pin to its shutdown function for appropriate PMICs
    doesn't need to happen in single-CPU context, so there's really no point
    involving the syscore machinery. Hook it up to the standard driver model
    shutdown method instead. This also obviates the issue that the syscore
    ops weren't being unregistered on probe failure or module removal.

    Signed-off-by: Robin Murphy
    Signed-off-by: Lee Jones

    Robin Murphy
     
  • The RK809/RK817 suspend/resume hooks should not have to depend on
    whether this driver owns the pm_power_off hook, and thus the global
    rk808_i2c_client is set - indeed, the GPIO-based control is really
    only relevant when PSCI firmware is in charge of power rather than
    the kernel. As driver model callbacks, they have an appropriate
    device argument to hand, so can just always use that.

    Signed-off-by: Robin Murphy
    Signed-off-by: Lee Jones

    Robin Murphy
     
  • With the device tree property "rockchip,system-power-controller" we
    explicitly request to use this PMIC to power off the system. So always
    register our poweroff function, even if some other handler (probably
    PSCI poweroff) was registered before.

    This does tend to reveal a warning on shutdown due to the Rockchip I2C
    driver not implementing an atomic transfer method, however since the
    write to DEV_OFF takes effect immediately the I2C completion interrupt
    is moot anyway, and as the very last thing written to the console it is
    only visible to users going out of their way to capture serial output.

    Signed-off-by: Soeren Moch
    Reviewed-by: Heiko Stuebner
    [ rm: note potential warning in commit message ]
    Signed-off-by: Robin Murphy
    Signed-off-by: Lee Jones

    Soeren Moch
     

11 Nov, 2019

3 commits


27 Aug, 2019

2 commits

  • Avoids:
    ../drivers/mfd/rk808.c:771:1: warning: symbol 'rk8xx_pm_ops' \
    was not declared. Should it be static?

    Fixes: 5752bc4373b2 ("mfd: rk808: Mark pm functions __maybe_unused")
    Reviewed-by: Arnd Bergmann
    Signed-off-by: Lee Jones

    Lee Jones
     
  • The newly added suspend/resume functions are only used if CONFIG_PM
    is enabled:

    drivers/mfd/rk808.c:752:12: error: 'rk8xx_resume' defined but not used [-Werror=unused-function]
    drivers/mfd/rk808.c:732:12: error: 'rk8xx_suspend' defined but not used [-Werror=unused-function]

    Mark them as __maybe_unused so the compiler can silently drop them
    when they are not needed.

    Fixes: 586c1b4125b3 ("mfd: rk808: Add RK817 and RK809 support")
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Lee Jones

    Arnd Bergmann
     

16 Jul, 2019

1 commit

  • Pull MFD updates from Lee Jones:
    "Core Frameworks:
    - Set 'struct device' fwnode when registering a new device

    New Drivers:
    - Add support for ROHM BD70528 PMIC

    New Device Support:
    - Add support for LP87561 4-Phase Regulator to TI LP87565 PMIC
    - Add support for RK809 and RK817 to Rockchip RK808
    - Add support for Lid Angle to ChromeOS core
    - Add support for CS47L15 CODEC to Madera core
    - Add support for CS47L92 CODEC to Madera core
    - Add support for ChromeOS (legacy) Accelerometers in ChromeOS core
    - Add support for Add Intel Elkhart Lake PCH to Intel LPSS

    New Functionality:
    - Provide regulator supply information when registering; madera-core
    - Additional Device Tree support; lp87565, madera, cros-ec, rohm,bd71837-pmic
    - Allow over-riding power button press via Device Tree; rohm-bd718x7
    - Differentiate between running processors; cros_ec_dev

    Fix-ups:
    - Big header file update; cros_ec_commands.h
    - Split header per-subsystem; rohm-bd718x7
    - Remove superfluous code; menelaus, cs5535-mfd, cs47lXX-tables
    - Trivial; sorting, coding style; intel-lpss-pci
    - Only remove Power Off functionality if set locally; rk808
    - Make use for Power Off Prepare(); rk808
    - Fix spelling mistake in header guards; stmfx
    - Properly free IDA resources
    - SPDX fixups; cs47lXX-tables, madera
    - Error path fixups; hi655x-pmic

    Bug Fixes:
    - Add missing break in case() statement
    - Repair undefined behaviour when not initialising variables; arizona-core, madera-core
    - Fix reference to Device Tree documentation; madera"

    * tag 'mfd-next-5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (45 commits)
    mfd: hi655x-pmic: Fix missing return value check for devm_regmap_init_mmio_clk
    mfd: madera: Fixup SPDX headers
    mfd: madera: Remove some unused registers and fix some defaults
    mfd: intel-lpss: Release IDA resources
    mfd: intel-lpss: Add Intel Elkhart Lake PCH PCI IDs
    mfd: cs5535-mfd: Remove ifdef OLPC noise
    mfd: stmfx: Fix macro definition spelling
    dt-bindings: mfd: Add link to ROHM BD71847 Datasheet
    MAINAINERS: Swap words in INTEL PMIC MULTIFUNCTION DEVICE DRIVERS
    mfd: cros_ec_dev: Register cros_ec_accel_legacy driver as a subdevice
    mfd: rk808: Prepare rk805 for poweroff
    mfd: rk808: Check pm_power_off pointer
    mfd: cros_ec: differentiate SCP from EC by feature bit
    dt-bindings: Add binding for cros-ec-rpmsg
    mfd: madera: Add Madera core support for CS47L92
    mfd: madera: Add Madera core support for CS47L15
    mfd: madera: Update DT bindings to add additional CODECs
    mfd: madera: Add supply mapping for MICVDD
    mfd: madera: Fix potential uninitialised use of variable
    mfd: madera: Fix bad reference to pinctrl.txt file
    ...

    Linus Torvalds
     

02 Jul, 2019

2 commits

  • RK805 has SLEEP signal, which can put the device into SLEEP or OFF
    mode. The default is SLEEP mode.

    However, when the kernel performs power-off (actually the ATF) the
    device will not go fully off and this will result in higher power
    consumption and inability to wake the device with RTC alarm.

    The solution is to enable pm_power_off_prepare function, which will
    configure SLEEP pin for OFF function.

    Signed-off-by: Stefan Mavrodiev
    Signed-off-by: Lee Jones

    Stefan Mavrodiev
     
  • The function pointer pm_power_off may point to function from other
    module (PSCI for example). If rk808 is removed, pm_power_off is
    overwritten to NULL and the system cannot be powered off.

    This patch checks if pm_power_off points to a module function.

    Signed-off-by: Stefan Mavrodiev
    Signed-off-by: Lee Jones

    Stefan Mavrodiev
     

27 Jun, 2019

1 commit

  • The RK809 and RK817 are a Power Management IC (PMIC) for multimedia
    and handheld devices. They contains the following components:
    - Regulators
    - RTC
    - Clocking

    Both RK809 and RK817 chips are using a similar register map,
    so we can reuse the RTC and Clocking functionality.
    Most of regulators have a some implementation also.

    Signed-off-by: Tony Xie
    Acked-by: Stephen Boyd
    Signed-off-by: Lee Jones

    Tony Xie
     

05 Jun, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms and conditions of the gnu general public license
    version 2 as published by the free software foundation this program
    is distributed in the hope it will be useful but without any
    warranty without even the implied warranty of merchantability or
    fitness for a particular purpose see the gnu general public license
    for more details

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 263 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Alexios Zavras
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190529141901.208660670@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

14 May, 2019

1 commit


21 Aug, 2017

4 commits


13 Feb, 2017

1 commit

  • Declare regmap_irq_chip structures as const as they are only stored
    in the regmap_irq_chip field of a rk808 structure. This field is of
    type const, so regmap_irq_chip structures having this property can be
    made const too.
    Done using Coccinelle:

    @r disable optional_qualifier@
    identifier x;
    position p;
    @@
    static struct regmap_irq_chip x@p={...};

    @ok@
    struct rk808 a;
    identifier r.x;
    position p;
    @@
    a.regmap_irq_chip=&x@p;

    @bad@
    position p != {r.p,ok.p};
    identifier r.x;
    @@
    x@p

    @depends on !bad disable optional_qualifier@
    identifier r.x;
    @@
    +const
    struct regmap_irq_chip x;

    File size before:
    text data bss dec hex filename
    5033 584 16 5633 1601 drivers/mfd/rk808.o

    File size after:
    text data bss dec hex filename
    5225 392 16 5633 1601 drivers/mfd/rk808.o

    Signed-off-by: Bhumika Goyal
    Signed-off-by: Lee Jones

    Bhumika Goyal
     

29 Nov, 2016

1 commit


31 Aug, 2016

1 commit

  • The RK818 chip is a Power Management IC (PMIC) for multimedia and handheld
    devices. It contains the following components:

    - Regulators
    - RTC
    - Clocking
    - Battery support

    Both RK808 and RK818 chips are using a similar register map,
    so we can reuse the RTC and Clocking functionality.

    Signed-off-by: Wadim Egorov
    Tested-by: Andy Yan
    Signed-off-by: Lee Jones

    Wadim Egorov
     

19 Apr, 2016

1 commit


26 Mar, 2015

1 commit


12 Mar, 2015

1 commit

  • Rk808 has a under voltage detect function, when the voltage of buck is
    under 85% the target voltage, the buck output will reset. But if the
    power load is too heavy, this function maybe err, when current over
    4.2A, although the voltage is normal, but RK808 mistakenly think it is
    under 85%, and reset the buck. So let's disable this function.

    Signed-off-by: Chris Zhong
    Signed-off-by: Lee Jones

    Chris Zhong
     

26 Sep, 2014

2 commits

  • Let's define the voltatile registers (those that can't be cached) and
    enable caching. The rk808 is accessed almost constantly with cpufreq
    so this is really nice.

    As measured by ftrace:
    before this change: cpu0_set_target() => ~2200us
    after this change: cpu0_set_target() => ~500us

    Signed-off-by: Doug Anderson
    Reviewed-by: Chris Zhong
    Signed-off-by: Lee Jones

    Doug Anderson
     
  • The RK808 chip is a power management IC for multimedia and handheld
    devices. It contains the following components:

    - Regulators
    - RTC
    - Clkout

    The RK808 core driver is registered as a platform driver and provides
    communication through I2C with the host device for the different
    components.

    Signed-off-by: Chris Zhong
    Signed-off-by: Zhang Qing
    Tested-by: Heiko
    Signed-off-by: Lee Jones

    Chris Zhong