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

Commit ebdbd365 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: u_data_ipa: Add support for BAM2BAM_IPA"

parents 92495037 4b64c291
Loading
Loading
Loading
Loading
+50 −27
Original line number Diff line number Diff line
/* Copyright (c) 2014-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2014-2018, The Linux Foundation. All rights reserved.
 *
 * 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
@@ -451,6 +451,7 @@ static void ipa_data_connect_work(struct work_struct *w)

	/* update IPA Parameteres here. */
	port->ipa_params.usb_connection_speed = gadget->speed;
	if (!gadget->is_chipidea)
		port->ipa_params.reset_pipe_after_lpm =
			msm_dwc3_reset_ep_after_lpm(gadget);
	port->ipa_params.skip_ep_cfg = true;
@@ -469,7 +470,7 @@ static void ipa_data_connect_work(struct work_struct *w)
				__func__);
			goto out;
		}

		if (!gadget->is_chipidea) {
			sps_params = MSM_SPS_MODE | MSM_DISABLE_WB
				| MSM_PRODUCER | port->src_pipe_idx;
			port->rx_req->length = 32*1024;
@@ -483,6 +484,16 @@ static void ipa_data_connect_work(struct work_struct *w)
				spin_unlock_irqrestore(&port->port_lock, flags);
				goto out;
			}
		} else {
			/* gadget->is_chipidea */
			get_bam2bam_connection_info(port->usb_bam_type,
					port->src_connection_idx,
					&port->src_pipe_idx,
					NULL, NULL, NULL);
			sps_params = (MSM_SPS_MODE | port->src_pipe_idx |
				MSM_VENDOR_ID) & ~MSM_IS_FINITE_TRANSFER;
			port->rx_req->udc_priv = sps_params;
		}
	}

	if (gport->in) {
@@ -496,18 +507,30 @@ static void ipa_data_connect_work(struct work_struct *w)
				__func__);
			goto unconfig_msm_ep_out;
		}
		if (!gadget->is_chipidea) {
			sps_params = MSM_SPS_MODE | MSM_DISABLE_WB |
				port->dst_pipe_idx;
			port->tx_req->length = 32*1024;
			port->tx_req->udc_priv = sps_params;
			configure_fifo(port->usb_bam_type,
					port->dst_connection_idx, gport->in);

			ret = msm_ep_config(gport->in, port->tx_req);
			if (ret) {
				pr_err("msm_ep_config() failed for IN EP\n");
				spin_unlock_irqrestore(&port->port_lock, flags);
				goto unconfig_msm_ep_out;
			}
		} else {
			/* gadget->is_chipidea */
			get_bam2bam_connection_info(port->usb_bam_type,
					port->dst_connection_idx,
					&port->dst_pipe_idx,
					NULL, NULL, NULL);
			sps_params = (MSM_SPS_MODE | port->dst_pipe_idx |
				MSM_VENDOR_ID) & ~MSM_IS_FINITE_TRANSFER;
			port->tx_req->udc_priv = sps_params;
		}
	}

	if (port->func_type == USB_IPA_FUNC_RMNET) {
@@ -1163,8 +1186,8 @@ static void bam2bam_data_resume_work(struct work_struct *w)
		spin_unlock_irqrestore(&port->port_lock, flags);
		msm_dwc3_reset_dbm_ep(port->port_usb->in);
		spin_lock_irqsave(&port->port_lock, flags);
		usb_bam_resume(port->usb_bam_type, &port->ipa_params);
	}
	usb_bam_resume(port->usb_bam_type, &port->ipa_params);

exit:
	spin_unlock_irqrestore(&port->port_lock, flags);