@@ -30,6 +30,8 @@ properties:items:-enum:# SMBus/I2C Digital Temperature Sensor in 6-Pin SOT with SMBus Alert and Over Temperature Pin+-acbel,crps+# Acbel CRPS Series power supply-ad,ad7414# ADM9240: Complete System Hardware Monitor for uProcessor-Based Systems-ad,adm9240
@@ -0,0 +1,81 @@+Kernel driver acbel-crps+=======================++Supported chips:++* ACBEL Common Redundant Power Supply.+ Supported models: FSG032-00xG++Author: Lakshmi Yadlapati <lakshmiy@us.ibm.com>++Description+-----------++This driver supports ACBEL Common Redundant Power Supply. This driver+is a client to the core PMBus driver.++Usage Notes+-----------++This driver does not auto-detect devices. You will have to instantiate the+devices explicitly. Please see Documentation/i2c/instantiating-devices.rst for+details.++Sysfs entries+-------------++The following attributes are supported:++======================= ======================================================+curr1_crit Critical maximum current.+curr1_crit_alarm Input current critical alarm.+curr1_input Measured output current.+curr1_label "iin"+curr1_max Maximum input current.+curr1_max_alarm Maximum input current high alarm.+curr1_rated_max Maximum rated input current.+curr2_crit Critical maximum current.+curr2_crit_alarm Output current critical alarm.+curr2_input Measured output current.+curr2_label "iout1"+curr2_max Maximum output current.+curr2_max_alarm Output current high alarm.+curr2_rated_max Maximum rated output current.+++fan1_alarm Fan 1 warning.+fan1_fault Fan 1 fault.+fan1_input Fan 1 speed in RPM.+fan1_target Set fan speed reference.++in1_alarm Input voltage under-voltage alarm.+in1_input Measured input voltage.+in1_label "vin"+in1_rated_max Maximum rated input voltage.+in1_rated_min Minimum rated input voltage.+in2_crit Critical maximum output voltage.+in2_crit_alarm Output voltage critical high alarm.+in2_input Measured output voltage.+in2_label "vout1"+in2_lcrit Critical minimum output voltage.+in2_lcrit_alarm Output voltage critical low alarm.+in2_rated_max Maximum rated output voltage.+in2_rated_min Minimum rated output voltage.++power1_alarm Input fault or alarm.+power1_input Measured input power.+power1_label "pin"+power1_max Input power limit.+power1_rated_max Maximum rated input power.+power2_crit Critical output power limit.+power2_crit_alarm Output power crit alarm limit exceeded.+power2_input Measured output power.+power2_label "pout"+power2_max Output power limit.+power2_max_alarm Output power high alarm.+power2_rated_max Maximum rated output power.++temp[1-3]_input Measured temperature.+temp[1-2]_max Maximum temperature.+temp[1-3]_rated_max Temperature high alarm.+======================= ======================================================
@@ -0,0 +1,102 @@+// SPDX-License-Identifier: GPL-2.0-or-later+/*+*Copyright2023IBMCorp.+*/++#include<linux/device.h>+#include<linux/fs.h>+#include<linux/i2c.h>+#include<linux/module.h>+#include<linux/pmbus.h>+#include<linux/hwmon-sysfs.h>+#include"pmbus.h"++structacbel_crps{+structi2c_client*client;+};++staticconststructi2c_device_idacbel_crps_id[]={+{"acbel_crps"},+{}+};+#define to_psu(x, y) container_of((x), struct acbel_crps, debugfs_entries[(y)])++staticconststructfile_operationsacbel_crps_fops={+.llseek=noop_llseek,+.open=simple_open,+};++staticstructpmbus_driver_infoacbel_crps_info={+.pages=1,+.func[0]=PMBUS_HAVE_VIN|PMBUS_HAVE_IIN|PMBUS_HAVE_PIN|+PMBUS_HAVE_VOUT|PMBUS_HAVE_IOUT|PMBUS_HAVE_POUT|+PMBUS_HAVE_TEMP|PMBUS_HAVE_TEMP2|PMBUS_HAVE_TEMP3|+PMBUS_HAVE_FAN12|PMBUS_HAVE_STATUS_VOUT|+PMBUS_HAVE_STATUS_IOUT|PMBUS_HAVE_STATUS_TEMP|+PMBUS_HAVE_STATUS_INPUT|PMBUS_HAVE_STATUS_FAN12,+};++staticintacbel_crps_probe(structi2c_client*client)+{+structacbel_crps*psu;+u8buf[I2C_SMBUS_BLOCK_MAX+1];+structdevice*dev=&client->dev;+intrc;++rc=i2c_smbus_read_block_data(client,PMBUS_MFR_ID,buf);+if(rc<0){+dev_err(dev,"Failed to read PMBUS_MFR_ID\n");+returnrc;+}+if(strncmp(buf,"ACBEL",5)){+buf[rc]='\0';+dev_err(dev,"Manufacturer '%s' not supported\n",buf);+return-ENODEV;+}++rc=i2c_smbus_read_block_data(client,PMBUS_MFR_MODEL,buf);+if(rc<0){+dev_err(dev,"Failed to read PMBUS_MFR_MODEL\n");+returnrc;+}++if(strncmp(buf,"FSG032",6)){+buf[rc]='\0';+dev_err(dev,"Model '%s' not supported\n",buf);+return-ENODEV;+}++rc=pmbus_do_probe(client,&acbel_crps_info);+if(rc)+returnrc;+/*+*Don'tfailtheprobeifthereisn'tenoughmemoryfordebugfs.+*/+psu=devm_kzalloc(&client->dev,sizeof(*psu),GFP_KERNEL);+if(!psu)+return0;++return0;+}++staticconststructof_device_idacbel_crps_of_match[]={+{.compatible="acbel,crps"},+{}+};+MODULE_DEVICE_TABLE(of,acbel_crps_of_match);++staticstructi2c_driveracbel_crps_driver={+.driver={+.name="acbel-crps",+.of_match_table=acbel_crps_of_match,+},+.probe_new=acbel_crps_probe,+.id_table=acbel_crps_id,+};++module_i2c_driver(acbel_crps_driver);++MODULE_AUTHOR("Lakshmi Yadlapati");+MODULE_DESCRIPTION("PMBus driver for AcBel Power System power supplies");+MODULE_LICENSE("GPL");+MODULE_IMPORT_NS(PMBUS);
@@ -30,6 +30,8 @@ properties:items:-enum:# SMBus/I2C Digital Temperature Sensor in 6-Pin SOT with SMBus Alert and Over Temperature Pin+-acbel,crps+# Acbel CRPS Series power supply
Wrong placements of comments. This is AD, not Acbel.
- ad,ad7414
# ADM9240: Complete System Hardware Monitor for uProcessor-Based Systems
- ad,adm9240
items:
- enum:
# SMBus/I2C Digital Temperature Sensor in 6-Pin SOT with SMBus Alert and Over Temperature Pin
+ - acbel,crps
+ # Acbel CRPS Series power supply
Wrong placements of comments. This is AD, not Acbel.
I will fix it. Thx
- ad,ad7414
# ADM9240: Complete System Hardware Monitor for uProcessor-Based Systems
- ad,adm9240
@@ -27,6 +27,16 @@ config SENSORS_PMBUSThisdrivercanalsobebuiltasamodule.Ifso,themodulewillbecalledpmbus.+configSENSORS_ACBEL_CRPS+tristate"ACBEL CRPS Power Supply"+help+IfyousayyeshereyougethardwaremonitoringsupportfortheACBEL+CommonRedundantPowerSupply.+
This sounds like there is only one, but ...
quoted hunk
+ This driver can also be built as a module. If so, the module will+ be called acbel-crps.+ Supported models: FSG032-00xG+
... here it says that only one model is (currently) supported.
This should just say "Support for Acbel FSG032-00xG CRPS Power Supply"
and not claim that it supports any others.
I am also not convinced that the Kconfig option driver name should simply
be "crps" There is no guarantee that all crps power supplies from this
vendor will always be supported (supportable) by this driver.
This is way too generic. What if there is some other Acbel power supply
which needs some other options or supports other attributes ?
This needs to be something like "acbel,fsg032" or similar.
@@ -0,0 +1,81 @@+Kernel driver acbel-crps+=======================++Supported chips:++* ACBEL Common Redundant Power Supply.+ Supported models: FSG032-00xG++Author: Lakshmi Yadlapati <lakshmiy@us.ibm.com>++Description+-----------++This driver supports ACBEL Common Redundant Power Supply. This driver+is a client to the core PMBus driver.
No, it supports the FSG032-00xG power supply. Neither the driver nor its
documentation should claim otherwise.
+
+Usage Notes
+-----------
+
+This driver does not auto-detect devices. You will have to instantiate the
+devices explicitly. Please see Documentation/i2c/instantiating-devices.rst for
+details.
+
+Sysfs entries
+-------------
+
+The following attributes are supported:
+
+======================= ======================================================
+curr1_crit Critical maximum current.
+curr1_crit_alarm Input current critical alarm.
+curr1_input Measured output current.
+curr1_label "iin"
+curr1_max Maximum input current.
+curr1_max_alarm Maximum input current high alarm.
+curr1_rated_max Maximum rated input current.
+curr2_crit Critical maximum current.
+curr2_crit_alarm Output current critical alarm.
+curr2_input Measured output current.
+curr2_label "iout1"
+curr2_max Maximum output current.
+curr2_max_alarm Output current high alarm.
+curr2_rated_max Maximum rated output current.
+
+
+fan1_alarm Fan 1 warning.
+fan1_fault Fan 1 fault.
+fan1_input Fan 1 speed in RPM.
+fan1_target Set fan speed reference.
+
+in1_alarm Input voltage under-voltage alarm.
+in1_input Measured input voltage.
+in1_label "vin"
+in1_rated_max Maximum rated input voltage.
+in1_rated_min Minimum rated input voltage.
+in2_crit Critical maximum output voltage.
+in2_crit_alarm Output voltage critical high alarm.
+in2_input Measured output voltage.
+in2_label "vout1"
+in2_lcrit Critical minimum output voltage.
+in2_lcrit_alarm Output voltage critical low alarm.
+in2_rated_max Maximum rated output voltage.
+in2_rated_min Minimum rated output voltage.
+
+power1_alarm Input fault or alarm.
+power1_input Measured input power.
+power1_label "pin"
+power1_max Input power limit.
+power1_rated_max Maximum rated input power.
+power2_crit Critical output power limit.
+power2_crit_alarm Output power crit alarm limit exceeded.
+power2_input Measured output power.
+power2_label "pout"
+power2_max Output power limit.
+power2_max_alarm Output power high alarm.
+power2_rated_max Maximum rated output power.
+
+temp[1-3]_input Measured temperature.
+temp[1-2]_max Maximum temperature.
+temp[1-3]_rated_max Temperature high alarm.
+======================= ======================================================
--
2.37.2
@@ -30,6 +30,8 @@ properties:items:-enum:# SMBus/I2C Digital Temperature Sensor in 6-Pin SOT with SMBus Alert and Over Temperature Pin+-acbel,crps+# Acbel CRPS Series power supply
This is way too generic. There is not just one Acbel CRPS power supply,
there is a whole lot of them. It is very unlikely that they can all
be described with a single devicetree "compatible" property.
Guenter
- ad,ad7414
# ADM9240: Complete System Hardware Monitor for uProcessor-Based Systems
- ad,adm9240
--
2.37.2
Documentation/hwmon/acbel-crps.rst:2: WARNING: Title underline too short.
Documentation/hwmon/acbel-crps.rst:7: WARNING: Bullet list ends without a blank line; unexpected unindent.
Documentation/hwmon/acbel-crps.rst:30: WARNING: Malformed table.
Documentation/hwmon/acbel-crps.rst: WARNING: document isn't included in any toctree
vim +2 Documentation/hwmon/acbel-crps.rst
> 2 =======================
3
4 Supported chips:
5
6 * ACBEL Common Redundant Power Supply.
> 7 Supported models: FSG032-00xG
8
9 Author: Lakshmi Yadlapati [off-list ref]
10
11 Description
12 -----------
13
14 This driver supports ACBEL Common Redundant Power Supply. This driver
15 is a client to the core PMBus driver.
16
17 Usage Notes
18 -----------
19
20 This driver does not auto-detect devices. You will have to instantiate the
21 devices explicitly. Please see Documentation/i2c/instantiating-devices.rst for
22 details.
23
24 Sysfs entries
25 -------------
26
27 The following attributes are supported:
28
29 ======================= ======================================================
> 30 curr1_crit Critical maximum current.
31 curr1_crit_alarm Input current critical alarm.
32 curr1_input Measured output current.
33 curr1_label "iin"
34 curr1_max Maximum input current.
35 curr1_max_alarm Maximum input current high alarm.
36 curr1_rated_max Maximum rated input current.
37 curr2_crit Critical maximum current.
38 curr2_crit_alarm Output current critical alarm.
39 curr2_input Measured output current.
40 curr2_label "iout1"
41 curr2_max Maximum output current.
42 curr2_max_alarm Output current high alarm.
43 curr2_rated_max Maximum rated output current.
44
45
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests