lkml.org 
[lkml]   [2021]   [Jan]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v5 2/7] pwm: pca9685: Support hardware readout
Hi Clemens,

On Fri, Jan 29, 2021 at 11:31 AM Clemens Gruber
<clemens.gruber@pqgruber.com> wrote:
>
> Ok, so you suggest we extend our get_state logic to deal with cases
> like the following:

Kind of. We can't control how other actors (bootloaders etc) program the
chip. As far as I know, there are many, many different register settings that
result in the same physical chip outputs. So if .probe() wants to preserve the
existing chip settings, .get_state() has to be able to deal with every possible
setting. Even invalid ones.

In addition, .apply() cannot make any assumptions as to which bits are
already set/cleared on the chip. Including preserved, invalid settings.

This might get quite complex.

However if we reset the chip in .probe() to a known state (a normalized state,
in the mathematical sense), then both .get_state() and .apply() become
much simpler. because they only need to deal with known, normalized states.

In short, it's a tradeoff between code complexity, and user friendliness/
features.

Sven

\
 
 \ /
  Last update: 2021-01-29 19:07    [W:0.242 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site