BL_INTERNAL: sound: codecs: tas2562: refactor volume control get function
- Sep 22, 2023
-
-
Vitor Sato Eschholz authored
Expose registers of tas2562 to allow reading and writing from/to them using ALSA controls. This will allow user to set a amplifier configuration which differs from the default one. Test - Reading registers: console:/ # tinymix Mixer name: 'mt-snd-card' Number of controls: 363 ctl type num name value [...] 127 BYTE 1 PAGE0 SW_RESET 00 128 BYTE 1 PAGE0 PWR_CTL 0d 129 BYTE 1 PAGE0 PB_CFG1 20 130 BYTE 1 PAGE0 MISC_CFG1 c6 131 BYTE 1 PAGE0 MISC_CFG2 22 [...] - Write to register and read back: console:/ # tinymix "PAGE0 PWR_CTL" 0x0c console:/ # tinymix "PAGE0 PWR_CTL" PAGE0 PWR_CTL: 0c Signed-off-by:
Vitor Sato Eschholz <vsatoes@baylibre.com>
-
Vitor Sato Eschholz authored
tas2562_volume_control_get() assumes that Digital Volume is only changed using the correspondent ALSA Control. However, it can also be changed by directly writing to DVC_CFG[1-4] registers, or by a software reset. To ensure tas2562_volume_control_get() returns the current digital volume level of the amplifier, update the function so that it reads the registers instead of returning the data internally stored. Signed-off-by:
Vitor Sato Eschholz <vsatoes@baylibre.com>
-