clk: print more consistent clock states
In clk_dump we only print the state of clk_is_enabled(). Depending on
the clock this can mean different things. When the clock provides an
is_enabled() callback it will print its result, so the enabled state
matches the hardware state of that clock, but doesn't necessarily mean
its parents are enabled. If a clock does not provide an is_enabled()
callback then we rely on our internal enable_count tracker.

Change this to always print the hardware state of the current clock. It
can be:

- disabled: The clock is disabled (as provided by is_enabled())
- enabled: The clock is enabled (as provided by is_enabled())
- always enabled: The clock can't be disabled (no is_enabled callback
                  and can't be enabled/disabled)
- unknown: no is_enabled callback but can be enabled/disabled

Additionally we print the enable_count variable, so from enable_count !=
0 we can know that barebox has enabled the clock.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent f0b5315 commit 5bf3e793ccef72e11a03ab3066a4893883249c5b
@Sascha Hauer Sascha Hauer authored on 24 Feb 2020
Showing 1 changed file
View
drivers/clk/clk.c