From 4cdf3aac4db863fa77dfe40647b82d0bfa4632e7 Mon Sep 17 00:00:00 2001 From: Bhaumik Bhatt Date: Fri, 20 Nov 2020 10:00:15 -0800 Subject: [PATCH] bus: mhi: host: Enable support for miscellaneous MHI features Add a new MHI_BUS_MISC Kconfig entry and support to build miscellaneous MHI features in Makefile if enabled. It can be enabled only if necessary for certain controllers and is tied to module init/exit and MHI registration. Change-Id: I36429eed9e786681150aceb494bcd06cf3d09ca9 Signed-off-by: Bhaumik Bhatt Signed-off-by: Lazarus Motha --- drivers/bus/mhi/host/init.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/bus/mhi/host/init.c b/drivers/bus/mhi/host/init.c index 7e830b9a0e95..85b39d69fdac 100644 --- a/drivers/bus/mhi/host/init.c +++ b/drivers/bus/mhi/host/init.c @@ -1021,6 +1021,14 @@ int mhi_register_controller(struct mhi_controller *mhi_cntrl, mhi_cntrl->mhi_dev = mhi_dev; + ret = mhi_misc_register_controller(mhi_cntrl); + if (ret) { + dev_err(mhi_cntrl->cntrl_dev, + "Could not enable miscellaneous features\n"); + mhi_cntrl->mhi_dev = NULL; + goto err_release_dev; + } + mhi_create_debugfs(mhi_cntrl); return 0; @@ -1050,6 +1058,8 @@ void mhi_unregister_controller(struct mhi_controller *mhi_cntrl) unsigned int i; mhi_deinit_free_irq(mhi_cntrl); + mhi_misc_unregister_controller(mhi_cntrl); + /* Free the memory controller wanted to preserve for BHIe images */ if (mhi_cntrl->img_pre_alloc) { mhi_cntrl->img_pre_alloc = false; @@ -1445,12 +1455,14 @@ struct bus_type mhi_bus_type = { static int __init mhi_init(void) { + mhi_misc_init(); mhi_debugfs_init(); return bus_register(&mhi_bus_type); } static void __exit mhi_exit(void) { + mhi_misc_exit(); mhi_debugfs_exit(); bus_unregister(&mhi_bus_type); }