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

Commit 85e28b13 authored by Prasadarao Durvasula's avatar Prasadarao Durvasula Committed by Sivasri Kumar Vanka
Browse files

usb: gadget: handle bam setup and cleanup for mbim in u_bam_dmux



When usb composition contains RMNET and MBIM functions, then
handle bam setup for mbim.
As RMNET and MBIM use same bam channel 8, In multi-function
usb compositions, RMNET binding happens before MBIM binding.
bam setup happens in binding operation. So if binding operation
happens for RMNET, then binding operation for MBIM is not required.

Depends on host selection of RMNET/MBIM function, same bam setup
will be used by one of functions RMNET/MBIM.

In non multi-function usb compositions where only RMNET or MBIM
present, RMNET or MBIM works as usual.

Change-Id: I5200d1a26726ee27e87a51404456232b09751b50
Signed-off-by: default avatarPrasadarao Durvasula <pdurvasu@codeaurora.org>
Signed-off-by: default avatarSivasri Kumar Vanka <sivasri@codeaurora.org>
parent 02752104
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -35,7 +35,6 @@ static struct workqueue_struct *gbam_wq;
static unsigned int n_tx_req_queued;

static unsigned int bam_ch_ids[BAM_DMUX_NUM_FUNCS] = {
	BAM_DMUX_USB_RMNET_0,
	BAM_DMUX_USB_RMNET_0,
	BAM_DMUX_USB_DPL
};
@@ -1026,12 +1025,13 @@ static void gbam_port_free(enum bam_dmux_func_type func)
	struct gbam_port *port = bam_ports[func].port;
	struct platform_driver *pdrv = &bam_ports[func].pdrv;

	if (port)
	if (port) {
		platform_driver_unregister(pdrv);

		kfree(port);
		bam_ports[func].port = NULL;
	}
}

static int gbam_port_alloc(enum bam_dmux_func_type func)
{
@@ -1217,6 +1217,9 @@ static void gbam_debugfs_init(void)
}
static void gbam_debugfs_remove(void)
{
	if (!gbam_dent)
		return;

	debugfs_remove_recursive(gbam_dent);
	debugfs_remove(gbam_dent);
	gbam_dent = NULL;
@@ -1451,6 +1454,7 @@ int gbam_mbim_setup(void)
{
	int ret = 0;

	if (!bam_ports[BAM_DMUX_FUNC_RMNET].port)
		ret = gbam_setup(BAM_DMUX_FUNC_MBIM);

	return ret;
+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@

enum bam_dmux_func_type {
	BAM_DMUX_FUNC_RMNET,
	BAM_DMUX_FUNC_MBIM,
	BAM_DMUX_FUNC_MBIM = 0,
	BAM_DMUX_FUNC_DPL,
	BAM_DMUX_NUM_FUNCS,
};