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

Commit 0f787250 authored by Mohit Aggarwal's avatar Mohit Aggarwal
Browse files

rtc: rtc-pm8xxx: add support for PM5100 RTC



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

Change-Id: Ia2a0052fdc5b07e371e67dc93d45cf47776e9690
Signed-off-by: default avatarMohit Aggarwal <maggarwa@codeaurora.org>
parent f291b2fb
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2010-2011, 2019-2020, The Linux Foundation. All rights reserved. */
/* Copyright (c) 2010-2011, 2019-2021, The Linux Foundation. All rights reserved. */

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

static const struct pm8xxx_rtc_regs pm5100_regs = {
	.ctrl		= 0x6446,
	.write		= 0x6440,
	.read		= 0x6448,
	.alarm_rw	= 0x6540,
	.alarm_ctrl	= 0x6546,
	.alarm_ctrl2	= 0x6548,
	.alarm_en	= BIT(7),
};

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