coresight-tmc: add support to set default sink
Add support to set default sink at probe time. Change-Id: I62abe39a5cb5e7f8b1bb1198cecd3b529b124de8 Signed-off-by: Shashank Mittal <mittals@codeaurora.org>
This commit is contained in:
parent
534fd1b6c4
commit
8185b206af
4 changed files with 22 additions and 1 deletions
|
@ -68,6 +68,8 @@ its hardware characteristcs.
|
|||
* arm,buffer-size: size of contiguous buffer space for TMC ETR
|
||||
(embedded trace router)
|
||||
|
||||
* arm,default-sink: represents the default compile time CoreSight sink
|
||||
|
||||
* Required property for TPDAs:
|
||||
|
||||
* qcom,tpda-atid: must be present. Specifies the ATID for TPDA.
|
||||
|
|
|
@ -1673,6 +1673,8 @@ static int tmc_probe(struct amba_device *adev, const struct amba_id *id)
|
|||
return -ENOMEM;
|
||||
}
|
||||
|
||||
pdata->default_sink = of_property_read_bool(np, "arm,default-sink");
|
||||
|
||||
desc = devm_kzalloc(dev, sizeof(*desc), GFP_KERNEL);
|
||||
if (!desc)
|
||||
return -ENOMEM;
|
||||
|
|
|
@ -795,6 +795,21 @@ struct coresight_device *coresight_register(struct coresight_desc *desc)
|
|||
coresight_fixup_device_conns(csdev);
|
||||
coresight_fixup_orphan_conns(csdev);
|
||||
|
||||
if (csdev->type == CORESIGHT_DEV_TYPE_SINK ||
|
||||
csdev->type == CORESIGHT_DEV_TYPE_LINKSINK) {
|
||||
if (desc->pdata->default_sink) {
|
||||
if (curr_sink) {
|
||||
dev_warn(&csdev->dev,
|
||||
"overwritting curr sink %s",
|
||||
dev_name(&curr_sink->dev));
|
||||
curr_sink->activated = false;
|
||||
}
|
||||
|
||||
curr_sink = csdev;
|
||||
curr_sink->activated = true;
|
||||
}
|
||||
}
|
||||
|
||||
mutex_unlock(&coresight_mutex);
|
||||
|
||||
return csdev;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2012, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2012, 2016 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
|
||||
|
@ -101,6 +101,7 @@ struct coresight_dev_subtype {
|
|||
connected to.
|
||||
* @nr_outport: number of output ports for this component.
|
||||
* @clk: The clock this component is associated to.
|
||||
* @default_sink: Flag to set default sink
|
||||
*/
|
||||
struct coresight_platform_data {
|
||||
int cpu;
|
||||
|
@ -111,6 +112,7 @@ struct coresight_platform_data {
|
|||
int *child_ports;
|
||||
int nr_outport;
|
||||
struct clk *clk;
|
||||
bool default_sink;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue