Thread (11 messages) read the whole thread 11 messages, 3 authors, 2017-03-15

Re: [PATCH v2 4/5] mfd: rk808: Add RK805 support

From: Lee Jones <hidden>
Date: 2017-03-15 11:04:26
Also in: linux-rockchip, lkml

On Fri, 10 Mar 2017, Elaine Zhang wrote:
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 <redacted>
---
 drivers/clk/Kconfig |   4 +-
Acked-by: Lee Jones <redacted>
 drivers/mfd/Kconfig |   4 +-
 drivers/mfd/rk808.c | 117 ++++++++++++++++++++++++++++++++++++++++++++++++++++
Comments below.
 drivers/rtc/Kconfig |   4 +-
Acked-by: Lee Jones <redacted>
 4 files changed, 123 insertions(+), 6 deletions(-)
Split this patch up into subsystems, it'll save issues.

[...]
quoted hunk ↗ jump to hunk
--- a/drivers/mfd/rk808.c
+++ b/drivers/mfd/rk808.c
[...]
+static void rk805_device_shutdown(void)
+{
+	int ret;
+	struct rk808 *rk808 = i2c_get_clientdata(rk808_i2c_client);
+
+	if (!rk808) {
+		dev_warn(&rk808_i2c_client->dev,
+			 "have no rk808, so do nothing here\n");
+		return;
+	}
+
+	/* close rtc int when power off */
+	regmap_update_bits(rk808->regmap,
+			   RK808_INT_STS_MSK_REG1,
+			   (0x3 << 5), (0x3 << 5));
No magic numbers.  Please define these.
+	regmap_update_bits(rk808->regmap,
+			   RK808_RTC_INT_REG,
+			   (0x3 << 2), (0x0 << 2));
No magic numbers.  Please define these.
+
+	/* pmic sleep shutdown function */
+	ret = regmap_update_bits(rk808->regmap,
+				 RK805_GPIO_IO_POL_REG,
+				 SLP_SD_MSK, SHUTDOWN_FUN);
+	if (ret)
+		dev_err(&rk808_i2c_client->dev, "power off error!\n");
+}
-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help