Lines Matching refs:drvdata
62 static void tpiu_enable_hw(struct tpiu_drvdata *drvdata) in tpiu_enable_hw() argument
64 CS_UNLOCK(drvdata->base); in tpiu_enable_hw()
68 CS_LOCK(drvdata->base); in tpiu_enable_hw()
73 struct tpiu_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent); in tpiu_enable() local
75 tpiu_enable_hw(drvdata); in tpiu_enable()
77 dev_info(drvdata->dev, "TPIU enabled\n"); in tpiu_enable()
81 static void tpiu_disable_hw(struct tpiu_drvdata *drvdata) in tpiu_disable_hw() argument
83 CS_UNLOCK(drvdata->base); in tpiu_disable_hw()
86 writel_relaxed(FFCR_STOP_FI, drvdata->base + TPIU_FFCR); in tpiu_disable_hw()
88 writel_relaxed(FFCR_STOP_FI | FFCR_FON_MAN, drvdata->base + TPIU_FFCR); in tpiu_disable_hw()
90 coresight_timeout(drvdata->base, TPIU_FFCR, FFCR_FON_MAN_BIT, 0); in tpiu_disable_hw()
92 coresight_timeout(drvdata->base, TPIU_FFSR, FFSR_FT_STOPPED_BIT, 1); in tpiu_disable_hw()
94 CS_LOCK(drvdata->base); in tpiu_disable_hw()
99 struct tpiu_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent); in tpiu_disable() local
101 tpiu_disable_hw(drvdata); in tpiu_disable()
103 dev_info(drvdata->dev, "TPIU disabled\n"); in tpiu_disable()
121 struct tpiu_drvdata *drvdata; in tpiu_probe() local
133 drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL); in tpiu_probe()
134 if (!drvdata) in tpiu_probe()
137 drvdata->dev = &adev->dev; in tpiu_probe()
138 drvdata->atclk = devm_clk_get(&adev->dev, "atclk"); /* optional */ in tpiu_probe()
139 if (!IS_ERR(drvdata->atclk)) { in tpiu_probe()
140 ret = clk_prepare_enable(drvdata->atclk); in tpiu_probe()
144 dev_set_drvdata(dev, drvdata); in tpiu_probe()
151 drvdata->base = base; in tpiu_probe()
154 tpiu_disable_hw(drvdata); in tpiu_probe()
163 drvdata->csdev = coresight_register(&desc); in tpiu_probe()
165 return PTR_ERR_OR_ZERO(drvdata->csdev); in tpiu_probe()
171 struct tpiu_drvdata *drvdata = dev_get_drvdata(dev); in tpiu_runtime_suspend() local
173 if (drvdata && !IS_ERR(drvdata->atclk)) in tpiu_runtime_suspend()
174 clk_disable_unprepare(drvdata->atclk); in tpiu_runtime_suspend()
181 struct tpiu_drvdata *drvdata = dev_get_drvdata(dev); in tpiu_runtime_resume() local
183 if (drvdata && !IS_ERR(drvdata->atclk)) in tpiu_runtime_resume()
184 clk_prepare_enable(drvdata->atclk); in tpiu_runtime_resume()