ASoC: sgtl5000: Calculate Lineout Channel Output Level
authorAlexander Stein <alexander.stein@systec-electronic.com>
Thu, 16 Apr 2015 12:51:57 +0000 (14:51 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 27 Apr 2015 14:42:20 +0000 (15:42 +0100)
commit1f39d9397f8a27becd2b72009865610a71c64b0f
treedd736e870b699c31af2a2ce4a4e7f499dd070785
parentd2b7c2aaf7b565532c7d9937519b199fbca4a779
ASoC: sgtl5000: Calculate Lineout Channel Output Level

Currently LO_VOL_* stays at it's default (0x4 each) but this should be
calculated after setting VAG_VAL and LO_VAGCNTRL.
LO_VOL_* = 40 * log10(VAG_VAL / LO_VAGCNTRL) + 15

To avoid the log10 operation a table for all valid register values is
precalculated which contains the corresponding value
(VAG_VAL * 100 / LO_VAGCNTRL).

Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/sgtl5000.c