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

Commit 715cf875 authored by Lena Salman's avatar Lena Salman
Browse files

usb: usb_bam: Add generic support for host mode



USB BAM driver supports essentially two types of BAM pipes.
One is USB device mode pipe, which is used in USB tethering and
QDSS use cases.
Second is HSIC host mode pipe, which is used in WLAN use case.

Add support for USB host mode pipe, which is needed for ODU use case.
For that, generalize the support for host mode operation, such that it
can support both USB and HSIC.

Change-Id: Id9a6f3f3ae85681beccdabe89ed03a791ecdcfd4
Signed-off-by: default avatarAmit Blay <ablay@codeaurora.org>
Signed-off-by: default avatarLena Salman <esalman@codeaurora.org>
parent fa184d34
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -280,6 +280,10 @@ Optional Properties for Subnode:
- qti,descriptor-fifo-offset: descriptor fifo offset address

Optional properties :
- qti,bam-mode: BAM mode can be one of.
	0 - BAM_MODE_DEVICE
	1 - BAM_MODE_HOST
	(If not set will be set by default to BAM_MODE_DEVICE)
- qti,ignore-core-reset-ack: If present then BAM ignores ACK from USB core
	    while performing PIPE RESET
- qti,disable-clk-gating: If present then disable BAM clock gating.
@@ -303,6 +307,7 @@ Example USB BAM controller device node:
			label = "hsusb-ipa-out-0";
			qti,usb-bam-mem-type = <0>;
			qti,bam-type = <1>;
			qti,bam-mode = <0>;
			qti,dir = <0>;
			qti,pipe-num = <0>;
			qti,peer-bam = <2>;
@@ -317,6 +322,7 @@ Example USB BAM controller device node:
			label = "hsusb-ipa-in-0";
			qti,usb-bam-mem-type = <0>;
			qti,bam-type = <1>;
			qti,bam-mode = <0>;
			qti,dir = <1>;
			qti,pipe-num = <0>;
			qti,peer-bam = <2>;
+9 −2
Original line number Diff line number Diff line
@@ -23,6 +23,11 @@ enum usb_bam {
	MAX_BAMS,
};

enum usb_bam_mode {
	USB_BAM_DEVICE = 0,
	USB_BAM_HOST,
};

enum peer_bam {
	A2_P_BAM = 0,
	QDSS_P_BAM,
@@ -120,6 +125,7 @@ struct usb_bam_pipe_connect {
	enum usb_pipe_mem_type mem_type;
	enum usb_bam_pipe_dir dir;
	enum usb_bam bam_type;
	enum usb_bam_mode bam_mode;
	enum peer_bam peer_bam;
	u32 src_phy_addr;
	u32 src_pipe_index;
@@ -357,7 +363,7 @@ void usb_bam_set_qdss_core(const char *qdss_core);
* @return 0 on success, negative value on error
*/
int usb_bam_get_connection_idx(const char *name, enum peer_bam client,
	enum usb_bam_pipe_dir dir, u32 num);
	enum usb_bam_pipe_dir dir, enum usb_bam_mode bam_mode, u32 num);

#else
static inline int usb_bam_connect(u8 idx, u32 *bam_pipe_idx)
@@ -448,7 +454,8 @@ static inline void usb_bam_set_qdss_core(const char *qdss_core)
}

static inline int usb_bam_get_connection_idx(const char *name,
		enum peer_bam client, enum usb_bam_pipe_dir dir, u32 num)
		enum peer_bam client, enum usb_bam_pipe_dir dir,
		enum usb_bam_mode bam_mode, u32 num)
{
	return -ENODEV;
}
+277 −115

File changed.

Preview size limit exceeded, changes collapsed.

+2 −2

File changed.

Preview size limit exceeded, changes collapsed.

+2 −2

File changed.

Preview size limit exceeded, changes collapsed.

Loading