mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 14:19:09 -04:00
Merge "coresight: cti: Add sys interface to show max trigger number"
This commit is contained in:
commit
ca81e969e7
1 changed files with 21 additions and 0 deletions
|
|
@ -56,6 +56,7 @@ do { \
|
|||
#define ITTRIGOUTACK (0xEF0)
|
||||
#define ITCHIN (0xEF4)
|
||||
#define ITTRIGIN (0xEF8)
|
||||
#define DEVID (0xFC8)
|
||||
|
||||
#define CTI_MAX_TRIGGERS (32)
|
||||
#define CTI_MAX_CHANNELS (4)
|
||||
|
|
@ -86,6 +87,8 @@ struct cti_drvdata {
|
|||
struct coresight_cti cti;
|
||||
int refcnt;
|
||||
int cpu;
|
||||
unsigned int trig_num_max;
|
||||
unsigned int ch_num_max;
|
||||
bool cti_save;
|
||||
bool cti_hwclk;
|
||||
bool l2_off;
|
||||
|
|
@ -1354,6 +1357,19 @@ static ssize_t disable_gate_store(struct device *dev,
|
|||
}
|
||||
static DEVICE_ATTR_WO(disable_gate);
|
||||
|
||||
static ssize_t show_info_show(struct device *dev, struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
struct cti_drvdata *drvdata = dev_get_drvdata(dev->parent);
|
||||
ssize_t size = 0;
|
||||
|
||||
size = scnprintf(&buf[size], PAGE_SIZE, "%d %d\n",
|
||||
drvdata->trig_num_max, drvdata->ch_num_max);
|
||||
|
||||
return size;
|
||||
}
|
||||
static DEVICE_ATTR_RO(show_info);
|
||||
|
||||
static struct attribute *cti_attrs[] = {
|
||||
&dev_attr_show_trigin.attr,
|
||||
&dev_attr_show_trigout.attr,
|
||||
|
|
@ -1370,6 +1386,7 @@ static struct attribute *cti_attrs[] = {
|
|||
&dev_attr_show_gate.attr,
|
||||
&dev_attr_enable_gate.attr,
|
||||
&dev_attr_disable_gate.attr,
|
||||
&dev_attr_show_info.attr,
|
||||
NULL,
|
||||
};
|
||||
|
||||
|
|
@ -1511,6 +1528,7 @@ EXPORT_SYMBOL(of_get_coresight_cti_data);
|
|||
static int cti_probe(struct amba_device *adev, const struct amba_id *id)
|
||||
{
|
||||
int ret;
|
||||
unsigned int ctidevid;
|
||||
struct device *dev = &adev->dev;
|
||||
struct coresight_platform_data *pdata;
|
||||
struct cti_drvdata *drvdata;
|
||||
|
|
@ -1574,6 +1592,9 @@ static int cti_probe(struct amba_device *adev, const struct amba_id *id)
|
|||
cpu_pm_register_notifier(&cti_cpu_pm_notifier);
|
||||
registered++;
|
||||
}
|
||||
ctidevid = cti_readl(drvdata, DEVID);
|
||||
drvdata->trig_num_max = (ctidevid & GENMASK(15, 8)) >> 8;
|
||||
drvdata->ch_num_max = (ctidevid & GENMASK(21, 16)) >> 16;
|
||||
pm_runtime_put(&adev->dev);
|
||||
dev_dbg(dev, "CTI initialized\n");
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue