Lines Matching refs:kobj
28 sysfs_gt_attribute_w_func(struct kobject *kobj, struct attribute *attr, in sysfs_gt_attribute_w_func() argument
34 if (!is_object_gt(kobj)) { in sysfs_gt_attribute_w_func()
36 struct device *dev = kobj_to_dev(kobj); in sysfs_gt_attribute_w_func()
45 gt = intel_gt_sysfs_get_drvdata(kobj, attr->name); in sysfs_gt_attribute_w_func()
53 sysfs_gt_attribute_r_func(struct kobject *kobj, struct attribute *attr, in sysfs_gt_attribute_r_func() argument
62 if (!is_object_gt(kobj)) { in sysfs_gt_attribute_r_func()
64 struct device *dev = kobj_to_dev(kobj); in sysfs_gt_attribute_r_func()
83 gt = intel_gt_sysfs_get_drvdata(kobj, attr->name); in sysfs_gt_attribute_r_func()
99 static ssize_t _name##_show_common(struct kobject *kobj, \
102 u32 val = sysfs_gt_attribute_r_##_attr_type##_func(kobj, attr, \
107 static ssize_t _name##_show(struct kobject *kobj, \
110 return _name ##_show_common(kobj, &attr->attr, buff); \
115 return _name##_show_common(&dev->kobj, &attr->attr, buff); \
119 static ssize_t _name##_store_common(struct kobject *kobj, \
130 ret = sysfs_gt_attribute_w_func(kobj, attr, _func, val); \
134 static ssize_t _name##_store(struct kobject *kobj, \
138 return _name##_store_common(kobj, &attr->attr, buff, count); \
144 return _name##_store_common(&dev->kobj, &attr->attr, buff, count); \
193 static ssize_t rc6_enable_show(struct kobject *kobj, in rc6_enable_show() argument
197 struct intel_gt *gt = intel_gt_sysfs_get_drvdata(kobj, attr->attr.name); in rc6_enable_show()
206 struct intel_gt *gt = intel_gt_sysfs_get_drvdata(&dev->kobj, attr->attr.name); in rc6_enable_dev_show()
291 static int __intel_gt_sysfs_create_group(struct kobject *kobj, in __intel_gt_sysfs_create_group() argument
294 return is_object_gt(kobj) ? in __intel_gt_sysfs_create_group()
295 sysfs_create_group(kobj, &grp[0]) : in __intel_gt_sysfs_create_group()
296 sysfs_merge_group(kobj, &grp[1]); in __intel_gt_sysfs_create_group()
299 static void intel_sysfs_rc6_init(struct intel_gt *gt, struct kobject *kobj) in intel_sysfs_rc6_init() argument
306 ret = __intel_gt_sysfs_create_group(kobj, rc6_attr_group); in intel_sysfs_rc6_init()
315 ret = __intel_gt_sysfs_create_group(kobj, rc6p_attr_group); in intel_sysfs_rc6_init()
321 ret = __intel_gt_sysfs_create_group(kobj, media_rc6_attr_group); in intel_sysfs_rc6_init()
444 static ssize_t punit_req_freq_mhz_show(struct kobject *kobj, in punit_req_freq_mhz_show() argument
448 struct intel_gt *gt = intel_gt_sysfs_get_drvdata(kobj, attr->attr.name); in punit_req_freq_mhz_show()
454 static ssize_t slpc_ignore_eff_freq_show(struct kobject *kobj, in slpc_ignore_eff_freq_show() argument
458 struct intel_gt *gt = intel_gt_sysfs_get_drvdata(kobj, attr->attr.name); in slpc_ignore_eff_freq_show()
464 static ssize_t slpc_ignore_eff_freq_store(struct kobject *kobj, in slpc_ignore_eff_freq_store() argument
468 struct intel_gt *gt = intel_gt_sysfs_get_drvdata(kobj, attr->attr.name); in slpc_ignore_eff_freq_store()
483 ssize_t (*show)(struct kobject *kobj, struct kobj_attribute *attr,
489 static ssize_t throttle_reason_bool_show(struct kobject *kobj, in throttle_reason_bool_show() argument
493 struct intel_gt *gt = intel_gt_sysfs_get_drvdata(kobj, attr->attr.name); in throttle_reason_bool_show()
572 static ssize_t freq_factor_scale_show(struct kobject *kobj, in freq_factor_scale_show() argument
585 static ssize_t media_freq_factor_show(struct kobject *kobj, in media_freq_factor_show() argument
589 struct intel_gt *gt = intel_gt_sysfs_get_drvdata(kobj, attr->attr.name); in media_freq_factor_show()
616 static ssize_t media_freq_factor_store(struct kobject *kobj, in media_freq_factor_store() argument
620 struct intel_gt *gt = intel_gt_sysfs_get_drvdata(kobj, attr->attr.name); in media_freq_factor_store()
645 static ssize_t media_RP0_freq_mhz_show(struct kobject *kobj, in media_RP0_freq_mhz_show() argument
649 struct intel_gt *gt = intel_gt_sysfs_get_drvdata(kobj, attr->attr.name); in media_RP0_freq_mhz_show()
666 static ssize_t media_RPn_freq_mhz_show(struct kobject *kobj, in media_RPn_freq_mhz_show() argument
670 struct intel_gt *gt = intel_gt_sysfs_get_drvdata(kobj, attr->attr.name); in media_RPn_freq_mhz_show()
704 rps_up_threshold_pct_show(struct kobject *kobj, struct kobj_attribute *attr, in rps_up_threshold_pct_show() argument
707 struct intel_gt *gt = intel_gt_sysfs_get_drvdata(kobj, attr->attr.name); in rps_up_threshold_pct_show()
714 rps_up_threshold_pct_store(struct kobject *kobj, struct kobj_attribute *attr, in rps_up_threshold_pct_store() argument
717 struct intel_gt *gt = intel_gt_sysfs_get_drvdata(kobj, attr->attr.name); in rps_up_threshold_pct_store()
738 rps_down_threshold_pct_show(struct kobject *kobj, struct kobj_attribute *attr, in rps_down_threshold_pct_show() argument
741 struct intel_gt *gt = intel_gt_sysfs_get_drvdata(kobj, attr->attr.name); in rps_down_threshold_pct_show()
748 rps_down_threshold_pct_store(struct kobject *kobj, struct kobj_attribute *attr, in rps_down_threshold_pct_store() argument
751 struct intel_gt *gt = intel_gt_sysfs_get_drvdata(kobj, attr->attr.name); in rps_down_threshold_pct_store()
778 default_min_freq_mhz_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) in default_min_freq_mhz_show() argument
780 struct intel_gt *gt = kobj_to_gt(kobj->parent); in default_min_freq_mhz_show()
789 default_max_freq_mhz_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) in default_max_freq_mhz_show() argument
791 struct intel_gt *gt = kobj_to_gt(kobj->parent); in default_max_freq_mhz_show()
800 default_rps_up_threshold_pct_show(struct kobject *kobj, in default_rps_up_threshold_pct_show() argument
804 struct intel_gt *gt = kobj_to_gt(kobj->parent); in default_rps_up_threshold_pct_show()
813 default_rps_down_threshold_pct_show(struct kobject *kobj, in default_rps_down_threshold_pct_show() argument
817 struct intel_gt *gt = kobj_to_gt(kobj->parent); in default_rps_down_threshold_pct_show()
833 static int intel_sysfs_rps_init(struct intel_gt *gt, struct kobject *kobj) in intel_sysfs_rps_init() argument
842 if (is_object_gt(kobj)) { in intel_sysfs_rps_init()
850 ret = sysfs_create_files(kobj, attrs); in intel_sysfs_rps_init()
855 ret = sysfs_create_file(kobj, vlv_attr); in intel_sysfs_rps_init()
857 if (is_object_gt(kobj) && !intel_uc_uses_guc_slpc(>->uc)) { in intel_sysfs_rps_init()
858 ret = sysfs_create_files(kobj, gen6_gt_rps_attrs); in intel_sysfs_rps_init()
866 void intel_gt_sysfs_pm_init(struct intel_gt *gt, struct kobject *kobj) in intel_gt_sysfs_pm_init() argument
870 intel_sysfs_rc6_init(gt, kobj); in intel_gt_sysfs_pm_init()
872 ret = intel_sysfs_rps_init(gt, kobj); in intel_gt_sysfs_pm_init()
877 if (!is_object_gt(kobj)) in intel_gt_sysfs_pm_init()
880 ret = sysfs_create_file(kobj, &attr_punit_req_freq_mhz.attr); in intel_gt_sysfs_pm_init()
885 ret = sysfs_create_file(kobj, &attr_slpc_ignore_eff_freq.attr); in intel_gt_sysfs_pm_init()
891 ret = sysfs_create_files(kobj, throttle_reason_attrs); in intel_gt_sysfs_pm_init()
897 ret = sysfs_create_files(kobj, media_perf_power_attrs); in intel_gt_sysfs_pm_init()