Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 52f9f8cf authored by David Collins's avatar David Collins
Browse files

rtc: rtc-pm8xxx: add support for PMK8350 RTC



Add support for the RTC peripheral found in PMK8350 PMIC chips.

Change-Id: Id4b93ae8017a174f577496078ed8ab8d73eabff8
Signed-off-by: default avatarDavid Collins <collinsd@codeaurora.org>
parent 2cfd8943
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
 */
/* Copyright (c) 2010-2011, 2019, The Linux Foundation. All rights reserved. */

#include <linux/of.h>
#include <linux/module.h>
#include <linux/init.h>
@@ -432,6 +432,16 @@ static const struct pm8xxx_rtc_regs pm8941_regs = {
	.alarm_en	= BIT(7),
};

static const struct pm8xxx_rtc_regs pmk8350_regs = {
	.ctrl		= 0x6146,
	.write		= 0x6140,
	.read		= 0x6148,
	.alarm_rw	= 0x6240,
	.alarm_ctrl	= 0x6246,
	.alarm_ctrl2	= 0x6248,
	.alarm_en	= BIT(7),
};

/*
 * Hardcoded RTC bases until IORESOURCE_REG mapping is figured out
 */
@@ -440,6 +450,7 @@ static const struct of_device_id pm8xxx_id_table[] = {
	{ .compatible = "qcom,pm8018-rtc", .data = &pm8921_regs },
	{ .compatible = "qcom,pm8058-rtc", .data = &pm8058_regs },
	{ .compatible = "qcom,pm8941-rtc", .data = &pm8941_regs },
	{ .compatible = "qcom,pmk8350-rtc", .data = &pmk8350_regs },
	{ },
};
MODULE_DEVICE_TABLE(of, pm8xxx_id_table);