CS43L22 Master Volume

Got myself a STM32F4-Discovery board and it comes with a decent audio DAC (CS43L22).

CS43L22-VolumeCS43L22 master volume registers 0x20 and 0x21 are documented rather poorly and it’s NOT immediately obvious what’s the logic with the values.
Anyhow here’s an explanation:
values 1-24 mean positive dB,
values 25-255 mean negative dB
…and the volume doesn’t go any lower than -102dB (values from 25 to 52 all result in volume of -102dB).
Oh and and if this is not confusing enough – the negative dB values are organized backwards. Here’s a table to illustrate this strangeness:

Registry value dB
24 +12.0dB
23 +11.5dB
22 +11.0dB
0 0.0dB
255 -0.5dB
254 -1.0dB
253 -1.5dB
53 -101.5dB
52 -102.0dB
51 -102.0dB
50 -102.0dB
25 -102.0dB

Would have been nice to see this explained in the official documentation and not waste an hour to figure this out.