Lines Matching refs:model

35 #define CCI_PMU_CNTR_SIZE(model)	((model)->cntr_size)  argument
36 #define CCI_PMU_CNTR_BASE(model, idx) ((idx) * CCI_PMU_CNTR_SIZE(model)) argument
40 #define CCI_PMU_MAX_HW_CNTRS(model) \ argument
41 ((model)->num_hw_cntrs + (model)->fixed_hw_cntrs)
104 const struct cci_pmu_model *model; member
362 if (ev_code >= cci_pmu->model->event_ranges[if_type].min && in cci400_validate_hw_event()
363 ev_code <= cci_pmu->model->event_ranges[if_type].max) in cci400_validate_hw_event()
573 if (ev_code >= cci_pmu->model->event_ranges[if_type].min && in cci500_validate_hw_event()
574 ev_code <= cci_pmu->model->event_ranges[if_type].max) in cci500_validate_hw_event()
625 if (ev_code >= cci_pmu->model->event_ranges[if_type].min && in cci550_validate_hw_event()
626 ev_code <= cci_pmu->model->event_ranges[if_type].max) in cci550_validate_hw_event()
717 CCI_PMU_CNTR_BASE(cci_pmu->model, idx) + offset); in pmu_read_register()
724 CCI_PMU_CNTR_BASE(cci_pmu->model, idx) + offset); in pmu_write_register()
802 if (cci_pmu->model->get_event_idx) in pmu_get_event_idx()
803 return cci_pmu->model->get_event_idx(cci_pmu, hw, cci_event); in pmu_get_event_idx()
819 !cci_pmu->model->validate_hw_event) in pmu_map_event()
822 return cci_pmu->model->validate_hw_event(cci_pmu, event->attr.config); in pmu_map_event()
909 if (cci_pmu->model->write_counters) in pmu_write_counters()
910 cci_pmu->model->write_counters(cci_pmu, mask); in pmu_write_counters()
1126 return (idx >= 0) && (idx < cci_pmu->model->fixed_hw_cntrs); in pmu_fixed_hw_idx()
1398 const struct cci_pmu_model *model = cci_pmu->model; in cci_pmu_init() local
1399 char *name = model->name; in cci_pmu_init()
1402 if (WARN_ON(model->num_hw_cntrs > NUM_HW_CNTRS_MAX)) in cci_pmu_init()
1404 if (WARN_ON(model->fixed_hw_cntrs > FIXED_HW_CNTRS_MAX)) in cci_pmu_init()
1407 pmu_event_attr_group.attrs = model->event_attrs; in cci_pmu_init()
1408 pmu_format_attr_group.attrs = model->format_attrs; in cci_pmu_init()
1412 .name = cci_pmu->model->name, in cci_pmu_init()
1428 if (num_cntrs > cci_pmu->model->num_hw_cntrs) { in cci_pmu_init()
1432 num_cntrs, cci_pmu->model->num_hw_cntrs); in cci_pmu_init()
1433 num_cntrs = cci_pmu->model->num_hw_cntrs; in cci_pmu_init()
1435 cci_pmu->num_cntrs = num_cntrs + cci_pmu->model->fixed_hw_cntrs; in cci_pmu_init()
1594 const struct cci_pmu_model *model; in cci_pmu_alloc() local
1607 model = of_device_get_match_data(dev); in cci_pmu_alloc()
1608 if (!model) { in cci_pmu_alloc()
1611 model = probe_cci_model(cci_pmu); in cci_pmu_alloc()
1613 if (!model) { in cci_pmu_alloc()
1618 cci_pmu->model = model; in cci_pmu_alloc()
1619 cci_pmu->irqs = devm_kcalloc(dev, CCI_PMU_MAX_HW_CNTRS(model), in cci_pmu_alloc()
1624 CCI_PMU_MAX_HW_CNTRS(model), in cci_pmu_alloc()
1630 CCI_PMU_MAX_HW_CNTRS(model), in cci_pmu_alloc()
1656 for (i = 0; i < CCI_PMU_MAX_HW_CNTRS(cci_pmu->model); i++) { in cci_pmu_probe()
1671 if (i < CCI_PMU_MAX_HW_CNTRS(cci_pmu->model)) { in cci_pmu_probe()
1673 i, CCI_PMU_MAX_HW_CNTRS(cci_pmu->model)); in cci_pmu_probe()
1691 pr_info("ARM %s PMU driver probed", cci_pmu->model->name); in cci_pmu_probe()