// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Driver for Digigram miXart soundcards
*
* mixer callbacks
*
* Copyright (c) 2003 by Digigram <alsa@digigram.com>
*/
#include <linux/time.h>
#include <linux/interrupt.h>
#include <linux/init.h>
#include <linux/mutex.h>
#include <sound/core.h>
#include "mixart.h"
#include "mixart_core.h"
#include "mixart_hwdep.h"
#include <sound/control.h>
#include <sound/tlv.h>
#include "mixart_mixer.h"
static u32 mixart_analog_level[256] = {
0xc2c00000, /* [000] -96.0 dB */
0xc2bf0000, /* [001] -95.5 dB */
0xc2be0000, /* [002] -95.0 dB */
0xc2bd0000, /* [003] -94.5 dB */
0xc2bc0000, /* [004] -94.0 dB */
0xc2bb0000, /* [005] -93.5 dB */
0xc2ba0000, /* [006] -93.0 dB */
0xc2b90000, /* [007] -92.5 dB */
0xc2b80000, /* [008] -92.0 dB */
0xc2b70000, /* [009] -91.5 dB */
0xc2b60000, /* [010] -91.0 dB */
0xc2b50000, /* [011] -90.5 dB */
0xc2b40000, /* [012] -90.0 dB */
0xc2b30000, /* [013] -89.5 dB */
0xc2b20000, /* [014] -89.0 dB */
0xc2b10000, /* [015] -88.5 dB */
0xc2b00000, /* [016] -88.0 dB */
0xc2af0000, /* [017] -87.5 dB */
0xc2ae0000, /* [018] -87.0 dB */
0xc2ad0000, /* [019] -86.5 dB */
0xc2ac0000, /* [020] -86.0 dB */
0xc2ab0000, /* [021] -85.5 dB */
0xc2aa0000, /* [022] -85.0 dB */
0xc2a90000, /* [023] -84.5 dB */
0xc2a80000, /* [024] -84.0 dB */
0xc2a70000, /* [025] -83.5 dB */
0xc2a60000, /* [026] -83.0 dB */
0xc2a50000, /* [027] -82.5 dB */
0xc2a40000, /* [028] -82.0 dB */
0xc2a30000, /* [029] -81.5 dB */
0xc2a20000, /* [030] -81.0 dB */
0xc2a10000, /* [031] -80.5 dB */
0xc2a00000, /* [032] -80.0 dB */
0xc29f0000, /* [033] -79.5 dB */
0xc29e0000, /* [034] -79.0 dB */
0xc29d0000, /* [035] -78.5 dB */
0xc29c0000, /* [036] -78.0 dB */
0xc29b0000, /* [037] -77.5 dB */
0xc29a0000, /* [038] -77.0 dB */
0xc2990000, /* [039] -76.5 dB */
0xc2980000, /* [040] -76.0 dB */
0xc2970000, /* [041] -75.5 dB */
0xc2960000, /* [042] -75.0 dB */
0xc2950000, /* [043] -74.5 dB */
0xc2940000, /* [044] -74.0 dB */
0xc2930000, /* [045] -73.5 dB */
0xc2920000, /* [046] -73.0 dB */
0xc2910000, /* [047] -72.5 dB */
0xc2900000, /* [048] -72.0 dB */
0xc28f0000, /* [049] -71.5 dB */
0xc28e0000, /* [050] -71.0 dB */
0xc28d0000, /* [051] -70.5 dB */
0xc28c0000, /* [052] -70.0 dB */
0xc28b0000, /* [053] -69.5 dB */
0xc28a0000, /* [054] -69.0 dB */
0xc2890000, /* [055] -68.5 dB */
0xc2880000, /* [056] -68.0 dB */
0xc2870000, /* [057] -67.5 dB */
0xc2860000, /* [058] -67.0 dB */
0xc2850000, /* [059] -66.5 dB */
0xc2840000, /* [060] -66.0 dB */
0xc2830000, /* [061] -65.5 dB */
0xc2820000, /* [062] -65.0 dB */
0xc2810000, /* [063] -64.5 dB */
0xc2800000, /* [064] -64.0 dB */
0xc27e0000, /* [065] -63.5 dB */
0xc27c0000, /* [066] -63.0 dB */
0xc27a0000, /* [067] -62.5 dB */
0xc2780000, /* [068] -62.0 dB */
0xc2760000, /* [069] -61.5 dB */
0xc2740000, /* [070] -61.0 dB */
0xc2720000, /* [071] -60.5 dB */
0xc2700000, /* [072] -60.0 dB */
0xc26e0000, /* [073] -59.5 dB */
0xc26c0000, /* [074] -59.0 dB */
0xc26a0000, /* [075] -58.5 dB */
0xc2680000, /* [076] -58.0 dB */
0xc2660000, /* [077] -57.5 dB */
0xc2640000, /* [078] -57.0 dB */
0xc2620000, /* [079] -56.5 dB */
0xc2600000, /* [080] -56.0 dB */
0xc25e0000, /* [081] -55.5 dB */
0xc25c0000, /* [082] -55.0 dB */
0xc25a0000, /* [083] -54.5 dB */
0xc2580000, /* [084] -54.0 dB */
0xc2560000, /* [085] -53.5 dB */
0xc2540000, /* [086] -53.0 dB */
0xc2520000, /* [087] -52.5 dB */
0xc2500000, /* [088] -52.0 dB */
0xc24e0000, /* [089] -51.5 dB */
0xc24c0000, /* [090] -51.0 dB */
0xc24a0000, /* [091] -50.5 dB */
0xc2480000, /* [092] -50.0 dB */
0xc2460000, /* [093] -49.5 dB */
0xc2440000