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

Commit cdd9a15f authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "dsp: update avtimer for kernel 5.4"

parents 7e9c038f cb89ebef
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2012-2015, 2017-2020 The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2015, 2017-2021 The Linux Foundation. All rights reserved.
 */

#include <linux/kernel.h>
@@ -334,7 +334,7 @@ int avcs_core_query_timer_offset(int64_t *av_offset, int32_t clock_id)
{
	uint32_t avtimer_msw = 0, avtimer_lsw = 0;
	uint64_t avtimer_tick_temp, avtimer_tick, sys_time = 0;
	struct timespec ts;
	struct timespec64 ts;

	if (!atomic_read(&avtimer.adsp_ready)) {
		pr_debug("%s:In SSR, return\n", __func__);
@@ -346,22 +346,22 @@ int avcs_core_query_timer_offset(int64_t *av_offset, int32_t clock_id)
		return -EINVAL;
	}

	memset(&ts, 0, sizeof(struct timespec));
	memset(&ts, 0, sizeof(struct timespec64));
	avtimer_lsw = ioread32(avtimer.p_avtimer_lsw);
	avtimer_msw = ioread32(avtimer.p_avtimer_msw);

	switch (clock_id) {
	case CLOCK_MONOTONIC_RAW:
		getrawmonotonic(&ts);
		ktime_get_raw_ts64(&ts);
		break;
	case CLOCK_BOOTTIME:
		get_monotonic_boottime(&ts);
		ktime_get_boottime_ts64(&ts);
		break;
	case CLOCK_MONOTONIC:
		ktime_get_ts(&ts);
		ktime_get_ts64(&ts);
		break;
	case CLOCK_REALTIME:
		ktime_get_real_ts(&ts);
		ktime_get_real_ts64(&ts);
		break;
	default:
		pr_debug("%s: unsupported clock id %d\n", __func__, clock_id);