Lines Matching refs:csdev
33 cscfg_get_feat_csdev(struct coresight_device *csdev, const char *name) in cscfg_get_feat_csdev() argument
37 list_for_each_entry(feat_csdev, &csdev->feature_csdev_list, node) { in cscfg_get_feat_csdev()
46 cscfg_alloc_csdev_cfg(struct coresight_device *csdev, int nr_feats) in cscfg_alloc_csdev_cfg() argument
49 struct device *dev = csdev->dev.parent; in cscfg_alloc_csdev_cfg()
58 config_csdev->csdev = csdev; in cscfg_alloc_csdev_cfg()
63 static int cscfg_add_csdev_cfg(struct coresight_device *csdev, in cscfg_add_csdev_cfg() argument
74 feat_csdev = cscfg_get_feat_csdev(csdev, config_desc->feat_ref_names[i]); in cscfg_add_csdev_cfg()
81 config_csdev = cscfg_alloc_csdev_cfg(csdev, in cscfg_add_csdev_cfg()
92 spin_lock_irqsave(&csdev->cscfg_csdev_lock, flags); in cscfg_add_csdev_cfg()
93 list_add(&config_csdev->node, &csdev->config_csdev_list); in cscfg_add_csdev_cfg()
94 spin_unlock_irqrestore(&csdev->cscfg_csdev_lock, flags); in cscfg_add_csdev_cfg()
111 err = cscfg_add_csdev_cfg(csdev_item->csdev, config_desc); in cscfg_add_cfg_to_csdevs()
123 cscfg_alloc_csdev_feat(struct coresight_device *csdev, struct cscfg_feature_desc *feat_desc) in cscfg_alloc_csdev_feat() argument
126 struct device *dev = csdev->dev.parent; in cscfg_alloc_csdev_feat()
169 feat_csdev->csdev = csdev; in cscfg_alloc_csdev_feat()
175 static int cscfg_load_feat_csdev(struct coresight_device *csdev, in cscfg_load_feat_csdev() argument
186 feat_csdev = cscfg_alloc_csdev_feat(csdev, feat_desc); in cscfg_load_feat_csdev()
191 err = ops->load_feat(csdev, feat_csdev); in cscfg_load_feat_csdev()
197 spin_lock_irqsave(&csdev->cscfg_csdev_lock, flags); in cscfg_load_feat_csdev()
198 list_add(&feat_csdev->node, &csdev->feature_csdev_list); in cscfg_load_feat_csdev()
199 spin_unlock_irqrestore(&csdev->cscfg_csdev_lock, flags); in cscfg_load_feat_csdev()
216 err = cscfg_load_feat_csdev(csdev_item->csdev, feat_desc, &csdev_item->ops); in cscfg_add_feat_to_csdevs()
311 cscfg_csdev_get_feat_from_desc(struct coresight_device *csdev, in cscfg_csdev_get_feat_from_desc() argument
316 list_for_each_entry(feat_csdev, &csdev->feature_csdev_list, node) { in cscfg_csdev_get_feat_from_desc()
347 feat_csdev = cscfg_csdev_get_feat_from_desc(csdev_item->csdev, feat_desc); in cscfg_update_feat_param_val()
414 static int cscfg_add_cfgs_csdev(struct coresight_device *csdev) in cscfg_add_cfgs_csdev() argument
420 err = cscfg_add_csdev_cfg(csdev, config_desc); in cscfg_add_cfgs_csdev()
428 static int cscfg_add_feats_csdev(struct coresight_device *csdev, in cscfg_add_feats_csdev() argument
440 err = cscfg_load_feat_csdev(csdev, feat_desc, ops); in cscfg_add_feats_csdev()
449 static int cscfg_list_add_csdev(struct coresight_device *csdev, in cscfg_list_add_csdev() argument
460 csdev_item->csdev = csdev; in cscfg_list_add_csdev()
465 INIT_LIST_HEAD(&csdev->feature_csdev_list); in cscfg_list_add_csdev()
466 INIT_LIST_HEAD(&csdev->config_csdev_list); in cscfg_list_add_csdev()
467 spin_lock_init(&csdev->cscfg_csdev_lock); in cscfg_list_add_csdev()
473 static void cscfg_list_remove_csdev(struct coresight_device *csdev) in cscfg_list_remove_csdev() argument
478 if (csdev_item->csdev == csdev) { in cscfg_list_remove_csdev()
497 int cscfg_register_csdev(struct coresight_device *csdev, in cscfg_register_csdev() argument
506 ret = cscfg_list_add_csdev(csdev, match_flags, ops); in cscfg_register_csdev()
511 ret = cscfg_add_feats_csdev(csdev, match_flags, ops); in cscfg_register_csdev()
513 cscfg_list_remove_csdev(csdev); in cscfg_register_csdev()
517 ret = cscfg_add_cfgs_csdev(csdev); in cscfg_register_csdev()
519 cscfg_list_remove_csdev(csdev); in cscfg_register_csdev()
523 pr_info("CSCFG registered %s", dev_name(&csdev->dev)); in cscfg_register_csdev()
536 void cscfg_unregister_csdev(struct coresight_device *csdev) in cscfg_unregister_csdev() argument
539 cscfg_list_remove_csdev(csdev); in cscfg_unregister_csdev()
552 void cscfg_csdev_reset_feats(struct coresight_device *csdev) in cscfg_csdev_reset_feats() argument
557 spin_lock_irqsave(&csdev->cscfg_csdev_lock, flags); in cscfg_csdev_reset_feats()
558 if (list_empty(&csdev->feature_csdev_list)) in cscfg_csdev_reset_feats()
561 list_for_each_entry(feat_csdev, &csdev->feature_csdev_list, node) in cscfg_csdev_reset_feats()
565 spin_unlock_irqrestore(&csdev->cscfg_csdev_lock, flags); in cscfg_csdev_reset_feats()
659 int cscfg_csdev_enable_active_config(struct coresight_device *csdev, in cscfg_csdev_enable_active_config() argument
675 spin_lock_irqsave(&csdev->cscfg_csdev_lock, flags); in cscfg_csdev_enable_active_config()
676 list_for_each_entry(config_csdev_item, &csdev->config_csdev_list, node) { in cscfg_csdev_enable_active_config()
681 csdev->active_cscfg_ctxt = (void *)config_csdev_active; in cscfg_csdev_enable_active_config()
685 spin_unlock_irqrestore(&csdev->cscfg_csdev_lock, flags); in cscfg_csdev_enable_active_config()
706 spin_lock_irqsave(&csdev->cscfg_csdev_lock, flags); in cscfg_csdev_enable_active_config()
707 if (csdev->active_cscfg_ctxt) in cscfg_csdev_enable_active_config()
711 spin_unlock_irqrestore(&csdev->cscfg_csdev_lock, flags); in cscfg_csdev_enable_active_config()
730 void cscfg_csdev_disable_active_config(struct coresight_device *csdev) in cscfg_csdev_disable_active_config() argument
740 spin_lock_irqsave(&csdev->cscfg_csdev_lock, flags); in cscfg_csdev_disable_active_config()
741 config_csdev = (struct cscfg_config_csdev *)csdev->active_cscfg_ctxt; in cscfg_csdev_disable_active_config()
748 csdev->active_cscfg_ctxt = NULL; in cscfg_csdev_disable_active_config()
749 spin_unlock_irqrestore(&csdev->cscfg_csdev_lock, flags); in cscfg_csdev_disable_active_config()