Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * wm8960.h  --  WM8960 Soc Audio driver
0004  */
0005 
0006 #ifndef _WM8960_H
0007 #define _WM8960_H
0008 
0009 /* WM8960 register space */
0010 
0011 
0012 #define WM8960_CACHEREGNUM  56
0013 
0014 #define WM8960_LINVOL       0x0
0015 #define WM8960_RINVOL       0x1
0016 #define WM8960_LOUT1        0x2
0017 #define WM8960_ROUT1        0x3
0018 #define WM8960_CLOCK1       0x4
0019 #define WM8960_DACCTL1      0x5
0020 #define WM8960_DACCTL2      0x6
0021 #define WM8960_IFACE1       0x7
0022 #define WM8960_CLOCK2       0x8
0023 #define WM8960_IFACE2       0x9
0024 #define WM8960_LDAC     0xa
0025 #define WM8960_RDAC     0xb
0026 
0027 #define WM8960_RESET        0xf
0028 #define WM8960_3D       0x10
0029 #define WM8960_ALC1     0x11
0030 #define WM8960_ALC2     0x12
0031 #define WM8960_ALC3     0x13
0032 #define WM8960_NOISEG       0x14
0033 #define WM8960_LADC     0x15
0034 #define WM8960_RADC     0x16
0035 #define WM8960_ADDCTL1      0x17
0036 #define WM8960_ADDCTL2      0x18
0037 #define WM8960_POWER1       0x19
0038 #define WM8960_POWER2       0x1a
0039 #define WM8960_ADDCTL3      0x1b
0040 #define WM8960_APOP1        0x1c
0041 #define WM8960_APOP2        0x1d
0042 
0043 #define WM8960_LINPATH      0x20
0044 #define WM8960_RINPATH      0x21
0045 #define WM8960_LOUTMIX      0x22
0046 
0047 #define WM8960_ROUTMIX      0x25
0048 #define WM8960_MONOMIX1     0x26
0049 #define WM8960_MONOMIX2     0x27
0050 #define WM8960_LOUT2        0x28
0051 #define WM8960_ROUT2        0x29
0052 #define WM8960_MONO     0x2a
0053 #define WM8960_INBMIX1      0x2b
0054 #define WM8960_INBMIX2      0x2c
0055 #define WM8960_BYPASS1      0x2d
0056 #define WM8960_BYPASS2      0x2e
0057 #define WM8960_POWER3       0x2f
0058 #define WM8960_ADDCTL4      0x30
0059 #define WM8960_CLASSD1      0x31
0060 
0061 #define WM8960_CLASSD3      0x33
0062 #define WM8960_PLL1     0x34
0063 #define WM8960_PLL2     0x35
0064 #define WM8960_PLL3     0x36
0065 #define WM8960_PLL4     0x37
0066 
0067 
0068 /*
0069  * WM8960 Clock dividers
0070  */
0071 #define WM8960_SYSCLKDIV        0
0072 #define WM8960_DACDIV           1
0073 #define WM8960_OPCLKDIV         2
0074 #define WM8960_DCLKDIV          3
0075 #define WM8960_TOCLKSEL         4
0076 
0077 #define WM8960_SYSCLK_DIV_1     (0 << 1)
0078 #define WM8960_SYSCLK_DIV_2     (2 << 1)
0079 
0080 #define WM8960_SYSCLK_MCLK      (0 << 0)
0081 #define WM8960_SYSCLK_PLL       (1 << 0)
0082 #define WM8960_SYSCLK_AUTO      (2 << 0)
0083 
0084 #define WM8960_DAC_DIV_1        (0 << 3)
0085 #define WM8960_DAC_DIV_1_5      (1 << 3)
0086 #define WM8960_DAC_DIV_2        (2 << 3)
0087 #define WM8960_DAC_DIV_3        (3 << 3)
0088 #define WM8960_DAC_DIV_4        (4 << 3)
0089 #define WM8960_DAC_DIV_5_5      (5 << 3)
0090 #define WM8960_DAC_DIV_6        (6 << 3)
0091 
0092 #define WM8960_DCLK_DIV_1_5     (0 << 6)
0093 #define WM8960_DCLK_DIV_2       (1 << 6)
0094 #define WM8960_DCLK_DIV_3       (2 << 6)
0095 #define WM8960_DCLK_DIV_4       (3 << 6)
0096 #define WM8960_DCLK_DIV_6       (4 << 6)
0097 #define WM8960_DCLK_DIV_8       (5 << 6)
0098 #define WM8960_DCLK_DIV_12      (6 << 6)
0099 #define WM8960_DCLK_DIV_16      (7 << 6)
0100 
0101 #define WM8960_TOCLK_F19        (0 << 1)
0102 #define WM8960_TOCLK_F21        (1 << 1)
0103 
0104 #define WM8960_OPCLK_DIV_1      (0 << 0)
0105 #define WM8960_OPCLK_DIV_2      (1 << 0)
0106 #define WM8960_OPCLK_DIV_3      (2 << 0)
0107 #define WM8960_OPCLK_DIV_4      (3 << 0)
0108 #define WM8960_OPCLK_DIV_5_5        (4 << 0)
0109 #define WM8960_OPCLK_DIV_6      (5 << 0)
0110 
0111 #endif