summaryrefslogtreecommitdiff
path: root/include/linux/msm_mhi.h
diff options
context:
space:
mode:
authorSujeev Dias <sdias@codeaurora.org>2017-02-04 21:04:46 -0800
committerSujeev Dias <sdias@codeaurora.org>2017-03-31 13:44:51 -0700
commitf13bb7cfebc2357881fb3c81d43691639db62dd0 (patch)
tree80221821820af8d4e65a80ef389bb0e0c302b7d0 /include/linux/msm_mhi.h
parent92124c76a2bd3e0c1d98de91d09199558117a1a9 (diff)
mhi: core: add support for subsystem restart and shutdown
Add support for subsystem restart and shutdown processing for slave mode and master mode. CRs-Fixed: 1097560 Change-Id: I8c60605d202d38a7a8f8fb587a179f95ec402692 Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
Diffstat (limited to 'include/linux/msm_mhi.h')
-rw-r--r--include/linux/msm_mhi.h31
1 files changed, 27 insertions, 4 deletions
diff --git a/include/linux/msm_mhi.h b/include/linux/msm_mhi.h
index b9fd610f92da..2b50ce59406e 100644
--- a/include/linux/msm_mhi.h
+++ b/include/linux/msm_mhi.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2014-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
@@ -13,6 +13,7 @@
#define MSM_MHI_H
#include <linux/types.h>
#include <linux/device.h>
+#include <linux/scatterlist.h>
#define MHI_DMA_MASK 0xFFFFFFFFFFULL
#define MHI_MAX_MTU 0xFFFF
@@ -77,6 +78,7 @@ enum MHI_CB_REASON {
MHI_CB_MHI_ENABLED,
MHI_CB_MHI_SHUTDOWN,
MHI_CB_SYS_ERROR,
+ MHI_CB_RDDM,
};
enum MHI_FLAGS {
@@ -128,16 +130,22 @@ struct __packed bhi_vec_entry {
* @dev: device node points to of_node
* @pdev: pci device node
* @resource: bar memory space and IRQ resources
+ * @support_rddm: this device support ramdump collection
+ * @rddm_size: size of ramdump buffer in bytes to allocate
* @pm_runtime_get: fp for bus masters rpm pm_runtime_get
* @pm_runtime_noidle: fp for bus masters rpm pm_runtime_noidle
+ * @status_cb: fp for MHI status change notifications
* @mhi_dev_ctxt: private data for host
*/
struct mhi_device {
struct device *dev;
struct pci_dev *pci_dev;
struct resource resources[2];
+ bool support_rddm;
+ size_t rddm_size;
int (*pm_runtime_get)(struct pci_dev *pci_dev);
- void (*pm_runtime_noidle)(struct pci_dev *pci_dev);
+ void (*pm_runtime_put_noidle)(struct pci_dev *pci_dev);
+ void (*status_cb)(enum MHI_CB_REASON, void *priv);
struct mhi_device_ctxt *mhi_dev_ctxt;
};
@@ -148,10 +156,16 @@ enum mhi_dev_ctrl {
MHI_DEV_CTRL_RESUME,
MHI_DEV_CTRL_POWER_OFF,
MHI_DEV_CTRL_POWER_ON,
- MHI_DEV_CTRL_RAM_DUMP,
+ MHI_DEV_CTRL_RDDM,
+ MHI_DEV_CTRL_RDDM_KERNEL_PANIC,
MHI_DEV_CTRL_NOTIFY_LINK_ERROR,
};
+enum mhi_rddm_segment {
+ MHI_RDDM_FW_SEGMENT,
+ MHI_RDDM_RD_SEGMENT,
+};
+
/**
* mhi_is_device_ready - Check if MHI is ready to register clients
*
@@ -173,7 +187,7 @@ bool mhi_is_device_ready(const struct device * const dev,
*/
int mhi_register_device(struct mhi_device *mhi_device,
const char *node_name,
- unsigned long user_data);
+ void *user_data);
/**
* mhi_pm_control_device - power management control api
@@ -185,6 +199,15 @@ int mhi_pm_control_device(struct mhi_device *mhi_device,
enum mhi_dev_ctrl ctrl);
/**
+ * mhi_xfer_rddm - transfer rddm segment to bus master
+ * @mhi_device: registered device structure
+ * @seg: scatterlist pointing to segments
+ * @Return: # of segments, 0 if no segment available
+ */
+int mhi_xfer_rddm(struct mhi_device *mhi_device, enum mhi_rddm_segment seg,
+ struct scatterlist **sg_list);
+
+/**
* mhi_deregister_channel - de-register callbacks from MHI
*
* @client_handle: Handle populated by MHI, opaque to client