Skip to content

Commit

Permalink
clk: bcm2835: Add support for programming the audio domain clocks
Browse files Browse the repository at this point in the history
This adds support for enabling, disabling, and setting the rate of the
audio domain clocks.  It will be necessary for setting the pixel clock
for HDMI in the VC4 driver and let us write a cpufreq driver.  It will
also improve compatibility with user changes to the firmware's
config.txt, since our previous fixed clocks are unaware of it.

The firmware also has support for configuring the clocks through the
mailbox channel, but the pixel clock setup by the firmware doesn't
work, and it's Raspberry Pi specific anyway.  The only conflicts we
should have with the firmware would be if we made firmware calls that
result in clock management (like opening firmware V3D or ISP access,
which we don't support in upstream), or on hardware over-thermal or
under-voltage (when the firmware would rewrite PLLB to take the ARM
out of overclock).  If that happens, our cached .recalc_rate() results
would be incorrect, but that's no worse than our current state where
we used fixed clocks.

The existing fixed clocks in the code are left in place to provide
backwards compatibility with old device tree files.

v2: Fix onecell->clks[] allocation size.
v3: '/*' on otherwise-empty line for multiline comments, fix top
    comment, use more named initializers, do fewer separate
    allocations on probe, unwind allocations on failure in probe (from
    review by Stephen Warren).  Use new clk_hw_get_name().  Switch
    fb_prediv_bit to be fb_prediv_mask to avoid typing BIT() so many
    times.
v4: Incorporate feedback from Stephen Boyd, and use devm_kasprintf instead
    of bare kasprintf in driver init.
v5: Fix nitpicks from Stefan Wahren, drop a debugging get_rate() call,
    clean up 2 more checkpatch --strict complaints.
v6: More feedback from Stephen Boyd, make #defines for the ANA bits,
    fix non-PLLH KA value.
v7: More nitpicks from Stephen Boyd.

Signed-off-by: Eric Anholt <eric@anholt.net>
Tested-by: Martin Sperl <kernel@martin.sperl.org>
  • Loading branch information
anholt authored and Phil Elwell committed Dec 2, 2015
1 parent 7a0dbbb commit 422afe2
Showing 1 changed file with 1,521 additions and 1 deletion.

0 comments on commit 422afe2

Please sign in to comment.