Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/xe/hwmon: Convert register access to use xe_mmio

Stop using GT pointers for register access.

Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240910234719.3335472-57-matthew.d.roper@intel.com

+8 -8
+8 -8
drivers/gpu/drm/xe/xe_hwmon.c
··· 149 149 u64 reg_val, min, max; 150 150 struct xe_device *xe = hwmon->xe; 151 151 struct xe_reg rapl_limit, pkg_power_sku; 152 - struct xe_gt *mmio = xe_root_mmio_gt(xe); 152 + struct xe_mmio *mmio = xe_root_tile_mmio(xe); 153 153 154 154 rapl_limit = xe_hwmon_get_reg(hwmon, REG_PKG_RAPL_LIMIT, channel); 155 155 pkg_power_sku = xe_hwmon_get_reg(hwmon, REG_PKG_POWER_SKU, channel); ··· 190 190 191 191 static int xe_hwmon_power_max_write(struct xe_hwmon *hwmon, int channel, long value) 192 192 { 193 - struct xe_gt *mmio = xe_root_mmio_gt(hwmon->xe); 193 + struct xe_mmio *mmio = xe_root_tile_mmio(hwmon->xe); 194 194 int ret = 0; 195 195 u64 reg_val; 196 196 struct xe_reg rapl_limit; ··· 222 222 223 223 static void xe_hwmon_power_rated_max_read(struct xe_hwmon *hwmon, int channel, long *value) 224 224 { 225 - struct xe_gt *mmio = xe_root_mmio_gt(hwmon->xe); 225 + struct xe_mmio *mmio = xe_root_tile_mmio(hwmon->xe); 226 226 struct xe_reg reg = xe_hwmon_get_reg(hwmon, REG_PKG_POWER_SKU, channel); 227 227 u64 reg_val; 228 228 ··· 259 259 static void 260 260 xe_hwmon_energy_get(struct xe_hwmon *hwmon, int channel, long *energy) 261 261 { 262 - struct xe_gt *mmio = xe_root_mmio_gt(hwmon->xe); 262 + struct xe_mmio *mmio = xe_root_tile_mmio(hwmon->xe); 263 263 struct xe_hwmon_energy_info *ei = &hwmon->ei[channel]; 264 264 u64 reg_val; 265 265 ··· 282 282 char *buf) 283 283 { 284 284 struct xe_hwmon *hwmon = dev_get_drvdata(dev); 285 - struct xe_gt *mmio = xe_root_mmio_gt(hwmon->xe); 285 + struct xe_mmio *mmio = xe_root_tile_mmio(hwmon->xe); 286 286 u32 x, y, x_w = 2; /* 2 bits */ 287 287 u64 r, tau4, out; 288 288 int sensor_index = to_sensor_dev_attr(attr)->index; ··· 323 323 const char *buf, size_t count) 324 324 { 325 325 struct xe_hwmon *hwmon = dev_get_drvdata(dev); 326 - struct xe_gt *mmio = xe_root_mmio_gt(hwmon->xe); 326 + struct xe_mmio *mmio = xe_root_tile_mmio(hwmon->xe); 327 327 u32 x, y, rxy, x_w = 2; /* 2 bits */ 328 328 u64 tau4, r, max_win; 329 329 unsigned long val; ··· 498 498 499 499 static void xe_hwmon_get_voltage(struct xe_hwmon *hwmon, int channel, long *value) 500 500 { 501 - struct xe_gt *mmio = xe_root_mmio_gt(hwmon->xe); 501 + struct xe_mmio *mmio = xe_root_tile_mmio(hwmon->xe); 502 502 u64 reg_val; 503 503 504 504 reg_val = xe_mmio_read32(mmio, xe_hwmon_get_reg(hwmon, REG_GT_PERF_STATUS, channel)); ··· 781 781 static void 782 782 xe_hwmon_get_preregistration_info(struct xe_device *xe) 783 783 { 784 - struct xe_gt *mmio = xe_root_mmio_gt(xe); 784 + struct xe_mmio *mmio = xe_root_tile_mmio(xe); 785 785 struct xe_hwmon *hwmon = xe->hwmon; 786 786 long energy; 787 787 u64 val_sku_unit = 0;