PMIC register read/write

Hello team,

We are working on a product based on apq8016 and working on Linaro-18.01.

Issue #1
We are unable to write reg SLEEP_CLK1_CAL_RC4 from the driver but the register has RW access. Kindly suggest here.

Issue #2
Question regarding COIN_EN_CTL PMIC register. What is the target of this register ? Is it Ok to write the 0x00 ? Can it break anything ?

Parth Y Shah

What are you trying to write inside (value) and how are you doing (kernel driver? userspace regmap access?). Is there an error reported or your change is just no applied?

Don’t think so, it will just disable the coincell (if any qualified one), which can be used to support RTC when the battery/power is removed.

We have created a reboot notifier inside a kernel driver and trying to write 0x00 in the register.

+static int chg_reboot_notifier_call(struct notifier_block *this,
+                                       unsigned long code, void *unused)
+	unsigned int ret;
+	ret = regmap_write(chg->regmap, chg->addr + PMIC_SLEEP_CLK1_CAL_RC4_OFFSET, DEFAULT_VAL_CAL_RC4);
+	if (ret < 0) {
+		printk("Write failed\n");
+		return ret;
+	}
+	return NOTIFY_DONE;
+static struct notifier_block chg_reboot_notifier = {
+	.notifier_call = chg_reboot_notifier_call,

Here, if we put prints “before” and “after” regmap_write(), we got only “before” print and did not get any erroneous prints from kernel after that, kernel just got reboots after that. Kindly suggest how to write 0x00 to this register.