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

Commit 1d926433 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "diag: Modularise diagfwd transport bridge registration"

parents a04675ee a77f2f09
Loading
Loading
Loading
Loading
+4 −19
Original line number Diff line number Diff line
@@ -1128,15 +1128,6 @@ static int diag_process_userspace_remote(int proc, void *buf, int len)
	return diagfwd_bridge_write(bridge_index, buf, len);
}
#else
int diag_remote_init(void)
{
	return 0;
}

void diag_remote_exit(void)
{
}

uint16_t diag_get_remote_device_mask(void)
{
	return 0;
@@ -4225,11 +4216,8 @@ static int __init diagchar_init(void)
	INIT_LIST_HEAD(&driver->diag_id_list);
	diag_add_diag_id_to_list(DIAG_ID_APPS, "APPS", APPS_DATA, APPS_DATA);
	pr_debug("diagchar initialized now");
#if defined(CONFIG_USB_QCOM_DIAG_BRIDGE)
	diag_register_with_hsic();
#elif defined(CONFIG_MHI_BUS)
	diag_register_with_mhi();
#endif
	if (IS_ENABLED(CONFIG_DIAGFWD_BRIDGE_CODE))
		diag_register_with_bridge();
	return 0;

fail:
@@ -4257,11 +4245,8 @@ static void diagchar_exit(void)
	diag_dci_exit();
	diag_masks_exit();
	diag_md_session_exit();
#if defined(CONFIG_USB_QCOM_DIAG_BRIDGE)
	diag_unregister_hsic();
#elif defined(CONFIG_MHI_BUS)
	diag_unregister_mhi();
#endif
	if (IS_ENABLED(CONFIG_DIAGFWD_BRIDGE_CODE))
		diag_unregister_bridge();
	diag_debugfs_cleanup();
	diagchar_cleanup();
	pr_info("done diagchar exit\n");
+15 −2
Original line number Diff line number Diff line
@@ -20,9 +20,7 @@
#include <linux/platform_device.h>
#include "diag_mux.h"
#include "diagfwd_bridge.h"
#ifdef CONFIG_USB_QCOM_DIAG_BRIDGE
#include "diagfwd_hsic.h"
#endif
#include "diagfwd_mhi.h"
#include "diag_dci.h"
#include "diag_ipc_logging.h"
@@ -268,3 +266,18 @@ uint16_t diag_get_remote_device_mask(void)
	return remote_dev;
}

void diag_register_with_bridge(void)
{
	if (IS_ENABLED(CONFIG_USB_QCOM_DIAG_BRIDGE))
		diag_register_with_hsic();
	else if (IS_ENABLED(CONFIG_MHI_BUS))
		diag_register_with_mhi();
}

void diag_unregister_bridge(void)
{
	if (IS_ENABLED(CONFIG_USB_QCOM_DIAG_BRIDGE))
		diag_unregister_hsic();
	else if (IS_ENABLED(CONFIG_MHI_BUS))
		diag_unregister_mhi();
}
+2 −0
Original line number Diff line number Diff line
@@ -63,4 +63,6 @@ int diag_remote_dev_read_done(int id, unsigned char *buf, int len);
int diag_remote_dev_write_done(int id, unsigned char *buf, int len, int ctxt);
int diag_remote_init(void);
void diag_remote_exit(void);
void diag_register_with_bridge(void);
void diag_unregister_bridge(void);
#endif