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

Commit bcd93bb6 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: changes for HSIC IPA functionality"

parents e1ccb021 5a11767b
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -261,7 +261,8 @@ static int get_bam_type_from_core_name(const char *name)
		strnstr(name, "dwc3", USB_BAM_MAX_STR_LEN))
		return DWC3_CTRL;
	else if (strnstr(name, bam_enable_strings[HSIC_CTRL],
			USB_BAM_MAX_STR_LEN))
			USB_BAM_MAX_STR_LEN) ||
		strnstr(name, "ci13xxx_msm_hsic", USB_BAM_MAX_STR_LEN))
		return HSIC_CTRL;
	else if (strnstr(name, bam_enable_strings[CI_CTRL],
			USB_BAM_MAX_STR_LEN) ||
@@ -3491,6 +3492,12 @@ int usb_bam_get_connection_idx(const char *core_name, enum peer_bam client,
}
EXPORT_SYMBOL(usb_bam_get_connection_idx);

int usb_bam_get_bam_type(int connection_idx)
{
	return usb_bam_connections[connection_idx].bam_type;
}
EXPORT_SYMBOL(usb_bam_get_bam_type);

bool msm_bam_device_lpm_ok(enum usb_ctrl bam_type)
{
	pr_debug("%s: enter bam%s\n", __func__, bam_enable_strings[bam_type]);
+2 −2
Original line number Diff line number Diff line
@@ -3613,8 +3613,8 @@ static int android_create_device(struct android_dev *dev, u8 usb_core_id)
	snprintf(device_node_name, ANDROID_DEVICE_NODE_NAME_LENGTH,
		 "android%d", usb_core_id);
	pr_debug("%s(): creating android%d device\n", __func__, usb_core_id);
	dev->dev = device_create(android_class, NULL,
					MKDEV(0, 0), NULL, device_node_name);
	dev->dev = device_create(android_class, NULL, MKDEV(0, usb_core_id),
		NULL, device_node_name);
	if (IS_ERR(dev->dev))
		return PTR_ERR(dev->dev);

+32 −25
Original line number Diff line number Diff line
@@ -950,7 +950,6 @@ static void bam2bam_data_connect_work(struct work_struct *w)

		d_port->ipa_consumer_ep = d->ipa_params.ipa_cons_ep_idx;

		if (gadget_is_dwc3(gadget)) {
		d->src_bam_idx = usb_bam_get_connection_idx(
				gadget->name,
				IPA_P_BAM, USB_TO_PEER_PERIPHERAL,
@@ -961,11 +960,10 @@ static void bam2bam_data_connect_work(struct work_struct *w)
			return;
		}

		if (gadget_is_dwc3(gadget))
			configure_usb_data_fifo(d->src_bam_idx,
					port->port_usb->out,
					d->src_pipe_type);
		}


		/* Remove support for UL using system-to-IPA towards DL */
		if (d->src_pipe_type == USB_BAM_PIPE_SYS2BAM) {
@@ -1006,7 +1004,6 @@ static void bam2bam_data_connect_work(struct work_struct *w)
				__func__, d_port->ipa_producer_ep,
				d_port->ipa_consumer_ep);

		if (gadget_is_dwc3(gadget)) {
		d->dst_bam_idx = usb_bam_get_connection_idx(
				gadget->name,
				IPA_P_BAM, PEER_PERIPHERAL_TO_USB,
@@ -1017,10 +1014,10 @@ static void bam2bam_data_connect_work(struct work_struct *w)
			return;
		}

		if (gadget_is_dwc3(gadget))
			configure_usb_data_fifo(d->dst_bam_idx,
					port->port_usb->in,
					d->dst_pipe_type);
		}

		/* Upadate BAM specific attributes in usb_request */
		if (gadget_is_dwc3(gadget)) {
@@ -1250,8 +1247,6 @@ int bam2bam_data_port_select(int portno)
	d = &port->data_ch;
	d->port = port;
	bam2bam_data_ports[portno] = port;
	d->ipa_params.src_client = IPA_CLIENT_USB_PROD;
	d->ipa_params.dst_client = IPA_CLIENT_USB_CONS;

	/* UL workaround requirements */
	skb_queue_head_init(&d->rx_skb_q);
@@ -1457,6 +1452,18 @@ int bam_data_connect(struct data_port *gr, u8 port_num,
	d->rx_buffer_size = (gr->rx_buffer_size ? gr->rx_buffer_size :
					bam_mux_rx_req_size);

	/*
	 * Both source (consumer) and destination (producer) use the same
	 * controller, so checking just one of them should suffice.
	 */
	if (usb_bam_get_bam_type(src_connection_idx) == HSIC_CTRL) {
		d->ipa_params.src_client = IPA_CLIENT_HSIC1_PROD;
		d->ipa_params.dst_client = IPA_CLIENT_HSIC1_CONS;
	} else {
		d->ipa_params.src_client = IPA_CLIENT_USB_PROD;
		d->ipa_params.dst_client = IPA_CLIENT_USB_CONS;
	}

	pr_debug("%s(): rx_buffer_size:%d\n", __func__, d->rx_buffer_size);
	if (trans == USB_GADGET_XPORT_BAM2BAM_IPA) {
		d->ipa_params.src_pipe = &(d->src_pipe_idx);
+14 −0
Original line number Diff line number Diff line
@@ -413,6 +413,15 @@ void usb_bam_set_qdss_core(const char *qdss_core);
int usb_bam_get_connection_idx(const char *name, enum peer_bam client,
	enum usb_bam_pipe_dir dir, enum usb_bam_mode bam_mode, u32 num);

/**
* return the usb controller bam type used for the supplied connection index
*
* @connection_idx - Connection index
*
* @return usb control bam type
*/
int usb_bam_get_bam_type(int connection_idx);

/**
* Indicates the type of connection the USB side of the connection is.
*
@@ -527,6 +536,11 @@ static inline int usb_bam_get_connection_idx(const char *name,
	return -ENODEV;
}

static inline int usb_bam_get_bam_type(int connection_idx)
{
	return -ENODEV;
}

static inline int usb_bam_get_pipe_type(u8 idx, enum usb_bam_pipe_type *type)
{
	return -ENODEV;