summaryrefslogtreecommitdiff
path: root/arch/arm/plat-mxc/include/mach/pmic_audio.h
blob: 6754d5a6d04e1a16d1d599e0af3691e8c4a94678 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
/*
 * Copyright 2004-2010 Freescale Semiconductor, Inc. All Rights Reserved.
 */

/*
 * The code contained herein is licensed under the GNU General Public
 * License. You may obtain a copy of the GNU General Public License
 * Version 2 or later at the following locations:
 *
 * http://www.opensource.org/licenses/gpl-license.html
 * http://www.gnu.org/copyleft/gpl.html
 */
#ifndef __ASM_ARCH_MXC_PMIC_AUDIO_H__
#define __ASM_ARCH_MXC_PMIC_AUDIO_H__

/*!
 * @defgroup PMIC_AUDIO  PMIC Audio Driver
 * @ingroup PMIC_DRVRS
 */

/*!
 * @file arch-mxc/pmic_audio.h
 * @brief External definitions for the PMIC Audio Client driver.
 *
 * The PMIC Audio driver and this API were developed to support the
 * audio playback, recording, and mixing capabilities of the power
 * management ICs that are available from Freescale Semiconductor, Inc.
 *
 * The following table shows which audio-related capabilities are supported
 * by each power management IC:
 *
 * @ingroup PMIC_AUDIO
 */

#include <linux/pmic_status.h>
#include <linux/pmic_external.h>

/***************************************************************************
 *                       TYPEDEFS AND ENUMERATIONS                         *
 ***************************************************************************/

/*!
 * @name General Setup and Audio Device Access Typedefs and Enumerations
 * Typedefs and enumerations that are used for initial access to the
 * PMIC Audio hardware.
 */
/*@{*/

/*!
 * @typedef PMIC_AUDIO_HANDLE
 * @brief Define typedef for a handle to the PMIC Audio hardware.
 *
 * Define a "handle" that is returned when the PMIC Audio hardware
 * is opened. This handle grants exclusive access to the PMIC Audio
 * hardware and must be used in all subsequent function calls. When access
 * to the PMIC Audio hardware is no longer required, then a close
 * operation must be done with this handle. The handle is no longer valid
 * if the close operation was successful.
 */
typedef long *PMIC_AUDIO_HANDLE;

/*!
 * @enum PMIC_AUDIO_EVENTS
 * @brief Identify the audio events that have been detected and should be
 * handled.
 *
 * This enumeration defines all of the possible PMIC Audio events. Multiple
 * events may be selected when defining a mask and multiple events may be
 * signalled together.
 *
 * Note that the MICROPHONE_DETECT and MICROPHONE_REMOVED events may also be
 * used to signal the operation of a serial or parallel microphone switch
 * when used with a combined headset+microphone device. In that case the
 * HEADSET_DETECT state must also be checked to determine if it's only the
 * microphone switch being operated or whether the microphone has truly been
 * inserted/removed (along with the headset).
 */
typedef enum {
	HEADSET_DETECTED = 1,	/*!< Detected headset insertion.      */
	HEADSET_STEREO = 2,	/*!< Detected stereo headset device.  */
	HEADSET_MONO = 4,	/*!< Detected mono headset device.    */
	HEADSET_THERMAL_SHUTDOWN = 8,	/*!< Detected output amplifier
					   shutdown due to thermal
					   limits .      */
	HEADSET_SHORT_CIRCUIT = 16,	/*!< Detected output amplifier
					   short circuit condition
					   .             */
	HEADSET_REMOVED = 32,	/*!< Detected headset removal.        */
	MICROPHONE_DETECTED = 64,	/*!< Detected microphone insertion.   */
	MICROPHONE_REMOVED = 128,	/*!< Detected microphone removal.     */
	PTT_BUTTON_PRESS = 256,	/*!< Detected PTT button down
				   .        */
	PTT_BUTTON_RANGE = 512,	/*!< Detected PTT button within
				   voltage range
				   .        */
	PTT_SHORT_OR_INVALID = 1024	/*!< Detected PTT button outside
					   of voltage range or invalid
					   device  . */
} PMIC_AUDIO_EVENTS;

/*!
 * @typedef PMIC_AUDIO_CALLBACK
 * @brief Typedef for PMIC Audio event notification callback function.
 *
 * Define a typedef for the PMIC Audio event notification callback
 * function. The signalled events are passed to the function as the first
 * argument. The callback function should then process whatever events it
 * can and then return the set of unhandled events (if any).
 */
typedef PMIC_AUDIO_EVENTS(*PMIC_AUDIO_CALLBACK) (const PMIC_AUDIO_EVENTS event);

typedef struct {
	int hs_state;
	int event_type;
} PMIC_HS_STATE;

/*!
 * @enum PMIC_AUDIO_SOURCE
 * @brief Select an audio signal processing component.
 *
 * This enumeration defines all of the possible PMIC audio signal handling
 * components which can be acquired by calling pmic_audio_open().
 *
 * Note that the EXTERNAL_STEREO_IN selection is used to simply gain access
 * to the stereo input pins. The stereo input signal can then be routed
 * directly to the output amplifiers. In this case, no signal processing is
 * done by either the Voice CODEC or the Stereo DAC.
 */
typedef enum {
	STEREO_DAC,		/*!< Open connection to Stereo DAC.             */
	VOICE_CODEC,		/*!< Open connection to Voice CODEC.            */
	EXTERNAL_STEREO_IN	/*!< Open connection to external stereo inputs. */
} PMIC_AUDIO_SOURCE;

/*@}*/

/*!
 * @name Data Bus Setup and Configuration Typedefs and Enumerations
 * Typedefs and enumerations that are used to define and configure
 * the data bus protocol in order to communicate with the Stereo DAC
 * or the Voice CODEC.
 */
/*@{*/

/*!
 * @enum PMIC_AUDIO_DATA_BUS
 * @brief Select the data bus used to transfer data between the host and
 *        Voice CODEC and/or the Stereo DAC.
 *
 * This enumeration defines all of the possible PMIC audio data buses that
 * can be used to transfer data between the host and the Voice CODEC and/or
 * the Stereo DAC on the PMIC.
 *
 * Note that the same data bus may be used to transfer audio data to/from
 * the Voice CODEC and the Stereo DAC. However, in this case, the data bus
 * must be configured for network mode with different timeslots assigned to
 * the Voice CODEC and the Stereo DAC. Also, the sampling rates must be
 * identical for both the Voice CODEC and the Stereo DAC in order to avoid
 * a data bus timing conflict and audio signal distortion.
 */
typedef enum {
	AUDIO_DATA_BUS_1,	/*!< Use data bus 1 for audio data. */
	AUDIO_DATA_BUS_2	/*!< Use data bus 2 for audio data. */
} PMIC_AUDIO_DATA_BUS;

/*!
 * @enum PMIC_AUDIO_BUS_PROTOCOL
 * @brief Select the data bus protocol to be used.
 *
 * This enumeration defines all of the possible PMIC audio data bus protocols
 * that may be selected.
 */
typedef enum {
	NORMAL_MSB_JUSTIFIED_MODE,	/*!< Transmit and receive audio data
					   in normal MSB-justified mode.       */
	NETWORK_MODE,		/*!< Transmit and receive audio data
				   in network mode.                    */
	I2S_MODE,		/*!< Transmit and receive audio data
				   in I2S mode.                        */
	SPD_IF_MODE		/*!< Transmit and receive audio data
				   in SPD/IF mode  . */
} PMIC_AUDIO_BUS_PROTOCOL;

/*!
 * @enum PMIC_AUDIO_BUS_MODE
 * @brief Select the data bus mode to be used.
 *
 * This enumeration defines all of the possible PMIC audio data bus modes
 * that may be selected. When configured in BUS_MASTER_MODE, the PMIC is
 * responsible for supplying the data bus clock signals. Alternatively,
 * when configured in BUS_SLAVE_MODE, the PMIC will use the data bus clock
 * signals that are supplied by the bus master.
 */
typedef enum {
	BUS_MASTER_MODE = 0,	/*!< Operate as bus master.       */
	BUS_SLAVE_MODE = 1	/*!< Operate as bus slave.        */
} PMIC_AUDIO_BUS_MODE;

/*!
 * @enum PMIC_AUDIO_CLOCK_IN_SOURCE
 * @brief Select the clock signal source when in bus master mode.
 *
 * This enumeration defines all of the possible PMIC audio clock signal
 * sources that may be selected. One of these clock signal sources must
 * be selected in order to use either the Voice CODEC or the Stereo DAC.
 *
 * When configured in BUS_MASTER_MODE, the PMIC's onboard PLL circuits
 * will also be driven by the selected clock input signal.
 */
typedef enum {
	CLOCK_IN_DEFAULT,	/*!< Just use default (power-up) clock input.      */
	CLOCK_IN_CLIA,		/*!< Use the CLIA clock source (Stereo DAC
				   default) .                 */
	CLOCK_IN_CLIB,		/*!< Use the CLIB clock source (Voice CODEC
				   default) .                 */
	CLOCK_IN_CLKIN,		/*!< Use the CLKIN clock source
				   .                     */
	CLOCK_IN_MCLK,		/*!< Disable the internal PLL and use the MCLK
				   clock source (Stereo DAC only)
				   .                     */
	CLOCK_IN_FSYNC,		/*!< Internal PLL input from external framesync
				   (Stereo DAC only) .   */
	CLOCK_IN_BITCLK		/*!< Internal PLL input from external bitclock
				   (Stereo DAC only)     */
} PMIC_AUDIO_CLOCK_IN_SOURCE;

/*!
 * @enum PMIC_AUDIO_CLOCK_INVERT
 * @brief Select whether to invert the frame sync or bit clock signals.
 *
 * This enumeration enables or disables the inversion of the incoming
 * frame sync or bit clock signals.
 */
typedef enum {
	NO_INVERT = 0,		/*!< Do not invert the clock signals.    */
	INVERT_BITCLOCK = 1,	/*!< Invert the BCLK input signal.       */
	INVERT_FRAMESYNC = 2	/*!< Invert the FSYNC input signal.      */
} PMIC_AUDIO_CLOCK_INVERT;

/*!
 * @enum PMIC_AUDIO_NUMSLOTS
 * @brief Select whether to invert the frame sync or bit clock signals.
 *
 * This enumeration defines all of the possible number of timeslots that may
 * be selected when the PMIC is configured as the data bus master. One of these
 * options must be selected if the Stereo DAC is to provide the data bus
 * clock signals.
 *
 * Note that the Voice CODEC currently only allows USE_4_TIMESLOTS when
 * operating in data bus master mode.
 */
typedef enum {
	USE_2_TIMESLOTS,	/*!< Configure for 2 timeslots. */
	USE_4_TIMESLOTS,	/*!< Configure for 4 timeslots. */
	USE_8_STAR_TIMESLOTS,	/*!< Configure for 8 (Left, Right, 6 other) timeslots. */
	USE_8_TIMESLOTS		/*!< Configure for 8 timeslots. */
} PMIC_AUDIO_NUMSLOTS;

/*!
 * @enum PMIC_AUDIO_STDAC_SAMPLING_RATE
 * @brief Select the audio data sampling rate for the Stereo DAC.
 *
 * This enumeration defines all of the possible sampling rates currently
 * supported by the Stereo DAC. One of these sampling rates must be selected
 * and it must match that of the audio stream or else signal distortion will
 * occur.
 */
typedef enum {
	STDAC_RATE_8_KHZ,	/*!< Use 8 kHz sampling rate.      */
	STDAC_RATE_11_025_KHZ,	/*!< Use 11.025 kHz sampling rate. */
	STDAC_RATE_12_KHZ,	/*!< Use 12 kHz sampling rate.     */
	STDAC_RATE_16_KHZ,	/*!< Use 16 kHz sampling rate.     */
	STDAC_RATE_22_050_KHZ,	/*!< Use 22.050 kHz sampling rate. */
	STDAC_RATE_24_KHZ,	/*!< Use 24 kHz sampling rate.     */
	STDAC_RATE_32_KHZ,	/*!< Use 32 kHz sampling rate.     */
	STDAC_RATE_44_1_KHZ,	/*!< Use 44.1 kHz sampling rate.   */
	STDAC_RATE_48_KHZ,	/*!< Use 48 kHz sampling rate.     */
	STDAC_RATE_64_KHZ,	/*!< Use 64 kHz sampling rate
				   .          */
	STDAC_RATE_96_KHZ	/*!< Use 96 kHz sampling rate.
				   .          */
} PMIC_AUDIO_STDAC_SAMPLING_RATE;

/*!
 * @enum PMIC_AUDIO_VCODEC_SAMPLING_RATE
 * @brief Select the audio data sampling rate for the Voice CODEC.
 *
 * This enumeration defines all of the possible sampling rates currently
 * supported by the Voice CODEC. One of these sampling rates must be selected
 * and it must match that of the audio stream or else signal distortion will
 * occur.
 */
typedef enum {
	VCODEC_RATE_8_KHZ,	/*!< Use 8 kHz sampling rate.      */
	VCODEC_RATE_16_KHZ,	/*!< Use 16 kHz sampling rate.     */
} PMIC_AUDIO_VCODEC_SAMPLING_RATE;

/*!
 * @enum PMIC_AUDIO_ANTI_POP_RAMP_SPEED
 * @brief Select the anti-pop circuitry's ramp up speed.
 *
 * This enumeration defines all of the possible ramp up speeds for the
 * anti-pop circuitry. A slow ramp up speed may be required in order to
 * avoid the popping noise that is typically generated during the insertion
 * or removal of a headset or microphone.
 */
typedef enum {
	ANTI_POP_RAMP_FAST,	/*!< Select fast ramp up.          */
	ANTI_POP_RAMP_SLOW	/*!< Select slow ramp up.          */
} PMIC_AUDIO_ANTI_POP_RAMP_SPEED;

/*@}*/

/*!
 * @name General Voice CODEC Configuration Typedefs and Enumerations
 * Typedefs and enumerations that are used to define and configure
 * the basic operating options for the Voice CODEC.
 */
/*@{*/

/*!
 * @enum PMIC_AUDIO_VCODEC_CLOCK_IN_FREQ
 * @brief Select the Voice CODEC input clock frequency.
 *
 * This enumeration defines all of the supported Voice CODEC input clock
 * frequencies. One of these frequencies must be selected in order to
 * properly configure the Voice CODEC to operate at the required sampling
 * rate.
 */
typedef enum {
	VCODEC_CLI_13MHZ,	/*!< Clock frequency is 13MHz.    */
	VCODEC_CLI_15_36MHZ,	/*!< Clock frequency is 15.36MHz. */
	VCODEC_CLI_16_8MHZ,	/*!< Clock frequency is 16.8MHz
				   .         */
	VCODEC_CLI_26MHZ,	/*!< Clock frequency is 26MHz.    */
	VCODEC_CLI_33_6MHZ,	/*!< Clock frequency is 33.6MHz.  */
} PMIC_AUDIO_VCODEC_CLOCK_IN_FREQ;

/*!
 * @enum PMIC_AUDIO_VCODEC_CONFIG
 * @brief Select the Voice CODEC configuration options.
 *
 * This enumeration is used to enable/disable each of the Voice CODEC options.
 * This includes the use of highpass digital filters and audio signal
 * loopback modes.
 *
 * Note that resetting the digital filters is now handled by the
 * pmic_audio_digital_filter_reset() API.
 */
typedef enum {
	DITHERING = 1,		/*!< Enable/disable dithering.      */
	INPUT_HIGHPASS_FILTER = 2,	/*!< Enable/disable the input high
					   pass digital filter.           */
	OUTPUT_HIGHPASS_FILTER = 4,	/*!< Enable/disable the output high
					   pass digital filter.           */
	ANALOG_LOOPBACK = 8,	/*!< Enable/disable the analog
				   loopback path
				   .           */
	DIGITAL_LOOPBACK = 16,	/*!< Enable/disable the digital
				   loopback path.                 */
	VCODEC_MASTER_CLOCK_OUTPUTS = 32,	/*!< Enable/disable the bus master
						   clock outputs.                 */
	TRISTATE_TS = 64	/*!< Enable/disable FSYNC, BITCLK,
				   and TX tristate.               */
} PMIC_AUDIO_VCODEC_CONFIG;

/*@}*/

/*!
 * @name General Stereo DAC Configuration Typedefs and Enumerations
 * Typedefs and enumerations that are used to define and configure
 * the basic operating options for the Stereo DAC.
 */
/*@{*/

/*!
 * @enum PMIC_AUDIO_STDAC_CLOCK_IN_FREQ
 * @brief Select the Stereo DAC input clock frequency.
 *
 * This enumeration defines all of the supported Stereo DAC input clock
 * frequencies. One of these frequencies must be selected in order to
 * properly configure the Stereo DAC to operate at the required sampling
 * rate.
 */
typedef enum {
	STDAC_CLI_3_36864MHZ,	/*!< Clock frequency is 3.36864MHz
				   .                */
	STDAC_CLI_12MHZ,	/*!< Clock frequency is 12MHz.
				   .                */
	STDAC_CLI_13MHZ,	/*!< Clock frequency is 13MHz.           */
	STDAC_CLI_15_36MHZ,	/*!< Clock frequency is 15.36MHz.        */
	STDAC_CLI_16_8MHZ,	/*!< Clock frequency is 16.8MHz
				   .                */
	STDAC_CLI_26MHZ,	/*!< Clock frequency is 26MHz.           */
	STDAC_CLI_33_6MHZ,	/*!< Clock frequency is 33.6MHz.         */
	STDAC_MCLK_PLL_DISABLED,	/*!< Use MCLK and disable internal PLL.  */
	STDAC_FSYNC_IN_PLL,	/*!< Use FSYNC as internal PLL input.    */
	STDAC_BCLK_IN_PLL	/*!< Use BCLK as internal PLL input.     */
} PMIC_AUDIO_STDAC_CLOCK_IN_FREQ;

/*!
 * @enum PMIC_AUDIO_STDAC_CONFIG
 * @brief Select the Stereo DAC configuration options.
 *
 * This enumeration is used to enable/disable each of the Stereo DAC options.
 */
typedef enum {
	STDAC_MASTER_CLOCK_OUTPUTS = 1	/*!< Enable/disable the bus master clock
					   outputs.                             */
} PMIC_AUDIO_STDAC_CONFIG;

/*@}*/

/*!
 * @name Voice CODEC Audio Port Mixing Typedefs and Enumerations
 * Typedefs and enumerations that are used for setting up the audio mixer
 * within the Voice CODEC.
 */
/*@{*/

/*!
 * @enum PMIC_AUDIO_VCODEC_TIMESLOT
 * @brief Select the Stereo DAC configuration options.
 *
 * This enumeration is used to select the timeslot for both the primary and
 * secondary (for mc13783-only) audio channels to the Voice CODEC.
 */
typedef enum {
	USE_TS0,		/*!< Use timeslot 0 for audio signal source
				   .                    */
	USE_TS1,		/*!< Use timeslot 1 for audio signal source
				   .                    */
	USE_TS2,		/*!< Use timeslot 2 for audio signal source
				   .                    */
	USE_TS3			/*!< Use timeslot 3 for audio signal source
				   .                    */
} PMIC_AUDIO_VCODEC_TIMESLOT;

/*!
 * @enum PMIC_AUDIO_VCODEC_MIX_IN_GAIN
 * @brief Select the secondary channel input gain for the Voice CODEC mixer.
 *
 * This enumeration selects the secondary channel input gain for the Voice
 * CODEC mixer.
 */
typedef enum {
	VCODEC_NO_MIX,		/*!< No audio mixing .  */
	VCODEC_MIX_IN_0DB,	/*!< Mix with 0dB secondary channel gain
				   .                  */
	VCODEC_MIX_IN_MINUS_6DB,	/*!< Mix with -6dB secondary channel gain
					   .                  */
	VCODEC_MIX_IN_MINUS_12DB,	/*!< Mix with -12dB secondary channel gain
					   .                  */
} PMIC_AUDIO_VCODEC_MIX_IN_GAIN;

/*!
 * @enum PMIC_AUDIO_VCODEC_MIX_OUT_GAIN
 * @brief Select the output gain for the Voice CODEC mixer.
 *
 * This enumeration selects the output gain for the Voice CODEC mixer.
 */
typedef enum {
	VCODEC_MIX_OUT_0DB,	/*!< Select 0dB mixer output gain
				   .                  */
	VCODEC_MIX_OUT_MINUS_6DB,	/*!< Select -6dB mixer output gain
					   .                  */
} PMIC_AUDIO_VCODEC_MIX_OUT_GAIN;

/*@}*/

/*!
 * @name Stereo DAC Audio Port Mixing Typedefs and Enumerations
 * Typedefs and enumerations that are used for setting up the audio mixer
 * within the Stereo DAC.
 */
/*@{*/

/*!
 * @enum PMIC_AUDIO_STDAC_TIMESLOTS
 * @brief Select the timeslots used to transmit the left and right audio
 *        channels to the Stereo DAC.
 *
 * This enumeration is used to select the timeslots used to transmit the
 * data corresponding to the left and right audio channels to the Stereo
 * DAC.
 */
typedef enum {
	USE_TS0_TS1,		/*!< Use timeslots 0 and 1 for left and
				   right channels, respectively.      */
	USE_TS2_TS3,		/*!< Use timeslots 2 and 3 for left and
				   right channels, respectively
				   .               */
	USE_TS4_TS5,		/*!< Use timeslots 4 and 5 for left and
				   right channels, respectively
				   .               */
	USE_TS6_TS7		/*!< Use timeslots 6 and 7 for left and
				   right channels, respectively
				   .               */
} PMIC_AUDIO_STDAC_TIMESLOTS;

/*!
 * @enum PMIC_AUDIO_STDAC_MIX_IN_GAIN
 * @brief Select the secondary channel input gain for the Stereo DAC mixer.
 *
 * This enumeration is used to select the secondary channel input gain for
 * the Stereo DAC mixer.
 */
typedef enum {
	STDAC_NO_MIX,		/*!< No mixing, keep separate left
				   and right audio channels.         */
	STDAC_MIX_IN_0DB,	/*!< Mix left and right audio channels
				   together with 0dB secondary
				   channel gain.                     */
	STDAC_MIX_IN_MINUS_6DB,	/*!< Mix left and right audio channels
				   together with -6dB secondary
				   channel gain.                     */
	STDAC_MIX_IN_MINUS_12DB	/*!< Mix left and right audio channels
				   together with -12dB secondary
				   channel gain . */
} PMIC_AUDIO_STDAC_MIX_IN_GAIN;

/*!
 * @enum PMIC_AUDIO_STDAC_MIX_OUT_GAIN
 * @brief Select the output gain for the Stereo DAC mixer.
 *
 * This enumeration is used to select the output gain for the Stereo DAC
 * mixer.
 */
typedef enum {
	STDAC_MIX_OUT_0DB,	/*!< Select 0dB mixer output gain.     */
	STDAC_MIX_OUT_MINUS_6DB,	/*!< Select -6dB mixer output gain
					   .              */
} PMIC_AUDIO_STDAC_MIX_OUT_GAIN;

/*@}*/

/*!
 * @name Microphone Input Typedefs and Enumerations
 * Typedefs and enumerations that are used for selecting and setting up
 * one or more or microphone inputs for recording.
 */
/*@{*/

/*!
 * @enum PMIC_AUDIO_MIC_BIAS
 * @brief Select the microphone bias circuit to be enabled/disabled.
 *
 * This enumeration lists all of the available microphone bias circuits that
 * may be enabled or disabled.
 */
typedef enum {
	NO_BIAS = 0,		/*!< No microphone bias circuit selected.      */
	MIC_BIAS1 = 1,		/*!< Enable/disable microphone bias 1 circuit. */
	MIC_BIAS2 = 2,		/*!< Enable/disable microphone bias 2 circuit. */
} PMIC_AUDIO_MIC_BIAS;

/*!
 * @enum PMIC_AUDIO_INPUT_PORT
 * @brief Select an audio input port for recording.
 *
 * This enumeration lists all of the available audio input ports that may
 * be selected for a recording operation.
 */
typedef enum {
	NO_MIC,			/*!< No microphone input selected.               */
	MIC1_LEFT,		/*!< Enable left/mono channel microphone input
				   .                        */
	MIC1_RIGHT_MIC_MONO,	/*!< Enable right channel microphone input.      */
	MIC2_AUX,		/*!< Enable auxiliary microphone input.          */
	TXIN_EXT		/*!< Enable external mono input.                 */
} PMIC_AUDIO_INPUT_PORT;

/*!
 * @enum PMIC_AUDIO_INPUT_MIC_STATE
 * @brief Control whether the input microphone is on/off.
 *
 * This enumeration allows the currently selected input microphone amplifier
 * to be turned on/off.
 */
typedef enum {
	MICROPHONE_ON,		/*!< Turn microphone input on for recording. */
	MICROPHONE_OFF		/*!< Turn microphone input off (mute).       */
} PMIC_AUDIO_INPUT_MIC_STATE;

/*!
 * @enum PMIC_AUDIO_INPUT_CONFIG
 * @brief Enable/disable the audio input options.
 *
 * This enumeration allows for enabling/disabling any of the audio input
 * section options.
 */
typedef enum {
	MIC_AMP_AUTO_DISABLE = 1	/*!< Enable/disable automatic disabling of
					   microphone input amplifiers following
					   headset insertion/removal          */
} PMIC_AUDIO_INPUT_CONFIG;

/*!
 * @enum PMIC_AUDIO_MIC_AMP_MODE
 * @brief Select the operating mode for the microphone amplifiers.
 *
 * This enumeration is used to select the operating mode for the microphone
 * amplifier.
 */
typedef enum {
	AMP_OFF,		/*!< Disable input amplifier.   */
	VOLTAGE_TO_VOLTAGE,	/*!< Operate input amplifier in
				   voltage-to-voltage mode
				   .       */
	CURRENT_TO_VOLTAGE	/*!< Operate input amplifier in
				   current-to-voltage mode    */
} PMIC_AUDIO_MIC_AMP_MODE;

/*!
 * @enum PMIC_AUDIO_MIC_GAIN
 * @brief Select the microphone amplifier gain level.
 *
 * This enumeration lists all of the available microphone amplifier gain
 * levels.
 */
typedef enum {
	MIC_GAIN_MINUS_8DB,	/*!< Select -8dB microphone amplifier gain
				   .                   */
	MIC_GAIN_MINUS_7DB,	/*!< Select -7dB microphone amplifier gain
				   .              */
	MIC_GAIN_MINUS_6DB,	/*!< Select -6dB microphone amplifier gain
				   .                   */
	MIC_GAIN_MINUS_5DB,	/*!< Select -5dB microphone amplifier gain
				   .                   */
	MIC_GAIN_MINUS_4DB,	/*!< Select -4dB microphone amplifier gain
				   .                   */
	MIC_GAIN_MINUS_3DB,	/*!< Select -3dB microphone amplifier gain
				   .                   */
	MIC_GAIN_MINUS_2DB,	/*!< Select -2dB microphone amplifier gain
				   .                   */
	MIC_GAIN_MINUS_1DB,	/*!< Select -1dB microphone amplifier gain
				   .                   */
	MIC_GAIN_0DB,		/*!< Select 0dB microphone amplifier gain.  */
	MIC_GAIN_PLUS_1DB,	/*!< Select 1dB microphone amplifier gain.  */
	MIC_GAIN_PLUS_2DB,	/*!< Select 2dB microphone amplifier gain.  */
	MIC_GAIN_PLUS_3DB,	/*!< Select 3dB microphone amplifier gain.  */
	MIC_GAIN_PLUS_4DB,	/*!< Select 4dB microphone amplifier gain.  */
	MIC_GAIN_PLUS_5DB,	/*!< Select 5dB microphone amplifier gain.  */
	MIC_GAIN_PLUS_6DB,	/*!< Select 6dB microphone amplifier gain.  */
	MIC_GAIN_PLUS_7DB,	/*!< Select 7dB microphone amplifier gain.  */
	MIC_GAIN_PLUS_8DB,	/*!< Select 8dB microphone amplifier gain.  */
	MIC_GAIN_PLUS_9DB,	/*!< Select 9dB microphone amplifier gain.  */
	MIC_GAIN_PLUS_10DB,	/*!< Select 10dB microphone amplifier gain. */
	MIC_GAIN_PLUS_11DB,	/*!< Select 11dB microphone amplifier gain. */
	MIC_GAIN_PLUS_12DB,	/*!< Select 12dB microphone amplifier gain. */
	MIC_GAIN_PLUS_13DB,	/*!< Select 13dB microphone amplifier gain. */
	MIC_GAIN_PLUS_14DB,	/*!< Select 14dB microphone amplifier gain. */
	MIC_GAIN_PLUS_15DB,	/*!< Select 15dB microphone amplifier gain. */
	MIC_GAIN_PLUS_16DB,	/*!< Select 16dB microphone amplifier gain. */
	MIC_GAIN_PLUS_17DB,	/*!< Select 17dB microphone amplifier gain. */
	MIC_GAIN_PLUS_18DB,	/*!< Select 18dB microphone amplifier gain. */
	MIC_GAIN_PLUS_19DB,	/*!< Select 19dB microphone amplifier gain. */
	MIC_GAIN_PLUS_20DB,	/*!< Select 20dB microphone amplifier gain. */
	MIC_GAIN_PLUS_21DB,	/*!< Select 21dB microphone amplifier gain. */
	MIC_GAIN_PLUS_22DB,	/*!< Select 22dB microphone amplifier gain. */
	MIC_GAIN_PLUS_23DB,	/*!< Select 23dB microphone amplifier gain. */
	MIC_GAIN_PLUS_24DB,	/*!< Select 24dB microphone amplifier gain
				   .              */
	MIC_GAIN_PLUS_25DB,	/*!< Select 25dB microphone amplifier gain
				   .              */
	MIC_GAIN_PLUS_26DB,	/*!< Select 26dB microphone amplifier gain
				   .              */
	MIC_GAIN_PLUS_27DB,	/*!< Select 27dB microphone amplifier gain
				   .              */
	MIC_GAIN_PLUS_28DB,	/*!< Select 28dB microphone amplifier gain
				   .              */
	MIC_GAIN_PLUS_29DB,	/*!< Select 29dB microphone amplifier gain
				   .              */
	MIC_GAIN_PLUS_30DB,	/*!< Select 30dB microphone amplifier gain
				   .              */
	MIC_GAIN_PLUS_31DB	/*!< Select 31dB microphone amplifier gain
				   .              */
} PMIC_AUDIO_MIC_GAIN;

/*@}*/

/*!
 * @name Audio Output Section Typedefs and Enumerations
 * Typedefs and enumerations that are used for selecting and setting up
 * one or more or audio output ports for playback.
 */
/*@{*/

/*!
 * @enum PMIC_AUDIO_OUTPUT_PORT
 * @brief Select the audio output port.
 *
 * This enumeration lists all of the available audio output ports. One or
 * more may be selected as desired to handle the output audio stream from
 * either the Voice CODEC or the Stereo DAC.
 */
typedef enum {
	MONO_SPEAKER = 1,	/*!< Select mono output speaker.            */
	MONO_LOUDSPEAKER = 2,	/*!< Select mono loudspeaker
				   .                   */
	MONO_ALERT = 4,		/*!< Select mono alert output               */
	MONO_EXTOUT = 8,	/*!< Select mono external output            */
	MONO_CDCOUT = 16,	/*!< Select dedicated Voice CODEC output
				   .                   */
	STEREO_LEFT_LOW_POWER = 32,	/*!< Select stereo left channel low power
					   output .            */
	STEREO_HEADSET_LEFT = 64,	/*!< Select stereo headset left channel.    */
	STEREO_HEADSET_RIGHT = 128,	/*!< Select stereo headset right channel.   */
	STEREO_OUT_LEFT = 256,	/*!< Select stereo external left channel
				   output .            */
	STEREO_OUT_RIGHT = 512	/*!< Select stereo external right channel
				   output .            */
} PMIC_AUDIO_OUTPUT_PORT;

/*!
 * @enum PMIC_AUDIO_OUTPUT_CONFIG
 * @brief Enable/disable the audio output section options.
 *
 * This enumeration is used to enable/disable any of the audio output section
 * options.
 */
typedef enum {
	MONO_SPEAKER_INVERT_OUT_ONLY = 1,	/*!< Enable/disable the non-inverted
						   mono speaker output          */
	MONO_LOUDSPEAKER_COMMON_BIAS = 2,	/*!< Enable/disable the loudspeaker
						   output amplifier common bias
						   .            */
	HEADSET_DETECT_ENABLE = 4,	/*!< Enable/disable headset
					   insertion/removal detection
					   .            */
	STEREO_HEADSET_AMP_AUTO_DISABLE = 8	/*!< Enable/disable automatic
						   disabling of the stereo headset
						   output amplifiers following
						   headset insertion/removal.      */
} PMIC_AUDIO_OUTPUT_CONFIG;

/*!
 * @enum PMIC_AUDIO_STEREO_IN_GAIN
 * @brief Select the amplifier gain for the external stereo inputs.
 *
 * This enumeration is used to select the amplifier gain level to be used for
 * the external stereo inputs.
 */
typedef enum {
	STEREO_IN_GAIN_0DB,	/*!< Select 0dB external stereo signal
				   input gain.                        */
	STEREO_IN_GAIN_PLUS_18DB	/*!< Select 18dB external stereo signal
					   input gain .    */
} PMIC_AUDIO_STEREO_IN_GAIN;

/*!
 * @enum PMIC_AUDIO_OUTPUT_PGA_GAIN
 * @brief Select the output PGA amplifier gain level.
 *
 * This enumeration is used to select the output PGA amplifier gain level.
 */
typedef enum {
	OUTPGA_GAIN_MINUS_33DB,	/*!< Select -33dB output PGA gain
				   .          */
	OUTPGA_GAIN_MINUS_30DB,	/*!< Select -30dB output PGA gain
				   .          */
	OUTPGA_GAIN_MINUS_27DB,	/*!< Select -27dB output PGA gain
				   .          */
	OUTPGA_GAIN_MINUS_24DB,	/*!< Select -24dB output PGA gain. */
	OUTPGA_GAIN_MINUS_21DB,	/*!< Select -21dB output PGA gain. */
	OUTPGA_GAIN_MINUS_18DB,	/*!< Select -18dB output PGA gain. */
	OUTPGA_GAIN_MINUS_15DB,	/*!< Select -15dB output PGA gain. */
	OUTPGA_GAIN_MINUS_12DB,	/*!< Select -12dB output PGA gain. */
	OUTPGA_GAIN_MINUS_9DB,	/*!< Select -9dB output PGA gain.  */
	OUTPGA_GAIN_MINUS_6DB,	/*!< Select -6dB output PGA gain.  */
	OUTPGA_GAIN_MINUS_3DB,	/*!< Select -3dB output PGA gain.  */
	OUTPGA_GAIN_0DB,	/*!< Select 0dB output PGA gain.   */
	OUTPGA_GAIN_PLUS_3DB,	/*!< Select 3dB output PGA gain.   */
	OUTPGA_GAIN_PLUS_6DB,	/*!< Select 6dB output PGA gain.   */
	OUTPGA_GAIN_PLUS_9DB,	/*!< Select 9dB output PGA gain.
				   .     */
	OUTPGA_GAIN_PLUS_12DB,	/*!< Select 12dB output PGA gain
				   .     */
	OUTPGA_GAIN_PLUS_15DB,	/*!< Select 15dB output PGA gain
				   .     */
	OUTPGA_GAIN_PLUS_18DB,	/*!< Select 18dB output PGA gain
				   .     */
	OUTPGA_GAIN_PLUS_21DB	/*!< Select 21dB output PGA gain
				   .     */
} PMIC_AUDIO_OUTPUT_PGA_GAIN;

/*!
 * @enum PMIC_AUDIO_OUTPUT_BALANCE_GAIN
 * @brief Select the left/right channel balance gain level.
 *
 * This enumeration is used to select the balance gain level that is to be
 * separately applied to the left and right audio channels.
 */
typedef enum {
	BAL_GAIN_MINUS_21DB,	/*!< Select -21dB channel balance
				   gain .        */
	BAL_GAIN_MINUS_18DB,	/*!< Select -18dB channel balance
				   gain .        */
	BAL_GAIN_MINUS_15DB,	/*!< Select -15dB channel balance
				   gain .        */
	BAL_GAIN_MINUS_12DB,	/*!< Select -12dB channel balance
				   gain .        */
	BAL_GAIN_MINUS_9DB,	/*!< Select -9dB channel balance
				   gain .        */
	BAL_GAIN_MINUS_6DB,	/*!< Select -6dB channel balance
				   gain .        */
	BAL_GAIN_MINUS_3DB,	/*!< Select -3dB channel balance
				   gain .        */
	BAL_GAIN_0DB		/*!< Select 0dB channel balance gain. */
} PMIC_AUDIO_OUTPUT_BALANCE_GAIN;

/*!
 * @enum PMIC_AUDIO_MONO_ADDER_MODE
 * @brief Select the output mono adder operating mode.
 *
 * This enumeration is used to select the operating mode for the mono adder
 * in the audio output section.
 */
typedef enum {
	MONO_ADDER_OFF,		/*!< Disable mono adder (keep separate
				   left and right channels).         */
	MONO_ADD_LEFT_RIGHT,	/*!< Add left and right channels.      */
	MONO_ADD_OPPOSITE_PHASE,	/*!< Add left and right channels but
					   with outputs in opposite phase
					   .              */
	STEREO_OPPOSITE_PHASE	/*!< Keep separate left and right
				   channels but invert phase of
				   left channel . */
} PMIC_AUDIO_MONO_ADDER_MODE;

/*!
 * @enum PMIC_AUDIO_MONO_ADDER_OUTPUT_GAIN
 * @brief Select the mono adder output amplifier gain level.
 *
 * This enumeration is used to select the output amplifier gain level for
 * the mono adder.
 */
typedef enum {
	MONOADD_GAIN_MINUS_6DB,	/*!< Select -6dB mono adder output gain
				   .          */
	MONOADD_GAIN_MINUS_3DB,	/*!< Select -3dB mono adder output gain
				   .          */
	MONOADD_GAIN_0DB	/*!< Select 0dB mono adder output gain. */
} PMIC_AUDIO_MONO_ADDER_OUTPUT_GAIN;

/*@}*/

/***************************************************************************
 *                       PMIC-SPECIFIC DEFINITIONS                         *
 ***************************************************************************/

/*!
 * @name Definition of PMIC-specific Capabilities
 * Constants that are used to define PMIC-specific capabilities.
 */
/*@{*/

/*!
 * Define the minimum Stereo DAC sampling rate (Hz).
 */
extern const unsigned MIN_STDAC_SAMPLING_RATE_HZ;
/*!
 * Define the maximum Stereo DAC sampling rate (Hz).
 */
extern const unsigned MAX_STDAC_SAMPLING_RATE_HZ;

/*@}*/

#define DEBUG_AUDIO

#ifdef __KERNEL__

/***************************************************************************
 *                          PMIC API DEFINITIONS                           *
 ***************************************************************************/

/*!
 * @name General Setup and Configuration APIs
 * Functions for general setup and configuration of the PMIC Audio
 * hardware.
 */
/*@{*/

/*!
 * This function enables the Headset detection mechanism in hardware
 */
PMIC_STATUS pmic_audio_set_autodetect(int val);

/*!
 * @brief Request exclusive access to the PMIC Audio hardware.
 *
 * Attempt to open and gain exclusive access to a key PMIC audio hardware
 * component (e.g., the Stereo DAC or the Voice CODEC). Depending upon the
 * type of audio operation that is desired and the nature of the audio data
 * stream, the Stereo DAC and/or the Voice CODEC will be a required hardware
 * component and needs to be acquired by calling this function.
 *
 * If the open request is successful, then a numeric handle is returned
 * and this handle must be used in all subsequent function calls to complete
 * the configuration of either the Stereo DAC or the Voice CODEC and along
 * with any other associated audio hardware components that will be needed.
 *
 * The same handle must also be used in the close call when use of the PMIC
 * audio hardware is no longer required.
 *
 * The open request will fail if the requested audio hardware component has
 * already been acquired by a previous open call but not yet closed.
 *
 * @param[out]  handle          Device handle to be used for subsequent PMIC
 *                              Connectivity API calls.
 * @param[in]   device          The required PMIC audio hardware component.
 *
 * @retval      PMIC_SUCCESS         If the open request was successful
 * @retval      PMIC_PARAMETER_ERROR If the handle argument is NULL.
 * @retval      PMIC_ERROR           If the audio hardware component is
 *                                   unavailable.
 */
PMIC_STATUS pmic_audio_open(PMIC_AUDIO_HANDLE * const handle,
			    const PMIC_AUDIO_SOURCE device);

/*!
 * @brief Terminate further access to the PMIC audio hardware.
 *
 * Terminate further access to the PMIC audio hardware that was previously
 * acquired by calling pmic_audio_open(). This now allows another thread to
 * successfully call pmic_audio_open() to gain access.
 *
 * @param[in]   handle          Device handle from pmic_audio_open() call.
 *
 * @retval      PMIC_SUCCESS         If the close request was successful.
 * @retval      PMIC_PARAMETER_ERROR If the handle is invalid.
 */
PMIC_STATUS pmic_audio_close(const PMIC_AUDIO_HANDLE handle);

/*!
 * @brief Configure the data bus protocol to be used.
 *
 * Provide the parameters needed to properly configure the audio data bus
 * protocol so that data can be read/written to either the Stereo DAC or
 * the Voice CODEC.
 *
 * @param[in]   handle          Device handle from pmic_audio_open() call.
 * @param[in]   busID           Select data bus to be used.
 * @param[in]   protocol        Select the data bus protocol.
 * @param[in]   masterSlave     Select the data bus timing mode.
 * @param[in]   numSlots        Define the number of timeslots (only if in
 *                              master mode).
 *
 * @retval      PMIC_SUCCESS         If the protocol was successful configured.
 * @retval      PMIC_PARAMETER_ERROR If the handle or the protocol parameters
 *                                   are invalid.
 */
PMIC_STATUS pmic_audio_set_protocol(const PMIC_AUDIO_HANDLE handle,
				    const PMIC_AUDIO_DATA_BUS busID,
				    const PMIC_AUDIO_BUS_PROTOCOL protocol,
				    const PMIC_AUDIO_BUS_MODE masterSlave,
				    const PMIC_AUDIO_NUMSLOTS numSlots);

/*!
 * @brief Retrieve the current data bus protocol configuration.
 *
 * Retrieve the parameters that define the current audio data bus protocol.
 *
 * @param[in]   handle          Device handle from pmic_audio_open() call.
 * @param[out]  busID           The data bus being used.
 * @param[out]  protocol        The data bus protocol being used.
 * @param[out]  masterSlave     The data bus timing mode being used.
 * @param[out]  numSlots        The number of timeslots being used (if in
 *                              master mode).
 *
 * @retval      PMIC_SUCCESS         If the protocol was successful retrieved.
 * @retval      PMIC_PARAMETER_ERROR If the handle is invalid.
 */
PMIC_STATUS pmic_audio_get_protocol(const PMIC_AUDIO_HANDLE handle,
				    PMIC_AUDIO_DATA_BUS * const busID,
				    PMIC_AUDIO_BUS_PROTOCOL * const protocol,
				    PMIC_AUDIO_BUS_MODE * const masterSlave,
				    PMIC_AUDIO_NUMSLOTS * const numSlots);

/*!
 * @brief Enable the Stereo DAC or the Voice CODEC.
 *
 * Explicitly enable the Stereo DAC or the Voice CODEC to begin audio
 * playback or recording as required. This should only be done after
 * successfully configuring all of the associated audio components (e.g.,
 * microphones, amplifiers, etc.).
 *
 * @param[in]   handle          Device handle from pmic_audio_open() call.
 *
 * @retval      PMIC_SUCCESS         If the device was successful enabled.
 * @retval      PMIC_PARAMETER_ERROR If the handle is invalid.
 * @retval      PMIC_ERROR           If the device could not be enabled.
 */
PMIC_STATUS pmic_audio_enable(const PMIC_AUDIO_HANDLE handle);

/*!
 * @brief Disable the Stereo DAC or the Voice CODEC.
 *
 * Explicitly disable the Stereo DAC or the Voice CODEC to end audio
 * playback or recording as required.
 *
 * @param[in]   handle          Device handle from pmic_audio_open() call.
 *
 * @retval      PMIC_SUCCESS         If the device was successful disabled.
 * @retval      PMIC_PARAMETER_ERROR If the handle is invalid.
 * @retval      PMIC_ERROR           If the device could not be disabled.
 */
PMIC_STATUS pmic_audio_disable(const PMIC_AUDIO_HANDLE handle);

/*!
 * @brief Reset the selected audio hardware control registers to their
 *        power on state.
 *
 * This resets all of the audio hardware control registers currently
 * associated with the device handle back to their power on states. For
 * example, if the handle is associated with the Stereo DAC and a
 * specific output port and output amplifiers, then this function will
 * reset all of those components to their power on state.
 *
 * @param[in]   handle          Device handle from pmic_audio_open() call.
 *
 * @retval      PMIC_SUCCESS         If the reset operation was successful.
 * @retval      PMIC_PARAMETER_ERROR If the handle is invalid.
 * @retval      PMIC_ERROR           If the reset was unsuccessful.
 */
PMIC_STATUS pmic_audio_reset(const PMIC_AUDIO_HANDLE handle);

/*!
 * @brief Reset all audio hardware control registers to their power on state.
 *
 * This resets all of the audio hardware control registers back to their
 * power on states. Use this function with care since it also invalidates
 * (i.e., automatically closes) all currently opened device handles.
 *
 * @retval      PMIC_SUCCESS         If the reset operation was successful.
 * @retval      PMIC_ERROR           If the reset was unsuccessful.
 */
PMIC_STATUS pmic_audio_reset_all(void);

/*!
 * @brief Set the Audio callback function.
 *
 * Register a callback function that will be used to signal PMIC audio
 * events. For example, the OSS audio driver should register a callback
 * function in order to be notified of headset connect/disconnect events.
 *
 * @param[in]   func            A pointer to the callback function.
 * @param[in]   eventMask       A mask selecting events to be notified.
 * @param[in]   hs_state        To know the headset state.
 *
 * @retval      PMIC_SUCCESS         If the callback was successfully
 *                                   registered.
 * @retval      PMIC_PARAMETER_ERROR If the handle or the eventMask is invalid.
 */
PMIC_STATUS pmic_audio_set_callback(void *func,
				    const PMIC_AUDIO_EVENTS eventMask,
				    PMIC_HS_STATE *hs_state);

/*!
 * @brief Deregisters the existing audio callback function.
 *
 * Deregister the callback function that was previously registered by calling
 * pmic_audio_set_callback().
 *
 *
 * @retval      PMIC_SUCCESS         If the callback was successfully
 *                                   deregistered.
 * @retval      PMIC_PARAMETER_ERROR If the handle is invalid.
 */
PMIC_STATUS pmic_audio_clear_callback(void);

/*!
 * @brief Get the current audio callback function settings.
 *
 * Get the current callback function and event mask.
 *
 * @param[out]  func            The current callback function.
 * @param[out]  eventMask       The current event selection mask.
 *
 * @retval      PMIC_SUCCESS         If the callback information was
 *                                   successfully retrieved.
 * @retval      PMIC_PARAMETER_ERROR If the handle is invalid.
 */
PMIC_STATUS pmic_audio_get_callback(PMIC_AUDIO_CALLBACK * const func,
				    PMIC_AUDIO_EVENTS * const eventMask);

/*!
 * @brief Enable the anti-pop circuitry to avoid extra noise when inserting
 *        or removing a external device (e.g., a headset).
 *
 * Enable the use of the built-in anti-pop circuitry to prevent noise from
 * being generated when an external audio device is inserted or removed
 * from an audio plug. A slow ramp speed may be needed to avoid extra noise.
 *
 * @param[in]   rampSpeed       The desired anti-pop circuitry ramp speed.
 *
 * @retval      PMIC_SUCCESS         If the anti-pop circuitry was successfully
 *                                   enabled.
 * @retval      PMIC_ERROR           If the anti-pop circuitry could not be
 *                                   enabled.
 */
PMIC_STATUS pmic_audio_antipop_enable(const PMIC_AUDIO_ANTI_POP_RAMP_SPEED
				      rampSpeed);

/*!
 * @brief Disable the anti-pop circuitry.
 *
 * Disable the use of the built-in anti-pop circuitry to prevent noise from
 * being generated when an external audio device is inserted or removed
 * from an audio plug.
 *
 * @retval      PMIC_SUCCESS         If the anti-pop circuitry was successfully
 *                                   disabled.
 * @retval      PMIC_ERROR           If the anti-pop circuitry could not be
 *                                   disabled.
 */
PMIC_STATUS pmic_audio_antipop_disable(void);

/*!
 * @brief Performs a reset of the Voice CODEC/Stereo DAC digital filter.
 *
 * This function performs a reset of the digital filter using the back-to-back
 * SPI write procedure.
 *
 * @retval      PMIC_SUCCESS         If the digital filter was successfully
 *                                   reset.
 * @retval      PMIC_ERROR           If the digital filter could not be reset.
 */
PMIC_STATUS pmic_audio_digital_filter_reset(const PMIC_AUDIO_HANDLE handle);

/*!
 * @brief Get the most recent PTT button voltage reading.
 *
 * This function returns the most recent reading for the PTT button voltage.
 * The value may be used during the processing of the PTT_BUTTON_RANGE event
 * as part of the headset ID detection process.
 *
 * @retval      PMIC_SUCCESS         If the most recent PTT button voltage was
 *                                   returned.
 * @retval      PMIC_PARAMETER_ERROR If a NULL pointer argument was given.
 */
PMIC_STATUS pmic_audio_get_ptt_button_level(unsigned int *const level);

#ifdef DEBUG_AUDIO

/*!
 * @brief Provide a hexadecimal dump of all PMIC audio registers (DEBUG only).
 *
 * This function is intended strictly for debugging purposes only (i.e.,
 * the DEBUG macro must be defined) and will print the current values of the
 * following PMIC registers:
 *
 * - AUD_CODEC (Voice CODEC state)
 * - ST_DAC (Stereo DAC state)
 * - RX_AUD_AMPS (audio input section state)
 * - TX_AUD_AMPS (audio output section state)
 *
 * The register fields will also be decoded.
 */
void pmic_audio_dump_registers(void);

#endif				/* DEBUG */

/*@}*/

/*!
 * @name General Voice CODEC Setup and Configuration APIs
 * Functions for general setup and configuration of the PMIC Voice
 * CODEC hardware.
 */
/*@{*/

/*!
 * @brief Set the Voice CODEC clock source and operating characteristics.
 *
 * Define the Voice CODEC clock source and operating characteristics. This
 * must be done before the Voice CODEC is enabled.
 *
 * @param[in]   handle          Device handle from pmic_audio_open() call.
 * @param[in]   clockIn         Select the clock signal source.
 * @param[in]   clockFreq       Select the clock signal frequency.
 * @param[in]   samplingRate    Select the audio data sampling rate.
 * @param[in]   invert          Enable inversion of the frame sync and/or
 *                              bit clock inputs.
 *
 * @retval      PMIC_SUCCESS         If the Voice CODEC clock settings were
 *                                   successfully configured.
 * @retval      PMIC_PARAMETER_ERROR If the handle or clock configuration was
 *                                   invalid.
 * @retval      PMIC_ERROR           If the Voice CODEC clock configuration
 *                                   could not be set.
 */
PMIC_STATUS pmic_audio_vcodec_set_clock(const PMIC_AUDIO_HANDLE handle,
					const PMIC_AUDIO_CLOCK_IN_SOURCE
					clockIn,
					const PMIC_AUDIO_VCODEC_CLOCK_IN_FREQ
					clockFreq,
					const PMIC_AUDIO_VCODEC_SAMPLING_RATE
					samplingRate,
					const PMIC_AUDIO_CLOCK_INVERT invert);

/*!
 * @brief Get the Voice CODEC clock source and operating characteristics.
 *
 * Get the current Voice CODEC clock source and operating characteristics.
 *
 * @param[in]   handle          Device handle from pmic_audio_open() call.
 * @param[out]  clockIn         The clock signal source.
 * @param[out]  clockFreq       The clock signal frequency.
 * @param[out]  samplingRate    The audio data sampling rate.
 * @param[out]  invert          Inversion of the frame sync and/or
 *                              bit clock inputs is enabled/disabled.
 *
 * @retval      PMIC_SUCCESS         If the Voice CODEC clock settings were
 *                                   successfully retrieved.
 * @retval      PMIC_PARAMETER_ERROR If the handle invalid.
 * @retval      PMIC_ERROR           If the Voice CODEC clock configuration
 *                                   could not be retrieved.
 */
PMIC_STATUS pmic_audio_vcodec_get_clock(const PMIC_AUDIO_HANDLE handle,
					PMIC_AUDIO_CLOCK_IN_SOURCE *
					const clockIn,
					PMIC_AUDIO_VCODEC_CLOCK_IN_FREQ *
					const clockFreq,
					PMIC_AUDIO_VCODEC_SAMPLING_RATE *
					const samplingRate,
					PMIC_AUDIO_CLOCK_INVERT * const invert);

/*!
 * @brief Set the Voice CODEC primary audio channel timeslot.
 *
 * Set the Voice CODEC primary audio channel timeslot. This function must be
 * used if the default timeslot for the primary audio channel is to be changed.
 *
 * @param[in]   handle          Device handle from pmic_audio_open() call.
 * @param[in]   timeslot        Select the primary audio channel timeslot.
 *
 * @retval      PMIC_SUCCESS         If the Voice CODEC primary audio channel
 *                                   timeslot was successfully configured.
 * @retval      PMIC_PARAMETER_ERROR If the handle or audio channel timeslot
 *                                   was invalid.
 * @retval      PMIC_ERROR           If the Voice CODEC primary audio channel
 *                                   timeslot could not be set.
 */
PMIC_STATUS pmic_audio_vcodec_set_rxtx_timeslot(const PMIC_AUDIO_HANDLE handle,
						const PMIC_AUDIO_VCODEC_TIMESLOT
						timeslot);

/*!
 * @brief Get the current Voice CODEC primary audio channel timeslot.
 *
 * Get the current Voice CODEC primary audio channel timeslot.
 *
 * @param[in]   handle          Device handle from pmic_audio_open() call.
 * @param[out]  timeslot        The primary audio channel timeslot.
 *
 * @retval      PMIC_SUCCESS         If the Voice CODEC primary audio channel
 *                                   timeslot was successfully retrieved.
 * @retval      PMIC_PARAMETER_ERROR If the handle was invalid.
 * @retval      PMIC_ERROR           If the Voice CODEC primary audio channel
 *                                   timeslot could not be retrieved.
 */
PMIC_STATUS pmic_audio_vcodec_get_rxtx_timeslot(const PMIC_AUDIO_HANDLE handle,
						PMIC_AUDIO_VCODEC_TIMESLOT *
						const timeslot);

/*!
 * @brief Set the Voice CODEC secondary recording audio channel timeslot.
 *
 * Set the Voice CODEC secondary audio channel timeslot. This function must be
 * used if the default timeslot for the secondary audio channel is to be
 * changed. The secondary audio channel timeslot is used to transmit the audio
 * data that was recorded by the Voice CODEC from the secondary audio input
 * channel.
 *
 * @param[in]   handle          Device handle from pmic_audio_open() call.
 * @param[in]   timeslot        Select the secondary audio channel timeslot.
 *
 * @retval      PMIC_SUCCESS         If the Voice CODEC secondary audio channel
 *                                   timeslot was successfully configured.
 * @retval      PMIC_PARAMETER_ERROR If the handle or audio channel timeslot
 *                                   was invalid.
 * @retval      PMIC_ERROR           If the Voice CODEC secondary audio channel
 *                                   timeslot could not be set.
 */
PMIC_STATUS pmic_audio_vcodec_set_secondary_txslot(const PMIC_AUDIO_HANDLE
						   handle,
						   const
						   PMIC_AUDIO_VCODEC_TIMESLOT
						   timeslot);

/*!
 * @brief Get the Voice CODEC secondary recording audio channel timeslot.
 *
 * Get the Voice CODEC secondary audio channel timeslot.
 *
 * @param[in]   handle          Device handle from pmic_audio_open() call.
 * @param[out]  timeslot        The secondary audio channel timeslot.
 *
 * @retval      PMIC_SUCCESS         If the Voice CODEC secondary audio channel
 *                                   timeslot was successfully retrieved.
 * @retval      PMIC_PARAMETER_ERROR If the handle was invalid.
 * @retval      PMIC_ERROR           If the Voice CODEC secondary audio channel
 *                                   timeslot could not be retrieved.
 */
PMIC_STATUS pmic_audio_vcodec_get_secondary_txslot(const PMIC_AUDIO_HANDLE
						   handle,
						   PMIC_AUDIO_VCODEC_TIMESLOT *
						   const timeslot);

/*!
 * @brief Set/Enable the Voice CODEC options.
 *
 * Set or enable various Voice CODEC options. The available options include
 * the use of dithering, highpass digital filters, and loopback modes.
 *
 * @param[in]   handle          Device handle from pmic_audio_open() call.
 * @param[in]   config          The Voice CODEC options to enable.
 *
 * @retval      PMIC_SUCCESS         If the Voice CODEC options were
 *                                   successfully configured.
 * @retval      PMIC_PARAMETER_ERROR If the handle or Voice CODEC options
 *                                   were invalid.
 * @retval      PMIC_ERROR           If the Voice CODEC options could not be
 *                                   successfully set/enabled.
 */
PMIC_STATUS pmic_audio_vcodec_set_config(const PMIC_AUDIO_HANDLE handle,
					 const PMIC_AUDIO_VCODEC_CONFIG config);

/*!
 * @brief Clear/Disable the Voice CODEC options.
 *
 * Clear or disable various Voice CODEC options.
 *
 * @param[in]   handle          Device handle from pmic_audio_open() call.
 * @param[in]   config          The Voice CODEC options to be cleared/disabled.
 *
 * @retval      PMIC_SUCCESS         If the Voice CODEC options were
 *                                   successfully cleared/disabled.
 * @retval      PMIC_PARAMETER_ERROR If the handle or the Voice CODEC options
 *                                   were invalid.
 * @retval      PMIC_ERROR           If the Voice CODEC options could not be
 *                                   cleared/disabled.
 */
PMIC_STATUS pmic_audio_vcodec_clear_config(const PMIC_AUDIO_HANDLE handle,
					   const PMIC_AUDIO_VCODEC_CONFIG
					   config);

/*!
 * @brief Get the current Voice CODEC options.
 *
 * Get the current Voice CODEC options.
 *
 * @param[in]   handle          Device handle from pmic_audio_open() call.
 * @param[out]  config          The current set of Voice CODEC options.
 *
 * @retval      PMIC_SUCCESS         If the Voice CODEC options were
 *                                   successfully retrieved.
 * @retval      PMIC_PARAMETER_ERROR If the handle was invalid.
 * @retval      PMIC_ERROR           If the Voice CODEC options could not be
 *                                   retrieved.
 */
PMIC_STATUS pmic_audio_vcodec_get_config(const PMIC_AUDIO_HANDLE handle,
					 PMIC_AUDIO_VCODEC_CONFIG *
					 const config);

/*!
 * @brief Enable the Voice CODEC bypass audio pathway.
 *
 * Enables the Voice CODEC bypass pathway for audio data. This allows direct
 * output of the voltages on the TX data bus line to the output amplifiers
 * (bypassing the digital-to-analog converters within the Voice CODEC).
 *
 * @param[in]   handle          Device handle from pmic_audio_open() call.
 *
 * @retval      PMIC_SUCCESS         If the Voice CODEC bypass was successfully
 *                                   enabled.
 * @retval      PMIC_PARAMETER_ERROR If the handle was invalid.
 * @retval      PMIC_ERROR           If the Voice CODEC bypass could not be
 *                                   enabled.
 */
PMIC_STATUS pmic_audio_vcodec_enable_bypass(const PMIC_AUDIO_HANDLE handle);

/*!
 * @brief Disable the Voice CODEC bypass audio pathway.
 *
 * Disables the Voice CODEC bypass pathway for audio data. This means that
 * the TX data bus line will deliver digital data to the digital-to-analog
 * converters within the Voice CODEC.
 *
 * @param[in]   handle          Device handle from pmic_audio_open() call.
 *
 * @retval      PMIC_SUCCESS         If the Voice CODEC bypass was successfully
 *                                   disabled.
 * @retval      PMIC_PARAMETER_ERROR If the handle was invalid.
 * @retval      PMIC_ERROR           If the Voice CODEC bypass could not be
 *                                   disabled.
 */
PMIC_STATUS pmic_audio_vcodec_disable_bypass(const PMIC_AUDIO_HANDLE handle);

/*@}*/

/*!
 * @name General Stereo DAC Setup and Configuration APIs
 * Functions for general setup and configuration of the PMIC Stereo
 * DAC hardware.
 */
/*@{*/

/*!
 * @brief Set the Stereo DAC clock source and operating characteristics.
 *
 * Define the Stereo DAC clock source and operating characteristics. This
 * must be done before the Stereo DAC is enabled.
 *
 * @param[in]   handle          Device handle from pmic_audio_open() call.
 * @param[in]   clockIn         Select the clock signal source.
 * @param[in]   clockFreq       Select the clock signal frequency.
 * @param[in]   samplingRate    Select the audio data sampling rate.
 * @param[in]   invert          Enable inversion of the frame sync and/or
 *                              bit clock inputs.
 *
 * @retval      PMIC_SUCCESS         If the Stereo DAC clock settings were
 *                                   successfully configured.
 * @retval      PMIC_PARAMETER_ERROR If the handle or clock configuration was
 *                                   invalid.
 * @retval      PMIC_ERROR           If the Stereo DAC clock configuration
 *                                   could not be set.
 */
PMIC_STATUS pmic_audio_stdac_set_clock(const PMIC_AUDIO_HANDLE handle,
				       const PMIC_AUDIO_CLOCK_IN_SOURCE clockIn,
				       const PMIC_AUDIO_STDAC_CLOCK_IN_FREQ
				       clockFreq,
				       const PMIC_AUDIO_STDAC_SAMPLING_RATE
				       samplingRate,
				       const PMIC_AUDIO_CLOCK_INVERT invert);

/*!
 * @brief Get the Stereo DAC clock source and operating characteristics.
 *
 * Get the current Stereo DAC clock source and operating characteristics.
 *
 * @param[in]   handle          Device handle from pmic_audio_open() call.
 * @param[out]  clockIn         The clock signal source.
 * @param[out]  clockFreq       The clock signal frequency.
 * @param[out]  samplingRate    The audio data sampling rate.
 * @param[out]  invert          Inversion of the frame sync and/or
 *                              bit clock inputs is enabled/disabled.
 *
 * @retval      PMIC_SUCCESS         If the Stereo DAC clock settings were
 *                                   successfully retrieved.
 * @retval      PMIC_PARAMETER_ERROR If the handle invalid.
 * @retval      PMIC_ERROR           If the Stereo DAC clock configuration
 *                                   could not be retrieved.
 */
PMIC_STATUS pmic_audio_stdac_get_clock(const PMIC_AUDIO_HANDLE handle,
				       PMIC_AUDIO_CLOCK_IN_SOURCE *
				       const clockIn,
				       PMIC_AUDIO_STDAC_SAMPLING_RATE *
				       const samplingRate,
				       PMIC_AUDIO_STDAC_CLOCK_IN_FREQ *
				       const clockFreq,
				       PMIC_AUDIO_CLOCK_INVERT * const invert);

/*!
 * @brief Set the Stereo DAC primary audio channel timeslot.
 *
 * Set the Stereo DAC primary audio channel timeslot. This function must be
 * used if the default timeslot for the primary audio channel is to be changed.
 *
 * @param[in]   handle          Device handle from pmic_audio_open() call.
 * @param[in]   timeslot        Select the primary audio channel timeslot.
 *
 * @retval      PMIC_SUCCESS         If the Stereo DAC primary audio channel
 *                                   timeslot was successfully configured.
 * @retval      PMIC_PARAMETER_ERROR If the handle or audio channel timeslot
 *                                   was invalid.
 * @retval      PMIC_ERROR           If the Stereo DAC primary audio channel
 *                                   timeslot could not be set.
 */
PMIC_STATUS pmic_audio_stdac_set_rxtx_timeslot(const PMIC_AUDIO_HANDLE handle,
					       const PMIC_AUDIO_STDAC_TIMESLOTS
					       timeslot);

/*!
 * @brief Get the current Stereo DAC primary audio channel timeslot.
 *
 * Get the current Stereo DAC primary audio channel timeslot.
 *
 * @param[in]   handle          Device handle from pmic_audio_open() call.
 * @param[out]  timeslot        The primary audio channel timeslot.
 *
 * @retval      PMIC_SUCCESS         If the Stereo DAC primary audio channel
 *                                   timeslot was successfully retrieved.
 * @retval      PMIC_PARAMETER_ERROR If the handle was invalid.
 * @retval      PMIC_ERROR           If the Stereo DAC primary audio channel
 *                                   timeslot could not be retrieved.
 */
PMIC_STATUS pmic_audio_stdac_get_rxtx_timeslot(const PMIC_AUDIO_HANDLE handle,
					       PMIC_AUDIO_STDAC_TIMESLOTS *
					       const timeslot);

/*!
 * @brief Set/Enable the Stereo DAC options.
 *
 * Set or enable various Stereo DAC options. The available options include
 * enabling/disabling the bus master clock outputs.
 *
 * @param[in]   handle          Device handle from pmic_audio_open() call.
 * @param[in]   config          The Stereo DAC options to enable.
 *
 * @retval      PMIC_SUCCESS         If the Stereo DAC options were
 *                                   successfully configured.
 * @retval      PMIC_PARAMETER_ERROR If the handle or Stereo DAC options
 *                                   were invalid.
 * @retval      PMIC_ERROR           If the Stereo DAC options could not be
 *                                   successfully set/enabled.
 */
PMIC_STATUS pmic_audio_stdac_set_config(const PMIC_AUDIO_HANDLE handle,
					const PMIC_AUDIO_STDAC_CONFIG config);

/*!
 * @brief Clear/Disable the Stereo DAC options.
 *
 * Clear or disable various Stereo DAC options.
 *
 * @param[in]   handle          Device handle from pmic_audio_open() call.
 * @param[in]   config          The Stereo DAC options to be cleared/disabled.
 *
 * @retval      PMIC_SUCCESS         If the Stereo DAC options were
 *                                   successfully cleared/disabled.
 * @retval      PMIC_PARAMETER_ERROR If the handle or the Stereo DAC options
 *                                   were invalid.
 * @retval      PMIC_ERROR           If the Stereo DAC options could not be
 *                                   cleared/disabled.
 */
PMIC_STATUS pmic_audio_stdac_clear_config(const PMIC_AUDIO_HANDLE handle,
					  const PMIC_AUDIO_STDAC_CONFIG config);

/*!
 * @brief Get the current Stereo DAC options.
 *
 * Get the current Stereo DAC options.
 *
 * @param[in]   handle          Device handle from pmic_audio_open() call.
 * @param[out]  config          The current set of Stereo DAC options.
 *
 * @retval      PMIC_SUCCESS         If the Stereo DAC options were
 *                                   successfully retrieved.
 * @retval      PMIC_PARAMETER_ERROR If the handle was invalid.
 * @retval      PMIC_ERROR           If the Stereo DAC options could not be
 *                                   retrieved.
 */
PMIC_STATUS pmic_audio_stdac_get_config(const PMIC_AUDIO_HANDLE handle,
					PMIC_AUDIO_STDAC_CONFIG * const config);

/*@}*/

/*!
 * @name Audio Input Setup and Configuration APIs
 * Functions for general setup and configuration of the PMIC audio
 * input hardware.
 */
/*@{*/

/*!
 * @brief Set/Enable the audio input section options.
 *
 * Set or enable various audio input section options. The only available
 * option right now is to enable the automatic disabling of the microphone
 * input amplifiers when a microphone/headset is inserted or removed.
 *
 * @param[in]   handle          Device handle from pmic_audio_open() call.
 * @param[in]   config          The audio input section options to enable.
 *
 * @retval      PMIC_SUCCESS         If the audio input section options were
 *                                   successfully configured.
 * @retval      PMIC_PARAMETER_ERROR If the handle or audio input section
 *                                   options were invalid.
 * @retval      PMIC_ERROR           If the audio input section options could
 *                                   not be successfully set/enabled.
 */
PMIC_STATUS pmic_audio_input_set_config(const PMIC_AUDIO_HANDLE handle,
					const PMIC_AUDIO_INPUT_CONFIG config);

/*!
 * @brief Clear/Disable the audio input section options.
 *
 * Clear or disable various audio input section options.
 *
 * @param[in]   handle          Device handle from pmic_audio_open() call.
 * @param[in]   config          The audio input section options to be
 *                              cleared/disabled.
 *
 * @retval      PMIC_SUCCESS         If the audio input section options were
 *                                   successfully cleared/disabled.
 * @retval      PMIC_PARAMETER_ERROR If the handle or the audio input section
 *                                   options were invalid.
 * @retval      PMIC_ERROR           If the audio input section options could
 *                                   not be cleared/disabled.
 */
PMIC_STATUS pmic_audio_input_clear_config(const PMIC_AUDIO_HANDLE handle,
					  const PMIC_AUDIO_INPUT_CONFIG config);

/*!
 * @brief Get the current audio input section options.
 *
 * Get the current audio input section options.
 *
 * @param[in]   handle          Device handle from pmic_audio_open() call.
 * @param[out]  config          The current set of audio input section options.
 *
 * @retval      PMIC_SUCCESS         If the audio input section options were
 *                                   successfully retrieved.
 * @retval      PMIC_PARAMETER_ERROR If the handle was invalid.
 * @retval      PMIC_ERROR           If the audio input section options could
 *                                   not be retrieved.
 */
PMIC_STATUS pmic_audio_input_get_config(const PMIC_AUDIO_HANDLE handle,
					PMIC_AUDIO_INPUT_CONFIG * const config);

/*@}*/

/*!
 * @name Audio Recording Using the Voice CODEC Setup and Configuration APIs
 * Functions for general setup and configuration of the PMIC Voice CODEC
 * to perform audio recording.
 */
/*@{*/

/*!
 * @brief Select the microphone inputs to be used for Voice CODEC recording.
 *
 * Select left  and right microphone inputs for Voice CODEC
 * recording. It is possible to disable or not use a particular microphone
 * input channel by specifying NO_MIC as a parameter.
 *
 * @param[in]   handle          Device handle from pmic_audio_open() call.
 * @param[in]   leftChannel     Select the left microphone input channel.
 * @param[in]   rightChannel    Select the right microphone input channel.
 *
 * @retval      PMIC_SUCCESS         If the microphone input channels were
 *                                   successfully enabled.
 * @retval      PMIC_PARAMETER_ERROR If the handle or microphone input ports
 *                                   were invalid.
 * @retval      PMIC_ERROR           If the microphone input channels could
 *                                   not be successfully enabled.
 */
PMIC_STATUS pmic_audio_vcodec_set_mic(const PMIC_AUDIO_HANDLE handle,
				      const PMIC_AUDIO_INPUT_PORT leftChannel,
				      const PMIC_AUDIO_INPUT_PORT rightChannel);

/*!
 * @brief Get the current microphone inputs being used for Voice CODEC
 *        recording.
 *
 * Get the left  and right microphone inputs currently being
 * used for Voice CODEC recording.
 *
 * @param[in]   handle          Device handle from pmic_audio_open() call.
 * @param[out]  leftChannel     The left microphone input channel.
 * @param[out]  rightChannel    The right microphone input channel.
 *
 * @retval      PMIC_SUCCESS         If the microphone input channels were
 *                                   successfully retrieved.
 * @retval      PMIC_PARAMETER_ERROR If the handle was invalid.
 * @retval      PMIC_ERROR           If the microphone input channels could
 *                                   not be retrieved.
 */
PMIC_STATUS pmic_audio_vcodec_get_mic(const PMIC_AUDIO_HANDLE handle,
				      PMIC_AUDIO_INPUT_PORT * const leftChannel,
				      PMIC_AUDIO_INPUT_PORT *
				      const rightChannel);

/*!
 * @brief Enable/disable the microphone input.
 *
 * This function enables/disables the current microphone input channel. The
 * input amplifier is automatically turned off when the microphone input is
 * disabled.
 *
 * @param[in]   handle          Device handle from pmic_audio_open() call.
 * @param[in]   leftChannel     The left microphone input channel state.
 * @param[in]   rightChannel    the right microphone input channel state.
 *
 * @retval      PMIC_SUCCESS         If the microphone input channels were
 *                                   successfully reconfigured.
 * @retval      PMIC_PARAMETER_ERROR If the handle or microphone input states
 *                                   were invalid.
 * @retval      PMIC_ERROR           If the microphone input channels could
 *                                   not be reconfigured.
 */
PMIC_STATUS pmic_audio_vcodec_set_mic_on_off(const PMIC_AUDIO_HANDLE handle,
					     const PMIC_AUDIO_INPUT_MIC_STATE
					     leftChannel,
					     const PMIC_AUDIO_INPUT_MIC_STATE
					     rightChannel);

/*!
 * @brief Return the current state of the microphone inputs.
 *
 * This function returns the current state (on/off) of the microphone
 * input channels.
 *
 * @param[in]   handle          Device handle from pmic_audio_open() call.
 * @param[out]  leftChannel     The current left microphone input channel
 *                              state.
 * @param[out]  rightChannel    the current right microphone input channel
 *                              state.
 *
 * @retval      PMIC_SUCCESS         If the microphone input channel states
 *                                   were successfully retrieved.
 * @retval      PMIC_PARAMETER_ERROR If the handle was invalid.
 * @retval      PMIC_ERROR           If the microphone input channel states
 *                                   could not be retrieved.
 */
PMIC_STATUS pmic_audio_vcodec_get_mic_on_off(const PMIC_AUDIO_HANDLE handle,
					     PMIC_AUDIO_INPUT_MIC_STATE *
					     const leftChannel,
					     PMIC_AUDIO_INPUT_MIC_STATE *
					     const rightChannel);

/*!
 * @brief Set the microphone input amplifier mode and gain level.
 *
 * This function sets the current microphone input amplifier operating mode
 * and gain level.
 *
 * @param[in]   handle           Device handle from pmic_audio_open() call.
 * @param[in]   leftChannelMode  The left microphone input amplifier mode.
 * @param[in]   leftChannelGain  The left microphone input amplifier gain level.
 * @param[in]   rightChannelMode The right microphone input amplifier mode.
 * @param[in]   rightChannelGain The right microphone input amplifier gain
 *                               level.
 *
 * @retval      PMIC_SUCCESS         If the microphone input amplifiers were
 *                                   successfully reconfigured.
 * @retval      PMIC_PARAMETER_ERROR If the handle or microphone input amplifier
 *                                   modes or gain levels were invalid.
 * @retval      PMIC_ERROR           If the microphone input amplifiers could
 *                                   not be reconfigured.
 */
PMIC_STATUS pmic_audio_vcodec_set_record_gain(const PMIC_AUDIO_HANDLE handle,
					      const PMIC_AUDIO_MIC_AMP_MODE
					      leftChannelMode,
					      const PMIC_AUDIO_MIC_GAIN
					      leftChannelGain,
					      const PMIC_AUDIO_MIC_AMP_MODE
					      rightChannelMode,
					      const PMIC_AUDIO_MIC_GAIN
					      rightChannelGain);

/*!
 * @brief Get the current microphone input amplifier mode and gain level.
 *
 * This function gets the current microphone input amplifier operating mode
 * and gain level.
 *
 * @param[in]   handle           Device handle from pmic_audio_open() call.
 * @param[out]  leftChannelMode  The left microphone input amplifier mode.
 * @param[out]  leftChannelGain  The left microphone input amplifier gain level.
 * @param[out]  rightChannelMode The right microphone input amplifier mode.
 * @param[out]  rightChannelGain The right microphone input amplifier gain
 *                               level.
 *
 * @retval      PMIC_SUCCESS         If the microphone input amplifier modes
 *                                   and gain levels were successfully
 *                                   retrieved.
 * @retval      PMIC_PARAMETER_ERROR If the handle was invalid.
 * @retval      PMIC_ERROR           If the microphone input amplifier modes
 *                                   and gain levels could not be retrieved.
 */
PMIC_STATUS pmic_audio_vcodec_get_record_gain(const PMIC_AUDIO_HANDLE handle,
					      PMIC_AUDIO_MIC_AMP_MODE *
					      const leftChannelMode,
					      PMIC_AUDIO_MIC_GAIN *
					      const leftChannelGain,
					      PMIC_AUDIO_MIC_AMP_MODE *
					      const rightChannelMode,
					      PMIC_AUDIO_MIC_GAIN *
					      const rightChannelGain);

/*!
 * @brief Enable a microphone bias circuit.
 *
 * This function enables one of the available microphone bias circuits.
 *
 * @param[in]   handle           Device handle from pmic_audio_open() call.
 * @param[in]   biasCircuit      The microphone bias circuit to be enabled.
 *
 * @retval      PMIC_SUCCESS         If the microphone bias circuit was
 *                                   successfully enabled.
 * @retval      PMIC_PARAMETER_ERROR If the handle or selected microphone bias
 *                                   circuit was invalid.
 * @retval      PMIC_ERROR           If the microphone bias circuit could not
 *                                   be enabled.
 */
PMIC_STATUS pmic_audio_vcodec_enable_micbias(const PMIC_AUDIO_HANDLE handle,
					     const PMIC_AUDIO_MIC_BIAS
					     biasCircuit);

/*!
 * @brief Disable a microphone bias circuit.
 *
 * This function disables one of the available microphone bias circuits.
 *
 * @param[in]   handle           Device handle from pmic_audio_open() call.
 * @param[in]   biasCircuit      The microphone bias circuit to be disabled.
 *
 * @retval      PMIC_SUCCESS         If the microphone bias circuit was
 *                                   successfully disabled.
 * @retval      PMIC_PARAMETER_ERROR If the handle or selected microphone bias
 *                                   circuit was invalid.
 * @retval      PMIC_ERROR           If the microphone bias circuit could not
 *                                   be disabled.
 */
PMIC_STATUS pmic_audio_vcodec_disable_micbias(const PMIC_AUDIO_HANDLE handle,
					      const PMIC_AUDIO_MIC_BIAS
					      biasCircuit);

/*@}*/

/*!
 * @name Audio Playback Using the Voice CODEC Setup and Configuration APIs
 * Functions for general setup and configuration of the PMIC Voice CODEC
 * to perform audio playback.
 */
/*@{*/

/*!
 * @brief Configure and enable the Voice CODEC mixer.
 *
 * This function configures and enables the Voice CODEC mixer.
 *
 * @param[in]   handle              Device handle from pmic_audio_open() call.
 * @param[in]   rxSecondaryTimeslot The timeslot used for the secondary audio
 *                                  channel.
 * @param[in]   gainIn              The secondary audio channel gain level.
 * @param[in]   gainOut             The mixer output gain level.
 *
 * @retval      PMIC_SUCCESS         If the Voice CODEC mixer was successfully
 *                                   configured and enabled.
 * @retval      PMIC_PARAMETER_ERROR If the handle or mixer configuration
 *                                   was invalid.
 * @retval      PMIC_ERROR           If the Voice CODEC mixer could not be
 *                                   reconfigured or enabled.
 */
PMIC_STATUS pmic_audio_vcodec_enable_mixer(const PMIC_AUDIO_HANDLE handle,
					   const PMIC_AUDIO_VCODEC_TIMESLOT
					   rxSecondaryTimeslot,
					   const PMIC_AUDIO_VCODEC_MIX_IN_GAIN
					   gainIn,
					   const PMIC_AUDIO_VCODEC_MIX_OUT_GAIN
					   gainOut);

/*!
 * @brief Disable the Voice CODEC mixer.
 *
 * This function disables the Voice CODEC mixer.
 *
 * @param[in]   handle              Device handle from pmic_audio_open() call.
 *
 * @retval      PMIC_SUCCESS         If the Voice CODEC mixer was successfully
 *                                   disabled.
 * @retval      PMIC_PARAMETER_ERROR If the handle was invalid.
 * @retval      PMIC_ERROR           If the Voice CODEC mixer could not be
 *                                   disabled.
 */
PMIC_STATUS pmic_audio_vcodec_disable_mixer(const PMIC_AUDIO_HANDLE handle);

/*@}*/

/*!
 * @name Audio Playback Using the Stereo DAC Setup and Configuration APIs
 * Functions for general setup and configuration of the PMIC Stereo DAC
 * to perform audio playback.
 */
/*@{*/

/*!
 * @brief Configure and enable the Stereo DAC mixer.
 *
 * This function configures and enables the Stereo DAC mixer.
 *
 * @param[in]   handle              Device handle from pmic_audio_open() call.
 * @param[in]   rxSecondaryTimeslot The timeslot used for the secondary audio
 *                                  channel.
 * @param[in]   gainIn              The secondary audio channel gain level.
 * @param[in]   gainOut             The mixer output gain level.
 *
 * @retval      PMIC_SUCCESS         If the Stereo DAC mixer was successfully
 *                                   configured and enabled.
 * @retval      PMIC_PARAMETER_ERROR If the handle or mixer configuration
 *                                   was invalid.
 * @retval      PMIC_ERROR           If the Stereo DAC mixer could not be
 *                                   reconfigured or enabled.
 */
PMIC_STATUS pmic_audio_stdac_enable_mixer(const PMIC_AUDIO_HANDLE handle,
					  const PMIC_AUDIO_STDAC_TIMESLOTS
					  rxSecondaryTimeslot,
					  const PMIC_AUDIO_STDAC_MIX_IN_GAIN
					  gainIn,
					  const PMIC_AUDIO_STDAC_MIX_OUT_GAIN
					  gainOut);

/*!
 * @brief Disable the Stereo DAC mixer.
 *
 * This function disables the Stereo DAC mixer.
 *
 * @param[in]   handle              Device handle from pmic_audio_open() call.
 *
 * @retval      PMIC_SUCCESS         If the Stereo DAC mixer was successfully
 *                                   disabled.
 * @retval      PMIC_PARAMETER_ERROR If the handle was invalid.
 * @retval      PMIC_ERROR           If the Stereo DAC mixer could not be
 *                                   disabled.
 */
PMIC_STATUS pmic_audio_stdac_disable_mixer(const PMIC_AUDIO_HANDLE handle);

/*@}*/

/*!
 * @name Audio Output Section Setup and Configuration APIs
 * Functions for general setup and configuration of the PMIC audio output
 * section to support playback.
 */
/*@{*/

/*!
 * @brief Select the audio output ports.
 *
 * This function selects the audio output ports to be used. This also enables
 * the appropriate output amplifiers.
 *
 * @param[in]   handle              Device handle from pmic_audio_open() call.
 * @param[in]   port                The audio output ports to be used.
 *
 * @retval      PMIC_SUCCESS         If the audio output ports were successfully
 *                                   acquired.
 * @retval      PMIC_PARAMETER_ERROR If the handle or output ports were
 *                                   invalid.
 * @retval      PMIC_ERROR           If the audio output ports could not be
 *                                   acquired.
 */
PMIC_STATUS pmic_audio_output_set_port(const PMIC_AUDIO_HANDLE handle,
				       const PMIC_AUDIO_OUTPUT_PORT port);

/*!
 * @brief Deselect/disable the audio output ports.
 *
 * This function disables the audio output ports that were previously enabled
 * by calling pmic_audio_output_set_port().
 *
 * @param[in]   handle              Device handle from pmic_audio_open() call.
 * @param[in]   port                The audio output ports to be disabled.
 *
 * @retval      PMIC_SUCCESS         If the audio output ports were successfully
 *                                   disabled.
 * @retval      PMIC_PARAMETER_ERROR If the handle or output ports were
 *                                   invalid.
 * @retval      PMIC_ERROR           If the audio output ports could not be
 *                                   disabled.
 */
PMIC_STATUS pmic_audio_output_clear_port(const PMIC_AUDIO_HANDLE handle,
					 const PMIC_AUDIO_OUTPUT_PORT port);

/*!
 * @brief Get the current audio output ports.
 *
 * This function retrieves the audio output ports that are currently being
 * used.
 *
 * @param[in]   handle              Device handle from pmic_audio_open() call.
 * @param[out]  port                The audio output ports currently being used.
 *
 * @retval      PMIC_SUCCESS         If the audio output ports were successfully
 *                                   retrieved.
 * @retval      PMIC_PARAMETER_ERROR If the handle was invalid.
 * @retval      PMIC_ERROR           If the audio output ports could not be
 *                                   retrieved.
 */
PMIC_STATUS pmic_audio_output_get_port(const PMIC_AUDIO_HANDLE handle,
				       PMIC_AUDIO_OUTPUT_PORT * const port);

/*!
 * @brief Set the gain level for the external stereo inputs.
 *
 * This function sets the gain levels for the external stereo inputs.
 *
 * @param[in]   handle              Device handle from pmic_audio_open() call.
 * @param[in]   gain                The external stereo input gain level.
 *
 * @retval      PMIC_SUCCESS         If the gain level was successfully set.
 * @retval      PMIC_PARAMETER_ERROR If the handle or gain level was invalid.
 * @retval      PMIC_ERROR           If the gain level could not be set.
 */
PMIC_STATUS pmic_audio_output_set_stereo_in_gain(const PMIC_AUDIO_HANDLE handle,
						 const PMIC_AUDIO_STEREO_IN_GAIN
						 gain);

/*!
 * @brief Get the current gain level for the external stereo inputs.
 *
 * This function retrieves the current gain levels for the external stereo
 * inputs.
 *
 * @param[in]   handle              Device handle from pmic_audio_open() call.
 * @param[out]  gain                The current external stereo input gain
 *                                  level.
 *
 * @retval      PMIC_SUCCESS         If the gain level was successfully
 *                                   retrieved.
 * @retval      PMIC_PARAMETER_ERROR If the handle was invalid.
 * @retval      PMIC_ERROR           If the gain level could not be retrieved.
 */
PMIC_STATUS pmic_audio_output_get_stereo_in_gain(const PMIC_AUDIO_HANDLE handle,
						 PMIC_AUDIO_STEREO_IN_GAIN *
						 const gain);

/*!
 * @brief Set the output PGA gain level.
 *
 * This function sets the audio output PGA gain level.
 *
 * @param[in]   handle              Device handle from pmic_audio_open() call.
 * @param[in]   gain                The output PGA gain level.
 *
 * @retval      PMIC_SUCCESS         If the gain level was successfully set.
 * @retval      PMIC_PARAMETER_ERROR If the handle or gain level was invalid.
 * @retval      PMIC_ERROR           If the gain level could not be set.
 */
PMIC_STATUS pmic_audio_output_set_pgaGain(const PMIC_AUDIO_HANDLE handle,
					  const PMIC_AUDIO_OUTPUT_PGA_GAIN
					  gain);

/*!
 * @brief Get the output PGA gain level.
 *
 * This function retrieves the current audio output PGA gain level.
 *
 * @param[in]   handle              Device handle from pmic_audio_open() call.
 * @param[out]  gain                The current output PGA gain level.
 *
 * @retval      PMIC_SUCCESS         If the gain level was successfully
 *                                   retrieved.
 * @retval      PMIC_PARAMETER_ERROR If the handle was invalid.
 * @retval      PMIC_ERROR           If the gain level could not be retrieved.
 */
PMIC_STATUS pmic_audio_output_get_pgaGain(const PMIC_AUDIO_HANDLE handle,
					  PMIC_AUDIO_OUTPUT_PGA_GAIN *
					  const gain);

/*!
 * @brief Enable the output mixer.
 *
 * This function enables the output mixer for the audio stream that
 * corresponds to the current handle (i.e., the Voice CODEC, Stereo DAC, or
 * the external stereo inputs).
 *
 * @param[in]   handle              Device handle from pmic_audio_open() call.
 *
 * @retval      PMIC_SUCCESS         If the mixer was successfully enabled.
 * @retval      PMIC_PARAMETER_ERROR If the handle was invalid.
 * @retval      PMIC_ERROR           If the mixer could not be enabled.
 */
PMIC_STATUS pmic_audio_output_enable_mixer(const PMIC_AUDIO_HANDLE handle);

/*!
 * @brief Disable the output mixer.
 *
 * This function disables the output mixer for the audio stream that
 * corresponds to the current handle (i.e., the Voice CODEC, Stereo DAC, or
 * the external stereo inputs).
 *
 * @param[in]   handle              Device handle from pmic_audio_open() call.
 *
 * @retval      PMIC_SUCCESS         If the mixer was successfully disabled.
 * @retval      PMIC_PARAMETER_ERROR If the handle was invalid.
 * @retval      PMIC_ERROR           If the mixer could not be disabled.
 */
PMIC_STATUS pmic_audio_output_disable_mixer(const PMIC_AUDIO_HANDLE handle);

/*!
 * @brief Configure and enable the output balance amplifiers.
 *
 * This function configures and enables the output balance amplifiers.
 *
 * @param[in]   handle              Device handle from pmic_audio_open() call.
 * @param[in]   leftGain            The desired left channel gain level.
 * @param[in]   rightGain           The desired right channel gain level.
 *
 * @retval      PMIC_SUCCESS         If the output balance amplifiers were
 *                                   successfully configured and enabled.
 * @retval      PMIC_PARAMETER_ERROR If the handle or gain levels were invalid.
 * @retval      PMIC_ERROR           If the output balance amplifiers could not
 *                                   be reconfigured or enabled.
 */
PMIC_STATUS pmic_audio_output_set_balance(const PMIC_AUDIO_HANDLE handle,
					  const PMIC_AUDIO_OUTPUT_BALANCE_GAIN
					  leftGain,
					  const PMIC_AUDIO_OUTPUT_BALANCE_GAIN
					  rightGain);

/*!
 * @brief Get the current output balance amplifier gain levels.
 *
 * This function retrieves the current output balance amplifier gain levels.
 *
 * @param[in]   handle              Device handle from pmic_audio_open() call.
 * @param[out]  leftGain            The current left channel gain level.
 * @param[out]  rightGain           The current right channel gain level.
 *
 * @retval      PMIC_SUCCESS         If the output balance amplifier gain levels
 *                                   were successfully retrieved.
 * @retval      PMIC_PARAMETER_ERROR If the handle was invalid.
 * @retval      PMIC_ERROR           If the output balance amplifier gain levels
 *                                   could be retrieved.
 */
PMIC_STATUS pmic_audio_output_get_balance(const PMIC_AUDIO_HANDLE handle,
					  PMIC_AUDIO_OUTPUT_BALANCE_GAIN *
					  const leftGain,
					  PMIC_AUDIO_OUTPUT_BALANCE_GAIN *
					  const rightGain);

/*!
 * @brief Configure and enable the output mono adder.
 *
 * This function configures and enables the output mono adder.
 *
 * @param[in]   handle              Device handle from pmic_audio_open() call.
 * @param[in]   mode                The desired mono adder operating mode.
 *
 * @retval      PMIC_SUCCESS         If the mono adder was successfully
 *                                   configured and enabled.
 * @retval      PMIC_PARAMETER_ERROR If the handle or mono adder mode was
 *                                   invalid.
 * @retval      PMIC_ERROR           If the mono adder could not be reconfigured
 *                                   or enabled.
 */
PMIC_STATUS pmic_audio_output_enable_mono_adder(const PMIC_AUDIO_HANDLE handle,
						const PMIC_AUDIO_MONO_ADDER_MODE
						mode);

/*!
 * @brief Disable the output mono adder.
 *
 * This function disables the output mono adder.
 *
 * @param[in]   handle              Device handle from pmic_audio_open() call.
 *
 * @retval      PMIC_SUCCESS         If the mono adder was successfully
 *                                   disabled.
 * @retval      PMIC_PARAMETER_ERROR If the handle was invalid.
 * @retval      PMIC_ERROR           If the mono adder could not be disabled.
 */
PMIC_STATUS pmic_audio_output_disable_mono_adder(const PMIC_AUDIO_HANDLE
						 handle);

/*!
 * @brief Configure the mono adder output gain level.
 *
 * This function configures the mono adder output amplifier gain level.
 *
 * @param[in]   handle              Device handle from pmic_audio_open() call.
 * @param[in]   gain                The desired output gain level.
 *
 * @retval      PMIC_SUCCESS         If the mono adder output amplifier gain
 *                                   level was successfully set.
 * @retval      PMIC_PARAMETER_ERROR If the handle or gain level was invalid.
 * @retval      PMIC_ERROR           If the mono adder output amplifier gain
 *                                   level could not be reconfigured.
 */
PMIC_STATUS pmic_audio_output_set_mono_adder_gain(const PMIC_AUDIO_HANDLE
						  handle,
						  const
						  PMIC_AUDIO_MONO_ADDER_OUTPUT_GAIN
						  gain);

/*!
 * @brief Get the current mono adder output gain level.
 *
 * This function retrieves the current mono adder output amplifier gain level.
 *
 * @param[in]   handle              Device handle from pmic_audio_open() call.
 * @param[out]  gain                The current output gain level.
 *
 * @retval      PMIC_SUCCESS         If the mono adder output amplifier gain
 *                                   level was successfully retrieved.
 * @retval      PMIC_PARAMETER_ERROR If the handle was invalid.
 * @retval      PMIC_ERROR           If the mono adder output amplifier gain
 *                                   level could not be retrieved.
 */
PMIC_STATUS pmic_audio_output_get_mono_adder_gain(const PMIC_AUDIO_HANDLE
						  handle,
						  PMIC_AUDIO_MONO_ADDER_OUTPUT_GAIN
						  * const gain);

/*!
 * @brief Set various audio output section options.
 *
 * This function sets one or more audio output section configuration
 * options. The currently supported options include whether to disable
 * the non-inverting mono speaker output, enabling the loudspeaker common
 * bias circuit, enabling detection of headset insertion/removal, and
 * whether to automatically disable the headset amplifiers when a headset
 * insertion/removal has been detected.
 *
 * @param[in]   handle              Device handle from pmic_audio_open() call.
 * @param[in]   config              The desired audio output section
 *                                  configuration options to be set.
 *
 * @retval      PMIC_SUCCESS         If the desired configuration options were
 *                                   all successfully set.
 * @retval      PMIC_PARAMETER_ERROR If the handle or configuration options
 *                                   were invalid.
 * @retval      PMIC_ERROR           If the desired configuration options
 *                                   could not be set.
 */
PMIC_STATUS pmic_audio_output_set_config(const PMIC_AUDIO_HANDLE handle,
					 const PMIC_AUDIO_OUTPUT_CONFIG config);

/*!
 * @brief Clear various audio output section options.
 *
 * This function clears one or more audio output section configuration
 * options.
 *
 * @param[in]   handle              Device handle from pmic_audio_open() call.
 * @param[in]   config              The desired audio output section
 *                                  configuration options to be cleared.
 *
 * @retval      PMIC_SUCCESS         If the desired configuration options were
 *                                   all successfully cleared.
 * @retval      PMIC_PARAMETER_ERROR If the handle or configuration options
 *                                   were invalid.
 * @retval      PMIC_ERROR           If the desired configuration options
 *                                   could not be cleared.
 */
PMIC_STATUS pmic_audio_output_clear_config(const PMIC_AUDIO_HANDLE handle,
					   const PMIC_AUDIO_OUTPUT_CONFIG
					   config);

/*!
 * @brief Get the current audio output section options.
 *
 * This function retrieves the current audio output section configuration
 * option settings.
 *
 * @param[in]   handle              Device handle from pmic_audio_open() call.
 * @param[out]  config              The current audio output section
 *                                  configuration option settings.
 *
 * @retval      PMIC_SUCCESS         If the current configuration options were
 *                                   successfully retrieved.
 * @retval      PMIC_PARAMETER_ERROR If the handle was invalid.
 * @retval      PMIC_ERROR           If the current configuration options
 *                                   could not be retrieved.
 */
PMIC_STATUS pmic_audio_output_get_config(const PMIC_AUDIO_HANDLE handle,
					 PMIC_AUDIO_OUTPUT_CONFIG *
					 const config);

/*!
 * @brief Enable the phantom ground circuit that is used to help identify
 *        the type of headset that has been inserted.
 *
 * This function enables the phantom ground circuit that is used to help
 * identify the type of headset (e.g., stereo or mono) that has been inserted.
 *
 * @param[in]   handle              Device handle from pmic_audio_open() call.
 *
 * @retval      PMIC_SUCCESS         If the phantom ground circuit was
 *                                   successfully enabled.
 * @retval      PMIC_PARAMETER_ERROR If the handle was invalid.
 * @retval      PMIC_ERROR           If the phantom ground circuit could not
 *                                   be enabled.
 */
PMIC_STATUS pmic_audio_output_enable_phantom_ground(void);

/*!
 * @brief Disable the phantom ground circuit that is used to help identify
 *        the type of headset that has been inserted.
 *
 * This function disables the phantom ground circuit that is used to help
 * identify the type of headset (e.g., stereo or mono) that has been inserted.
 *
 * @param[in]   handle              Device handle from pmic_audio_open() call.
 *
 * @retval      PMIC_SUCCESS         If the phantom ground circuit was
 *                                   successfully disabled.
 * @retval      PMIC_PARAMETER_ERROR If the handle was invalid.
 * @retval      PMIC_ERROR           If the phantom ground circuit could not
 *                                   be disabled.
 */
PMIC_STATUS pmic_audio_output_disable_phantom_ground(void);

/*!
 * @brief Enable/Disable fm output
 *
 * This function enables/disables the fm output.
 *
 * @param[in]   enable		     True to enable and false to disable
 *
 * @retval      PMIC_SUCCESS         If the fm output  was
 *                                   successfully enable or disabled
 * @retval      PMIC_ERROR           If the operation fails
 */
PMIC_STATUS pmic_audio_fm_output_enable(bool enable);

/*@}*/

#endif				/* __KERNEL__ */

#endif				/* __ASM_ARCH_MXC_PMIC_AUDIO_H__ */