summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/mmc/core.h2
-rw-r--r--include/linux/mmc/host.h1
-rw-r--r--include/linux/usb/diag_bridge.h54
-rw-r--r--include/linux/usb/ipc_bridge.h65
4 files changed, 122 insertions, 0 deletions
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
index 862d8d1bae8f..ef3e628388cf 100644
--- a/include/linux/mmc/core.h
+++ b/include/linux/mmc/core.h
@@ -131,6 +131,8 @@ struct mmc_bus_ops {
int (*shutdown)(struct mmc_host *);
int (*reset)(struct mmc_host *);
int (*change_bus_speed)(struct mmc_host *, unsigned long *);
+ int (*pre_hibernate)(struct mmc_host *);
+ int (*post_hibernate)(struct mmc_host *);
};
struct mmc_card;
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index f564303a28f9..89e19dd4b144 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -419,6 +419,7 @@ struct mmc_host {
#define MMC_CAP_HW_RESET (1 << 31) /* Hardware reset */
u32 caps2; /* More host capabilities */
+ u32 cached_caps2;
#define MMC_CAP2_BOOTPART_NOACC (1 << 0) /* Boot partition no access */
#define MMC_CAP2_FULL_PWR_CYCLE (1 << 2) /* Can do full power cycle */
diff --git a/include/linux/usb/diag_bridge.h b/include/linux/usb/diag_bridge.h
new file mode 100644
index 000000000000..e82c65330722
--- /dev/null
+++ b/include/linux/usb/diag_bridge.h
@@ -0,0 +1,54 @@
+/* Copyright (c) 2011, 2013, 2018, 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
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __LINUX_USB_DIAG_BRIDGE_H__
+#define __LINUX_USB_DIAG_BRIDGE_H__
+
+struct diag_bridge_ops {
+ void *ctxt;
+ void (*read_complete_cb)(void *ctxt, char *buf,
+ int buf_size, int actual);
+ void (*write_complete_cb)(void *ctxt, char *buf,
+ int buf_size, int actual);
+ int (*suspend)(void *ctxt);
+ void (*resume)(void *ctxt);
+};
+
+#if IS_ENABLED(CONFIG_USB_QCOM_DIAG_BRIDGE)
+
+extern int diag_bridge_read(int id, char *data, int size);
+extern int diag_bridge_write(int id, char *data, int size);
+extern int diag_bridge_open(int id, struct diag_bridge_ops *ops);
+extern void diag_bridge_close(int id);
+
+#else
+
+static int __maybe_unused diag_bridge_read(int id, char *data, int size)
+{
+ return -ENODEV;
+}
+
+static int __maybe_unused diag_bridge_write(int id, char *data, int size)
+{
+ return -ENODEV;
+}
+
+static int __maybe_unused diag_bridge_open(int id, struct diag_bridge_ops *ops)
+{
+ return -ENODEV;
+}
+
+static void __maybe_unused diag_bridge_close(int id) { }
+
+#endif
+
+#endif
diff --git a/include/linux/usb/ipc_bridge.h b/include/linux/usb/ipc_bridge.h
new file mode 100644
index 000000000000..a0e12d6f9af5
--- /dev/null
+++ b/include/linux/usb/ipc_bridge.h
@@ -0,0 +1,65 @@
+/* Copyright (c) 2013 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
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __MSM_IPC_BRIDGE_H__
+#define __MSM_IPC_BRIDGE_H__
+
+#include <linux/platform_device.h>
+
+/*
+ * The IPC bridge driver adds a IPC bridge platform device when the
+ * underlying transport is ready. The IPC transport driver acts as a
+ * platform driver for this device. The platform data is populated by
+ * IPC bridge driver to facilitate I/O. The callback functions are
+ * passed in platform data to avoid export functions. This would allow
+ * different bridge drivers to exist in the kernel. The IPC bridge driver
+ * removes the platform device when the underly transport is no longer
+ * available. It typically happens during shutdown and remote processor's
+ * subsystem restart.
+ */
+
+/**
+ * struct ipc_bridge_platform_data - platform device data for IPC
+ * transport driver.
+ * @max_read_size: The maximum possible read size.
+ * @max_write_size: The maximum possible write size.
+ * @open: The open must be called before starting I/O. The IPC bridge
+ * driver use the platform device pointer to identify the
+ * underlying transport channel. The IPC bridge driver may
+ * notify that remote processor that it is ready to receive
+ * data. Returns 0 upon success and appropriate error code
+ * upon failure.
+ * @read: The read is done synchronously and should be called from process
+ * context. Returns the number of bytes read from remote
+ * processor or error code upon failure. The IPC transport
+ * driver may pass the buffer of max_read_size length if the
+ * available data size is not known in advance.
+ * @write: The write is done synchronously and should be called from process
+ * context. The IPC bridge driver uses the same buffer for DMA
+ * to avoid additional memcpy. So it must be physically contiguous.
+ * Returns the number of bytes written or error code upon failure.
+ * @close: The close must be called when the IPC bridge platform device
+ * is removed. The IPC transport driver may call close when
+ * it is no longer required to communicate with remote processor.
+ */
+struct ipc_bridge_platform_data {
+ unsigned int max_read_size;
+ unsigned int max_write_size;
+ int (*open)(struct platform_device *pdev);
+ int (*read)(struct platform_device *pdev, char *buf,
+ unsigned int count);
+ int (*write)(struct platform_device *pdev, char *buf,
+ unsigned int count);
+ void (*close)(struct platform_device *pdev);
+};
+
+#endif