]> asedeno.scripts.mit.edu Git - linux.git/commit
habanalabs: add sysfs and hwmon support
authorOded Gabbay <oded.gabbay@gmail.com>
Fri, 15 Feb 2019 22:39:19 +0000 (00:39 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 18 Feb 2019 08:46:45 +0000 (09:46 +0100)
commitd91389bc839d724cd8df7ca308dde97beca9b0c5
treec89375e38daba6d58acdeb99e6e9750e46412124
parent1251f23ae8583b1bb99c3db07102f4c9cc3160fe
habanalabs: add sysfs and hwmon support

This patch add the sysfs and hwmon entries that are exposed by the driver.

Goya has several sensors, from various categories such as temperature,
voltage, current, etc. The driver exposes those sensors in the standard
hwmon mechanism.

In addition, the driver exposes a couple of interfaces in sysfs, both for
configuration and for providing status of the device or driver.

The configuration attributes is for Power Management:
- Automatic or manual
- Frequency value when moving to high frequency mode
- Maximum power the device is allowed to consume

The rest of the attributes are read-only and provide the following
information:
- Versions of the various firmwares running on the device
- Contents of the device's EEPROM
- The device type (currently only Goya is supported)
- PCI address of the device (to allow user-space to connect between
  /dev/hlX to PCI address)
- Status of the device (operational, malfunction, in_reset)
- How many processes are open on the device's file

Reviewed-by: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Documentation/ABI/testing/sysfs-driver-habanalabs [new file with mode: 0644]
drivers/misc/habanalabs/Makefile
drivers/misc/habanalabs/device.c
drivers/misc/habanalabs/goya/Makefile
drivers/misc/habanalabs/goya/goya.c
drivers/misc/habanalabs/goya/goyaP.h
drivers/misc/habanalabs/goya/goya_hwmgr.c [new file with mode: 0644]
drivers/misc/habanalabs/habanalabs.h
drivers/misc/habanalabs/habanalabs_drv.c
drivers/misc/habanalabs/hwmon.c [new file with mode: 0644]
drivers/misc/habanalabs/sysfs.c [new file with mode: 0644]