|
17 | 17 | #include "intel_rc6.h" |
18 | 18 | #include "intel_rps.h" |
19 | 19 |
|
20 | | -#ifdef CONFIG_PM |
21 | 20 | enum intel_gt_sysfs_op { |
22 | 21 | INTEL_GT_SYSFS_MIN = 0, |
23 | 22 | INTEL_GT_SYSFS_MAX, |
@@ -92,6 +91,7 @@ sysfs_gt_attribute_r_func(struct device *dev, struct device_attribute *attr, |
92 | 91 | #define sysfs_gt_attribute_r_max_func(d, a, f) \ |
93 | 92 | sysfs_gt_attribute_r_func(d, a, f, INTEL_GT_SYSFS_MAX) |
94 | 93 |
|
| 94 | +#ifdef CONFIG_PM |
95 | 95 | static u32 get_residency(struct intel_gt *gt, i915_reg_t reg) |
96 | 96 | { |
97 | 97 | intel_wakeref_t wakeref; |
@@ -457,22 +457,23 @@ static ssize_t vlv_rpe_freq_mhz_show(struct device *dev, |
457 | 457 | } |
458 | 458 |
|
459 | 459 | #define INTEL_GT_RPS_SYSFS_ATTR(_name, _mode, _show, _store) \ |
460 | | - struct device_attribute dev_attr_gt_##_name = __ATTR(gt_##_name, _mode, _show, _store); \ |
461 | | - struct device_attribute dev_attr_rps_##_name = __ATTR(rps_##_name, _mode, _show, _store) |
| 460 | + static struct device_attribute dev_attr_gt_##_name = __ATTR(gt_##_name, _mode, _show, _store); \ |
| 461 | + static struct device_attribute dev_attr_rps_##_name = __ATTR(rps_##_name, _mode, _show, _store) |
462 | 462 |
|
463 | 463 | #define INTEL_GT_RPS_SYSFS_ATTR_RO(_name) \ |
464 | 464 | INTEL_GT_RPS_SYSFS_ATTR(_name, 0444, _name##_show, NULL) |
465 | 465 | #define INTEL_GT_RPS_SYSFS_ATTR_RW(_name) \ |
466 | 466 | INTEL_GT_RPS_SYSFS_ATTR(_name, 0644, _name##_show, _name##_store) |
467 | 467 |
|
468 | | -static INTEL_GT_RPS_SYSFS_ATTR_RO(act_freq_mhz); |
469 | | -static INTEL_GT_RPS_SYSFS_ATTR_RO(cur_freq_mhz); |
470 | | -static INTEL_GT_RPS_SYSFS_ATTR_RW(boost_freq_mhz); |
471 | | -static INTEL_GT_RPS_SYSFS_ATTR_RO(RP0_freq_mhz); |
472 | | -static INTEL_GT_RPS_SYSFS_ATTR_RO(RP1_freq_mhz); |
473 | | -static INTEL_GT_RPS_SYSFS_ATTR_RO(RPn_freq_mhz); |
474 | | -static INTEL_GT_RPS_SYSFS_ATTR_RW(max_freq_mhz); |
475 | | -static INTEL_GT_RPS_SYSFS_ATTR_RW(min_freq_mhz); |
| 468 | +/* The below macros generate static structures */ |
| 469 | +INTEL_GT_RPS_SYSFS_ATTR_RO(act_freq_mhz); |
| 470 | +INTEL_GT_RPS_SYSFS_ATTR_RO(cur_freq_mhz); |
| 471 | +INTEL_GT_RPS_SYSFS_ATTR_RW(boost_freq_mhz); |
| 472 | +INTEL_GT_RPS_SYSFS_ATTR_RO(RP0_freq_mhz); |
| 473 | +INTEL_GT_RPS_SYSFS_ATTR_RO(RP1_freq_mhz); |
| 474 | +INTEL_GT_RPS_SYSFS_ATTR_RO(RPn_freq_mhz); |
| 475 | +INTEL_GT_RPS_SYSFS_ATTR_RW(max_freq_mhz); |
| 476 | +INTEL_GT_RPS_SYSFS_ATTR_RW(min_freq_mhz); |
476 | 477 |
|
477 | 478 | static DEVICE_ATTR_RO(vlv_rpe_freq_mhz); |
478 | 479 |
|
|
0 commit comments