* [PATCH] hwmon: (pmbus/ibm-cffps) Add clear_faults debugfs entry
@ 2022-03-11 0:18 Brandon Wyman
2022-03-11 1:00 ` Guenter Roeck
0 siblings, 1 reply; 3+ messages in thread
From: Brandon Wyman @ 2022-03-11 0:18 UTC (permalink / raw)
To: Joel Stanley, openbmc, Eddie James, Guenter Roeck, Jean Delvare,
linux-hwmon, linux-kernel
Cc: Brandon Wyman
Add a clear_faults write-only debugfs entry for the ibm-cffps device
driver.
Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
---
drivers/hwmon/pmbus/ibm-cffps.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/hwmon/pmbus/ibm-cffps.c b/drivers/hwmon/pmbus/ibm-cffps.c
index e3294a1a54bb..fca2642a8ed4 100644
--- a/drivers/hwmon/pmbus/ibm-cffps.c
+++ b/drivers/hwmon/pmbus/ibm-cffps.c
@@ -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;
}
--
2.25.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] hwmon: (pmbus/ibm-cffps) Add clear_faults debugfs entry
2022-03-11 0:18 [PATCH] hwmon: (pmbus/ibm-cffps) Add clear_faults debugfs entry Brandon Wyman
@ 2022-03-11 1:00 ` Guenter Roeck
2022-03-11 2:38 ` Brandon Wyman
0 siblings, 1 reply; 3+ messages in thread
From: Guenter Roeck @ 2022-03-11 1:00 UTC (permalink / raw)
To: Brandon Wyman, Joel Stanley, openbmc, Eddie James, Jean Delvare,
linux-hwmon, linux-kernel
On 3/10/22 16:18, Brandon Wyman wrote:
> Add a clear_faults write-only debugfs entry for the ibm-cffps device
> driver.
>
This does not explain _why_ this would be needed.
Guenter
> Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
> ---
> drivers/hwmon/pmbus/ibm-cffps.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/drivers/hwmon/pmbus/ibm-cffps.c b/drivers/hwmon/pmbus/ibm-cffps.c
> index e3294a1a54bb..fca2642a8ed4 100644
> --- a/drivers/hwmon/pmbus/ibm-cffps.c
> +++ b/drivers/hwmon/pmbus/ibm-cffps.c
> @@ -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;
> }
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] hwmon: (pmbus/ibm-cffps) Add clear_faults debugfs entry
2022-03-11 1:00 ` Guenter Roeck
@ 2022-03-11 2:38 ` Brandon Wyman
0 siblings, 0 replies; 3+ messages in thread
From: Brandon Wyman @ 2022-03-11 2:38 UTC (permalink / raw)
To: Guenter Roeck
Cc: Joel Stanley, OpenBMC Maillist, Eddie James, Jean Delvare,
linux-hwmon, linux-kernel
On Thu, Mar 10, 2022 at 7:00 PM Guenter Roeck <linux@roeck-us.net> wrote:
>
> On 3/10/22 16:18, Brandon Wyman wrote:
> > Add a clear_faults write-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.
>
> > Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
> > ---
> > drivers/hwmon/pmbus/ibm-cffps.c | 11 +++++++++++
> > 1 file changed, 11 insertions(+)
> >
> > diff --git a/drivers/hwmon/pmbus/ibm-cffps.c b/drivers/hwmon/pmbus/ibm-cffps.c
> > index e3294a1a54bb..fca2642a8ed4 100644
> > --- a/drivers/hwmon/pmbus/ibm-cffps.c
> > +++ b/drivers/hwmon/pmbus/ibm-cffps.c
> > @@ -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;
> > }
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-03-11 2:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-11 0:18 [PATCH] hwmon: (pmbus/ibm-cffps) Add clear_faults debugfs entry Brandon Wyman
2022-03-11 1:00 ` Guenter Roeck
2022-03-11 2:38 ` Brandon Wyman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®