lkml.org 
[lkml]   [2023]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] drivers/regulator: Notify sysfs about status changes
Hi Mark,

On Thu, 2 Nov 2023 at 18:36, Mark Brown <broonie@kernel.org> wrote:
>
> On Thu, Nov 02, 2023 at 05:35:42PM +0530, Naresh Solanki wrote:
> > On Thu, 5 Oct 2023 at 22:30, Mark Brown <broonie@kernel.org> wrote:
> > > On Thu, Oct 05, 2023 at 03:30:58PM +0200, Naresh Solanki wrote:
>
> > > We probably should filter the events more, there's events for pre and
> > > post voltage change for example which aren't status changes so would be
> > > spurious. It ought not to break anything but we should still avoid
> > > unneeded work.
>
> > Can you please provide me inputs on the additional filtering needed for this.
> > Like some list of events for notify on status?
>
> I think I'd start off with just reporting things that are obviously
> errors and not things that should ever go off during normal operation.
This is what I could come up with:
if (event & REGULATOR_EVENT_VOLTAGE_CHANGE) {
name = dev_attr_microvolts.attr.name;
sysfs_notify(&rdev->dev.kobj, NULL, name);
} else if (event & (REGULATOR_EVENT_DISABLE | REGULATOR_EVENT_ENABLE)){
name = dev_attr_status.attr.name;
sysfs_notify(&rdev->dev.kobj, NULL, name);
}

Regards,
Naresh

\
 
 \ /
  Last update: 2023-11-02 15:49    [W:0.041 / U:0.380 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site