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
|
* arm,buffer-size: size of contiguous buffer space for TMC ETR
|
||||||
(embedded trace router)
|
(embedded trace router)
|
||||||
|
|
||||||
|
* arm,default-sink: represents the default compile time CoreSight sink
|
||||||
|
|
||||||
* Required property for TPDAs:
|
* Required property for TPDAs:
|
||||||
|
|
||||||
* qcom,tpda-atid: must be present. Specifies the ATID for TPDA.
|
* 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;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pdata->default_sink = of_property_read_bool(np, "arm,default-sink");
|
||||||
|
|
||||||
desc = devm_kzalloc(dev, sizeof(*desc), GFP_KERNEL);
|
desc = devm_kzalloc(dev, sizeof(*desc), GFP_KERNEL);
|
||||||
if (!desc)
|
if (!desc)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
|
@ -795,6 +795,21 @@ struct coresight_device *coresight_register(struct coresight_desc *desc)
|
||||||
coresight_fixup_device_conns(csdev);
|
coresight_fixup_device_conns(csdev);
|
||||||
coresight_fixup_orphan_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);
|
mutex_unlock(&coresight_mutex);
|
||||||
|
|
||||||
return csdev;
|
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
|
* 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
|
* it under the terms of the GNU General Public License version 2 and
|
||||||
|
@ -101,6 +101,7 @@ struct coresight_dev_subtype {
|
||||||
connected to.
|
connected to.
|
||||||
* @nr_outport: number of output ports for this component.
|
* @nr_outport: number of output ports for this component.
|
||||||
* @clk: The clock this component is associated to.
|
* @clk: The clock this component is associated to.
|
||||||
|
* @default_sink: Flag to set default sink
|
||||||
*/
|
*/
|
||||||
struct coresight_platform_data {
|
struct coresight_platform_data {
|
||||||
int cpu;
|
int cpu;
|
||||||
|
@ -111,6 +112,7 @@ struct coresight_platform_data {
|
||||||
int *child_ports;
|
int *child_ports;
|
||||||
int nr_outport;
|
int nr_outport;
|
||||||
struct clk *clk;
|
struct clk *clk;
|
||||||
|
bool default_sink;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue