blob: 47338804999233d2aaf4b6e61b79322a95848d87 [file] [log] [blame]
Barry Songa1533d92010-03-19 14:48:33 +08001/*
2 * AD193X Audio Codec driver
3 *
4 * Copyright 2010 Analog Devices Inc.
5 *
6 * Licensed under the GPL-2 or later.
7 */
8
9#ifndef __AD193X_H__
10#define __AD193X_H__
11
Lars-Peter Clausen30ab1e72011-09-05 20:46:33 +020012#define AD193X_PLL_CLK_CTRL0 0x00
Barry Songa1533d92010-03-19 14:48:33 +080013#define AD193X_PLL_POWERDOWN 0x01
Axel Linf3aa7212011-10-14 17:01:59 +080014#define AD193X_PLL_INPUT_MASK 0x6
Barry Songfab90aa2010-05-21 11:57:01 +080015#define AD193X_PLL_INPUT_256 (0 << 1)
16#define AD193X_PLL_INPUT_384 (1 << 1)
17#define AD193X_PLL_INPUT_512 (2 << 1)
18#define AD193X_PLL_INPUT_768 (3 << 1)
Lars-Peter Clausen30ab1e72011-09-05 20:46:33 +020019#define AD193X_PLL_CLK_CTRL1 0x01
20#define AD193X_DAC_CTRL0 0x02
Barry Songa1533d92010-03-19 14:48:33 +080021#define AD193X_DAC_POWERDOWN 0x01
22#define AD193X_DAC_SERFMT_MASK 0xC0
23#define AD193X_DAC_SERFMT_STEREO (0 << 6)
24#define AD193X_DAC_SERFMT_TDM (1 << 6)
Lars-Peter Clausen30ab1e72011-09-05 20:46:33 +020025#define AD193X_DAC_CTRL1 0x03
Barry Songa1533d92010-03-19 14:48:33 +080026#define AD193X_DAC_CHAN_SHFT 1
27#define AD193X_DAC_CHAN_MASK (3 << AD193X_DAC_CHAN_SHFT)
28#define AD193X_DAC_LCR_MASTER (1 << 4)
29#define AD193X_DAC_BCLK_MASTER (1 << 5)
30#define AD193X_DAC_LEFT_HIGH (1 << 3)
31#define AD193X_DAC_BCLK_INV (1 << 7)
Lars-Peter Clausenb82ca572011-11-28 17:28:11 +010032#define AD193X_DAC_FMT_MASK (AD193X_DAC_LCR_MASTER | \
33 AD193X_DAC_BCLK_MASTER | AD193X_DAC_LEFT_HIGH | AD193X_DAC_BCLK_INV)
Lars-Peter Clausen30ab1e72011-09-05 20:46:33 +020034#define AD193X_DAC_CTRL2 0x04
Scott Jiang95c93d82011-08-12 18:04:11 -040035#define AD193X_DAC_WORD_LEN_SHFT 3
Scott Jiangbf545ed2011-08-12 18:04:10 -040036#define AD193X_DAC_WORD_LEN_MASK 0x18
Barry Songa1533d92010-03-19 14:48:33 +080037#define AD193X_DAC_MASTER_MUTE 1
Lars-Peter Clausen30ab1e72011-09-05 20:46:33 +020038#define AD193X_DAC_CHNL_MUTE 0x05
Barry Songa1533d92010-03-19 14:48:33 +080039#define AD193X_DACL1_MUTE 0
40#define AD193X_DACR1_MUTE 1
41#define AD193X_DACL2_MUTE 2
42#define AD193X_DACR2_MUTE 3
43#define AD193X_DACL3_MUTE 4
44#define AD193X_DACR3_MUTE 5
45#define AD193X_DACL4_MUTE 6
46#define AD193X_DACR4_MUTE 7
Lars-Peter Clausen30ab1e72011-09-05 20:46:33 +020047#define AD193X_DAC_L1_VOL 0x06
48#define AD193X_DAC_R1_VOL 0x07
49#define AD193X_DAC_L2_VOL 0x08
50#define AD193X_DAC_R2_VOL 0x09
51#define AD193X_DAC_L3_VOL 0x0a
52#define AD193X_DAC_R3_VOL 0x0b
53#define AD193X_DAC_L4_VOL 0x0c
54#define AD193X_DAC_R4_VOL 0x0d
55#define AD193X_ADC_CTRL0 0x0e
Barry Songa1533d92010-03-19 14:48:33 +080056#define AD193X_ADC_POWERDOWN 0x01
57#define AD193X_ADC_HIGHPASS_FILTER 1
58#define AD193X_ADCL1_MUTE 2
59#define AD193X_ADCR1_MUTE 3
60#define AD193X_ADCL2_MUTE 4
61#define AD193X_ADCR2_MUTE 5
Lars-Peter Clausen30ab1e72011-09-05 20:46:33 +020062#define AD193X_ADC_CTRL1 0x0f
Barry Songa1533d92010-03-19 14:48:33 +080063#define AD193X_ADC_SERFMT_MASK 0x60
64#define AD193X_ADC_SERFMT_STEREO (0 << 5)
Scott Jiangbf545ed2011-08-12 18:04:10 -040065#define AD193X_ADC_SERFMT_TDM (1 << 5)
Barry Songa1533d92010-03-19 14:48:33 +080066#define AD193X_ADC_SERFMT_AUX (2 << 5)
67#define AD193X_ADC_WORD_LEN_MASK 0x3
Lars-Peter Clausen30ab1e72011-09-05 20:46:33 +020068#define AD193X_ADC_CTRL2 0x10
Barry Songa1533d92010-03-19 14:48:33 +080069#define AD193X_ADC_CHAN_SHFT 4
70#define AD193X_ADC_CHAN_MASK (3 << AD193X_ADC_CHAN_SHFT)
71#define AD193X_ADC_LCR_MASTER (1 << 3)
72#define AD193X_ADC_BCLK_MASTER (1 << 6)
73#define AD193X_ADC_LEFT_HIGH (1 << 2)
74#define AD193X_ADC_BCLK_INV (1 << 1)
Lars-Peter Clausenb82ca572011-11-28 17:28:11 +010075#define AD193X_ADC_FMT_MASK (AD193X_ADC_LCR_MASTER | \
76 AD193X_ADC_BCLK_MASTER | AD193X_ADC_LEFT_HIGH | AD193X_ADC_BCLK_INV)
77
78#define AD193X_2_CHANNELS 0
79#define AD193X_4_CHANNELS 1
80#define AD193X_8_CHANNELS 2
81#define AD193X_16_CHANNELS 3
Barry Songa1533d92010-03-19 14:48:33 +080082
83#define AD193X_NUM_REGS 17
84
Barry Songa1533d92010-03-19 14:48:33 +080085#endif