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

Commit cfc8de97 authored by Sujeev Dias's avatar Sujeev Dias
Browse files

mhi: controller: qcom: add support to capture local SoC time



For syncronization between local SoC and remote SoC time, time_get
support is added. Time_get returns local host SoC XO clock time in
ticks.

CRs-Fixed: 2306423
Change-Id: I76886feac00f994bad8968cf8ac837341624aa08
Acked-by: default avatarBhaumik Vasav Bhatt <bbhatt@qti.qualcomm.com>
Signed-off-by: default avatarSujeev Dias <sdias@codeaurora.org>
parent 5193a94c
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2018, The Linux Foundation. All rights reserved.*/

#include <asm/arch_timer.h>
#include <linux/debugfs.h>
#include <linux/device.h>
#include <linux/dma-direction.h>
@@ -318,6 +319,12 @@ static void mhi_status_cb(struct mhi_controller *mhi_cntrl,
	}
}

/* capture host SoC XO time in ticks */
static u64 mhi_time_get(struct mhi_controller *mhi_cntrl, void *priv)
{
	return arch_counter_get_cntvct();
}

int mhi_debugfs_trigger_m0(void *data, u64 val)
{
	struct mhi_controller *mhi_cntrl = data;
@@ -478,6 +485,8 @@ static struct mhi_controller *mhi_register_controller(struct pci_dev *pci_dev)
	mhi_cntrl->runtime_put = mhi_runtime_put;
	mhi_cntrl->link_status = mhi_link_status;

	mhi_cntrl->time_get = mhi_time_get;

	ret = of_register_mhi_controller(mhi_cntrl);
	if (ret)
		goto error_register;