mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 23:24:22 -04:00
Merge "Rest replicator registers when enabling it first time"
This commit is contained in:
commit
82b466e558
1 changed files with 16 additions and 0 deletions
|
|
@ -94,6 +94,18 @@ static int dynamic_replicator_enable(struct replicator_drvdata *drvdata,
|
|||
return rc;
|
||||
}
|
||||
|
||||
static bool is_replicator_disabled(struct coresight_device *csdev)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < csdev->pdata->nr_outport; i++) {
|
||||
if (atomic_read(&csdev->refcnt[i]) > 0)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static int replicator_enable(struct coresight_device *csdev, int inport,
|
||||
int outport)
|
||||
{
|
||||
|
|
@ -103,6 +115,10 @@ static int replicator_enable(struct coresight_device *csdev, int inport,
|
|||
bool first_enable = false;
|
||||
|
||||
spin_lock_irqsave(&drvdata->spinlock, flags);
|
||||
|
||||
if (is_replicator_disabled(csdev))
|
||||
dynamic_replicator_reset(drvdata);
|
||||
|
||||
if (atomic_read(&csdev->refcnt[outport]) == 0) {
|
||||
if (drvdata->base)
|
||||
rc = dynamic_replicator_enable(drvdata, inport,
|
||||
|
|
|
|||
Loading…
Reference in a new issue