xref: /openbmc/linux/sound/soc/codecs/wm8400.h (revision 2874c5fd)
12874c5fdSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-or-later */
2aaf1e176SMark Brown /*
3aaf1e176SMark Brown  * wm8400.h  --  audio driver for WM8400
4aaf1e176SMark Brown  *
5aaf1e176SMark Brown  * Copyright 2008 Wolfson Microelectronics PLC.
6aaf1e176SMark Brown  * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
7aaf1e176SMark Brown  */
8aaf1e176SMark Brown 
9aaf1e176SMark Brown #ifndef _WM8400_CODEC_H
10aaf1e176SMark Brown #define _WM8400_CODEC_H
11aaf1e176SMark Brown 
12aaf1e176SMark Brown #define WM8400_MCLK_DIV 0
13aaf1e176SMark Brown #define WM8400_DACCLK_DIV 1
14aaf1e176SMark Brown #define WM8400_ADCCLK_DIV 2
15aaf1e176SMark Brown #define WM8400_BCLK_DIV 3
16aaf1e176SMark Brown 
17aaf1e176SMark Brown #define WM8400_MCLK_DIV_1 0x400
18aaf1e176SMark Brown #define WM8400_MCLK_DIV_2 0x800
19aaf1e176SMark Brown 
20aaf1e176SMark Brown #define WM8400_DAC_CLKDIV_1    0x00
21aaf1e176SMark Brown #define WM8400_DAC_CLKDIV_1_5  0x04
22aaf1e176SMark Brown #define WM8400_DAC_CLKDIV_2    0x08
23aaf1e176SMark Brown #define WM8400_DAC_CLKDIV_3    0x0c
24aaf1e176SMark Brown #define WM8400_DAC_CLKDIV_4    0x10
25aaf1e176SMark Brown #define WM8400_DAC_CLKDIV_5_5  0x14
26aaf1e176SMark Brown #define WM8400_DAC_CLKDIV_6    0x18
27aaf1e176SMark Brown 
28aaf1e176SMark Brown #define WM8400_ADC_CLKDIV_1    0x00
29aaf1e176SMark Brown #define WM8400_ADC_CLKDIV_1_5  0x20
30aaf1e176SMark Brown #define WM8400_ADC_CLKDIV_2    0x40
31aaf1e176SMark Brown #define WM8400_ADC_CLKDIV_3    0x60
32aaf1e176SMark Brown #define WM8400_ADC_CLKDIV_4    0x80
33aaf1e176SMark Brown #define WM8400_ADC_CLKDIV_5_5  0xa0
34aaf1e176SMark Brown #define WM8400_ADC_CLKDIV_6    0xc0
35aaf1e176SMark Brown 
36aaf1e176SMark Brown 
37aaf1e176SMark Brown #define WM8400_BCLK_DIV_1                       (0x0 << 1)
38aaf1e176SMark Brown #define WM8400_BCLK_DIV_1_5                     (0x1 << 1)
39aaf1e176SMark Brown #define WM8400_BCLK_DIV_2                       (0x2 << 1)
40aaf1e176SMark Brown #define WM8400_BCLK_DIV_3                       (0x3 << 1)
41aaf1e176SMark Brown #define WM8400_BCLK_DIV_4                       (0x4 << 1)
42aaf1e176SMark Brown #define WM8400_BCLK_DIV_5_5                     (0x5 << 1)
43aaf1e176SMark Brown #define WM8400_BCLK_DIV_6                       (0x6 << 1)
44aaf1e176SMark Brown #define WM8400_BCLK_DIV_8                       (0x7 << 1)
45aaf1e176SMark Brown #define WM8400_BCLK_DIV_11                      (0x8 << 1)
46aaf1e176SMark Brown #define WM8400_BCLK_DIV_12                      (0x9 << 1)
47aaf1e176SMark Brown #define WM8400_BCLK_DIV_16                      (0xA << 1)
48aaf1e176SMark Brown #define WM8400_BCLK_DIV_22                      (0xB << 1)
49aaf1e176SMark Brown #define WM8400_BCLK_DIV_24                      (0xC << 1)
50aaf1e176SMark Brown #define WM8400_BCLK_DIV_32                      (0xD << 1)
51aaf1e176SMark Brown #define WM8400_BCLK_DIV_44                      (0xE << 1)
52aaf1e176SMark Brown #define WM8400_BCLK_DIV_48                      (0xF << 1)
53aaf1e176SMark Brown 
54aaf1e176SMark Brown #endif
55