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

Commit 329b153b authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "alarmtimer : Remove power_on_alarm_init"

parents 57cff77c 981b18db
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2015,2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -20,7 +20,6 @@
#include <linux/spmi.h>
#include <linux/spinlock.h>
#include <linux/spmi.h>
#include <linux/alarmtimer.h>

/* RTC/ALARM Register offsets */
#define REG_OFFSET_ALARM_RW	0x40
@@ -377,6 +376,15 @@ qpnp_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm)
				alarm->time.tm_sec, alarm->time.tm_mday,
				alarm->time.tm_mon, alarm->time.tm_year);

	rc = qpnp_read_wrapper(rtc_dd, value,
		rtc_dd->alarm_base + REG_OFFSET_ALARM_CTRL1, 1);
	if (rc) {
		dev_err(dev, "Read from ALARM CTRL1 failed\n");
		return rc;
	}

	alarm->enabled = !!(value[0] & BIT_RTC_ALARM_ENABLE);

	return 0;
}

@@ -596,9 +604,6 @@ static int qpnp_rtc_probe(struct spmi_device *spmi)
		goto fail_rtc_enable;
	}

	/* Init power_on_alarm after adding rtc device */
	power_on_alarm_init();

	/* Request the alarm IRQ */
	rc = request_any_context_irq(rtc_dd->rtc_alarm_irq,
				 qpnp_alarm_trigger, IRQF_TRIGGER_RISING,
+0 −1
Original line number Diff line number Diff line
@@ -51,7 +51,6 @@ void alarm_restart(struct alarm *alarm);
int alarm_try_to_cancel(struct alarm *alarm);
int alarm_cancel(struct alarm *alarm);
void set_power_on_alarm(void);
void power_on_alarm_init(void);
enum alarmtimer_type clock2alarm(clockid_t clockid);

u64 alarm_forward(struct alarm *alarm, ktime_t now, ktime_t interval);
+0 −33
Original line number Diff line number Diff line
@@ -60,38 +60,6 @@ static struct rtc_timer rtctimer;
static struct rtc_device	*rtcdev;
static DEFINE_SPINLOCK(rtcdev_lock);
static struct mutex power_on_alarm_lock;
static struct alarm init_alarm;

/**
 * power_on_alarm_init - Init power on alarm value
 *
 * Read rtc alarm value after device booting up and add this alarm
 * into alarm queue.
 */
void power_on_alarm_init(void)
{
	struct rtc_wkalrm rtc_alarm;
	struct rtc_time rt;
	unsigned long alarm_time;
	struct rtc_device *rtc;
	ktime_t alarm_ktime;

	rtc = alarmtimer_get_rtcdev();

	if (!rtc)
		return;

	rtc_read_alarm(rtc, &rtc_alarm);
	rt = rtc_alarm.time;

	rtc_tm_to_time(&rt, &alarm_time);

	if (alarm_time) {
		alarm_ktime = ktime_set(alarm_time, 0);
		alarm_init(&init_alarm, ALARM_POWEROFF_REALTIME, NULL);
		alarm_start(&init_alarm, alarm_ktime);
	}
}

/**
 * set_power_on_alarm - set power on alarm value into rtc register
@@ -496,7 +464,6 @@ static int alarmtimer_resume(struct device *dev)
		return 0;
	rtc_timer_cancel(rtc, &rtctimer);

	queue_delayed_work(power_off_alarm_workqueue, &work, 0);
	return 0;
}