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

Commit 8f812be3 authored by Mayank Rana's avatar Mayank Rana
Browse files

usb: f_gsi: Add API to allow selection of LLCC TCM memory



This change adds and exports API which allows composite function
driver (such as qti_gadget) to select LLCC TCM memory for allocating
USB RMNET IN buffers instead of using DDR memory (default).

Change-Id: I68f46a1e09e732841e12b9dac60181db701a51d3
Signed-off-by: default avatarMayank Rana <mrana@codeaurora.org>
parent 0611102d
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -3010,6 +3010,15 @@ static void gsi_get_ether_addr(const char *str, u8 *dev_addr)
	random_ether_addr(dev_addr);
	random_ether_addr(dev_addr);
}
}


void rmnet_gsi_update_in_buffer_mem_type(struct usb_function *f, bool use_tcm)
{
	struct f_gsi *gsi = func_to_gsi(f);

	if (gsi && gsi->prot_id == IPA_USB_RMNET)
		gsi->rmnet_use_tcm_mem = use_tcm;
}
EXPORT_SYMBOL(rmnet_gsi_update_in_buffer_mem_type);

static int gsi_bind(struct usb_configuration *c, struct usb_function *f)
static int gsi_bind(struct usb_configuration *c, struct usb_function *f)
{
{
	struct usb_composite_dev *cdev = c->cdev;
	struct usb_composite_dev *cdev = c->cdev;
+8 −0
Original line number Original line Diff line number Diff line
@@ -164,4 +164,12 @@ static bool __maybe_unused usb_get_remote_wakeup_status(struct usb_gadget *gadge
{ return false; }
{ return false; }
#endif
#endif


#if IS_ENABLED(CONFIG_USB_F_GSI)
void rmnet_gsi_update_in_buffer_mem_type(struct usb_function *f, bool use_tcm);
#else
static inline __maybe_unused void rmnet_gsi_update_in_buffer_mem_type(
		struct usb_function *f, bool use_tcm)
{ }
#endif

#endif /* __LINUX_USB_DWC3_MSM_H */
#endif /* __LINUX_USB_DWC3_MSM_H */