[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAE3SzaTNoQujrR_h212XLpBbBWddzmSJb9bbUOFmDTBv20p7Ag@mail.gmail.com>
Date: Sun, 31 Aug 2025 01:19:39 +0530
From: Akshay Jindal <akshayaj.lkd@...il.com>
To: Jonathan Cameron <jic23@...nel.org>
Cc: anshulusr@...il.com, dlechner@...libre.com, nuno.sa@...log.com,
andy@...nel.org, shuah@...nel.org, linux-iio@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] iio: light: ltr390: Add runtime PM support
On Sat, Aug 30, 2025 at 11:38 PM Jonathan Cameron <jic23@...nel.org> wrote:
>
> On Tue, 26 Aug 2025 02:29:12 +0530
> Akshay Jindal <akshayaj.lkd@...il.com> wrote:
> Normally we'd check the register to find out what whether the event
> is enabled or not. If we are asking for the state it is already in
> then just return having done nothing. If bus reads are an overhead
> worth avoiding regcache will ensure we only do it once.
>
> Then if we are doing something, do the runtime pm get / put as appropriate.
Hi Jonathan,
I looked into the code of multiple drivers. Almost every other driver
uses a flag
inside driver specific data structure to denote whether events are enabled or
disabled. Some use masks to mark which events are enabled in case multiple
types of events are supported.
For eg: bmc150, fxls8962af, kxcjk1013, ad7173, ad7291, ad799x, hi8435,
max1363, nct7201, pac1921, palmas_adc, bd79124, ads1015, ad5421, bmg160,
bmi323, inv_mpu6050, and the list goes on. I see this in at least 30+ drivers,
maybe more.
On the other hand, regcache is used by only 4-5 drivers.
On the basis of the above arguments, I am strongly advocating the usage of
irq_enabled flag in ltr390_data. Moreover, using register read to
determine existing
event config every time we do event configuration, seems to be an unnecessary
burden on the bus and increases lines of code which I am finding it tough to
convince myself for.
Having said that, I have prepared a v3. Kindly give your feedback on it.
Thanks,
Akshay.
Powered by blists - more mailing lists