Re: [PATCH v3 2/2] hwmon: ltc4282: add support for the LTC4282 chip

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2023-12-11 at 07:41 -0800, Guenter Roeck wrote:
> On Tue, Dec 05, 2023 at 04:22:56PM +0100, Nuno Sa via B4 Relay wrote:
> > From: Nuno Sa <nuno.sa@xxxxxxxxxx>
> > 
> > The LTC4282 hot swap controller allows a board to be safely inserted and
> > removed from a live backplane. Using one or more external N-channel pass
> > transistors, board supply voltage and inrush current are ramped up at an
> > adjustable rate. An I2C interface and onboard ADC allows for monitoring
> > of board current, voltage, power, energy and fault status.
> > 
> > Signed-off-by: Nuno Sa <nuno.sa@xxxxxxxxxx>
> > ---
> [ ... ]
> 
> > +/* power1_fault */
> > +static SENSOR_DEVICE_ATTR_RO(power1_good, ltc4282_status,
> > +			     LTC4282_POWER_GOOD_MASK);
> > +/* FET faults */
> > +static SENSOR_DEVICE_ATTR_RO(fet_short_fault, ltc4282_status,
> > +			     LTC4282_FET_SHORT_MASK);
> > +static SENSOR_DEVICE_ATTR_RO(fet_bad_fault, ltc4282_status,
> > +			     LTC4282_FET_BAD_STATUS_MASK);
> > +/*
> > + * Fault log failures. These faults might be important in systems where
> > + * auto-retry is not enabled since they will cause the part to latch off
> > until
> > + * they are cleared. Typically that happens when the system admin is close
> > + * enough so he can check what happened and manually clear the faults.
> > Hence, we
> > + * provide an attribute to clear all fauls at once while still capable of
> > + * checking individual faults in debugfs.
> > + */
> > +static SENSOR_DEVICE_ATTR_WO(fault_logs_reset, ltc4282_clear_faults, 0);
> > +
> > +static struct attribute *ltc4282_attrs[] = {
> > +	&sensor_dev_attr_energy1_input.dev_attr.attr,
> > +	&sensor_dev_attr_power1_good.dev_attr.attr,
> > +	&sensor_dev_attr_fet_bad_fault.dev_attr.attr,
> > +	&sensor_dev_attr_fet_short_fault.dev_attr.attr,
> > +	&sensor_dev_attr_fault_logs_reset.dev_attr.attr,
> > +	NULL
> > +};
> > +ATTRIBUTE_GROUPS(ltc4282);
> > +
> 
> Ah, now I see what those are for. Please move all but energy1_input
> to debugfs, including clearing the faults.
> 

I'll reply in the other thread. Just wanted to make it clear (not totally sure
it is) that all of those attributes are status stuff and not fault logs. All of
the fault logs where moved to debugfs and I kept this one in here. If this was
already clear to you, sorry for the noise.

- Nuno Sá
> 
> 






[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux