mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 05:39:54 -04:00
Rest replicator registers when enabling it first time
Replicator register value could be reset when it's disabled and clock is off. Reset the register to all ports disabled when enabling it first time to avoid all ports to be enabled by default. Change-Id: I29973d38eb7f836fabe22757f98db62afbe6a4c3 Signed-off-by: Mao Jinlong <jinlmao@codeaurora.org>
This commit is contained in:
parent
1c730ce06f
commit
75d0b9f7e9
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