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

Commit e3915147 authored by Chandana Kishori Chiluveru's avatar Chandana Kishori Chiluveru
Browse files

usb: gadget: Fix ep_flush issue on composition switch



Currently if composition switch happens from BAM composition to
NON BAM composition. USB driver tries to flush USB endpoint as
part of composition switch, which is failing. Fix the issue by
performing usb core soft reset before disabling bam for NON BAM
composition.

Change-Id: I60d008341ab2788b2eeae5cc4671bb97ef5b792d
Signed-off-by: default avatarChandana Kishori Chiluveru <cchiluve@codeaurora.org>
parent 1e395c5c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
/* Copyright (c) 2011-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2011-2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -3568,6 +3568,7 @@ bool msm_usb_bam_enable(enum usb_ctrl bam, bool bam_enable)
		log_event_dbg("%s: USB BAM Registered\n", __func__);
		msm_hw_bam_disable(0);
	} else {
		msm_hw_soft_reset();
		msm_hw_bam_disable(1);
		sps_device_reset(ctx->h_bam);
		sps_deregister_bam_device(ctx->h_bam);
+8 −1
Original line number Diff line number Diff line
/* Copyright (c) 2010-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2010-2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -470,6 +470,13 @@ void ci13xxx_msm_shutdown(struct platform_device *pdev)
	ci13xxx_pullup(&_udc->gadget, 0);
}

void msm_hw_soft_reset(void)
{
	struct ci13xxx *udc = _udc;

	hw_device_reset(udc);
}

void msm_hw_bam_disable(bool bam_disable)
{
	u32 val;
+5 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
 *
 * Copyright (C) 2008 Google, Inc.
 * Author: Brian Swetland <swetland@google.com>
 * Copyright (c) 2009-2016, The Linux Foundation. All rights reserved.
 * Copyright (c) 2009-2017, The Linux Foundation. All rights reserved.
 *
 * This software is licensed under the terms of the GNU General Public
 * License version 2, as published by the Free Software Foundation, and
@@ -659,9 +659,13 @@ static inline bool msm_usb_bam_enable(enum usb_ctrl ctrl, bool bam_enable)
int msm_do_bam_disable_enable(enum usb_ctrl ctrl) { return true; }
#endif
#ifdef CONFIG_USB_CI13XXX_MSM
void msm_hw_soft_reset(void);
void msm_hw_bam_disable(bool bam_disable);
void msm_usb_irq_disable(bool disable);
#else
static inline void msm_hw_soft_reset(void)
{
}
static inline void msm_hw_bam_disable(bool bam_disable)
{
}