mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
coresight: reset bam before making etr to usb connection
Since USB recently started resetting USB BAM before calling the cable connect callback, it is recommended that QDSS BAM is reset before TMC ETR to USB connection is made in the TMC driver. Change-Id: I37639b9ada69c9d5077812463c05ce5e6176a181 Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
This commit is contained in:
parent
d1fdc3d5b6
commit
e1c4c42acd
1 changed files with 10 additions and 4 deletions
|
@ -255,7 +255,12 @@ static int tmc_etr_bam_enable(struct tmc_drvdata *drvdata)
|
|||
if (bamdata->enable)
|
||||
return 0;
|
||||
|
||||
/* Configure and enable ndp bam */
|
||||
/* Reset bam to start with */
|
||||
ret = sps_device_reset(bamdata->handle);
|
||||
if (ret)
|
||||
goto err0;
|
||||
|
||||
/* Now configure and enable bam */
|
||||
|
||||
bamdata->pipe = sps_alloc_endpoint();
|
||||
if (!bamdata->pipe)
|
||||
|
@ -263,7 +268,7 @@ static int tmc_etr_bam_enable(struct tmc_drvdata *drvdata)
|
|||
|
||||
ret = sps_get_config(bamdata->pipe, &bamdata->connect);
|
||||
if (ret)
|
||||
goto err;
|
||||
goto err1;
|
||||
|
||||
bamdata->connect.mode = SPS_MODE_SRC;
|
||||
bamdata->connect.source = bamdata->handle;
|
||||
|
@ -278,12 +283,13 @@ static int tmc_etr_bam_enable(struct tmc_drvdata *drvdata)
|
|||
|
||||
ret = sps_connect(bamdata->pipe, &bamdata->connect);
|
||||
if (ret)
|
||||
goto err;
|
||||
goto err1;
|
||||
|
||||
bamdata->enable = true;
|
||||
return 0;
|
||||
err:
|
||||
err1:
|
||||
sps_free_endpoint(bamdata->pipe);
|
||||
err0:
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue