Commit Graph

12 Commits

Author SHA1 Message Date
Joseph Chen f7c22398f5 mfd: rk808: Add RK805 power key support
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2017-08-21 08:54:56 +01:00
Joseph Chen 8d249b67c7 mfd: rk808: Add RK805 pinctrl support
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2017-08-21 08:54:51 +01:00
Elaine Zhang 990f05f6a5 mfd: rk808: Add RK805 support
The RK805 chip is a Power Management IC (PMIC) for multimedia and handheld
devices. It contains the following components:

    - Regulators
    - RTC
    - Clocking

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

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2017-08-21 08:54:20 +01:00
Elaine Zhang 9d6105e19f mfd: rk808: Fix up the chip id get failed
the rk8xx chip id is:
((MSB << 8) | LSB) & 0xfff0

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2017-08-21 08:53:57 +01:00
Bhumika Goyal 24e34b9d75 mfd: constify regmap_irq_chip structures
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 <bhumirks@gmail.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2017-02-13 09:29:44 +00:00
Jianhong Chen b2e2c85091 mfd: rk808: RK818 uses DEV_OFF to power off supplies
DEV_OFF and DEV_OFF_RST functions for RK808 are designed error that
only DEV_OFF_RST can power off supplies. RK818 has been fixed this
issue, so that DEV_OFF is used to power off supplies.

Signed-off-by: Jianhong Chen <chenjh@rock-chips.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-11-29 08:21:24 +00:00
Wadim Egorov 2eedcbfc06 mfd: rk808: Add RK818 support
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 <w.egorov@phytec.de>
Tested-by: Andy Yan <andy.yan@rock-chips.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-08-31 13:48:25 +01:00
Laxman Dewangan d5623161ac mfd: rk808: Use devm_mfd_add_devices() for mfd_device registration
Use devm_mfd_add_devices() for MFD devices registration and remove
the call of mfd_remove_devices() from .remove callback to remove
MFD child-devices. This is done by managed device framework.

CC: Chris Zhong <zyw@rock-chips.com>
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-04-19 07:55:59 +01:00
Fabian Frederick 908725d541 mfd: Constify of_device_id array
of_device_id is always used as const.

(See driver.of_match_table and open firmware functions)

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-03-26 14:20:18 +00:00
Chris Zhong e19f742885 mfd: rk808: Disable the under voltage detect
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 <zyw@rock-chips.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-03-12 09:07:10 +00:00
Doug Anderson 2adb3b8e6f mfd: rk808: Add register caching
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 <dianders@chromium.org>
Reviewed-by: Chris Zhong <zyw@rock-chips.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:23:56 +01:00
Chris Zhong f69a7cf74d mfd: RK808: Add new mfd driver for RK808
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 <zyw@rock-chips.com>
Signed-off-by: Zhang Qing <zhangqing@rock-chips.com>
Tested-by: Heiko <heiko@sntech.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:15:56 +01:00