xref: /linux/sound/soc/codecs/wm8753.h (revision d331124dc2923ec0966a82e3428c532cee8da95f)
11f53aee0SLiam Girdwood /*
21f53aee0SLiam Girdwood  * wm8753.h  --  audio driver for WM8753
31f53aee0SLiam Girdwood  *
41f53aee0SLiam Girdwood  * Copyright 2003 Wolfson Microelectronics PLC.
5*d331124dSLiam Girdwood  * Author: Liam Girdwood <lrg@slimlogic.co.uk>
61f53aee0SLiam Girdwood  *
71f53aee0SLiam Girdwood  *  This program is free software; you can redistribute  it and/or modify it
81f53aee0SLiam Girdwood  *  under  the terms of  the GNU General  Public License as published by the
91f53aee0SLiam Girdwood  *  Free Software Foundation;  either version 2 of the  License, or (at your
101f53aee0SLiam Girdwood  *  option) any later version.
111f53aee0SLiam Girdwood  *
121f53aee0SLiam Girdwood  */
131f53aee0SLiam Girdwood 
141f53aee0SLiam Girdwood #ifndef _WM8753_H
151f53aee0SLiam Girdwood #define _WM8753_H
161f53aee0SLiam Girdwood 
171f53aee0SLiam Girdwood /* WM8753 register space */
181f53aee0SLiam Girdwood 
191f53aee0SLiam Girdwood #define WM8753_DAC		0x01
201f53aee0SLiam Girdwood #define WM8753_ADC		0x02
211f53aee0SLiam Girdwood #define WM8753_PCM		0x03
221f53aee0SLiam Girdwood #define WM8753_HIFI		0x04
231f53aee0SLiam Girdwood #define WM8753_IOCTL		0x05
241f53aee0SLiam Girdwood #define WM8753_SRATE1		0x06
251f53aee0SLiam Girdwood #define WM8753_SRATE2		0x07
261f53aee0SLiam Girdwood #define WM8753_LDAC		0x08
271f53aee0SLiam Girdwood #define WM8753_RDAC		0x09
281f53aee0SLiam Girdwood #define WM8753_BASS		0x0a
291f53aee0SLiam Girdwood #define WM8753_TREBLE		0x0b
301f53aee0SLiam Girdwood #define WM8753_ALC1		0x0c
311f53aee0SLiam Girdwood #define WM8753_ALC2		0x0d
321f53aee0SLiam Girdwood #define WM8753_ALC3		0x0e
331f53aee0SLiam Girdwood #define WM8753_NGATE		0x0f
341f53aee0SLiam Girdwood #define WM8753_LADC		0x10
351f53aee0SLiam Girdwood #define WM8753_RADC		0x11
361f53aee0SLiam Girdwood #define WM8753_ADCTL1		0x12
371f53aee0SLiam Girdwood #define WM8753_3D		0x13
381f53aee0SLiam Girdwood #define WM8753_PWR1		0x14
391f53aee0SLiam Girdwood #define WM8753_PWR2		0x15
401f53aee0SLiam Girdwood #define WM8753_PWR3		0x16
411f53aee0SLiam Girdwood #define WM8753_PWR4		0x17
421f53aee0SLiam Girdwood #define WM8753_ID		0x18
431f53aee0SLiam Girdwood #define WM8753_INTPOL		0x19
441f53aee0SLiam Girdwood #define WM8753_INTEN		0x1a
451f53aee0SLiam Girdwood #define WM8753_GPIO1		0x1b
461f53aee0SLiam Girdwood #define WM8753_GPIO2		0x1c
471f53aee0SLiam Girdwood #define WM8753_RESET		0x1f
481f53aee0SLiam Girdwood #define WM8753_RECMIX1		0x20
491f53aee0SLiam Girdwood #define WM8753_RECMIX2		0x21
501f53aee0SLiam Girdwood #define WM8753_LOUTM1		0x22
511f53aee0SLiam Girdwood #define WM8753_LOUTM2		0x23
521f53aee0SLiam Girdwood #define WM8753_ROUTM1		0x24
531f53aee0SLiam Girdwood #define WM8753_ROUTM2		0x25
541f53aee0SLiam Girdwood #define WM8753_MOUTM1		0x26
551f53aee0SLiam Girdwood #define WM8753_MOUTM2		0x27
561f53aee0SLiam Girdwood #define WM8753_LOUT1V		0x28
571f53aee0SLiam Girdwood #define WM8753_ROUT1V		0x29
581f53aee0SLiam Girdwood #define WM8753_LOUT2V		0x2a
591f53aee0SLiam Girdwood #define WM8753_ROUT2V		0x2b
601f53aee0SLiam Girdwood #define WM8753_MOUTV		0x2c
611f53aee0SLiam Girdwood #define WM8753_OUTCTL		0x2d
621f53aee0SLiam Girdwood #define WM8753_ADCIN		0x2e
631f53aee0SLiam Girdwood #define WM8753_INCTL1		0x2f
641f53aee0SLiam Girdwood #define WM8753_INCTL2		0x30
651f53aee0SLiam Girdwood #define WM8753_LINVOL		0x31
661f53aee0SLiam Girdwood #define WM8753_RINVOL		0x32
671f53aee0SLiam Girdwood #define WM8753_MICBIAS		0x33
681f53aee0SLiam Girdwood #define WM8753_CLOCK		0x34
691f53aee0SLiam Girdwood #define WM8753_PLL1CTL1		0x35
701f53aee0SLiam Girdwood #define WM8753_PLL1CTL2		0x36
711f53aee0SLiam Girdwood #define WM8753_PLL1CTL3		0x37
721f53aee0SLiam Girdwood #define WM8753_PLL1CTL4		0x38
731f53aee0SLiam Girdwood #define WM8753_PLL2CTL1		0x39
741f53aee0SLiam Girdwood #define WM8753_PLL2CTL2		0x3a
751f53aee0SLiam Girdwood #define WM8753_PLL2CTL3		0x3b
761f53aee0SLiam Girdwood #define WM8753_PLL2CTL4		0x3c
771f53aee0SLiam Girdwood #define WM8753_BIASCTL		0x3d
781f53aee0SLiam Girdwood #define WM8753_ADCTL2		0x3f
791f53aee0SLiam Girdwood 
801f53aee0SLiam Girdwood struct wm8753_setup_data {
81dd0c0c80SMark Brown 	int spi;
82ad4503d8SJean Delvare 	int i2c_bus;
831f53aee0SLiam Girdwood 	unsigned short i2c_address;
841f53aee0SLiam Girdwood };
851f53aee0SLiam Girdwood 
861f53aee0SLiam Girdwood #define WM8753_PLL1			0
871f53aee0SLiam Girdwood #define WM8753_PLL2			1
881f53aee0SLiam Girdwood 
891f53aee0SLiam Girdwood /* clock inputs */
901f53aee0SLiam Girdwood #define WM8753_MCLK		0
911f53aee0SLiam Girdwood #define WM8753_PCMCLK		1
921f53aee0SLiam Girdwood 
931f53aee0SLiam Girdwood /* clock divider id's */
941f53aee0SLiam Girdwood #define WM8753_PCMDIV		0
951f53aee0SLiam Girdwood #define WM8753_BCLKDIV		1
961f53aee0SLiam Girdwood #define WM8753_VXCLKDIV		2
971f53aee0SLiam Girdwood 
981f53aee0SLiam Girdwood /* PCM clock dividers */
991f53aee0SLiam Girdwood #define WM8753_PCM_DIV_1	(0 << 6)
1001f53aee0SLiam Girdwood #define WM8753_PCM_DIV_3	(2 << 6)
1011f53aee0SLiam Girdwood #define WM8753_PCM_DIV_5_5	(3 << 6)
1021f53aee0SLiam Girdwood #define WM8753_PCM_DIV_2	(4 << 6)
1031f53aee0SLiam Girdwood #define WM8753_PCM_DIV_4	(5 << 6)
1041f53aee0SLiam Girdwood #define WM8753_PCM_DIV_6	(6 << 6)
1051f53aee0SLiam Girdwood #define WM8753_PCM_DIV_8	(7 << 6)
1061f53aee0SLiam Girdwood 
1071f53aee0SLiam Girdwood /* BCLK clock dividers */
1081f53aee0SLiam Girdwood #define WM8753_BCLK_DIV_1	(0 << 3)
1091f53aee0SLiam Girdwood #define WM8753_BCLK_DIV_2	(1 << 3)
1101f53aee0SLiam Girdwood #define WM8753_BCLK_DIV_4	(2 << 3)
1111f53aee0SLiam Girdwood #define WM8753_BCLK_DIV_8	(3 << 3)
1121f53aee0SLiam Girdwood #define WM8753_BCLK_DIV_16	(4 << 3)
1131f53aee0SLiam Girdwood 
1141f53aee0SLiam Girdwood /* VXCLK clock dividers */
1151f53aee0SLiam Girdwood #define WM8753_VXCLK_DIV_1	(0 << 6)
1161f53aee0SLiam Girdwood #define WM8753_VXCLK_DIV_2	(1 << 6)
1171f53aee0SLiam Girdwood #define WM8753_VXCLK_DIV_4	(2 << 6)
1181f53aee0SLiam Girdwood #define WM8753_VXCLK_DIV_8	(3 << 6)
1191f53aee0SLiam Girdwood #define WM8753_VXCLK_DIV_16	(4 << 6)
1201f53aee0SLiam Girdwood 
1211f53aee0SLiam Girdwood #define WM8753_DAI_HIFI		0
1221f53aee0SLiam Girdwood #define WM8753_DAI_VOICE		1
1231f53aee0SLiam Girdwood 
124e550e17fSLiam Girdwood extern struct snd_soc_dai wm8753_dai[2];
1251f53aee0SLiam Girdwood extern struct snd_soc_codec_device soc_codec_dev_wm8753;
1261f53aee0SLiam Girdwood 
1271f53aee0SLiam Girdwood #endif
128