drm/xe/hwmon: Expose power attributes
authorBadal Nilawar <badal.nilawar@intel.com>
Mon, 25 Sep 2023 08:18:38 +0000 (13:48 +0530)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Thu, 21 Dec 2023 16:42:08 +0000 (11:42 -0500)
commitfb1b70607f73af5e5c9d02af203197191ab7abae
tree2038369f2a92a5f4819651d07f651f06955f4247
parent9a674bef6cf0ad2e7653381cacda9fbc9c1ea67e
drm/xe/hwmon: Expose power attributes

Expose Card reactive sustained (pl1) power limit as power_max and
card default power limit (tdp) as power_rated_max.

v2:
  - Fix review comments (Riana)
v3:
  - Use drmm_mutex_init (Matt Brost)
  - Print error value (Matt Brost)
  - Convert enums to uppercase (Matt Brost)
  - Avoid extra reg read in hwmon_is_visible function (Riana)
  - Use xe_device_assert_mem_access when applicable (Matt Brost)
  - Add intel-xe@lists.freedesktop.org in Documentation (Matt Brost)
v4:
  - Use prefix xe_hwmon prefix for all functions (Matt Brost/Andi)
  - %s/hwmon_reg/xe_hwmon_reg (Andi)
  - Fix review comments (Guenter/Andi)
v5:
  - Fix review comments (Riana)
v6:
  - Use drm_warn in default case (Rodrigo)
  - s/ENODEV/EOPNOTSUPP (Andi)

Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Riana Tauro <riana.tauro@intel.com>
Signed-off-by: Badal Nilawar <badal.nilawar@intel.com>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Link: https://lore.kernel.org/r/20230925081842.3566834-2-badal.nilawar@intel.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Documentation/ABI/testing/sysfs-driver-intel-xe-hwmon [new file with mode: 0644]
drivers/gpu/drm/xe/Makefile
drivers/gpu/drm/xe/regs/xe_gt_regs.h
drivers/gpu/drm/xe/regs/xe_mchbar_regs.h [new file with mode: 0644]
drivers/gpu/drm/xe/xe_device.c
drivers/gpu/drm/xe/xe_device_types.h
drivers/gpu/drm/xe/xe_hwmon.c [new file with mode: 0644]
drivers/gpu/drm/xe/xe_hwmon.h [new file with mode: 0644]