]> git.baikalelectronics.ru Git - kernel.git/commit
net: phy: aquantia: add hwmon support
authorHeiner Kallweit <hkallweit1@gmail.com>
Mon, 25 Feb 2019 18:56:38 +0000 (19:56 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 25 Feb 2019 22:16:22 +0000 (14:16 -0800)
commita985fdba1c454cf8372116647931ded64cea68f2
tree4fca2ac1f2ecb6aa270b8cb0c8da35c522f9ab4a
parentf6052496d332d0247a3a0f6b5df47577cae85f9b
net: phy: aquantia: add hwmon support

This adds HWMON support for the temperature sensor and the related
alarms on the 107/108/109 chips. This patch is based on work from
Nikita and Andrew. I added:
- support for changing alarm thresholds via sysfs
- move HWMON code to a separate source file to improve maintainability
- smaller changes like using IS_REACHABLE instead of ifdef
  (avoids problems if PHY driver is built in and HWMON is a module)

v2:
- remove struct aqr_priv
- rename header file to aquantia.h
v3:
- add conditional compiling of aquantia_hwmon.c
- improve converting sensor register values to/from long
- add helper aqr_hwmon_test_bit

Signed-off-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/Makefile
drivers/net/phy/aquantia.h [new file with mode: 0644]
drivers/net/phy/aquantia_hwmon.c [new file with mode: 0644]
drivers/net/phy/aquantia_main.c