Lines Matching refs:csdev

72  * @csdev:	component vitals needed by the framework.
85 struct coresight_device *csdev;
95 static int etb_set_buffer(struct coresight_device *csdev,
133 int rc = coresight_claim_device(drvdata->csdev);
142 static int etb_enable_sysfs(struct coresight_device *csdev)
146 struct etb_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent);
151 if (coresight_get_mode(csdev) == CS_MODE_PERF) {
156 if (coresight_get_mode(csdev) == CS_MODE_DISABLED) {
161 coresight_set_mode(csdev, CS_MODE_SYSFS);
164 csdev->refcnt++;
170 static int etb_enable_perf(struct coresight_device *csdev, void *data)
175 struct etb_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent);
182 if (coresight_get_mode(drvdata->csdev) == CS_MODE_SYSFS) {
200 csdev->refcnt++;
209 ret = etb_set_buffer(csdev, handle);
217 coresight_set_mode(drvdata->csdev, CS_MODE_PERF);
218 csdev->refcnt++;
226 static int etb_enable(struct coresight_device *csdev, enum cs_mode mode,
233 ret = etb_enable_sysfs(csdev);
236 ret = etb_enable_perf(csdev, data);
246 dev_dbg(&csdev->dev, "ETB enabled\n");
253 struct device *dev = &drvdata->csdev->dev;
254 struct csdev_access *csa = &drvdata->csdev->access;
290 struct device *dev = &drvdata->csdev->dev;
347 coresight_disclaim_device(drvdata->csdev);
350 static int etb_disable(struct coresight_device *csdev)
352 struct etb_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent);
357 csdev->refcnt--;
358 if (csdev->refcnt) {
364 WARN_ON_ONCE(coresight_get_mode(csdev) == CS_MODE_DISABLED);
368 coresight_set_mode(csdev, CS_MODE_DISABLED);
371 dev_dbg(&csdev->dev, "ETB disabled\n");
375 static void *etb_alloc_buffer(struct coresight_device *csdev,
403 static int etb_set_buffer(struct coresight_device *csdev,
427 static unsigned long etb_update_buffer(struct coresight_device *csdev,
439 struct etb_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent);
449 if (csdev->refcnt != 1)
465 dev_err(&csdev->dev,
591 if (coresight_get_mode(drvdata->csdev) == CS_MODE_SYSFS) {
598 dev_dbg(&drvdata->csdev->dev, "ETB dumped\n");
609 dev_dbg(&drvdata->csdev->dev, "%s: successfully opened\n", __func__);
619 struct device *dev = &drvdata->csdev->dev;
646 dev_dbg(&drvdata->csdev->dev, "%s: released\n", __func__);
776 drvdata->csdev = coresight_register(&desc);
777 if (IS_ERR(drvdata->csdev))
778 return PTR_ERR(drvdata->csdev);
791 coresight_unregister(drvdata->csdev);
805 coresight_unregister(drvdata->csdev);