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

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

Merge "usb: bam: remove deprecated IPA code"

parents f025c8a6 3cd98b93
Loading
Loading
Loading
Loading
+4 −69
Original line number Diff line number Diff line
@@ -1125,53 +1125,6 @@ static void stop_cons_transfers(struct usb_bam_pipe_connect *pipe_connect)
	}
}

static int ipa_suspend_pipes(enum usb_bam cur_bam, u32 idx)
{
	struct usb_bam_pipe_connect *dst_pipe, *src_pipe;
	int ret1, ret2;

	dst_pipe = &usb_bam_connections[info[cur_bam].suspend_dst_idx[idx]];
	src_pipe = &usb_bam_connections[info[cur_bam].suspend_src_idx[idx]];

	if (dst_pipe->ipa_clnt_hdl == -1 ||
		src_pipe->ipa_clnt_hdl == -1) {
		pr_err("%s: One of handles is -1, not connected?", __func__);
	}

	ret1 = ipa_suspend(dst_pipe->ipa_clnt_hdl);
	if (ret1)
		pr_err("%s: ipa_suspend on dst failed with %d", __func__, ret1);

	ret2 = ipa_suspend(src_pipe->ipa_clnt_hdl);
	if (ret2)
		pr_err("%s: ipa_suspend on src failed with %d", __func__, ret2);

	return ret1 | ret2;
}

static int ipa_resume_pipes(enum usb_bam cur_bam, u32 idx)
{
	struct usb_bam_pipe_connect *dst_pipe, *src_pipe;
	int ret1, ret2;

	src_pipe = &usb_bam_connections[info[cur_bam].resume_src_idx[idx]];
	dst_pipe = &usb_bam_connections[info[cur_bam].resume_dst_idx[idx]];

	if (dst_pipe->ipa_clnt_hdl == -1 ||
		src_pipe->ipa_clnt_hdl == -1) {
		pr_err("%s: One of handles is -1, not connected?", __func__);
	}

	ret1 = ipa_resume(dst_pipe->ipa_clnt_hdl);
	if (ret1)
		pr_err("%s: ipa_resume on dst failed with %d", __func__, ret1);
	ret2 = ipa_resume(src_pipe->ipa_clnt_hdl);
	if (ret2)
		pr_err("%s: ipa_resume on src failed with %d", __func__, ret2);

	return ret1 | ret2;
}

static void resume_suspended_pipes(enum usb_bam cur_bam)
{
	u32 idx, dst_idx;
@@ -1184,9 +1137,6 @@ static void resume_suspended_pipes(enum usb_bam cur_bam)
		dst_idx = info[cur_bam].resume_dst_idx[idx];
		pipe_connect = &usb_bam_connections[dst_idx];
		if (pipe_connect->cons_stopped) {
			spin_unlock(&usb_bam_ipa_handshake_info_lock);
			ipa_resume_pipes(cur_bam, idx);
			spin_lock(&usb_bam_ipa_handshake_info_lock);
			pr_debug("%s: Starting CONS on %d", __func__, dst_idx);
			start_cons_transfers(pipe_connect);
		}
@@ -1272,7 +1222,6 @@ static void usb_bam_finish_suspend(enum usb_bam cur_bam)
					IPA_RM_RESOURCE_RELEASED,
					ipa_rm_resource_cons[cur_bam]);
			}
			ipa_suspend_pipes(cur_bam, idx);
			spin_lock(&usb_bam_ipa_handshake_info_lock);
			info[cur_bam].resume_src_idx[idx] =
				info[cur_bam].suspend_src_idx[idx];
@@ -1351,9 +1300,7 @@ static void usb_prod_notify_cb(void *user_data, enum ipa_rm_event event,
}

/**
 * usb_bam_resume_host: vote for hsic host core resume. In
 * addition also resume all hsic pipes that are connected to the
 * ipa peer bam.
 * usb_bam_resume_host: vote for hsic host core resume.
 *
 * NOTE: This function should be called in a context that hold
 *	 usb_bam_lock.
@@ -1370,12 +1317,8 @@ static void usb_bam_resume_host(enum usb_bam bam_type)
			pipe_iter = &usb_bam_connections[i];
			if (pipe_iter->bam_type == bam_type &&
			    pipe_iter->enabled &&
			    pipe_iter->suspended) {
				spin_unlock(&usb_bam_lock);
				ipa_resume(pipe_iter->ipa_clnt_hdl);
			    pipe_iter->suspended)
				pipe_iter->suspended = false;
				spin_lock(&usb_bam_lock);
			}
		}
}

@@ -1821,9 +1764,6 @@ static void usb_bam_finish_resume(struct work_struct *w)
		dst_idx = info[cur_bam].resume_dst_idx[idx];
		pipe_connect = &usb_bam_connections[dst_idx];
		if (pipe_connect->cons_stopped) {
			spin_unlock(&usb_bam_ipa_handshake_info_lock);
			ipa_resume_pipes(cur_bam, idx);
			spin_lock(&usb_bam_ipa_handshake_info_lock);
			pr_debug("%s: Starting CONS on %d", __func__, dst_idx);
			start_cons_transfers(pipe_connect);
		}
@@ -1983,13 +1923,8 @@ bool msm_bam_host_lpm_ok(enum usb_bam bam_type)
					&usb_bam_connections[i];
				if (pipe_iter->bam_type == bam_type &&
				    pipe_iter->enabled &&
				    !pipe_iter->suspended) {
					spin_unlock(&usb_bam_lock);
					ipa_suspend(
					   pipe_iter->ipa_clnt_hdl);
				    !pipe_iter->suspended)
					pipe_iter->suspended = true;
					spin_lock(&usb_bam_lock);
				}
			}

			host_info[bam_type].in_lpm = true;
@@ -2245,7 +2180,7 @@ static void usb_bam_work(struct work_struct *w)
		 * the hsic bam clocks are already enabled, so no need
		 * to actualluy resume the hardware... However, we still need
		 * to update the usb bam driver state (to set in_lpm=false),
		 * and to wake ipa (ipa_resume) and to hold again the hsic host
		 * and to wake ipa and to hold again the hsic host
		 * device again to avoid it going to low poer mode next time
		 * until we complete releasing the hsic consumer and producer
		 * resources against the ipa resource manager.