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

Commit e21ba989 authored by Ajay Agarwal's avatar Ajay Agarwal
Browse files

diag: Add support for diagfwd via USB



Some devices need diagfwd via USB. Add support for the same based
on USB_QCOM_DIAG_BRIDGE config option.

Change-Id: I8c5c5a5ec4d0d76fec4380241564b2973442b66a
Signed-off-by: default avatarAjay Agarwal <ajaya@codeaurora.org>
parent 10be142e
Loading
Loading
Loading
Loading
+7 −2
Original line number Original line Diff line number Diff line
@@ -42,6 +42,7 @@
#include "diag_ipc_logging.h"
#include "diag_ipc_logging.h"
#include "diagfwd_peripheral.h"
#include "diagfwd_peripheral.h"
#include "diagfwd_mhi.h"
#include "diagfwd_mhi.h"
#include "diagfwd_hsic.h"


#include <linux/coresight-stm.h>
#include <linux/coresight-stm.h>
#include <linux/kernel.h>
#include <linux/kernel.h>
@@ -4224,7 +4225,9 @@ static int __init diagchar_init(void)
	INIT_LIST_HEAD(&driver->diag_id_list);
	INIT_LIST_HEAD(&driver->diag_id_list);
	diag_add_diag_id_to_list(DIAG_ID_APPS, "APPS", APPS_DATA, APPS_DATA);
	diag_add_diag_id_to_list(DIAG_ID_APPS, "APPS", APPS_DATA, APPS_DATA);
	pr_debug("diagchar initialized now");
	pr_debug("diagchar initialized now");
#ifdef CONFIG_DIAGFWD_BRIDGE_CODE
#if defined(CONFIG_USB_QCOM_DIAG_BRIDGE)
	diag_register_with_hsic();
#elif defined(CONFIG_MHI_BUS)
	diag_register_with_mhi();
	diag_register_with_mhi();
#endif
#endif
	return 0;
	return 0;
@@ -4254,7 +4257,9 @@ static void diagchar_exit(void)
	diag_dci_exit();
	diag_dci_exit();
	diag_masks_exit();
	diag_masks_exit();
	diag_md_session_exit();
	diag_md_session_exit();
#ifdef CONFIG_DIAGFWD_BRIDGE_CODE
#if defined(CONFIG_USB_QCOM_DIAG_BRIDGE)
	diag_unregister_hsic();
#elif defined(CONFIG_MHI_BUS)
	diag_unregister_mhi();
	diag_unregister_mhi();
#endif
#endif
	diag_debugfs_cleanup();
	diag_debugfs_cleanup();
+20 −2
Original line number Original line Diff line number Diff line
/* Copyright (c) 2012-2014, 2016-2018 The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2014, 2016-2019, The Linux Foundation. All rights reserved.
 *
 *
 * This program is free software; you can redistribute it and/or modify
 * 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
 * it under the terms of the GNU General Public License version 2 and
@@ -533,6 +533,24 @@ void diag_hsic_exit(void)
		if (ch->hsic_wq)
		if (ch->hsic_wq)
			destroy_workqueue(ch->hsic_wq);
			destroy_workqueue(ch->hsic_wq);
	}
	}
	platform_driver_unregister(&msm_hsic_ch_driver);
}
}


void diag_register_with_hsic(void)
{
	int ret = 0;

	ret = diag_remote_init();
	if (ret)
		return;

	ret = diag_hsic_init();
	if (ret)
		diag_remote_exit();
}

void diag_unregister_hsic(void)
{
	platform_driver_unregister(&msm_hsic_ch_driver);
	diag_hsic_exit();
	diag_remote_exit();
}
+3 −1
Original line number Original line Diff line number Diff line
/* Copyright (c) 2012-2014, 2017-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2014, 2017-2019, The Linux Foundation. All rights reserved.
 *
 *
 * This program is free software; you can redistribute it and/or modify
 * 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
 * it under the terms of the GNU General Public License version 2 and
@@ -52,6 +52,8 @@ extern struct diag_hsic_info diag_hsic[NUM_HSIC_DEV];


int diag_hsic_init(void);
int diag_hsic_init(void);
void diag_hsic_exit(void);
void diag_hsic_exit(void);
void diag_register_with_hsic(void);
void diag_unregister_hsic(void);


#endif
#endif