audio_amplifier: Add hook for amplifier calibration

Sometimes the amplifier will need to do calibration and fw download
on the very first boot. For example, it will need to load calibration
files from another partition, download calibration firmware to the
amplifier and play silence sound for some seconds.

While the current interface, amp_module_open, is able to handle most
of the operations mentioned above, it is not able to allow the HAL
to play silence sound, because it cannot get the needed audio_device,
or adev, it is not able to enable the snd device, and write silence
pcm data using pcm_write interface.

This change adds an interface to allow the audio_amplifier HAL to
calibrate the amplifier. It passes the required audio_device struct
to audio_amplifier as a parameter, and is called after opening the
audio_amplifier module.

Signed-off-by: Luofan Chen <clfbbn@gmail.com>
Change-Id: I9d497fb5d9716bbcbc6ef9035205ee18da994e72
(cherry picked from commit d05ce0065b8147d05adf0d68c8a182ebbe668d27)
1 file changed