Commit 4a110907 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'hwmon-for-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging

Pull hwmon updates from Guenter Roeck:
 "New drivers:

   - PMBus driver for MPS Multi-phase mp5023

   - PMBus driver for Delta AHE-50DC fan control module

   - Driver for NZXT RGB&Fan Controller/Smart Device v2

   - Driver for Texas Instruments INA238

   - Driver to support X370 Asus WMI

   - Driver to support B550 Asus WMI

  Other notable changes:

   - Cleanup of ntc_thermistor driver, and added support for Samsung
     1404-001221 NTC

   - Improve detection of LM84, MAX1617, and MAX1617A in adm1021 driver

   - Clean up tmp401 driver, and convert to with_info API

   - Add support for regulators and IR38060, IR38164 IR38263 to ir38064
     PMBus driver

   - Add support for AMD Family 19h Models 10h-1Fh and A0h-AFh to
     k10temp driver

   - Add support for F81966 to f71882fg driver

   - Add support for ONSEMI N34TS04 to jc42 driver

   - Clean up and simplify dell-smm driver

   - Add support for ROG STRIX B550-A/X570-I GAMING to nct6775 driver

  And various other minor improvements and fixes"

* tag 'hwmon-for-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: (49 commits)
  hwmon: (nzxt-smart2) make array detect_fans_report static const
  hwmon: (xgene-hwmon) Add free before exiting xgene_hwmon_probe
  hwmon: (nzxt-smart2) Fix "unused function" warning
  hwmon: (dell-smm) Pack the whole smm_regs struct
  hwmon: (nct6775) Additional check for ChipID before ASUS WMI usage
  hwmon: (mr75203) fix wrong power-up delay value
  hwmon/pmbus: (ir38064) Fix spelling mistake "comaptible" -> "compatible"
  hwmon/pmbus: (ir38064) Expose a regulator
  hwmon/pmbus: (ir38064) Add of_match_table
  hwmon/pmbus: (ir38064) Add support for IR38060, IR38164 IR38263
  hwmon: add driver for NZXT RGB&Fan Controller/Smart Device v2.
  hwmon: (nct6775) add ROG STRIX B550-A/X570-I GAMING
  hwmon: (pmbus) Add support for MPS Multi-phase mp5023
  dt-bindings: add Delta AHE-50DC fan control module
  hwmon: (pmbus) Add Delta AHE-50DC fan control module driver
  hwmon: prefix kernel-doc comments for structs with struct
  hwmon: (ntc_thermistor) Add Samsung 1404-001221 NTC
  hwmon: (ntc_thermistor) Drop OF dependency
  hwmon: (dell-smm) Unify i8k_ioctl() and i8k_ioctl_unlocked()
  hwmon: (dell-smm) Simplify ioctl handler
  ...
parents 5c947d0d 00f5117c
...@@ -76,6 +76,7 @@ properties: ...@@ -76,6 +76,7 @@ properties:
- const: murata,ncp15wl333 - const: murata,ncp15wl333
- const: murata,ncp03wf104 - const: murata,ncp03wf104
- const: murata,ncp15xh103 - const: murata,ncp15xh103
- const: samsung,1404-001221
# Deprecated "ntp," compatible strings # Deprecated "ntp," compatible strings
- const: ntc,ncp15wb473 - const: ntc,ncp15wb473
deprecated: true deprecated: true
......
...@@ -26,6 +26,7 @@ properties: ...@@ -26,6 +26,7 @@ properties:
- ti,ina226 - ti,ina226
- ti,ina230 - ti,ina230
- ti,ina231 - ti,ina231
- ti,ina238
reg: reg:
maxItems: 1 maxItems: 1
...@@ -35,6 +36,27 @@ properties: ...@@ -35,6 +36,27 @@ properties:
Shunt resistor value in micro-Ohm. Shunt resistor value in micro-Ohm.
$ref: /schemas/types.yaml#/definitions/uint32 $ref: /schemas/types.yaml#/definitions/uint32
ti,shunt-gain:
description: |
Programmable gain divisor for the shunt voltage accuracy and range. This
property only applies to devices that have configurable PGA/ADCRANGE. The
gain value is used configure the gain and to convert the shunt voltage,
current and power register values when reading measurements from the
device.
For devices that have a configurable PGA (e.g. INA209, INA219, INA220),
the gain value maps directly with the PG bits of the config register.
For devices that have ADCRANGE configuration (e.g. INA238) a shunt-gain
value of 1 maps to ADCRANGE=1 where no gain divisor is applied to the
shunt voltage, and a value of 4 maps to ADCRANGE=0 such that a wider
voltage range is used.
The default value is device dependent, and is defined by the reset value
of PGA/ADCRANGE in the respective configuration registers.
$ref: /schemas/types.yaml#/definitions/uint32
enum: [1, 2, 4, 8]
required: required:
- compatible - compatible
- reg - reg
......
...@@ -73,6 +73,8 @@ properties: ...@@ -73,6 +73,8 @@ properties:
- dallas,ds4510 - dallas,ds4510
# Digital Thermometer and Thermostat # Digital Thermometer and Thermostat
- dallas,ds75 - dallas,ds75
# Delta AHE-50DC Open19 power shelf fan control module
- delta,ahe50dc-fan
# Delta Electronics DPS-650-AB power supply # Delta Electronics DPS-650-AB power supply
- delta,dps650ab - delta,dps650ab
# Delta Electronics DPS920AB 920W 54V Power Supply # Delta Electronics DPS920AB 920W 54V Power Supply
...@@ -121,8 +123,14 @@ properties: ...@@ -121,8 +123,14 @@ properties:
- ibm,cffps2 - ibm,cffps2
# Infineon IR36021 digital POL buck controller # Infineon IR36021 digital POL buck controller
- infineon,ir36021 - infineon,ir36021
# Infineon IR38060 Voltage Regulator
- infineon,ir38060
# Infineon IR38064 Voltage Regulator # Infineon IR38064 Voltage Regulator
- infineon,ir38064 - infineon,ir38064
# Infineon IR38164 Voltage Regulator
- infineon,ir38164
# Infineon IR38263 Voltage Regulator
- infineon,ir38263
# Infineon SLB9635 (Soft-) I2C TPM (old protocol, max 100khz) # Infineon SLB9635 (Soft-) I2C TPM (old protocol, max 100khz)
- infineon,slb9635tt - infineon,slb9635tt
# Infineon SLB9645 I2C TPM (new protocol, max 400khz) # Infineon SLB9645 I2C TPM (new protocol, max 400khz)
......
.. SPDX-License-Identifier: GPL-2.0-or-later
Kernel driver asus_wmi_ec_sensors
=================================
Supported boards:
* PRIME X570-PRO,
* Pro WS X570-ACE,
* ROG CROSSHAIR VIII DARK HERO,
* ROG CROSSHAIR VIII FORMULA,
* ROG CROSSHAIR VIII HERO,
* ROG STRIX B550-E GAMING,
* ROG STRIX B550-I GAMING,
* ROG STRIX X570-E GAMING.
Authors:
- Eugene Shalygin <eugene.shalygin@gmail.com>
Description:
------------
ASUS mainboards publish hardware monitoring information via Super I/O
chip and the ACPI embedded controller (EC) registers. Some of the sensors
are only available via the EC.
ASUS WMI interface provides a method (BREC) to read data from EC registers,
which is utilized by this driver to publish those sensor readings to the
HWMON system. The driver is aware of and reads the following sensors:
1. Chipset (PCH) temperature
2. CPU package temperature
3. Motherboard temperature
4. Readings from the T_Sensor header
5. VRM temperature
6. CPU_Opt fan RPM
7. Chipset fan RPM
8. Readings from the "Water flow meter" header (RPM)
9. Readings from the "Water In" and "Water Out" temperature headers
10. CPU current
.. SPDX-License-Identifier: GPL-2.0-or-later
Kernel driver asus_wmi_sensors
=================================
Supported boards:
* PRIME X399-A,
* PRIME X470-PRO,
* ROG CROSSHAIR VI EXTREME,
* ROG CROSSHAIR VI HERO,
* ROG CROSSHAIR VI HERO (WI-FI AC),
* ROG CROSSHAIR VII HERO,
* ROG CROSSHAIR VII HERO (WI-FI),
* ROG STRIX B450-E GAMING,
* ROG STRIX B450-F GAMING,
* ROG STRIX B450-I GAMING,
* ROG STRIX X399-E GAMING,
* ROG STRIX X470-F GAMING,
* ROG STRIX X470-I GAMING,
* ROG ZENITH EXTREME,
* ROG ZENITH EXTREME ALPHA.
Authors:
- Ed Brindley <kernel@maidavale.org>
Description:
------------
ASUS mainboards publish hardware monitoring information via WMI interface.
ASUS WMI interface provides a methods to get list of sensors and values of
such, which is utilized by this driver to publish those sensor readings to the
HWMON system.
The driver is aware of and reads the following sensors:
* CPU Core Voltage,
* CPU SOC Voltage,
* DRAM Voltage,
* VDDP Voltage,
* 1.8V PLL Voltage,
* +12V Voltage,
* +5V Voltage,
* 3VSB Voltage,
* VBAT Voltage,
* AVCC3 Voltage,
* SB 1.05V Voltage,
* CPU Core Voltage,
* CPU SOC Voltage,
* DRAM Voltage,
* CPU Fan RPM,
* Chassis Fan 1 RPM,
* Chassis Fan 2 RPM,
* Chassis Fan 3 RPM,
* HAMP Fan RPM,
* Water Pump RPM,
* CPU OPT RPM,
* Water Flow RPM,
* AIO Pump RPM,
* CPU Temperature,
* CPU Socket Temperature,
* Motherboard Temperature,
* Chipset Temperature,
* Tsensor 1 Temperature,
* CPU VRM Temperature,
* Water In,
* Water Out,
* CPU VRM Output Current.
Known Issues:
* The WMI implementation in some of Asus' BIOSes is buggy. This can result in
fans stopping, fans getting stuck at max speed, or temperature readouts
getting stuck. This is not an issue with the driver, but the BIOS. The Prime
X470 Pro seems particularly bad for this. The more frequently the WMI
interface is polled the greater the potential for this to happen. Until you
have subjected your computer to an extended soak test while polling the
sensors frequently, don't leave you computer unattended. Upgrading to new
BIOS version with method version greater than or equal to two should
rectify the issue.
* A few boards report 12v voltages to be ~10v.
.. SPDX-License-Identifier: GPL-2.0-only
Kernel driver ina238
====================
Supported chips:
* Texas Instruments INA238
Prefix: 'ina238'
Addresses: I2C 0x40 - 0x4f
Datasheet:
https://www.ti.com/lit/gpn/ina238
Author: Nathan Rossi <nathan.rossi@digi.com>
Description
-----------
The INA238 is a current shunt, power and temperature monitor with an I2C
interface. It includes a number of programmable functions including alerts,
conversion rate, sample averaging and selectable shunt voltage accuracy.
The shunt value in micro-ohms can be set via platform data or device tree at
compile-time or via the shunt_resistor attribute in sysfs at run-time. Please
refer to the Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml for bindings
if the device tree is used.
Sysfs entries
-------------
======================= =======================================================
in0_input Shunt voltage (mV)
in0_min Minimum shunt voltage threshold (mV)
in0_min_alarm Minimum shunt voltage alarm
in0_max Maximum shunt voltage threshold (mV)
in0_max_alarm Maximum shunt voltage alarm
in1_input Bus voltage (mV)
in1_min Minimum bus voltage threshold (mV)
in1_min_alarm Minimum shunt voltage alarm
in1_max Maximum bus voltage threshold (mV)
in1_max_alarm Maximum shunt voltage alarm
power1_input Power measurement (uW)
power1_max Maximum power threshold (uW)
power1_max_alarm Maximum power alarm
curr1_input Current measurement (mA)
temp1_input Die temperature measurement (mC)
temp1_max Maximum die temperature threshold (mC)
temp1_max_alarm Maximum die temperature alarm
======================= =======================================================
...@@ -43,6 +43,8 @@ Hardware Monitoring Kernel Drivers ...@@ -43,6 +43,8 @@ Hardware Monitoring Kernel Drivers
asb100 asb100
asc7621 asc7621
aspeed-pwm-tacho aspeed-pwm-tacho
asus_wmi_ec_sensors
asus_wmi_sensors
bcm54140 bcm54140
bel-pfe bel-pfe
bpa-rs600 bpa-rs600
...@@ -76,6 +78,7 @@ Hardware Monitoring Kernel Drivers ...@@ -76,6 +78,7 @@ Hardware Monitoring Kernel Drivers
ibmpowernv ibmpowernv
ina209 ina209
ina2xx ina2xx
ina238
ina3221 ina3221
intel-m10-bmc-hwmon intel-m10-bmc-hwmon
ir35221 ir35221
...@@ -142,6 +145,7 @@ Hardware Monitoring Kernel Drivers ...@@ -142,6 +145,7 @@ Hardware Monitoring Kernel Drivers
mlxreg-fan mlxreg-fan
mp2888 mp2888
mp2975 mp2975
mp5023
nct6683 nct6683
nct6775 nct6775
nct7802 nct7802
...@@ -150,6 +154,7 @@ Hardware Monitoring Kernel Drivers ...@@ -150,6 +154,7 @@ Hardware Monitoring Kernel Drivers
nsa320 nsa320
ntc_thermistor ntc_thermistor
nzxt-kraken2 nzxt-kraken2
nzxt-smart2
occ occ
pc87360 pc87360
pc87427 pc87427
......
...@@ -3,14 +3,38 @@ Kernel driver ir38064 ...@@ -3,14 +3,38 @@ Kernel driver ir38064
Supported chips: Supported chips:
* Infineon IR38060
Prefix: 'IR38060'
Addresses scanned: -
Datasheet: Publicly available at the Infineon website
https://www.infineon.com/dgdl/Infineon-IR38060M-DS-v03_16-EN.pdf?fileId=5546d4625c167129015c3291ea9a4cee
* Infineon IR38064 * Infineon IR38064
Prefix: 'ir38064' Prefix: 'ir38064'
Addresses scanned: - Addresses scanned: -
Datasheet: Publicly available at the Infineon webiste Datasheet: Publicly available at the Infineon website
https://www.infineon.com/dgdl/Infineon-IR38064MTRPBF-DS-v03_07-EN.pdf?fileId=5546d462584d1d4a0158db0d9efb67ca https://www.infineon.com/dgdl/Infineon-IR38064MTRPBF-DS-v03_07-EN.pdf?fileId=5546d462584d1d4a0158db0d9efb67ca
* Infineon IR38164
Prefix: 'ir38164'
Addresses scanned: -
Datasheet: Publicly available at the Infineon website
https://www.infineon.com/dgdl/Infineon-IR38164M-DS-v02_02-EN.pdf?fileId=5546d462636cc8fb01640046efea1248
* Infineon ir38263
Prefix: 'ir38263'
Addresses scanned: -
Datasheet: Publicly available at the Infineon website
https://www.infineon.com/dgdl/Infineon-IR38263M-DataSheet-v03_05-EN.pdf?fileId=5546d4625b62cd8a015bcf81f90a6e52
Authors: Authors:
- Maxim Sloyko <maxims@google.com> - Maxim Sloyko <maxims@google.com>
- Patrick Venture <venture@google.com> - Patrick Venture <venture@google.com>
...@@ -18,7 +42,7 @@ Authors: ...@@ -18,7 +42,7 @@ Authors:
Description Description
----------- -----------
IR38064 is a Single-input Voltage, Synchronous Buck Regulator, DC-DC Converter. IR38x6x are a Single-input Voltage, Synchronous Buck Regulator, DC-DC Converter.
Usage Notes Usage Notes
----------- -----------
......
.. SPDX-License-Identifier: GPL-2.0
Kernel driver mp5023
====================
Supported chips:
* MPS MP5023
Prefix: 'mp5023'
* Datasheet
Publicly available at the MPS website : https://www.monolithicpower.com/en/mp5023.html
Author:
Howard Chiu <howard.chiu@quantatw.com>
Description
-----------
This driver implements support for Monolithic Power Systems, Inc. (MPS)
MP5023 Hot-Swap Controller.
Device complaint with:
- PMBus rev 1.3 interface.
Device supports direct format for reading input voltage, output voltage,
output current, input power and temperature.
The driver exports the following attributes via the 'sysfs' files
for input voltage:
**in1_input**
**in1_label**
**in1_max**
**in1_max_alarm**
**in1_min**
**in1_min_alarm**
The driver provides the following attributes for output voltage:
**in2_input**
**in2_label**
**in2_alarm**
The driver provides the following attributes for output current:
**curr1_input**
**curr1_label**
**curr1_alarm**
**curr1_max**
The driver provides the following attributes for input power:
**power1_input**
**power1_label**
**power1_alarm**
The driver provides the following attributes for temperature:
**temp1_input**
**temp1_max**
**temp1_max_alarm**
**temp1_crit**
**temp1_crit_alarm**
.. SPDX-License-Identifier: GPL-2.0-or-later
Kernel driver nzxt-smart2
=========================
Supported devices:
- NZXT RGB & Fan controller
- NZXT Smart Device v2
Description
-----------
This driver implements monitoring and control of fans plugged into the device.
Besides typical speed monitoring and PWM duty cycle control, voltage and current
is reported for every fan.
The device also has two connectors for RGB LEDs; support for them isn't
implemented (mainly because there is no standardized sysfs interface).
Also, the device has a noise sensor, but the sensor seems to be completely
useless (and very imprecise), so support for it isn't implemented too.
Usage Notes
-----------
The device should be autodetected, and the driver should load automatically.
If fans are plugged in/unplugged while the system is powered on, the driver
must be reloaded to detect configuration changes; otherwise, new fans can't
be controlled (`pwm*` changes will be ignored). It is necessary because the
device has a dedicated "detect fans" command, and currently, it is executed only
during initialization. Speed, voltage, current monitoring will work even without
reload. As an alternative to reloading the module, a userspace tool (like
`liquidctl`_) can be used to run "detect fans" command through hidraw interface.
The driver coexists with userspace tools that access the device through hidraw
interface with no known issues.
.. _liquidctl: https://github.com/liquidctl/liquidctl
Sysfs entries
-------------
======================= ========================================================
fan[1-3]_input Fan speed monitoring (in rpm).
curr[1-3]_input Current supplied to the fan (in milliamperes).
in[0-2]_input Voltage supplied to the fan (in millivolts).
pwm[1-3] Controls fan speed: PWM duty cycle for PWM-controlled
fans, voltage for other fans. Voltage can be changed in
9-12 V range, but the value of the sysfs attribute is
always in 0-255 range (1 = 9V, 255 = 12V). Setting the
attribute to 0 turns off the fan completely.
pwm[1-3]_enable 1 if the fan can be controlled by writing to the
corresponding pwm* attribute, 0 otherwise. The device
can control only the fans it detected itself, so the
attribute is read-only.
pwm[1-3]_mode Read-only, 1 for PWM-controlled fans, 0 for other fans
(or if no fan connected).
update_interval The interval at which all inputs are updated (in
milliseconds). The default is 1000ms. Minimum is 250ms.
======================= ========================================================
...@@ -3013,6 +3013,20 @@ W: http://acpi4asus.sf.net ...@@ -3013,6 +3013,20 @@ W: http://acpi4asus.sf.net
F: drivers/platform/x86/asus*.c F: drivers/platform/x86/asus*.c
F: drivers/platform/x86/eeepc*.c F: drivers/platform/x86/eeepc*.c
ASUS WMI HARDWARE MONITOR DRIVER
M: Ed Brindley <kernel@maidavale.org>
M: Denis Pauk <pauk.denis@gmail.com>
L: linux-hwmon@vger.kernel.org
S: Maintained
F: drivers/hwmon/asus_wmi_sensors.c
ASUS WMI EC HARDWARE MONITOR DRIVER
M: Eugene Shalygin <eugene.shalygin@gmail.com>
M: Denis Pauk <pauk.denis@gmail.com>
L: linux-hwmon@vger.kernel.org
S: Maintained
F: drivers/hwmon/asus_wmi_ec_sensors.c
ASUS WIRELESS RADIO CONTROL DRIVER ASUS WIRELESS RADIO CONTROL DRIVER
M: João Paulo Rechi Vita <jprvita@gmail.com> M: João Paulo Rechi Vita <jprvita@gmail.com>
L: platform-driver-x86@vger.kernel.org L: platform-driver-x86@vger.kernel.org
...@@ -5440,6 +5454,12 @@ W: https://linuxtv.org ...@@ -5440,6 +5454,12 @@ W: https://linuxtv.org
T: git git://linuxtv.org/media_tree.git T: git git://linuxtv.org/media_tree.git
F: drivers/media/platform/sti/delta F: drivers/media/platform/sti/delta
DELTA AHE-50DC FAN CONTROL MODULE DRIVER
M: Zev Weiss <zev@bewilderbeest.net>
L: linux-hwmon@vger.kernel.org
S: Maintained
F: drivers/hwmon/pmbus/delta-ahe50dc-fan.c
DELTA DPS920AB PSU DRIVER DELTA DPS920AB PSU DRIVER
M: Robert Marko <robert.marko@sartura.hr> M: Robert Marko <robert.marko@sartura.hr>
L: linux-hwmon@vger.kernel.org L: linux-hwmon@vger.kernel.org
...@@ -13837,6 +13857,13 @@ S: Maintained ...@@ -13837,6 +13857,13 @@ S: Maintained
F: Documentation/hwmon/nzxt-kraken2.rst F: Documentation/hwmon/nzxt-kraken2.rst
F: drivers/hwmon/nzxt-kraken2.c F: drivers/hwmon/nzxt-kraken2.c
NZXT-SMART2 HARDWARE MONITORING DRIVER
M: Aleksandr Mezin <mezin.alexander@gmail.com>
L: linux-hwmon@vger.kernel.org
S: Maintained
F: Documentation/hwmon/nzxt-smart2.rst
F: drivers/hwmon/nzxt-smart2.c
OBJAGG OBJAGG
M: Jiri Pirko <jiri@nvidia.com> M: Jiri Pirko <jiri@nvidia.com>
L: netdev@vger.kernel.org L: netdev@vger.kernel.org
......
...@@ -19,12 +19,14 @@ ...@@ -19,12 +19,14 @@
#define PCI_DEVICE_ID_AMD_17H_M10H_ROOT 0x15d0 #define PCI_DEVICE_ID_AMD_17H_M10H_ROOT 0x15d0
#define PCI_DEVICE_ID_AMD_17H_M30H_ROOT 0x1480 #define PCI_DEVICE_ID_AMD_17H_M30H_ROOT 0x1480
#define PCI_DEVICE_ID_AMD_17H_M60H_ROOT 0x1630 #define PCI_DEVICE_ID_AMD_17H_M60H_ROOT 0x1630
#define PCI_DEVICE_ID_AMD_19H_M10H_ROOT 0x14a4
#define PCI_DEVICE_ID_AMD_17H_DF_F4 0x1464 #define PCI_DEVICE_ID_AMD_17H_DF_F4 0x1464
#define PCI_DEVICE_ID_AMD_17H_M10H_DF_F4 0x15ec #define PCI_DEVICE_ID_AMD_17H_M10H_DF_F4 0x15ec
#define PCI_DEVICE_ID_AMD_17H_M30H_DF_F4 0x1494 #define PCI_DEVICE_ID_AMD_17H_M30H_DF_F4 0x1494
#define PCI_DEVICE_ID_AMD_17H_M60H_DF_F4 0x144c #define PCI_DEVICE_ID_AMD_17H_M60H_DF_F4 0x144c
#define PCI_DEVICE_ID_AMD_17H_M70H_DF_F4 0x1444 #define PCI_DEVICE_ID_AMD_17H_M70H_DF_F4 0x1444
#define PCI_DEVICE_ID_AMD_19H_DF_F4 0x1654 #define PCI_DEVICE_ID_AMD_19H_DF_F4 0x1654
#define PCI_DEVICE_ID_AMD_19H_M10H_DF_F4 0x14b1
#define PCI_DEVICE_ID_AMD_19H_M40H_ROOT 0x14b5 #define PCI_DEVICE_ID_AMD_19H_M40H_ROOT 0x14b5
#define PCI_DEVICE_ID_AMD_19H_M40H_DF_F4 0x167d #define PCI_DEVICE_ID_AMD_19H_M40H_DF_F4 0x167d
#define PCI_DEVICE_ID_AMD_19H_M50H_DF_F4 0x166e #define PCI_DEVICE_ID_AMD_19H_M50H_DF_F4 0x166e
...@@ -39,6 +41,7 @@ static const struct pci_device_id amd_root_ids[] = { ...@@ -39,6 +41,7 @@ static const struct pci_device_id amd_root_ids[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M10H_ROOT) }, { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M10H_ROOT) },
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M30H_ROOT) }, { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M30H_ROOT) },
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M60H_ROOT) }, { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M60H_ROOT) },
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M10H_ROOT) },
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M40H_ROOT) }, { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M40H_ROOT) },
{} {}
}; };
...@@ -61,6 +64,7 @@ static const struct pci_device_id amd_nb_misc_ids[] = { ...@@ -61,6 +64,7 @@ static const struct pci_device_id amd_nb_misc_ids[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CNB17H_F3) }, { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CNB17H_F3) },
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M70H_DF_F3) }, { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M70H_DF_F3) },
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_DF_F3) }, { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_DF_F3) },
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M10H_DF_F3) },
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M40H_DF_F3) }, { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M40H_DF_F3) },
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M50H_DF_F3) }, { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M50H_DF_F3) },
{} {}
...@@ -78,6 +82,7 @@ static const struct pci_device_id amd_nb_link_ids[] = { ...@@ -78,6 +82,7 @@ static const struct pci_device_id amd_nb_link_ids[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M60H_DF_F4) }, { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M60H_DF_F4) },
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M70H_DF_F4) }, { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M70H_DF_F4) },
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_DF_F4) }, { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_DF_F4) },
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M10H_DF_F4) },
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M40H_DF_F4) }, { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M40H_DF_F4) },
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M50H_DF_F4) }, { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M50H_DF_F4) },
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CNB17H_F4) }, { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CNB17H_F4) },
......
...@@ -1414,8 +1414,8 @@ config SENSORS_PC87427 ...@@ -1414,8 +1414,8 @@ config SENSORS_PC87427
will be called pc87427. will be called pc87427.
config SENSORS_NTC_THERMISTOR config SENSORS_NTC_THERMISTOR
tristate "NTC thermistor support from Murata" tristate "NTC thermistor support"
depends on !OF || IIO=n || IIO depends on IIO
depends on THERMAL || !THERMAL_OF depends on THERMAL || !THERMAL_OF
help help
This driver supports NTC thermistors sensor reading and its This driver supports NTC thermistors sensor reading and its
...@@ -1513,6 +1513,16 @@ config SENSORS_NZXT_KRAKEN2 ...@@ -1513,6 +1513,16 @@ config SENSORS_NZXT_KRAKEN2
This driver can also be built as a module. If so, the module This driver can also be built as a module. If so, the module
will be called nzxt-kraken2. will be called nzxt-kraken2.
config SENSORS_NZXT_SMART2
tristate "NZXT RGB & Fan Controller/Smart Device v2"
depends on USB_HID
help
If you say yes here you get support for hardware monitoring for the
NZXT RGB & Fan Controller/Smart Device v2.
This driver can also be built as a module. If so, the module
will be called nzxt-smart2.
source "drivers/hwmon/occ/Kconfig" source "drivers/hwmon/occ/Kconfig"
config SENSORS_PCF8591 config SENSORS_PCF8591
...@@ -1872,6 +1882,18 @@ config SENSORS_INA2XX ...@@ -1872,6 +1882,18 @@ config SENSORS_INA2XX
This driver can also be built as a module. If so, the module This driver can also be built as a module. If so, the module
will be called ina2xx. will be called ina2xx.
config SENSORS_INA238
tristate "Texas Instruments INA238"
depends on I2C
select REGMAP_I2C
help
If you say yes here you get support for the INA238 power monitor
chip. This driver supports voltage, current, power and temperature
measurements as well as alarm configuration.
This driver can also be built as a module. If so, the module
will be called ina238.
config SENSORS_INA3221 config SENSORS_INA3221
tristate "Texas Instruments INA3221 Triple Power Monitor" tristate "Texas Instruments INA3221 Triple Power Monitor"
depends on I2C depends on I2C
...@@ -1939,6 +1961,7 @@ config SENSORS_TMP108 ...@@ -1939,6 +1961,7 @@ config SENSORS_TMP108
config SENSORS_TMP401 config SENSORS_TMP401
tristate "Texas Instruments TMP401 and compatibles" tristate "Texas Instruments TMP401 and compatibles"
depends on I2C depends on I2C
select REGMAP
help help
If you say yes here you get support for Texas Instruments TMP401, If you say yes here you get support for Texas Instruments TMP401,
TMP411, TMP431, TMP432, and TMP435 temperature sensor chips. TMP411, TMP431, TMP432, and TMP435 temperature sensor chips.
...@@ -2215,6 +2238,30 @@ config SENSORS_ATK0110 ...@@ -2215,6 +2238,30 @@ config SENSORS_ATK0110
This driver can also be built as a module. If so, the module This driver can also be built as a module. If so, the module
will be called asus_atk0110. will be called asus_atk0110.
config SENSORS_ASUS_WMI
tristate "ASUS WMI X370/X470/B450/X399"
depends on ACPI_WMI
help
If you say yes here you get support for the ACPI hardware monitoring
interface found in X370/X470/B450/X399 ASUS motherboards. This driver
will provide readings of fans, voltages and temperatures through the system
firmware.
This driver can also be built as a module. If so, the module
will be called asus_wmi_sensors.
config SENSORS_ASUS_WMI_EC
tristate "ASUS WMI B550/X570"
depends on ACPI_WMI
help
If you say yes here you get support for the ACPI embedded controller
hardware monitoring interface found in B550/X570 ASUS motherboards.
This driver will provide readings of fans, voltages and temperatures
through the system firmware.
This driver can also be built as a module. If so, the module
will be called asus_wmi_sensors_ec.
endif # ACPI endif # ACPI
endif # HWMON endif # HWMON
...@@ -9,6 +9,8 @@ obj-$(CONFIG_HWMON_VID) += hwmon-vid.o ...@@ -9,6 +9,8 @@ obj-$(CONFIG_HWMON_VID) += hwmon-vid.o
# APCI drivers # APCI drivers
obj-$(CONFIG_SENSORS_ACPI_POWER) += acpi_power_meter.o obj-$(CONFIG_SENSORS_ACPI_POWER) += acpi_power_meter.o
obj-$(CONFIG_SENSORS_ATK0110) += asus_atk0110.o obj-$(CONFIG_SENSORS_ATK0110) += asus_atk0110.o
obj-$(CONFIG_SENSORS_ASUS_WMI) += asus_wmi_sensors.o
obj-$(CONFIG_SENSORS_ASUS_WMI_EC) += asus_wmi_ec_sensors.o
# Native drivers # Native drivers
# asb100, then w83781d go first, as they can override other drivers' addresses. # asb100, then w83781d go first, as they can override other drivers' addresses.
...@@ -90,6 +92,7 @@ obj-$(CONFIG_SENSORS_IBMPOWERNV)+= ibmpowernv.o ...@@ -90,6 +92,7 @@ obj-$(CONFIG_SENSORS_IBMPOWERNV)+= ibmpowernv.o
obj-$(CONFIG_SENSORS_IIO_HWMON) += iio_hwmon.o obj-$(CONFIG_SENSORS_IIO_HWMON) += iio_hwmon.o
obj-$(CONFIG_SENSORS_INA209) += ina209.o obj-$(CONFIG_SENSORS_INA209) += ina209.o
obj-$(CONFIG_SENSORS_INA2XX) += ina2xx.o obj-$(CONFIG_SENSORS_INA2XX) += ina2xx.o
obj-$(CONFIG_SENSORS_INA238) += ina238.o
obj-$(CONFIG_SENSORS_INA3221) += ina3221.o obj-$(CONFIG_SENSORS_INA3221) += ina3221.o
obj-$(CONFIG_SENSORS_INTEL_M10_BMC_HWMON) += intel-m10-bmc-hwmon.o obj-$(CONFIG_SENSORS_INTEL_M10_BMC_HWMON) += intel-m10-bmc-hwmon.o
obj-$(CONFIG_SENSORS_IT87) += it87.o obj-$(CONFIG_SENSORS_IT87) += it87.o
...@@ -157,6 +160,7 @@ obj-$(CONFIG_SENSORS_NPCM7XX) += npcm750-pwm-fan.o ...@@ -157,6 +160,7 @@ obj-$(CONFIG_SENSORS_NPCM7XX) += npcm750-pwm-fan.o
obj-$(CONFIG_SENSORS_NSA320) += nsa320-hwmon.o obj-$(CONFIG_SENSORS_NSA320) += nsa320-hwmon.o
obj-$(CONFIG_SENSORS_NTC_THERMISTOR) += ntc_thermistor.o obj-$(CONFIG_SENSORS_NTC_THERMISTOR) += ntc_thermistor.o
obj-$(CONFIG_SENSORS_NZXT_KRAKEN2) += nzxt-kraken2.o obj-$(CONFIG_SENSORS_NZXT_KRAKEN2) += nzxt-kraken2.o
obj-$(CONFIG_SENSORS_NZXT_SMART2) += nzxt-smart2.o
obj-$(CONFIG_SENSORS_PC87360) += pc87360.o obj-$(CONFIG_SENSORS_PC87360) += pc87360.o
obj-$(CONFIG_SENSORS_PC87427) += pc87427.o obj-$(CONFIG_SENSORS_PC87427) += pc87427.o
obj-$(CONFIG_SENSORS_PCF8591) += pcf8591.o obj-$(CONFIG_SENSORS_PCF8591) += pcf8591.o
......
...@@ -324,7 +324,7 @@ static int adm1021_detect(struct i2c_client *client, ...@@ -324,7 +324,7 @@ static int adm1021_detect(struct i2c_client *client,
{ {
struct i2c_adapter *adapter = client->adapter; struct i2c_adapter *adapter = client->adapter;
const char *type_name; const char *type_name;
int conv_rate, status, config, man_id, dev_id; int reg, conv_rate, status, config, man_id, dev_id;
if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) { if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) {
pr_debug("detect failed, smbus byte data not supported!\n"); pr_debug("detect failed, smbus byte data not supported!\n");
...@@ -349,9 +349,19 @@ static int adm1021_detect(struct i2c_client *client, ...@@ -349,9 +349,19 @@ static int adm1021_detect(struct i2c_client *client,
if (man_id < 0 || dev_id < 0) if (man_id < 0 || dev_id < 0)
return -ENODEV; return -ENODEV;
if (man_id == 0x4d && dev_id == 0x01) if (man_id == 0x4d && dev_id == 0x01) {
/*
* dev_id 0x01 matches MAX6680, MAX6695, MAX6696, and possibly
* others. Read register which is unsupported on MAX1617 but
* exists on all those chips and compare with the dev_id
* register. If it matches, it may be a MAX1617A.
*/
reg = i2c_smbus_read_byte_data(client,
ADM1023_REG_REM_TEMP_PREC);
if (reg != dev_id)
return -ENODEV;
type_name = "max1617a"; type_name = "max1617a";
else if (man_id == 0x41) { } else if (man_id == 0x41) {
if ((dev_id & 0xF0) == 0x30) if ((dev_id & 0xF0) == 0x30)
type_name = "adm1023"; type_name = "adm1023";
else if ((dev_id & 0xF0) == 0x00) else if ((dev_id & 0xF0) == 0x00)
...@@ -395,13 +405,18 @@ static int adm1021_detect(struct i2c_client *client, ...@@ -395,13 +405,18 @@ static int adm1021_detect(struct i2c_client *client,
/* /*
* LM84 Mfr ID is in a different place, * LM84 Mfr ID is in a different place,
* and it has more unused bits. * and it has more unused bits. Registers at 0xfe and 0xff
* are undefined and return the most recently read value,
* here the value of the configuration register.
*/ */
if (conv_rate == 0x00 if (conv_rate == 0x00
&& man_id == config && dev_id == config
&& (config & 0x7F) == 0x00 && (config & 0x7F) == 0x00
&& (status & 0xAB) == 0x00) { && (status & 0xAB) == 0x00) {
type_name = "lm84"; type_name = "lm84";
} else { } else {
if ((config & 0x3f) || (status & 0x03))
return -ENODEV;
/* fail if low limits are larger than high limits */ /* fail if low limits are larger than high limits */
if ((s8)llo > lhi || (s8)rlo > rhi) if ((s8)llo > lhi || (s8)rlo > rhi)
return -ENODEV; return -ENODEV;
......
...@@ -242,9 +242,8 @@ static int FAN_TO_REG(int reg, int div) ...@@ -242,9 +242,8 @@ static int FAN_TO_REG(int reg, int div)
static int AUTO_TEMP_MAX_TO_REG(int val, int reg, int pwm) static int AUTO_TEMP_MAX_TO_REG(int val, int reg, int pwm)
{ {
int ret; int ret;
int range = val - AUTO_TEMP_MIN_FROM_REG(reg); int range = ((val - AUTO_TEMP_MIN_FROM_REG(reg)) * 10) / (16 - pwm);
range = ((val - AUTO_TEMP_MIN_FROM_REG(reg))*10)/(16 - pwm);
ret = ((reg & 0xf8) | ret = ((reg & 0xf8) |
(range < 10000 ? 0 : (range < 10000 ? 0 :
range < 20000 ? 1 : range < 20000 ? 1 :
......
This diff is collapsed.
This diff is collapsed.
...@@ -113,12 +113,12 @@ MODULE_PARM_DESC(fan_max, "Maximum configurable fan speed (default: autodetect)" ...@@ -113,12 +113,12 @@ MODULE_PARM_DESC(fan_max, "Maximum configurable fan speed (default: autodetect)"
struct smm_regs { struct smm_regs {
unsigned int eax; unsigned int eax;
unsigned int ebx __packed; unsigned int ebx;
unsigned int ecx __packed; unsigned int ecx;
unsigned int edx __packed; unsigned int edx;
unsigned int esi __packed; unsigned int esi;
unsigned int edi __packed; unsigned int edi;
}; } __packed;
static const char * const temp_labels[] = { static const char * const temp_labels[] = {
"CPU", "CPU",
...@@ -449,13 +449,12 @@ static int i8k_get_power_status(void) ...@@ -449,13 +449,12 @@ static int i8k_get_power_status(void)
* Procfs interface * Procfs interface
*/ */
static int static long i8k_ioctl(struct file *fp, unsigned int cmd, unsigned long arg)
i8k_ioctl_unlocked(struct file *fp, struct dell_smm_data *data, unsigned int cmd, unsigned long arg)
{ {
int val = 0; struct dell_smm_data *data = PDE_DATA(file_inode(fp));
int speed, err;
unsigned char buff[16];
int __user *argp = (int __user *)arg; int __user *argp = (int __user *)arg;
int speed, err;
int val = 0;
if (!argp) if (!argp)
return -EINVAL; return -EINVAL;
...@@ -468,15 +467,19 @@ i8k_ioctl_unlocked(struct file *fp, struct dell_smm_data *data, unsigned int cmd ...@@ -468,15 +467,19 @@ i8k_ioctl_unlocked(struct file *fp, struct dell_smm_data *data, unsigned int cmd
val = (data->bios_version[0] << 16) | val = (data->bios_version[0] << 16) |
(data->bios_version[1] << 8) | data->bios_version[2]; (data->bios_version[1] << 8) | data->bios_version[2];
break;
if (copy_to_user(argp, &val, sizeof(val)))
return -EFAULT;
return 0;
case I8K_MACHINE_ID: case I8K_MACHINE_ID:
if (restricted && !capable(CAP_SYS_ADMIN)) if (restricted && !capable(CAP_SYS_ADMIN))
return -EPERM; return -EPERM;
strscpy_pad(buff, data->bios_machineid, sizeof(buff)); if (copy_to_user(argp, data->bios_machineid, sizeof(data->bios_machineid)))
break; return -EFAULT;
return 0;
case I8K_FN_STATUS: case I8K_FN_STATUS:
val = i8k_get_fn_status(); val = i8k_get_fn_status();
break; break;
...@@ -513,11 +516,13 @@ i8k_ioctl_unlocked(struct file *fp, struct dell_smm_data *data, unsigned int cmd ...@@ -513,11 +516,13 @@ i8k_ioctl_unlocked(struct file *fp, struct dell_smm_data *data, unsigned int cmd
if (copy_from_user(&speed, argp + 1, sizeof(int))) if (copy_from_user(&speed, argp + 1, sizeof(int)))
return -EFAULT; return -EFAULT;
mutex_lock(&data->i8k_mutex);
err = i8k_set_fan(data, val, speed); err = i8k_set_fan(data, val, speed);
if (err < 0) if (err < 0)
return err; val = err;
else
val = i8k_get_fan_status(data, val); val = i8k_get_fan_status(data, val);
mutex_unlock(&data->i8k_mutex);
break; break;
default: default:
...@@ -527,39 +532,12 @@ i8k_ioctl_unlocked(struct file *fp, struct dell_smm_data *data, unsigned int cmd ...@@ -527,39 +532,12 @@ i8k_ioctl_unlocked(struct file *fp, struct dell_smm_data *data, unsigned int cmd
if (val < 0) if (val < 0)
return val; return val;
switch (cmd) { if (copy_to_user(argp, &val, sizeof(int)))
case I8K_BIOS_VERSION: return -EFAULT;
if (copy_to_user(argp, &val, 4))
return -EFAULT;
break;
case I8K_MACHINE_ID:
if (copy_to_user(argp, buff, 16))
return -EFAULT;
break;
default:
if (copy_to_user(argp, &val, sizeof(int)))
return -EFAULT;
break;
}
return 0; return 0;
} }
static long i8k_ioctl(struct file *fp, unsigned int cmd, unsigned long arg)
{
struct dell_smm_data *data = PDE_DATA(file_inode(fp));
long ret;
mutex_lock(&data->i8k_mutex);
ret = i8k_ioctl_unlocked(fp, data, cmd, arg);
mutex_unlock(&data->i8k_mutex);
return ret;
}
/* /*
* Print the information for /proc/i8k. * Print the information for /proc/i8k.
*/ */
......
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
#define SIO_F81768D_ID 0x1210 /* Chipset ID */ #define SIO_F81768D_ID 0x1210 /* Chipset ID */
#define SIO_F81865_ID 0x0704 /* Chipset ID */ #define SIO_F81865_ID 0x0704 /* Chipset ID */
#define SIO_F81866_ID 0x1010 /* Chipset ID */ #define SIO_F81866_ID 0x1010 /* Chipset ID */
#define SIO_F81966_ID 0x1502 /* Chipset ID */
#define REGION_LENGTH 8 #define REGION_LENGTH 8
#define ADDR_REG_OFFSET 5 #define ADDR_REG_OFFSET 5
...@@ -2672,6 +2673,7 @@ static int __init f71882fg_find(int sioaddr, struct f71882fg_sio_data *sio_data) ...@@ -2672,6 +2673,7 @@ static int __init f71882fg_find(int sioaddr, struct f71882fg_sio_data *sio_data)
sio_data->type = f81865f; sio_data->type = f81865f;
break; break;
case SIO_F81866_ID: case SIO_F81866_ID:
case SIO_F81966_ID:
sio_data->type = f81866a; sio_data->type = f81866a;
break; break;
default: default:
......
This diff is collapsed.
...@@ -137,6 +137,9 @@ static const unsigned short normal_i2c[] = { ...@@ -137,6 +137,9 @@ static const unsigned short normal_i2c[] = {
#define CAT34TS04_DEVID 0x2200 #define CAT34TS04_DEVID 0x2200
#define CAT34TS04_DEVID_MASK 0xfff0 #define CAT34TS04_DEVID_MASK 0xfff0
#define N34TS04_DEVID 0x2230
#define N34TS04_DEVID_MASK 0xfff0
/* ST Microelectronics */ /* ST Microelectronics */
#define STTS424_DEVID 0x0101 #define STTS424_DEVID 0x0101
#define STTS424_DEVID_MASK 0xffff #define STTS424_DEVID_MASK 0xffff
...@@ -181,6 +184,7 @@ static struct jc42_chips jc42_chips[] = { ...@@ -181,6 +184,7 @@ static struct jc42_chips jc42_chips[] = {
{ ONS_MANID, CAT6095_DEVID, CAT6095_DEVID_MASK }, { ONS_MANID, CAT6095_DEVID, CAT6095_DEVID_MASK },
{ ONS_MANID, CAT34TS02C_DEVID, CAT34TS02C_DEVID_MASK }, { ONS_MANID, CAT34TS02C_DEVID, CAT34TS02C_DEVID_MASK },
{ ONS_MANID, CAT34TS04_DEVID, CAT34TS04_DEVID_MASK }, { ONS_MANID, CAT34TS04_DEVID, CAT34TS04_DEVID_MASK },
{ ONS_MANID, N34TS04_DEVID, N34TS04_DEVID_MASK },
{ NXP_MANID, SE98_DEVID, SE98_DEVID_MASK }, { NXP_MANID, SE98_DEVID, SE98_DEVID_MASK },
{ STM_MANID, STTS424_DEVID, STTS424_DEVID_MASK }, { STM_MANID, STTS424_DEVID, STTS424_DEVID_MASK },
{ STM_MANID, STTS424E_DEVID, STTS424E_DEVID_MASK }, { STM_MANID, STTS424E_DEVID, STTS424E_DEVID_MASK },
......
...@@ -76,26 +76,6 @@ static DEFINE_MUTEX(nb_smu_ind_mutex); ...@@ -76,26 +76,6 @@ static DEFINE_MUTEX(nb_smu_ind_mutex);
#define ZEN_CUR_TEMP_SHIFT 21 #define ZEN_CUR_TEMP_SHIFT 21
#define ZEN_CUR_TEMP_RANGE_SEL_MASK BIT(19) #define ZEN_CUR_TEMP_RANGE_SEL_MASK BIT(19)
#define ZEN_SVI_BASE 0x0005A000
/* F17h thermal registers through SMN */
#define F17H_M01H_SVI_TEL_PLANE0 (ZEN_SVI_BASE + 0xc)
#define F17H_M01H_SVI_TEL_PLANE1 (ZEN_SVI_BASE + 0x10)
#define F17H_M31H_SVI_TEL_PLANE0 (ZEN_SVI_BASE + 0x14)
#define F17H_M31H_SVI_TEL_PLANE1 (ZEN_SVI_BASE + 0x10)
#define F17H_M01H_CFACTOR_ICORE 1000000 /* 1A / LSB */
#define F17H_M01H_CFACTOR_ISOC 250000 /* 0.25A / LSB */
#define F17H_M31H_CFACTOR_ICORE 1000000 /* 1A / LSB */
#define F17H_M31H_CFACTOR_ISOC 310000 /* 0.31A / LSB */
/* F19h thermal registers through SMN */
#define F19H_M01_SVI_TEL_PLANE0 (ZEN_SVI_BASE + 0x14)
#define F19H_M01_SVI_TEL_PLANE1 (ZEN_SVI_BASE + 0x10)
#define F19H_M01H_CFACTOR_ICORE 1000000 /* 1A / LSB */
#define F19H_M01H_CFACTOR_ISOC 310000 /* 0.31A / LSB */
struct k10temp_data { struct k10temp_data {
struct pci_dev *pdev; struct pci_dev *pdev;
void (*read_htcreg)(struct pci_dev *pdev, u32 *regval); void (*read_htcreg)(struct pci_dev *pdev, u32 *regval);
...@@ -191,6 +171,10 @@ static const char *k10temp_temp_label[] = { ...@@ -191,6 +171,10 @@ static const char *k10temp_temp_label[] = {
"Tccd6", "Tccd6",
"Tccd7", "Tccd7",
"Tccd8", "Tccd8",
"Tccd9",
"Tccd10",
"Tccd11",
"Tccd12",
}; };
static int k10temp_read_labels(struct device *dev, static int k10temp_read_labels(struct device *dev,
...@@ -226,7 +210,7 @@ static int k10temp_read_temp(struct device *dev, u32 attr, int channel, ...@@ -226,7 +210,7 @@ static int k10temp_read_temp(struct device *dev, u32 attr, int channel,
if (*val < 0) if (*val < 0)
*val = 0; *val = 0;
break; break;
case 2 ... 9: /* Tccd{1-8} */ case 2 ... 13: /* Tccd{1-12} */
amd_smn_read(amd_pci_dev_to_node_id(data->pdev), amd_smn_read(amd_pci_dev_to_node_id(data->pdev),
ZEN_CCD_TEMP(data->ccd_offset, channel - 2), ZEN_CCD_TEMP(data->ccd_offset, channel - 2),
&regval); &regval);
...@@ -361,6 +345,10 @@ static const struct hwmon_channel_info *k10temp_info[] = { ...@@ -361,6 +345,10 @@ static const struct hwmon_channel_info *k10temp_info[] = {
HWMON_T_INPUT | HWMON_T_LABEL, HWMON_T_INPUT | HWMON_T_LABEL,
HWMON_T_INPUT | HWMON_T_LABEL, HWMON_T_INPUT | HWMON_T_LABEL,
HWMON_T_INPUT | HWMON_T_LABEL, HWMON_T_INPUT | HWMON_T_LABEL,
HWMON_T_INPUT | HWMON_T_LABEL,
HWMON_T_INPUT | HWMON_T_LABEL,
HWMON_T_INPUT | HWMON_T_LABEL,
HWMON_T_INPUT | HWMON_T_LABEL,
HWMON_T_INPUT | HWMON_T_LABEL), HWMON_T_INPUT | HWMON_T_LABEL),
NULL NULL
}; };
...@@ -457,6 +445,11 @@ static int k10temp_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -457,6 +445,11 @@ static int k10temp_probe(struct pci_dev *pdev, const struct pci_device_id *id)
data->ccd_offset = 0x300; data->ccd_offset = 0x300;
k10temp_get_ccd_support(pdev, data, 8); k10temp_get_ccd_support(pdev, data, 8);
break; break;
case 0x10 ... 0x1f:
case 0xa0 ... 0xaf:
data->ccd_offset = 0x300;
k10temp_get_ccd_support(pdev, data, 12);
break;
} }
} else { } else {
data->read_htcreg = read_htcreg_pci; data->read_htcreg = read_htcreg_pci;
...@@ -497,6 +490,7 @@ static const struct pci_device_id k10temp_id_table[] = { ...@@ -497,6 +490,7 @@ static const struct pci_device_id k10temp_id_table[] = {
{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_17H_M60H_DF_F3) }, { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_17H_M60H_DF_F3) },
{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_17H_M70H_DF_F3) }, { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_17H_M70H_DF_F3) },
{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_19H_DF_F3) }, { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_19H_DF_F3) },
{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_19H_M10H_DF_F3) },
{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_19H_M40H_DF_F3) }, { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_19H_M40H_DF_F3) },
{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_19H_M50H_DF_F3) }, { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_19H_M50H_DF_F3) },
{ PCI_VDEVICE(HYGON, PCI_DEVICE_ID_AMD_17H_DF_F3) }, { PCI_VDEVICE(HYGON, PCI_DEVICE_ID_AMD_17H_DF_F3) },
......
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
#define VM_CH_REQ BIT(21) #define VM_CH_REQ BIT(21)
#define IP_TMR 0x05 #define IP_TMR 0x05
#define POWER_DELAY_CYCLE_256 0x80 #define POWER_DELAY_CYCLE_256 0x100
#define POWER_DELAY_CYCLE_64 0x40 #define POWER_DELAY_CYCLE_64 0x40
#define PVT_POLL_DELAY_US 20 #define PVT_POLL_DELAY_US 20
......
...@@ -3154,10 +3154,8 @@ store_speed_tolerance(struct device *dev, struct device_attribute *attr, ...@@ -3154,10 +3154,8 @@ store_speed_tolerance(struct device *dev, struct device_attribute *attr,
if (err < 0) if (err < 0)
return err; return err;
high = fan_from_reg16(data->target_speed[nr], high = fan_from_reg16(data->target_speed[nr], data->fan_div[nr]) + val;
data->fan_div[nr]) + val; low = fan_from_reg16(data->target_speed[nr], data->fan_div[nr]) - val;
low = fan_from_reg16(data->target_speed[nr],
data->fan_div[nr]) - val;
if (low <= 0) if (low <= 0)
low = 1; low = 1;
if (high < low) if (high < low)
...@@ -4995,11 +4993,13 @@ static const char * const asus_wmi_boards[] = { ...@@ -4995,11 +4993,13 @@ static const char * const asus_wmi_boards[] = {
"ROG CROSSHAIR VIII FORMULA", "ROG CROSSHAIR VIII FORMULA",
"ROG CROSSHAIR VIII HERO", "ROG CROSSHAIR VIII HERO",
"ROG CROSSHAIR VIII IMPACT", "ROG CROSSHAIR VIII IMPACT",
"ROG STRIX B550-A GAMING",
"ROG STRIX B550-E GAMING", "ROG STRIX B550-E GAMING",
"ROG STRIX B550-F GAMING", "ROG STRIX B550-F GAMING",
"ROG STRIX B550-F GAMING (WI-FI)", "ROG STRIX B550-F GAMING (WI-FI)",
"ROG STRIX B550-I GAMING", "ROG STRIX B550-I GAMING",
"ROG STRIX X570-F GAMING", "ROG STRIX X570-F GAMING",
"ROG STRIX X570-I GAMING",
"ROG STRIX Z390-E GAMING", "ROG STRIX Z390-E GAMING",
"ROG STRIX Z490-I GAMING", "ROG STRIX Z490-I GAMING",
"TUF GAMING B550M-PLUS", "TUF GAMING B550M-PLUS",
...@@ -5038,7 +5038,7 @@ static int __init sensors_nct6775_init(void) ...@@ -5038,7 +5038,7 @@ static int __init sensors_nct6775_init(void)
board_name); board_name);
if (err >= 0) { if (err >= 0) {
/* if reading chip id via WMI succeeds, use WMI */ /* if reading chip id via WMI succeeds, use WMI */
if (!nct6775_asuswmi_read(0, NCT6775_PORT_CHIPID, &tmp)) { if (!nct6775_asuswmi_read(0, NCT6775_PORT_CHIPID, &tmp) && tmp) {
pr_info("Using Asus WMI to access %#x chip.\n", tmp); pr_info("Using Asus WMI to access %#x chip.\n", tmp);
access = access_asuswmi; access = access_asuswmi;
} else { } else {
......
This diff is collapsed.
This diff is collapsed.
...@@ -66,6 +66,16 @@ config SENSORS_BPA_RS600 ...@@ -66,6 +66,16 @@ config SENSORS_BPA_RS600
This driver can also be built as a module. If so, the module will This driver can also be built as a module. If so, the module will
be called bpa-rs600. be called bpa-rs600.
config SENSORS_DELTA_AHE50DC_FAN
tristate "Delta AHE-50DC fan control module"
help
If you say yes here you get hardware monitoring support for
the integrated fan control module of the Delta AHE-50DC
Open19 power shelf.
This driver can also be built as a module. If so, the module
will be called delta-ahe50dc-fan.
config SENSORS_FSP_3Y config SENSORS_FSP_3Y
tristate "FSP/3Y-Power power supplies" tristate "FSP/3Y-Power power supplies"
help help
...@@ -123,14 +133,20 @@ config SENSORS_IR36021 ...@@ -123,14 +133,20 @@ config SENSORS_IR36021
be called ir36021. be called ir36021.
config SENSORS_IR38064 config SENSORS_IR38064
tristate "Infineon IR38064" tristate "Infineon IR38064 and compatibles"
help help
If you say yes here you get hardware monitoring support for Infineon If you say yes here you get hardware monitoring support for Infineon
IR38064. IR38060, IR38064, IR38164 and IR38263.
This driver can also be built as a module. If so, the module will This driver can also be built as a module. If so, the module will
be called ir38064. be called ir38064.
config SENSORS_IR38064_REGULATOR
bool "Regulator support for IR38064 and compatibles"
depends on SENSORS_IR38064 && REGULATOR
help
Uses the IR38064 or compatible as regulator.
config SENSORS_IRPS5401 config SENSORS_IRPS5401
tristate "Infineon IRPS5401" tristate "Infineon IRPS5401"
help help
...@@ -276,6 +292,15 @@ config SENSORS_MP2975 ...@@ -276,6 +292,15 @@ config SENSORS_MP2975
This driver can also be built as a module. If so, the module will This driver can also be built as a module. If so, the module will
be called mp2975. be called mp2975.
config SENSORS_MP5023
tristate "MPS MP5023"
help
If you say yes here you get hardware monitoring support for MPS
MP5023.
This driver can also be built as a module. If so, the module will
be called mp5023.
config SENSORS_PIM4328 config SENSORS_PIM4328
tristate "Flex PIM4328 and compatibles" tristate "Flex PIM4328 and compatibles"
help help
......
...@@ -9,6 +9,7 @@ obj-$(CONFIG_SENSORS_ADM1266) += adm1266.o ...@@ -9,6 +9,7 @@ obj-$(CONFIG_SENSORS_ADM1266) += adm1266.o
obj-$(CONFIG_SENSORS_ADM1275) += adm1275.o obj-$(CONFIG_SENSORS_ADM1275) += adm1275.o
obj-$(CONFIG_SENSORS_BEL_PFE) += bel-pfe.o obj-$(CONFIG_SENSORS_BEL_PFE) += bel-pfe.o
obj-$(CONFIG_SENSORS_BPA_RS600) += bpa-rs600.o obj-$(CONFIG_SENSORS_BPA_RS600) += bpa-rs600.o
obj-$(CONFIG_SENSORS_DELTA_AHE50DC_FAN) += delta-ahe50dc-fan.o
obj-$(CONFIG_SENSORS_FSP_3Y) += fsp-3y.o obj-$(CONFIG_SENSORS_FSP_3Y) += fsp-3y.o
obj-$(CONFIG_SENSORS_IBM_CFFPS) += ibm-cffps.o obj-$(CONFIG_SENSORS_IBM_CFFPS) += ibm-cffps.o
obj-$(CONFIG_SENSORS_DPS920AB) += dps920ab.o obj-$(CONFIG_SENSORS_DPS920AB) += dps920ab.o
...@@ -31,6 +32,7 @@ obj-$(CONFIG_SENSORS_MAX34440) += max34440.o ...@@ -31,6 +32,7 @@ obj-$(CONFIG_SENSORS_MAX34440) += max34440.o
obj-$(CONFIG_SENSORS_MAX8688) += max8688.o obj-$(CONFIG_SENSORS_MAX8688) += max8688.o
obj-$(CONFIG_SENSORS_MP2888) += mp2888.o obj-$(CONFIG_SENSORS_MP2888) += mp2888.o
obj-$(CONFIG_SENSORS_MP2975) += mp2975.o obj-$(CONFIG_SENSORS_MP2975) += mp2975.o
obj-$(CONFIG_SENSORS_MP5023) += mp5023.o
obj-$(CONFIG_SENSORS_PM6764TR) += pm6764tr.o obj-$(CONFIG_SENSORS_PM6764TR) += pm6764tr.o
obj-$(CONFIG_SENSORS_PXE1610) += pxe1610.o obj-$(CONFIG_SENSORS_PXE1610) += pxe1610.o
obj-$(CONFIG_SENSORS_Q54SJ108A2) += q54sj108a2.o obj-$(CONFIG_SENSORS_Q54SJ108A2) += q54sj108a2.o
......
// SPDX-License-Identifier: GPL-2.0
/*
* Delta AHE-50DC power shelf fan control module driver
*
* Copyright 2021 Zev Weiss <zev@bewilderbeest.net>
*/
#include <linux/i2c.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/pmbus.h>
#include "pmbus.h"
#define AHE50DC_PMBUS_READ_TEMP4 0xd0
static int ahe50dc_fan_read_word_data(struct i2c_client *client, int page, int phase, int reg)
{
/* temp1 in (virtual) page 1 is remapped to mfr-specific temp4 */
if (page == 1) {
if (reg == PMBUS_READ_TEMPERATURE_1)
return i2c_smbus_read_word_data(client, AHE50DC_PMBUS_READ_TEMP4);
return -EOPNOTSUPP;
}
/*
* There's a fairly limited set of commands this device actually
* supports, so here we block attempts to read anything else (which
* return 0xffff and would cause confusion elsewhere).
*/
switch (reg) {
case PMBUS_STATUS_WORD:
case PMBUS_FAN_COMMAND_1:
case PMBUS_FAN_COMMAND_2:
case PMBUS_FAN_COMMAND_3:
case PMBUS_FAN_COMMAND_4:
case PMBUS_STATUS_FAN_12:
case PMBUS_STATUS_FAN_34:
case PMBUS_READ_VIN:
case PMBUS_READ_TEMPERATURE_1:
case PMBUS_READ_TEMPERATURE_2:
case PMBUS_READ_TEMPERATURE_3:
case PMBUS_READ_FAN_SPEED_1:
case PMBUS_READ_FAN_SPEED_2:
case PMBUS_READ_FAN_SPEED_3:
case PMBUS_READ_FAN_SPEED_4:
return -ENODATA;
default:
return -EOPNOTSUPP;
}
}
static struct pmbus_driver_info ahe50dc_fan_info = {
.pages = 2,
.format[PSC_FAN] = direct,
.format[PSC_TEMPERATURE] = direct,
.format[PSC_VOLTAGE_IN] = direct,
.m[PSC_FAN] = 1,
.b[PSC_FAN] = 0,
.R[PSC_FAN] = 0,
.m[PSC_TEMPERATURE] = 1,
.b[PSC_TEMPERATURE] = 0,
.R[PSC_TEMPERATURE] = 1,
.m[PSC_VOLTAGE_IN] = 1,
.b[PSC_VOLTAGE_IN] = 0,
.R[PSC_VOLTAGE_IN] = 3,
.func[0] = PMBUS_HAVE_TEMP | PMBUS_HAVE_TEMP2 | PMBUS_HAVE_TEMP3 |
PMBUS_HAVE_VIN | PMBUS_HAVE_FAN12 | PMBUS_HAVE_FAN34 |
PMBUS_HAVE_STATUS_FAN12 | PMBUS_HAVE_STATUS_FAN34 | PMBUS_PAGE_VIRTUAL,
.func[1] = PMBUS_HAVE_TEMP | PMBUS_PAGE_VIRTUAL,
.read_word_data = ahe50dc_fan_read_word_data,
};
/*
* CAPABILITY returns 0xff, which appears to be this device's way indicating
* it doesn't support something (and if we enable I2C_CLIENT_PEC on seeing bit
* 7 being set it generates bad PECs, so let's not go there).
*/
static struct pmbus_platform_data ahe50dc_fan_data = {
.flags = PMBUS_NO_CAPABILITY,
};
static int ahe50dc_fan_probe(struct i2c_client *client)
{
client->dev.platform_data = &ahe50dc_fan_data;
return pmbus_do_probe(client, &ahe50dc_fan_info);
}
static const struct i2c_device_id ahe50dc_fan_id[] = {
{ "ahe50dc_fan" },
{ }
};
MODULE_DEVICE_TABLE(i2c, ahe50dc_fan_id);
static const struct of_device_id __maybe_unused ahe50dc_fan_of_match[] = {
{ .compatible = "delta,ahe50dc-fan" },
{ }
};
MODULE_DEVICE_TABLE(of, ahe50dc_fan_of_match);
static struct i2c_driver ahe50dc_fan_driver = {
.driver = {
.name = "ahe50dc_fan",
.of_match_table = of_match_ptr(ahe50dc_fan_of_match),
},
.probe_new = ahe50dc_fan_probe,
.id_table = ahe50dc_fan_id,
};
module_i2c_driver(ahe50dc_fan_driver);
MODULE_AUTHOR("Zev Weiss <zev@bewilderbeest.net>");
MODULE_DESCRIPTION("Driver for Delta AHE-50DC power shelf fan control module");
MODULE_LICENSE("GPL");
MODULE_IMPORT_NS(PMBUS);
...@@ -16,8 +16,16 @@ ...@@ -16,8 +16,16 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/of_device.h>
#include <linux/regulator/driver.h>
#include "pmbus.h" #include "pmbus.h"
#if IS_ENABLED(CONFIG_SENSORS_IR38064_REGULATOR)
static const struct regulator_desc ir38064_reg_desc[] = {
PMBUS_REGULATOR("vout", 0),
};
#endif /* CONFIG_SENSORS_IR38064_REGULATOR */
static struct pmbus_driver_info ir38064_info = { static struct pmbus_driver_info ir38064_info = {
.pages = 1, .pages = 1,
.format[PSC_VOLTAGE_IN] = linear, .format[PSC_VOLTAGE_IN] = linear,
...@@ -33,6 +41,10 @@ static struct pmbus_driver_info ir38064_info = { ...@@ -33,6 +41,10 @@ static struct pmbus_driver_info ir38064_info = {
| PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT | PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT
| PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT | PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT
| PMBUS_HAVE_POUT, | PMBUS_HAVE_POUT,
#if IS_ENABLED(CONFIG_SENSORS_IR38064_REGULATOR)
.num_regulators = 1,
.reg_desc = ir38064_reg_desc,
#endif
}; };
static int ir38064_probe(struct i2c_client *client) static int ir38064_probe(struct i2c_client *client)
...@@ -41,16 +53,30 @@ static int ir38064_probe(struct i2c_client *client) ...@@ -41,16 +53,30 @@ static int ir38064_probe(struct i2c_client *client)
} }
static const struct i2c_device_id ir38064_id[] = { static const struct i2c_device_id ir38064_id[] = {
{"ir38060", 0},
{"ir38064", 0}, {"ir38064", 0},
{"ir38164", 0},
{"ir38263", 0},
{} {}
}; };
MODULE_DEVICE_TABLE(i2c, ir38064_id); MODULE_DEVICE_TABLE(i2c, ir38064_id);
static const struct of_device_id ir38064_of_match[] = {
{ .compatible = "infineon,ir38060" },
{ .compatible = "infineon,ir38064" },
{ .compatible = "infineon,ir38164" },
{ .compatible = "infineon,ir38263" },
{}
};
MODULE_DEVICE_TABLE(of, ir38064_of_match);
/* This is the driver that will be inserted */ /* This is the driver that will be inserted */
static struct i2c_driver ir38064_driver = { static struct i2c_driver ir38064_driver = {
.driver = { .driver = {
.name = "ir38064", .name = "ir38064",
.of_match_table = of_match_ptr(ir38064_of_match),
}, },
.probe_new = ir38064_probe, .probe_new = ir38064_probe,
.id_table = ir38064_id, .id_table = ir38064_id,
...@@ -59,6 +85,6 @@ static struct i2c_driver ir38064_driver = { ...@@ -59,6 +85,6 @@ static struct i2c_driver ir38064_driver = {
module_i2c_driver(ir38064_driver); module_i2c_driver(ir38064_driver);
MODULE_AUTHOR("Maxim Sloyko <maxims@google.com>"); MODULE_AUTHOR("Maxim Sloyko <maxims@google.com>");
MODULE_DESCRIPTION("PMBus driver for Infineon IR38064"); MODULE_DESCRIPTION("PMBus driver for Infineon IR38064 and compatible chips");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_IMPORT_NS(PMBUS); MODULE_IMPORT_NS(PMBUS);
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Driver for MPS MP5023 Hot-Swap Controller
*/
#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/of_device.h>
#include "pmbus.h"
static struct pmbus_driver_info mp5023_info = {
.pages = 1,
.format[PSC_VOLTAGE_IN] = direct,
.format[PSC_VOLTAGE_OUT] = direct,
.format[PSC_CURRENT_OUT] = direct,
.format[PSC_POWER] = direct,
.format[PSC_TEMPERATURE] = direct,
.m[PSC_VOLTAGE_IN] = 32,
.b[PSC_VOLTAGE_IN] = 0,
.R[PSC_VOLTAGE_IN] = 0,
.m[PSC_VOLTAGE_OUT] = 32,
.b[PSC_VOLTAGE_OUT] = 0,
.R[PSC_VOLTAGE_OUT] = 0,
.m[PSC_CURRENT_OUT] = 16,
.b[PSC_CURRENT_OUT] = 0,
.R[PSC_CURRENT_OUT] = 0,
.m[PSC_POWER] = 1,
.b[PSC_POWER] = 0,
.R[PSC_POWER] = 0,
.m[PSC_TEMPERATURE] = 2,
.b[PSC_TEMPERATURE] = 0,
.R[PSC_TEMPERATURE] = 0,
.func[0] =
PMBUS_HAVE_VIN | PMBUS_HAVE_VOUT | PMBUS_HAVE_PIN |
PMBUS_HAVE_TEMP | PMBUS_HAVE_IOUT |
PMBUS_HAVE_STATUS_INPUT | PMBUS_HAVE_STATUS_TEMP,
};
static int mp5023_probe(struct i2c_client *client)
{
return pmbus_do_probe(client, &mp5023_info);
}
static const struct of_device_id __maybe_unused mp5023_of_match[] = {
{ .compatible = "mps,mp5023", },
{}
};
MODULE_DEVICE_TABLE(of, mp5023_of_match);
static struct i2c_driver mp5023_driver = {
.driver = {
.name = "mp5023",
.of_match_table = of_match_ptr(mp5023_of_match),
},
.probe_new = mp5023_probe,
};
module_i2c_driver(mp5023_driver);
MODULE_AUTHOR("Howard Chiu <howard.chiu@quantatw.com>");
MODULE_DESCRIPTION("PMBus driver for MPS MP5023 HSC");
MODULE_LICENSE("GPL");
MODULE_IMPORT_NS(PMBUS);
...@@ -120,6 +120,8 @@ static int rpi_hwmon_probe(struct platform_device *pdev) ...@@ -120,6 +120,8 @@ static int rpi_hwmon_probe(struct platform_device *pdev)
data, data,
&rpi_chip_info, &rpi_chip_info,
NULL); NULL);
if (IS_ERR(data->hwmon_dev))
return PTR_ERR(data->hwmon_dev);
ret = devm_delayed_work_autocancel(dev, &data->get_values_poll_work, ret = devm_delayed_work_autocancel(dev, &data->get_values_poll_work,
get_values_poll); get_values_poll);
...@@ -127,10 +129,9 @@ static int rpi_hwmon_probe(struct platform_device *pdev) ...@@ -127,10 +129,9 @@ static int rpi_hwmon_probe(struct platform_device *pdev)
return ret; return ret;
platform_set_drvdata(pdev, data); platform_set_drvdata(pdev, data);
if (!PTR_ERR_OR_ZERO(data->hwmon_dev)) schedule_delayed_work(&data->get_values_poll_work, 2 * HZ);
schedule_delayed_work(&data->get_values_poll_work, 2 * HZ);
return PTR_ERR_OR_ZERO(data->hwmon_dev); return 0;
} }
static struct platform_driver rpi_hwmon_driver = { static struct platform_driver rpi_hwmon_driver = {
......
...@@ -281,9 +281,16 @@ static const struct i2c_device_id sht4x_id[] = { ...@@ -281,9 +281,16 @@ static const struct i2c_device_id sht4x_id[] = {
}; };
MODULE_DEVICE_TABLE(i2c, sht4x_id); MODULE_DEVICE_TABLE(i2c, sht4x_id);
static const struct of_device_id sht4x_of_match[] = {
{ .compatible = "sensirion,sht4x" },
{ }
};
MODULE_DEVICE_TABLE(of, sht4x_of_match);
static struct i2c_driver sht4x_driver = { static struct i2c_driver sht4x_driver = {
.driver = { .driver = {
.name = "sht4x", .name = "sht4x",
.of_match_table = sht4x_of_match,
}, },
.probe = sht4x_probe, .probe = sht4x_probe,
.id_table = sht4x_id, .id_table = sht4x_id,
......
This diff is collapsed.
...@@ -659,8 +659,10 @@ static int xgene_hwmon_probe(struct platform_device *pdev) ...@@ -659,8 +659,10 @@ static int xgene_hwmon_probe(struct platform_device *pdev)
acpi_id = acpi_match_device(pdev->dev.driver->acpi_match_table, acpi_id = acpi_match_device(pdev->dev.driver->acpi_match_table,
&pdev->dev); &pdev->dev);
if (!acpi_id) if (!acpi_id) {
return -EINVAL; rc = -EINVAL;
goto out_mbox_free;
}
version = (int)acpi_id->driver_data; version = (int)acpi_id->driver_data;
......
...@@ -403,7 +403,7 @@ struct hwmon_ops { ...@@ -403,7 +403,7 @@ struct hwmon_ops {
}; };
/** /**
* Channel information * struct hwmon_channel_info - Channel information
* @type: Channel type. * @type: Channel type.
* @config: Pointer to NULL-terminated list of channel parameters. * @config: Pointer to NULL-terminated list of channel parameters.
* Use for per-channel attributes. * Use for per-channel attributes.
...@@ -422,7 +422,7 @@ struct hwmon_channel_info { ...@@ -422,7 +422,7 @@ struct hwmon_channel_info {
}) })
/** /**
* Chip configuration * struct hwmon_chip_info - Chip configuration
* @ops: Pointer to hwmon operations. * @ops: Pointer to hwmon operations.
* @info: Null-terminated list of channel information. * @info: Null-terminated list of channel information.
*/ */
......
...@@ -555,6 +555,7 @@ ...@@ -555,6 +555,7 @@
#define PCI_DEVICE_ID_AMD_17H_M60H_DF_F3 0x144b #define PCI_DEVICE_ID_AMD_17H_M60H_DF_F3 0x144b
#define PCI_DEVICE_ID_AMD_17H_M70H_DF_F3 0x1443 #define PCI_DEVICE_ID_AMD_17H_M70H_DF_F3 0x1443
#define PCI_DEVICE_ID_AMD_19H_DF_F3 0x1653 #define PCI_DEVICE_ID_AMD_19H_DF_F3 0x1653
#define PCI_DEVICE_ID_AMD_19H_M10H_DF_F3 0x14b0
#define PCI_DEVICE_ID_AMD_19H_M40H_DF_F3 0x167c #define PCI_DEVICE_ID_AMD_19H_M40H_DF_F3 0x167c
#define PCI_DEVICE_ID_AMD_19H_M50H_DF_F3 0x166d #define PCI_DEVICE_ID_AMD_19H_M50H_DF_F3 0x166d
#define PCI_DEVICE_ID_AMD_CNB17H_F3 0x1703 #define PCI_DEVICE_ID_AMD_CNB17H_F3 0x1703
......
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* ntc_thermistor.h - NTC Thermistors
*
* Copyright (C) 2010 Samsung Electronics
* MyungJoo Ham <myungjoo.ham@samsung.com>
*/
#ifndef _LINUX_NTC_H
#define _LINUX_NTC_H
struct iio_channel;
enum ntc_thermistor_type {
TYPE_B57330V2103,
TYPE_B57891S0103,
TYPE_NCPXXWB473,
TYPE_NCPXXWF104,
TYPE_NCPXXWL333,
TYPE_NCPXXXH103,
};
struct ntc_thermistor_platform_data {
/*
* One (not both) of read_uV and read_ohm should be provided and only
* one of the two should be provided.
* Both functions should return negative value for an error case.
*
* pullup_uV, pullup_ohm, pulldown_ohm, and connect are required to use
* read_uV()
*
* How to setup pullup_ohm, pulldown_ohm, and connect is
* described at Documentation/hwmon/ntc_thermistor.rst
*
* pullup/down_ohm: 0 for infinite / not-connected
*
* chan: iio_channel pointer to communicate with the ADC which the
* thermistor is using for conversion of the analog values.
*/
int (*read_uv)(struct ntc_thermistor_platform_data *);
unsigned int pullup_uv;
unsigned int pullup_ohm;
unsigned int pulldown_ohm;
enum { NTC_CONNECTED_POSITIVE, NTC_CONNECTED_GROUND } connect;
struct iio_channel *chan;
int (*read_ohm)(void);
};
#endif /* _LINUX_NTC_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment