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

Commit ed5423fd authored by David Collins's avatar David Collins Committed by Jishnu Prakash
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 7c9d79dd
Loading
Loading
Loading
Loading
+15 −10
Original line number Original line Diff line number Diff line
/* Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
// SPDX-License-Identifier: GPL-2.0-only
 *
/*
 * This program is free software; you can redistribute it and/or modify
 * Copyright (c) 2010-2011, 2020, The Linux Foundation. All rights reserved.
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that 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.
 */
 */

#include <linux/of.h>
#include <linux/of.h>
#include <linux/module.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/init.h>
@@ -455,6 +449,16 @@ static const struct pm8xxx_rtc_regs pm8941_regs = {
	.alarm_en	= BIT(7),
	.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
 * Hardcoded RTC bases until IORESOURCE_REG mapping is figured out
 */
 */
@@ -463,6 +467,7 @@ static const struct of_device_id pm8xxx_id_table[] = {
	{ .compatible = "qcom,pm8018-rtc", .data = &pm8921_regs },
	{ .compatible = "qcom,pm8018-rtc", .data = &pm8921_regs },
	{ .compatible = "qcom,pm8058-rtc", .data = &pm8058_regs },
	{ .compatible = "qcom,pm8058-rtc", .data = &pm8058_regs },
	{ .compatible = "qcom,pm8941-rtc", .data = &pm8941_regs },
	{ .compatible = "qcom,pm8941-rtc", .data = &pm8941_regs },
	{ .compatible = "qcom,pmk8350-rtc", .data = &pmk8350_regs },
	{ },
	{ },
};
};
MODULE_DEVICE_TABLE(of, pm8xxx_id_table);
MODULE_DEVICE_TABLE(of, pm8xxx_id_table);