Page MenuHomeFreeBSD

Fix audio for Allwinner H3/H5

Authored by on Apr 14 2019, 5:19 PM.



Due to three conditions the codec driver for Allwinner A10/A20 and H3/H5 did not work properly here:

  1. Wrong bit position for the analog audio reset
  2. Hardware Reset of codec was not de-asserted correctly
  3. Linux DTS file did not contain the address of the analog register the way as the driver was expecting it.

This patch proposes fixes for those three parts.

Test Plan

The patch was successfully tested on a Allwinner NanoPI NEO2 hardware.

Diff Detail

rS FreeBSD src repository - subversion
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Move H3/H5 specific setup into its mixer_init function.

507 ↗(On Diff #56220)

Using reg[0] + reg[1] should work for the end parameter.

740 ↗(On Diff #56220)

What's the reason for this stop here ?

Changed "end"-parameter for resource allocation. marked an inline comment as done and an inline comment as not done.

Move codec_stop call to a different place.

740 ↗(On Diff #56220)

Sometimes during testing the sound did not start the first time after a cold start/reboot. When i started the player once again, the sound was played correctly. I just wanted to set the peripheral to a known state before starting over. With this stop placed here, i could not reproduce the error during playing a sound the first time after reboot.

This revision was not accepted when it landed; it landed in state Needs Review.Apr 17 2019, 9:45 PM
This revision was automatically updated to reflect the committed changes.