hwmon: (pmbus/ibm-cffps) Add clear_faults debugfs entry
PATCH 1/1 hwmon: (pmbus/ibm-cffps) Add clear_faults debugfs entry
Add a clear_faults write-only debugfs entry for the ibm-cffps device driver.
Signed-off-by Brandon Wyman <[email protected]>
--- drivers/hwmon/pmbus/ibm-cffps.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/hwmon/pmbus/ibm-cffps.c +11 -0
@@ -67,6 +67,7 @@ enum {CFFPS_DEBUGFS_CCIN ,CFFPS_DEBUGFS_FW ,CFFPS_DEBUGFS_ON_OFF_CONFIG , +CFFPS_DEBUGFS_CLEAR_FAULTS , CFFPS_DEBUGFS_NUM_ENTRIES };
@@ -274,6 +275,13 @@ static ssize_t ibm_cffps_debugfs_write(struct file *file,if (rc)return rc; + rc =1 ; +break ; +case CFFPS_DEBUGFS_CLEAR_FAULTS : + rc =i2c_smbus_write_byte (psu->client,PMBUS_CLEAR_FAULTS ); +if (rc <0 ) +return rc; + rc =1 ;break ;default :
@@ -607,6 +615,9 @@ static int ibm_cffps_probe(struct i2c_client *client)debugfs_create_file ("on_off_config" ,0644 , ibm_cffps_dir, &psu->debugfs_entries[CFFPS_DEBUGFS_ON_OFF_CONFIG ], &ibm_cffps_fops); +debugfs_create_file ("clear_faults" ,0200 , ibm_cffps_dir, + &psu->debugfs_entries[CFFPS_DEBUGFS_CLEAR_FAULTS ], + &ibm_cffps_fops);return 0 ; }
Signature · 1 line
2.25.1
Guenter Roeck
maintainerQuoted 3 lines · Brandon Wyman
Add a
clear_faultswrite-only debugfs entry for the ibm-cffps device driver.
This does not explain _why_ this would be needed.
Guenter
Quoted 41 lines
Signed-off-by Brandon Wyman <[email protected]>--- drivers/hwmon/pmbus/ibm-cffps.c | 11 +++++++++++ 1 file changed, 11 insertions(+)drivers/hwmon/pmbus/ibm-cffps.c +11
-0@@ -67,6 +67,7 @@ enum {CFFPS_DEBUGFS_CCIN ,CFFPS_DEBUGFS_FW ,CFFPS_DEBUGFS_ON_OFF_CONFIG , +CFFPS_DEBUGFS_CLEAR_FAULTS , CFFPS_DEBUGFS_NUM_ENTRIES };@@ -274,6 +275,13 @@ static ssize_t ibm_cffps_debugfs_write(struct file *file,if (rc)return rc; + rc =1 ; +break ; +case CFFPS_DEBUGFS_CLEAR_FAULTS : + rc =i2c_smbus_write_byte (psu->client,PMBUS_CLEAR_FAULTS ); +if (rc <0 ) +return rc; + rc =1 ;break ;default :@@ -607,6 +615,9 @@ static int ibm_cffps_probe(struct i2c_client *client)debugfs_create_file ("on_off_config" ,0644 , ibm_cffps_dir, &psu->debugfs_entries[CFFPS_DEBUGFS_ON_OFF_CONFIG ], &ibm_cffps_fops); +debugfs_create_file ("clear_faults" ,0200 , ibm_cffps_dir, + &psu->debugfs_entries[CFFPS_DEBUGFS_CLEAR_FAULTS ], + &ibm_cffps_fops);return 0 ; }
Quoted 9 lines · Guenter Roeck
Quoted 3 lines · Brandon Wyman
Add a
clear_faultswrite-only debugfs entry for the ibm-cffps device driver.This does not explain _why_ this would be needed.
Guenter
I must have chopped that out when I did a squash on the commits I had.
Quoted 43 lines
Quoted 42 lines
Signed-off-by Brandon Wyman <[email protected]>--- drivers/hwmon/pmbus/ibm-cffps.c | 11 +++++++++++ 1 file changed, 11 insertions(+)drivers/hwmon/pmbus/ibm-cffps.c +11
-0@@ -67,6 +67,7 @@ enum {CFFPS_DEBUGFS_CCIN ,CFFPS_DEBUGFS_FW ,CFFPS_DEBUGFS_ON_OFF_CONFIG , +CFFPS_DEBUGFS_CLEAR_FAULTS , CFFPS_DEBUGFS_NUM_ENTRIES };@@ -274,6 +275,13 @@ static ssize_t ibm_cffps_debugfs_write(struct file *file,if (rc)return rc; + rc =1 ; +break ; +case CFFPS_DEBUGFS_CLEAR_FAULTS : + rc =i2c_smbus_write_byte (psu->client,PMBUS_CLEAR_FAULTS ); +if (rc <0 ) +return rc; + rc =1 ;break ;default :@@ -607,6 +615,9 @@ static int ibm_cffps_probe(struct i2c_client *client)debugfs_create_file ("on_off_config" ,0644 , ibm_cffps_dir, &psu->debugfs_entries[CFFPS_DEBUGFS_ON_OFF_CONFIG ], &ibm_cffps_fops); +debugfs_create_file ("clear_faults" ,0200 , ibm_cffps_dir, + &psu->debugfs_entries[CFFPS_DEBUGFS_CLEAR_FAULTS ], + &ibm_cffps_fops);return 0 ; }