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

Commit 36809d1c authored by Tingwei Zhang's avatar Tingwei Zhang
Browse files

soc: qcom: Add a snapshot of QDSS bridge driver



This is the snapshot of the QDSS bridge driver as of msm-4.14 commit
4f22a43 (soc: qcom: qdss_bridge: Add spin_lock for accessing lists).
Use DEVICE_ATTR_RW for mode.

Change-Id: I5fcd2ea772ff47e5fc9e4c4b35a5f954e593e066
Signed-off-by: default avatarTingwei Zhang <tingwei@codeaurora.org>
parent bdd918fd
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -531,6 +531,15 @@ config QCOM_GLINK_PKT
	  This enable the userspace clients to read and write to
	  some glink packets channel.

config QCOM_QDSS_BRIDGE
	bool "Configure bridge driver for QTI/Qualcomm Technologies, Inc. MDM"
	depends on MHI_BUS
	help
	  The driver will help route diag traffic from modem side over the QDSS
	  sub-system to USB on APSS side. The driver acts as a bridge between the
	  MHI and USB interface.
	  If unsure, say N.

config MSM_CDSP_LOADER
	tristate "CDSP loader support"
	help
+1 −0
Original line number Diff line number Diff line
@@ -58,6 +58,7 @@ obj-$(CONFIG_QCOM_BUS_SCALING) += msm_bus/
obj-$(CONFIG_QCOM_FSA4480_I2C) += fsa4480-i2c.o
obj-$(CONFIG_QCOM_GLINK) += glink_probe.o
obj-$(CONFIG_QCOM_GLINK_PKT) += glink_pkt.o
obj-$(CONFIG_QCOM_QDSS_BRIDGE) += qdss_bridge.o
obj-$(CONFIG_QSEE_IPC_IRQ) += qsee_ipc_irq.o
obj-$(CONFIG_QSEE_IPC_IRQ_BRIDGE) += qsee_ipc_irq_bridge.o
obj-$(CONFIG_QPNP_PBS) += qpnp-pbs.o
+932 −0

File added.

Preview size limit exceeded, changes collapsed.

+59 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
 */

#ifndef _QDSS_BRIDGE_H
#define _QDSS_BRIDGE_H

struct qdss_buf_tbl_lst {
	struct list_head link;
	unsigned char *buf;
	struct qdss_request *usb_req;
	atomic_t available;
};

struct qdss_mhi_buf_tbl_t {
	struct list_head link;
	unsigned char *buf;
	size_t len;
};

enum mhi_transfer_mode {
	MHI_TRANSFER_TYPE_USB,
	MHI_TRANSFER_TYPE_UCI,
};

enum open_status {
	DISABLE,
	ENABLE,
	SSR,
};

struct qdss_bridge_drvdata {
	int alias;
	enum open_status opened;
	struct completion completion;
	size_t mtu;
	enum mhi_transfer_mode mode;
	spinlock_t lock;
	struct device *dev;
	struct cdev cdev;
	struct mhi_device *mhi_dev;
	struct work_struct read_work;
	struct work_struct read_done_work;
	struct work_struct open_work;
	struct work_struct close_work;
	struct workqueue_struct *mhi_wq;
	struct mhi_client_handle *hdl;
	struct mhi_client_info_t *client_info;
	struct list_head buf_tbl;
	struct list_head mhi_buf_tbl;
	struct list_head read_done_list;
	struct usb_qdss_ch *usb_ch;
	struct qdss_mhi_buf_tbl_t *cur_buf;
	wait_queue_head_t uci_wq;
	size_t rx_size;
};

#endif