On Fri, Oct 07, 2022 at 02:01:19PM +0200, Krzysztof Hałasa wrote: > Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx> writes: > > > I think Krzysztof meant caching the value in the ar0521_dev structure, > > so it doesn't have to be read back. I2C is slow, let's avoid reads as > > much as possible. > > Right, ATM there is no I2C read function at all in this driver. > > > This being said, if all gain controls are in the same cluster, you won't > > need to read back or cache anything yourself, the control framework will > > handle that for you. > > Yep. Then there could be a common gain for all 3 colors, or a set of 3 > for R/G/B. I only don't know what should the former one return on read, > if individual values are used. That's an interesting question. We could make it a write-only control, but that would complicate userspace applications that don't need the per-color controls. This being said, I'm not sure I've seen any use case for reading back gain controls (beside on sensors that implement AEGC). -- Regards, Laurent Pinchart