2023-09-01 09:42:39

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 1/3] regulator: Add uapi header

On Thu, Aug 31, 2023 at 02:14:08PM +0200, Naresh Solanki wrote:

> +#define REGULATOR_EVENT_UNDER_VOLTAGE 0x01
> +#define REGULATOR_EVENT_OVER_CURRENT 0x02
> +#define REGULATOR_EVENT_REGULATION_OUT 0x04
> +#define REGULATOR_EVENT_FAIL 0x08
> +#define REGULATOR_EVENT_OVER_TEMP 0x10
> +#define REGULATOR_EVENT_FORCE_DISABLE 0x20
> +#define REGULATOR_EVENT_VOLTAGE_CHANGE 0x40
> +#define REGULATOR_EVENT_DISABLE 0x80
> +#define REGULATOR_EVENT_PRE_VOLTAGE_CHANGE 0x100
> +#define REGULATOR_EVENT_ABORT_VOLTAGE_CHANGE 0x200
> +#define REGULATOR_EVENT_PRE_DISABLE 0x400
> +#define REGULATOR_EVENT_ABORT_DISABLE 0x800
> +#define REGULATOR_EVENT_ENABLE 0x1000

I'm not sure embedded the raw numbers in the UAPI like this for just one
driver is ideal - it might be better to do something string based,
though that would result in us ending up with a file per event which is
a bit noisy.


Attachments:
(No filename) (914.00 B)
signature.asc (499.00 B)
Download all attachments

2023-09-05 16:06:24

by Naresh Solanki

[permalink] [raw]
Subject: Re: [PATCH 1/3] regulator: Add uapi header

Hi


On Thu, 31 Aug 2023 at 18:05, Mark Brown <[email protected]> wrote:
>
> On Thu, Aug 31, 2023 at 02:14:08PM +0200, Naresh Solanki wrote:
>
> > +#define REGULATOR_EVENT_UNDER_VOLTAGE 0x01
> > +#define REGULATOR_EVENT_OVER_CURRENT 0x02
> > +#define REGULATOR_EVENT_REGULATION_OUT 0x04
> > +#define REGULATOR_EVENT_FAIL 0x08
> > +#define REGULATOR_EVENT_OVER_TEMP 0x10
> > +#define REGULATOR_EVENT_FORCE_DISABLE 0x20
> > +#define REGULATOR_EVENT_VOLTAGE_CHANGE 0x40
> > +#define REGULATOR_EVENT_DISABLE 0x80
> > +#define REGULATOR_EVENT_PRE_VOLTAGE_CHANGE 0x100
> > +#define REGULATOR_EVENT_ABORT_VOLTAGE_CHANGE 0x200
> > +#define REGULATOR_EVENT_PRE_DISABLE 0x400
> > +#define REGULATOR_EVENT_ABORT_DISABLE 0x800
> > +#define REGULATOR_EVENT_ENABLE 0x1000
>
> I'm not sure embedded the raw numbers in the UAPI like this for just one
> driver is ideal - it might be better to do something string based,
> though that would result in us ending up with a file per event which is
> a bit noisy.
I guess this is the standard approach & can be a starting point for
future use cases.

If you still insist on string based then can you please elaborate on it.
Is the events attribute is expected to print string of space separated
events like
for REGULATOR_EVENT_ENABLE -> ENABLE
And even multiple events like: 'UNDER_VOLTAGE REGULATION_OUT'

Let me know your thoughts.

Regards,
Naresh