pmaports/device/archived/linux-oneplus-msm8998-downstream/0005-update-msm8998-qpnp-rtc-driver-src-with-sm8150.patch
Stefan Hansson fb7f99efe2
device: rename unmaintained to archived (MR 5046)
Unmaintained is a name which on multiple occasions have seen lead to
confusion with people having the impression that unmaintained is for all
unmaintained devices, which is not how we're really using it. Many
devices in testing do not actually have a maintainer, yet there has been
no push to move these out of there and into unmaintained.

I think this is a result of that unmaintained was introduced not to keep
unmaintained ports but rather a place to store ports that have a better
replacement but where the inferior one still holds some sort of value,
such as for debugging purposes. These ports also are not necessarily
entirely unmaintained and see more fixes than many ports in testing.

While one approach to solving this problem could be to simply moving all
unmaintained ports to unmaintained, I think this comes with some
problems: It would require an initial effort to figure out which ports
are indeed unmaintained and which just don't have a maintained noted in
the package, and given how many ports there are in testing this would be
a big endeavour. It would also require continuous work on moving ports
into unmaintained as the maintainers go silent if we are to keep testing
and unmaintained's state consistent with reality. Additionally, just
because a port doesn't have a maintainer on paper doens't mean that
there aren't people who aren't willing to fix it up if there are issues
that arise.

As such, I think the way to go is renaming unmaintained to better
reflect the original intent. Thanks to Luca Weiss for suggesting
"archive", and to Arnav Singh for suggesting that "archived" would match
the other category names better.
2024-05-15 17:07:51 +02:00

89 lines
3 KiB
Diff

--- a/drivers/rtc/qpnp-rtc.c
+++ b/drivers/rtc/qpnp-rtc.c
@@ -21,6 +21,8 @@
#include <linux/of_irq.h>
#include <linux/spmi.h>
#include <linux/platform_device.h>
+#include <linux/spinlock.h>
+#include <linux/alarmtimer.h>
/* RTC/ALARM Register offsets */
#define REG_OFFSET_ALARM_RW 0x40
@@ -85,11 +87,10 @@ static int qpnp_write_wrapper(struct qpnp_rtc *rtc_dd, u8 *rtc_val,
u16 base, int count)
{
int rc;
+
if (base == (rtc_dd->alarm_base + REG_OFFSET_ALARM_CTRL1)) {
- dev_err(rtc_dd->rtc_dev, "write ALARM_CTRL1=0x%x\n", *rtc_val);
- if (!(*rtc_val & BIT_RTC_ALARM_ENABLE))
- dump_stack();
- }
+ dev_info(rtc_dd->rtc_dev, "write ALARM_CTRL1=0x%x\n", *rtc_val);
+ }
rc = regmap_bulk_write(rtc_dd->regmap, base, rtc_val, count);
if (rc) {
@@ -116,7 +117,7 @@ qpnp_rtc_set_time(struct device *dev, struct rtc_time *tm)
value[2] = (secs >> 16) & 0xFF;
value[3] = (secs >> 24) & 0xFF;
- dev_dbg(dev, "Seconds value to be written to RTC = %lu\n", secs);
+ dev_err(dev, "Seconds value to be written to RTC = %lu\n", secs);
spin_lock_irqsave(&rtc_dd->alarm_ctrl_lock, irq_flags);
ctrl_reg = rtc_dd->alarm_ctrl_reg1;
@@ -275,7 +276,6 @@ qpnp_rtc_read_time(struct device *dev, struct rtc_time *tm)
dev_err(dev, "Invalid time read from RTC\n");
return rc;
}
-
dev_dbg(dev, "secs = %lu, h:m:s == %d:%d:%d, d/m/y = %d/%d/%d\n",
secs, tm->tm_hour, tm->tm_min, tm->tm_sec,
tm->tm_mday, tm->tm_mon, tm->tm_year);
@@ -314,6 +314,8 @@ qpnp_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm)
value[1] = (secs >> 8) & 0xFF;
value[2] = (secs >> 16) & 0xFF;
value[3] = (secs >> 24) & 0xFF;
+ dev_info(dev, "val[0] = 0x%x, val[1] = 0x%x, val[2] = 0x%x, val[3] = 0x%x\n",
+ value[0], value[1], value[2], value[3]);
spin_lock_irqsave(&rtc_dd->alarm_ctrl_lock, irq_flags);
@@ -338,7 +340,7 @@ qpnp_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm)
rtc_dd->alarm_ctrl_reg1 = ctrl_reg;
- dev_err(dev, "Alarm Set for h:r:s=%d:%d:%d, d/m/y=%d/%d/%d\n",
+ dev_dbg(dev, "Alarm Set for h:r:s=%d:%d:%d, d/m/y=%d/%d/%d\n",
alarm->time.tm_hour, alarm->time.tm_min,
alarm->time.tm_sec, alarm->time.tm_mday,
alarm->time.tm_mon, alarm->time.tm_year);
@@ -657,16 +659,15 @@ static void qpnp_rtc_shutdown(struct platform_device *pdev)
bool rtc_alarm_powerup;
struct rtc_wkalrm alarm;
+ if (!pdev) {
+ pr_err("qpnp-rtc: spmi device not found\n");
+ return;
+ }
qpnp_rtc_read_alarm(&pdev->dev, &alarm);
dev_err(&pdev->dev, "Alarm set for - h:r:s=%d:%d:%d, d/m/y=%d/%d/%d\n",
alarm.time.tm_hour, alarm.time.tm_min,
alarm.time.tm_sec, alarm.time.tm_mday,
alarm.time.tm_mon, alarm.time.tm_year);
-
- if (!pdev) {
- pr_err("qpnp-rtc: spmi device not found\n");
- return;
- }
rtc_dd = dev_get_drvdata(&pdev->dev);
if (!rtc_dd) {
pr_err("qpnp-rtc: rtc driver data not found\n");
@@ -729,5 +730,5 @@ static void __exit qpnp_rtc_exit(void)
}
module_exit(qpnp_rtc_exit);
-MODULE_DESCRIPTION("SMPI PMIC RTC driver");
+MODULE_DESCRIPTION("SPMI PMIC RTC driver");
MODULE_LICENSE("GPL v2");