blob: 624184fc458ee94cf8fda772ca7a24e33b98a874 [file] [log] [blame]
Suman Anna84369fb2018-05-31 12:11:02 -05001/* SPDX-License-Identifier: GPL-2.0 */
Bjorn Andersson835764dd2017-08-24 12:51:26 +05302/*
3 * Copyright (c) 2016-2017, Linaro Ltd
Bjorn Andersson835764dd2017-08-24 12:51:26 +05304 */
5
6#ifndef __QCOM_GLINK_NATIVE_H__
7#define __QCOM_GLINK_NATIVE_H__
8
Sricharan Rd31ad612017-08-24 12:51:32 +05309#define GLINK_FEATURE_INTENT_REUSE BIT(0)
10#define GLINK_FEATURE_MIGRATION BIT(1)
11#define GLINK_FEATURE_TRACER_PKT BIT(2)
12
Bjorn Andersson835764dd2017-08-24 12:51:26 +053013struct qcom_glink_pipe {
14 size_t length;
15
16 size_t (*avail)(struct qcom_glink_pipe *glink_pipe);
17
18 void (*peak)(struct qcom_glink_pipe *glink_pipe, void *data,
Bjorn Anderssonb88eee92017-08-24 12:51:36 +053019 unsigned int offset, size_t count);
Bjorn Andersson835764dd2017-08-24 12:51:26 +053020 void (*advance)(struct qcom_glink_pipe *glink_pipe, size_t count);
21
22 void (*write)(struct qcom_glink_pipe *glink_pipe,
23 const void *hdr, size_t hlen,
24 const void *data, size_t dlen);
25};
26
27struct qcom_glink;
28
29struct qcom_glink *qcom_glink_native_probe(struct device *dev,
Sricharan Rd31ad612017-08-24 12:51:32 +053030 unsigned long features,
Bjorn Andersson835764dd2017-08-24 12:51:26 +053031 struct qcom_glink_pipe *rx,
Sricharan R933b45d2017-08-24 12:51:34 +053032 struct qcom_glink_pipe *tx,
33 bool intentless);
Bjorn Andersson835764dd2017-08-24 12:51:26 +053034void qcom_glink_native_remove(struct qcom_glink *glink);
35
Bjorn Anderssoncaf989c2017-08-24 12:51:30 +053036void qcom_glink_native_unregister(struct qcom_glink *glink);
Bjorn Andersson835764dd2017-08-24 12:51:26 +053037#endif