1/*
2 * Copyright (c) 2008, ETH Zurich. All rights reserved.
3 *
4 * This file is distributed under the terms in the attached LICENSE file.
5 * If you do not find this file, copies can be found by writing to:
6 * ETH Zurich D-INFK, Universitaetstrasse 6, CH-8092 Zurich. Attn: Systems Group.
7 */
8
9/*
10 * ac97_ext_modem.dev
11 *
12 * DESCRIPTION: AC'97 Extended Modem Register Set
13 * 
14 * Numbers in comments refer to the Intel Audio Codec '97 specification, 
15 * revision 2.3 revision 1.0, April, 2002
16 */
17
18device ac97_ext_modem msbfirst ( io base ) "AC97 Extended Modem" {
19
20  // 6.6.1
21  register emid rw io( base, 0x3c ) "Extended modem ID" {
22    lin1	1 "Line 1 supported";
23    lin2	1 "Line 2 supported";
24    hset        1 "Handset DAC/ADC supported";
25    cid1	1 "Caller ID decode on line 1 supported";
26    cid2	1 "Caller ID decode on line 2 supported";
27    _		9;
28    id		2 "Codec configuration";
29  };
30
31  // 6.6.2
32  register emsc io( base, 0x3e ) "Extended modem control/status" {
33    gpio	1 ro "GPIO ready";
34    mref	1 ro "Modem Vref nominal";
35    adc1	1 ro "Line 1 ADC ready";
36    dac1	1 ro "Line 1 DAC ready";
37    adc2	1 ro "Line 2 ADC ready";
38    dac2	1 ro "Line 2 DAC ready";
39    hadc	1 ro "Handset ADC ready";
40    hdac	1 ro "Handset DAC ready";
41    pra		1 rw "GPIO power down";
42    prb		1 rw "Modem Vref off";
43    prc		1 rw "Line 1 ADC off";
44    prd		1 rw "Line 1 DAC off";
45    pre		1 rw "Line 2 ADC off";
46    prf		1 rw "Line 2 DAC off";
47    prg		1 rw "Handset ADC off";
48    prf		1 rw "Handset DAC off";
49  };
50
51  // 6.6.3
52  register line1rate rw io( base, 0x40 ) "Line 1 sample rate" type(uint16);
53  register line2rate rw io( base, 0x42 ) "Line 2 sample rate" type(uint16);
54  register handsrate rw io( base, 0x44 ) "Handset sample rate" type(uint16);
55
56  // 6.6.4
57  regtype lvlcntl "Modem DAC/ADC level control" {
58    dmute	1 "DAC mute";
59    _		3;
60    dac		4 "DAC level";
61    amute	1 "ADC mute";
62    _		3;
63    adc		4 "ADC level";
64  };
65  register line1lvl rw io (base, 0x46 ) "Line 1 level control" type(lvlcntl);
66  register line2lvl rw io (base, 0x48 ) "Line 2 level control" type(lvlcntl);
67  register handslvl rw io (base, 0x4a ) "Handset level control" type(lvlcntl);
68
69  // 6.6.5
70  register gpioconf rw io(base, 0x4c) "GPIO pin configuration" type(uint16);
71
72  // 6.6.6
73  register gpiopol rw io(base, 0x4e) "GPIO pin polarity/type" type(uint16);
74
75  // 6.6.7
76  register gpiosticky rw io(base, 0x50) "GPIO pin sticky" type(uint16);
77
78  // 6.6.8
79  register gpiowake rw io(base, 0x52) "GPIO pin wake-up mask" type(uint16);
80
81  // 6.6.9
82  register gpiostat rw io(base, 0x54) "GPIO pin status" type(uint16);
83
84  // 6.6.10
85
86  constants lpbkmode "Loopback modes" {
87    dis		= 0b000 "Disabled";
88    adc		= 0b001 "ADC loopback";
89    local	= 0b010 "Local analog loopback";
90    dac		= 0b011 "DAC loopback";
91    remote	= 0b100 "Remote analog loopback";
92  };
93
94  register misc rw io(base, 0x56) "Misc modem AFE status/control" {
95    cid2	1 "Caller ID decode line 2 supported";
96    cid1	1 "Caller ID decode line 1 supported";
97    cidr	1 "Caller ID raw data";
98    mlnk	1 "Secondary modem codec AC-link status";
99    _		1;
100    hsb		3 type(lpbkmode) "Handset loopback mode";
101    _		1;
102    l2b		3 type(lpbkmode) "Line 2 loopback mode";
103    _		1;
104    l1b		3 type(lpbkmode) "Line 1 loopback mode";
105  };
106};
107	
108