Files
android_kernel_xiaomi_sm8450/include/trace/hooks/usb.h
Puma Hsu 98085b5dd8 ANDROID: usb: Add vendor hook for usb suspend and resume
Add the hook that vendor can design and bypass the suspend/resume.
When the bypass is set, skip the orignal suspend/resume methods.

In mobile, a co-processor can be used with USB audio, and ACPU may
be able to sleep in such condition to improve power consumption.
We will need vendor hook to support this.

Bug: 192774581
Signed-off-by: Puma Hsu <pumahsu@google.com>
Change-Id: Ic62a8a1e662bbe3fb0aa17af7491daace0b9f18a
2021-07-12 09:06:49 +00:00

28 lines
858 B
C

/* SPDX-License-Identifier: GPL-2.0 */
#undef TRACE_SYSTEM
#define TRACE_SYSTEM usb
#undef TRACE_INCLUDE_PATH
#define TRACE_INCLUDE_PATH trace/hooks
#if !defined(_TRACE_HOOK_USB_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_HOOK_USB_H
#include <linux/tracepoint.h>
#include <linux/usb.h>
#include <trace/hooks/vendor_hooks.h>
/*
* Following tracepoints are not exported in tracefs and provide a
* mechanism for vendor modules to hook and extend functionality
*/
DECLARE_HOOK(android_vh_usb_dev_suspend,
TP_PROTO(struct usb_device *udev, pm_message_t msg, int *bypass),
TP_ARGS(udev, msg, bypass));
DECLARE_HOOK(android_vh_usb_dev_resume,
TP_PROTO(struct usb_device *udev, pm_message_t msg, int *bypass),
TP_ARGS(udev, msg, bypass));
#endif /* _TRACE_HOOK_USB_H */
/* This part must be outside protection */
#include <trace/define_trace.h>