diff mbox series

[V1,1/3] usb: misc: Add the interface for notifier call for Embedded USB Debugger(EUD)

Message ID a2b04d69396c9522327f6c0f22637a83161a5fe9.1689148711.git.quic_schowdhu@quicinc.com (mailing list archive)
State New, archived
Headers show
Series Add notifier call chain to Embedded USB Debug(EUD) driver | expand

Commit Message

Souradeep Chowdhury July 12, 2023, 8:22 a.m. UTC
Add the interface for notifier calls that can be made to check the role
switch status of EUD. An external module can import this file and use the
wrapper functions eud_register_notify to register a notifier to the EUD
notifier chain, eud_unregister_notify to unregister the notifier from the
chain, eud_notifier_call_chain to call the notifier chain to check the
status of role-switch. These interfaces are provided to handle the case
where multiple modules might go for a role-switch on the same port in which
case EUD will be given priority over the rest.

Signed-off-by: Souradeep Chowdhury <quic_schowdhu@quicinc.com>
---
 drivers/usb/misc/qcom_eud_notifier.h | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 drivers/usb/misc/qcom_eud_notifier.h

Comments

Greg Kroah-Hartman July 12, 2023, 4:41 p.m. UTC | #1
On Wed, Jul 12, 2023 at 01:52:38PM +0530, Souradeep Chowdhury wrote:
> Add the interface for notifier calls that can be made to check the role
> switch status of EUD. An external module can import this file and use the
> wrapper functions eud_register_notify to register a notifier to the EUD
> notifier chain, eud_unregister_notify to unregister the notifier from the
> chain, eud_notifier_call_chain to call the notifier chain to check the
> status of role-switch. These interfaces are provided to handle the case
> where multiple modules might go for a role-switch on the same port in which
> case EUD will be given priority over the rest.
> 
> Signed-off-by: Souradeep Chowdhury <quic_schowdhu@quicinc.com>
> ---
>  drivers/usb/misc/qcom_eud_notifier.h | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>  create mode 100644 drivers/usb/misc/qcom_eud_notifier.h
> 
> diff --git a/drivers/usb/misc/qcom_eud_notifier.h b/drivers/usb/misc/qcom_eud_notifier.h
> new file mode 100644
> index 000000000000..0cae42a5f6bf
> --- /dev/null
> +++ b/drivers/usb/misc/qcom_eud_notifier.h
> @@ -0,0 +1,10 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +/*
> + * Released under the GPLv2 only.
> + */
> +
> +#include <linux/notifier.h>
> +
> +extern int eud_register_notify(struct notifier_block *nb);
> +extern void eud_unregister_notify(struct notifier_block *nb);
> +extern void eud_notifier_call_chain(unsigned long role_switch_state);
> -- 
> 2.17.1
> 

Don't add .h files that no one actually use.
diff mbox series

Patch

diff --git a/drivers/usb/misc/qcom_eud_notifier.h b/drivers/usb/misc/qcom_eud_notifier.h
new file mode 100644
index 000000000000..0cae42a5f6bf
--- /dev/null
+++ b/drivers/usb/misc/qcom_eud_notifier.h
@@ -0,0 +1,10 @@ 
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Released under the GPLv2 only.
+ */
+
+#include <linux/notifier.h>
+
+extern int eud_register_notify(struct notifier_block *nb);
+extern void eud_unregister_notify(struct notifier_block *nb);
+extern void eud_notifier_call_chain(unsigned long role_switch_state);