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

Commit 487209ed authored by Chetan C R's avatar Chetan C R
Browse files

drivers: soc: qcom: Add usb bam changes



There is some comilation errors in usb bam drivers.
This fixes compilation issue by adding the required
members in usb bam drivers.

Change-Id: If41a6ab72c5701f1088634b2bd5050b55901dac0
Signed-off-by: default avatarChetan C R <cchinnad@codeaurora.org>
parent 0f1b0356
Loading
Loading
Loading
Loading
+22 −4
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2011-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2011-2020, The Linux Foundation. All rights reserved.
 */

#include <linux/kernel.h>
@@ -14,6 +14,7 @@
#include <linux/workqueue.h>
#include <linux/dma-mapping.h>
#include <linux/pm_runtime.h>
#include <linux/delay.h>

#define USB_THRESHOLD 512
#define USB_BAM_MAX_STR_LEN 50
@@ -216,6 +217,17 @@ struct usb_bam_ctx_type {
	spinlock_t		usb_bam_lock;
};

static char *bam_enable_strings[MAX_BAMS] = {
	[DWC3_CTRL] = "ssusb",
};

struct usb_bam_host_info {
	struct device *dev;
	bool in_lpm;
};

static struct usb_bam_host_info host_info[MAX_BAMS];

/*
 * CI_CTRL & DWC3_CTRL shouldn't be used simultaneously
 * since both share the same prod & cons rm resourses
@@ -257,7 +269,7 @@ struct usb_bam_ipa_handshake_info {
	bool in_lpm;
	u8 prod_pipes_enabled_per_bam;

	int (*wake_cb);
	int (*wake_cb)(void *wcb);
	void *wake_param;

	u32 suspend_src_idx[USB_BAM_NR_PORTS];
@@ -314,7 +326,13 @@ static void __maybe_unused put_timestamp(char *tbuf)

static inline enum usb_ctrl get_bam_type_from_core_name(const char *name)
{
	return USB_CTRL_UNUSED;
	if (strnstr(name, bam_enable_strings[DWC3_CTRL],
				USB_BAM_MAX_STR_LEN) ||
			strnstr(name, "dwc3", USB_BAM_MAX_STR_LEN))
		return DWC3_CTRL;

	log_event_err("%s: invalid BAM name(%s)\n", __func__, name);
	return -EINVAL;
}

static void usb_bam_set_inactivity_timer(enum usb_ctrl bam)
@@ -2641,7 +2659,7 @@ static struct msm_usb_bam_data *usb_bam_dt_to_data(
	struct device_node *node = pdev->dev.of_node;
	int rc = 0;
	u8 i = 0;
	u32 bam = USB_CTRL_UNUSED;
	u32 bam;
	u32 addr = 0;
	u32 threshold, max_connections = 0;
	static struct usb_bam_pipe_connect *usb_bam_connections;
+5 −0
Original line number Diff line number Diff line
@@ -543,6 +543,11 @@ struct usb_gadget {
	unsigned			connected:1;
	unsigned			lpm_capable:1;
	unsigned			remote_wakeup:1;
	bool				bam2bam_func_enabled;
	u32				extra_buf_alloc;
	bool				l1_supported;
	bool				is_chipidea;
	bool				self_powered;

	ANDROID_KABI_RESERVE(1);
	ANDROID_KABI_RESERVE(2);
+15 −1
Original line number Diff line number Diff line
@@ -17,12 +17,20 @@

/* Supported USB controllers*/
enum usb_ctrl {
	USB_CTRL_UNUSED = 0,
	DWC3_CTRL = 0,  /* DWC3 controller */
	CI_CTRL,        /* ChipIdea controller */
	HSIC_CTRL,      /* HSIC controller */
	NUM_CTRL,
};

enum usb_bam_mode {
	USB_BAM_DEVICE = 0,
	USB_BAM_HOST,
};

enum peer_bam {
	QDSS_P_BAM = 0,
	IPA_P_BAM,
	MAX_PEER_BAMS,
};

@@ -414,4 +422,10 @@ static inline int get_pm_runtime_counter(struct device *dev)
static inline int get_pm_runtime_counter(struct device *dev)
{ return -EOPNOTSUPP; }
#endif
#ifdef CONFIG_USB_CI13XXX_MSM
void msm_hw_bam_disable(bool bam_disable);
#else
static inline void msm_hw_bam_disable(bool bam_disable)
{}
#endif
#endif				/* _USB_BAM_H_ */