xref: /openbmc/linux/sound/soc/codecs/wm9713.h (revision b2441318)
1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
283ac08c0SLiam Girdwood /*
383ac08c0SLiam Girdwood  * wm9713.h  --  WM9713 Soc Audio driver
483ac08c0SLiam Girdwood  */
583ac08c0SLiam Girdwood 
683ac08c0SLiam Girdwood #ifndef _WM9713_H
783ac08c0SLiam Girdwood #define _WM9713_H
883ac08c0SLiam Girdwood 
983ac08c0SLiam Girdwood /* clock inputs */
1083ac08c0SLiam Girdwood #define WM9713_CLKA_PIN			0
1183ac08c0SLiam Girdwood #define WM9713_CLKB_PIN			1
1283ac08c0SLiam Girdwood 
1383ac08c0SLiam Girdwood /* clock divider ID's */
1483ac08c0SLiam Girdwood #define WM9713_PCMCLK_DIV		0
1583ac08c0SLiam Girdwood #define WM9713_CLKA_MULT		1
1683ac08c0SLiam Girdwood #define WM9713_CLKB_MULT		2
1783ac08c0SLiam Girdwood #define WM9713_HIFI_DIV			3
1883ac08c0SLiam Girdwood #define WM9713_PCMBCLK_DIV		4
1983ac08c0SLiam Girdwood #define WM9713_PCMCLK_PLL_DIV           5
2083ac08c0SLiam Girdwood #define WM9713_HIFI_PLL_DIV             6
2183ac08c0SLiam Girdwood 
2283ac08c0SLiam Girdwood /* Calculate the appropriate bit mask for the external PCM clock divider */
2383ac08c0SLiam Girdwood #define WM9713_PCMDIV(x)	((x - 1) << 8)
2483ac08c0SLiam Girdwood 
2583ac08c0SLiam Girdwood /* Calculate the appropriate bit mask for the external HiFi clock divider */
2683ac08c0SLiam Girdwood #define WM9713_HIFIDIV(x)	((x - 1) << 12)
2783ac08c0SLiam Girdwood 
2883ac08c0SLiam Girdwood /* MCLK clock mulitipliers */
2983ac08c0SLiam Girdwood #define WM9713_CLKA_X1		(0 << 1)
3083ac08c0SLiam Girdwood #define WM9713_CLKA_X2		(1 << 1)
3183ac08c0SLiam Girdwood #define WM9713_CLKB_X1		(0 << 2)
3283ac08c0SLiam Girdwood #define WM9713_CLKB_X2		(1 << 2)
3383ac08c0SLiam Girdwood 
3483ac08c0SLiam Girdwood /* MCLK clock MUX */
3583ac08c0SLiam Girdwood #define WM9713_CLK_MUX_A		(0 << 0)
3683ac08c0SLiam Girdwood #define WM9713_CLK_MUX_B		(1 << 0)
3783ac08c0SLiam Girdwood 
3883ac08c0SLiam Girdwood /* Voice DAI BCLK divider */
3983ac08c0SLiam Girdwood #define WM9713_PCMBCLK_DIV_1	(0 << 9)
4083ac08c0SLiam Girdwood #define WM9713_PCMBCLK_DIV_2	(1 << 9)
4183ac08c0SLiam Girdwood #define WM9713_PCMBCLK_DIV_4	(2 << 9)
4283ac08c0SLiam Girdwood #define WM9713_PCMBCLK_DIV_8	(3 << 9)
4383ac08c0SLiam Girdwood #define WM9713_PCMBCLK_DIV_16	(4 << 9)
4483ac08c0SLiam Girdwood 
4583ac08c0SLiam Girdwood #endif
46