xref: /linux/sound/aoa/codecs/onyx.h (revision 0ea5c948cb64bab5bc7a5516774eb8536f05aa0d)
1*d6869352SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */
2888dcb7cSJohannes Berg /*
3888dcb7cSJohannes Berg  * Apple Onboard Audio driver for Onyx codec (header)
4888dcb7cSJohannes Berg  *
5888dcb7cSJohannes Berg  * Copyright 2006 Johannes Berg <johannes@sipsolutions.net>
6888dcb7cSJohannes Berg  */
7888dcb7cSJohannes Berg #ifndef __SND_AOA_CODEC_ONYX_H
8888dcb7cSJohannes Berg #define __SND_AOA_CODEC_ONYX_H
9888dcb7cSJohannes Berg #include <linux/i2c.h>
10888dcb7cSJohannes Berg #include <asm/pmac_low_i2c.h>
11888dcb7cSJohannes Berg 
12888dcb7cSJohannes Berg /* PCM3052 register definitions */
13888dcb7cSJohannes Berg 
14888dcb7cSJohannes Berg /* the attenuation registers take values from
15888dcb7cSJohannes Berg  * -1 (0dB) to -127 (-63.0 dB) or others (muted) */
16888dcb7cSJohannes Berg #define ONYX_REG_DAC_ATTEN_LEFT		65
17888dcb7cSJohannes Berg #define FIRSTREGISTER			ONYX_REG_DAC_ATTEN_LEFT
18888dcb7cSJohannes Berg #define ONYX_REG_DAC_ATTEN_RIGHT	66
19888dcb7cSJohannes Berg 
20888dcb7cSJohannes Berg #define ONYX_REG_CONTROL		67
21888dcb7cSJohannes Berg #	define ONYX_MRST		(1<<7)
22888dcb7cSJohannes Berg #	define ONYX_SRST		(1<<6)
23888dcb7cSJohannes Berg #	define ONYX_ADPSV		(1<<5)
24888dcb7cSJohannes Berg #	define ONYX_DAPSV		(1<<4)
25888dcb7cSJohannes Berg #	define ONYX_SILICONVERSION	(1<<0)
26888dcb7cSJohannes Berg /* all others reserved */
27888dcb7cSJohannes Berg 
28888dcb7cSJohannes Berg #define ONYX_REG_DAC_CONTROL		68
29888dcb7cSJohannes Berg #	define ONYX_OVR1		(1<<6)
30888dcb7cSJohannes Berg #	define ONYX_MUTE_RIGHT		(1<<1)
31888dcb7cSJohannes Berg #	define ONYX_MUTE_LEFT		(1<<0)
32888dcb7cSJohannes Berg 
33888dcb7cSJohannes Berg #define ONYX_REG_DAC_DEEMPH		69
34888dcb7cSJohannes Berg #	define ONYX_DIGDEEMPH_SHIFT	5
35888dcb7cSJohannes Berg #	define ONYX_DIGDEEMPH_MASK	(3<<ONYX_DIGDEEMPH_SHIFT)
36888dcb7cSJohannes Berg #	define ONYX_DIGDEEMPH_CTRL	(1<<4)
37888dcb7cSJohannes Berg 
38888dcb7cSJohannes Berg #define ONYX_REG_DAC_FILTER		70
39888dcb7cSJohannes Berg #	define ONYX_ROLLOFF_FAST	(1<<5)
40888dcb7cSJohannes Berg #	define ONYX_DAC_FILTER_ALWAYS	(1<<2)
41888dcb7cSJohannes Berg 
42888dcb7cSJohannes Berg #define	ONYX_REG_DAC_OUTPHASE		71
43888dcb7cSJohannes Berg #	define ONYX_OUTPHASE_INVERTED	(1<<0)
44888dcb7cSJohannes Berg 
45888dcb7cSJohannes Berg #define ONYX_REG_ADC_CONTROL		72
46888dcb7cSJohannes Berg #	define ONYX_ADC_INPUT_MIC	(1<<5)
47888dcb7cSJohannes Berg /* 8 + input gain in dB, valid range for input gain is -4 .. 20 dB */
48888dcb7cSJohannes Berg #	define ONYX_ADC_PGA_GAIN_MASK	0x1f
49888dcb7cSJohannes Berg 
50888dcb7cSJohannes Berg #define ONYX_REG_ADC_HPF_BYPASS		75
51888dcb7cSJohannes Berg #	define ONYX_HPF_DISABLE		(1<<3)
52888dcb7cSJohannes Berg #	define ONYX_ADC_HPF_ALWAYS	(1<<2)
53888dcb7cSJohannes Berg 
54888dcb7cSJohannes Berg #define ONYX_REG_DIG_INFO1		77
55888dcb7cSJohannes Berg #	define ONYX_MASK_DIN_TO_BPZ	(1<<7)
56888dcb7cSJohannes Berg /* bits 1-5 control channel bits 1-5 */
57888dcb7cSJohannes Berg #	define ONYX_DIGOUT_DISABLE	(1<<0)
58888dcb7cSJohannes Berg 
59888dcb7cSJohannes Berg #define ONYX_REG_DIG_INFO2		78
60888dcb7cSJohannes Berg /* controls channel bits 8-15 */
61888dcb7cSJohannes Berg 
62888dcb7cSJohannes Berg #define ONYX_REG_DIG_INFO3		79
63888dcb7cSJohannes Berg /* control channel bits 24-29, high 2 bits reserved */
64888dcb7cSJohannes Berg 
65888dcb7cSJohannes Berg #define ONYX_REG_DIG_INFO4		80
66888dcb7cSJohannes Berg #	define ONYX_VALIDL		(1<<7)
67888dcb7cSJohannes Berg #	define ONYX_VALIDR		(1<<6)
68888dcb7cSJohannes Berg #	define ONYX_SPDIF_ENABLE	(1<<5)
69888dcb7cSJohannes Berg /* lower 4 bits control bits 32-35 of channel control and word length */
70888dcb7cSJohannes Berg #	define ONYX_WORDLEN_MASK	(0xF)
71888dcb7cSJohannes Berg 
72888dcb7cSJohannes Berg #endif /* __SND_AOA_CODEC_ONYX_H */
73