Lines Matching refs:drvdata
25 static void tpda_enable_pre_port(struct tpda_drvdata *drvdata) in tpda_enable_pre_port() argument
29 val = readl_relaxed(drvdata->base + TPDA_CR); in tpda_enable_pre_port()
31 val |= FIELD_PREP(TPDA_CR_ATID, drvdata->atid); in tpda_enable_pre_port()
32 writel_relaxed(val, drvdata->base + TPDA_CR); in tpda_enable_pre_port()
35 static void tpda_enable_port(struct tpda_drvdata *drvdata, int port) in tpda_enable_port() argument
39 val = readl_relaxed(drvdata->base + TPDA_Pn_CR(port)); in tpda_enable_port()
42 writel_relaxed(val, drvdata->base + TPDA_Pn_CR(port)); in tpda_enable_port()
45 static void __tpda_enable(struct tpda_drvdata *drvdata, int port) in __tpda_enable() argument
47 CS_UNLOCK(drvdata->base); in __tpda_enable()
49 if (!drvdata->csdev->enable) in __tpda_enable()
50 tpda_enable_pre_port(drvdata); in __tpda_enable()
52 tpda_enable_port(drvdata, port); in __tpda_enable()
54 CS_LOCK(drvdata->base); in __tpda_enable()
61 struct tpda_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent); in tpda_enable() local
63 spin_lock(&drvdata->spinlock); in tpda_enable()
65 __tpda_enable(drvdata, in->dest_port); in tpda_enable()
68 spin_unlock(&drvdata->spinlock); in tpda_enable()
70 dev_dbg(drvdata->dev, "TPDA inport %d enabled.\n", in->dest_port); in tpda_enable()
74 static void __tpda_disable(struct tpda_drvdata *drvdata, int port) in __tpda_disable() argument
78 CS_UNLOCK(drvdata->base); in __tpda_disable()
80 val = readl_relaxed(drvdata->base + TPDA_Pn_CR(port)); in __tpda_disable()
82 writel_relaxed(val, drvdata->base + TPDA_Pn_CR(port)); in __tpda_disable()
84 CS_LOCK(drvdata->base); in __tpda_disable()
91 struct tpda_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent); in tpda_disable() local
93 spin_lock(&drvdata->spinlock); in tpda_disable()
95 __tpda_disable(drvdata, in->dest_port); in tpda_disable()
97 spin_unlock(&drvdata->spinlock); in tpda_disable()
99 dev_dbg(drvdata->dev, "TPDA inport %d disabled\n", in->dest_port); in tpda_disable()
111 static int tpda_init_default_data(struct tpda_drvdata *drvdata) in tpda_init_default_data() argument
125 drvdata->atid = atid; in tpda_init_default_data()
134 struct tpda_drvdata *drvdata; in tpda_probe() local
143 drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL); in tpda_probe()
144 if (!drvdata) in tpda_probe()
147 drvdata->dev = &adev->dev; in tpda_probe()
148 dev_set_drvdata(dev, drvdata); in tpda_probe()
153 drvdata->base = base; in tpda_probe()
155 spin_lock_init(&drvdata->spinlock); in tpda_probe()
157 ret = tpda_init_default_data(drvdata); in tpda_probe()
170 drvdata->csdev = coresight_register(&desc); in tpda_probe()
171 if (IS_ERR(drvdata->csdev)) in tpda_probe()
172 return PTR_ERR(drvdata->csdev); in tpda_probe()
176 dev_dbg(drvdata->dev, "TPDA initialized\n"); in tpda_probe()
182 struct tpda_drvdata *drvdata = dev_get_drvdata(&adev->dev); in tpda_remove() local
184 coresight_trace_id_put_system_id(drvdata->atid); in tpda_remove()
185 coresight_unregister(drvdata->csdev); in tpda_remove()