aboutsummaryrefslogtreecommitdiffstats
path: root/bsp/pandaboard/ASoC-ABE-DSP-Add-support-for-OMAP4-ABE-DSP.patch
blob: 07479449dda025a7bc4c9e43e4b8e258f4724b26 (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
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
From d8168c54d8255dfa6ba8386441d379a802bf7776 Mon Sep 17 00:00:00 2001
From: Liam Girdwood <lrg@slimlogic.co.uk>
Date: Thu, 10 Feb 2011 16:55:18 -0600
Subject: [PATCH 14/60] ASoC: ABE DSP: Add support for OMAP4 ABE DSP

commit beade4ecd078e00b693df6d2cad9e626a3b6cd77 upstream

Add support for the OMAP4 ABE DSP.

Change-Id: I104d1bea41a17b6fda8caad4f4509a8d13515e66
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Sebastien Guiriec <s-guiriec@ti.com>
Signed-off-by: Margarita Olaya Cabrera <magi.olaya@ti.com>
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
Signed-off-by: Jorge Eduardo Candelaria <jorge.candelaria@ti.com>
Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
Signed-off-by: Hector Barajas <barajas@ti.com>
Integrated-by: Jingdong Lu <jingdong.lu@windriver.com>
---
 arch/arm/plat-omap/include/plat/io.h |    1 +
 include/sound/omap-abe-dsp.h         |   19 +
 sound/soc/omap/Kconfig               |    3 +
 sound/soc/omap/Makefile              |    4 +-
 sound/soc/omap/omap-abe-coef.h       |  200 ++++
 sound/soc/omap/omap-abe-dsp.c        | 2161 ++++++++++++++++++++++++++++++++++
 sound/soc/omap/omap-abe-dsp.h        |   36 +
 7 files changed, 2423 insertions(+), 1 deletions(-)
 create mode 100644 include/sound/omap-abe-dsp.h
 create mode 100644 sound/soc/omap/omap-abe-coef.h
 create mode 100644 sound/soc/omap/omap-abe-dsp.c
 create mode 100644 sound/soc/omap/omap-abe-dsp.h

diff --git a/arch/arm/plat-omap/include/plat/io.h b/arch/arm/plat-omap/include/plat/io.h
index d72ec85..b56e1d3 100644
--- a/arch/arm/plat-omap/include/plat/io.h
+++ b/arch/arm/plat-omap/include/plat/io.h
@@ -205,6 +205,7 @@
 #define L4_PER_44XX_VIRT	(L4_PER_44XX_PHYS + OMAP2_L4_IO_OFFSET)
 #define L4_PER_44XX_SIZE	SZ_4M
 
+#define L4_ABE_44XX_BASE       0x49000000
 #define L4_ABE_44XX_PHYS	L4_ABE_44XX_BASE
 						/* 0x49000000 --> 0xfb000000 */
 #define L4_ABE_44XX_VIRT	(L4_ABE_44XX_PHYS + OMAP2_L4_IO_OFFSET)
diff --git a/include/sound/omap-abe-dsp.h b/include/sound/omap-abe-dsp.h
new file mode 100644
index 0000000..04dae9b
--- /dev/null
+++ b/include/sound/omap-abe-dsp.h
@@ -0,0 +1,19 @@
+/*
+ * omap-aess  --  OMAP4 ABE DSP
+ *
+ * Author: Liam Girdwood <lrg@slimlogic.co.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef _OMAP4_ABE_DSP_H
+#define _OMAP4_ABE_DSP_H
+
+struct omap4_abe_dsp_pdata {
+	/* Return context loss count due to PM states changing */
+	int (*get_context_loss_count)(struct device *dev);
+};
+
+#endif
diff --git a/sound/soc/omap/Kconfig b/sound/soc/omap/Kconfig
index 7e63c5e..e28ca02 100644
--- a/sound/soc/omap/Kconfig
+++ b/sound/soc/omap/Kconfig
@@ -2,6 +2,9 @@ config SND_OMAP_SOC
 	tristate "SoC Audio for the Texas Instruments OMAP chips"
 	depends on ARCH_OMAP
 
+config SND_OMAP_SOC_ABE_DSP
+	tristate
+
 config SND_OMAP_SOC_MCBSP
 	tristate
 	select OMAP_MCBSP
diff --git a/sound/soc/omap/Makefile b/sound/soc/omap/Makefile
index 0f82558..78f5d8e 100644
--- a/sound/soc/omap/Makefile
+++ b/sound/soc/omap/Makefile
@@ -3,13 +3,15 @@ snd-soc-omap-abe-objs := omap-abe.o
 snd-soc-omap-objs := omap-pcm.o
 snd-soc-omap-dmic-objs := omap-dmic.o
 snd-soc-omap-mcbsp-objs := omap-mcbsp.o
-snd-soc-omap-mcpdm-objs := omap-mcpdm.o mcpdm.o
+snd-soc-omap-mcpdm-objs := omap-mcpdm.o
+snd-soc-omap-abe-dsp-objs := omap-abe-dsp.o
 
 obj-$(CONFIG_SND_OMAP_SOC_ABE) += snd-soc-omap-abe.o
 obj-$(CONFIG_SND_OMAP_SOC) += snd-soc-omap.o
 obj-$(CONFIG_SND_OMAP_SOC_DMIC) += snd-soc-omap-dmic.o
 obj-$(CONFIG_SND_OMAP_SOC_MCBSP) += snd-soc-omap-mcbsp.o
 obj-$(CONFIG_SND_OMAP_SOC_MCPDM) += snd-soc-omap-mcpdm.o
+obj-$(CONFIG_SND_OMAP_SOC_ABE_DSP) += snd-soc-omap-abe-dsp.o
 
 # OMAP Machine Support
 snd-soc-n810-objs := n810.o
diff --git a/sound/soc/omap/omap-abe-coef.h b/sound/soc/omap/omap-abe-coef.h
new file mode 100644
index 0000000..6a16980
--- /dev/null
+++ b/sound/soc/omap/omap-abe-coef.h
@@ -0,0 +1,200 @@
+/*
+ * omap-abe-coef.h
+ *
+ * Copyright (C) 2010 Texas Instruments
+ *
+ * Contact: Ricardo Neri <ricardo.neri@ti.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#ifndef __OMAP_ABE_COEFFICIENTS_H__
+#define __OMAP_ABE_COEFFICIENTS_H__
+
+/*
+ * ABE CONST AREA FOR EQUALIZER COEFFICIENTS
+ *
+ * TODO: These coefficents are for demonstration purposes. Set of
+ * coefficients can be computed for specific needs.
+ */
+
+#define NBDL1EQ_PROFILES 4  /* Number of supported DL1EQ profiles */
+#define NBDL1COEFFS 25      /* Number of coefficients for DL1EQ profiles */
+#define NBDL20EQ_PROFILES 4 /* Number of supported DL2EQ_L profiles */
+#define NBDL21EQ_PROFILES 4 /* Number of supported DL2EQ_R profiles */
+#define NBDL2COEFFS 25      /* Number of coefficients of DL2EQ profiles */
+#define NBAMICEQ_PROFILES 3 /* Number of supported AMICEQ profiles */
+#define NBAMICCOEFFS 19     /* Number of coefficients of AMICEQ profiles */
+#define NBSDTEQ_PROFILES 4  /* Number of supported SDTEQ profiles */
+#define NBSDTCOEFFS 9       /* Number of coefficients for SDTEQ profiles */
+#define NBDMICEQ_PROFILES 3 /* Number of supported DMICEQ profiles */
+#define NBDMICCOEFFS 19     /* Number of coefficients of DMICEQ profiles */
+
+/*
+ * Coefficients for DL1EQ
+ */
+const s32 dl1_equ_coeffs[NBDL1EQ_PROFILES][NBDL1COEFFS] = {
+/* Flat response with Gain = 0dB */
+				{0, 0, 0, 0, 0,
+				0, 0, 0, 0, 0,
+				0, 0, 0x040002, 0, 0,
+				0, 0, 0, 0, 0,
+				0, 0, 0, 0, 0},
+
+/* 800Hz cut-off frequency and Gain = 0dB  */
+				{0, 0, 0, 0, 0, 0, 0, 0, 0, -7554223,
+				708210, -708206, 7554225, 0, 0, 0, 0,
+				0, 0, 0, 0, 0, 6802833, -682266, 731554},
+
+/* 800Hz cut-off frequency and Gain = -12dB */
+				{0, 0, 0, 0, 0, 0, 0, 0, 0, -3777112,
+				5665669, -5665667, 3777112, 0, 0, 0, 0,
+				0, 0, 0, 0, 0, 6802833, -682266, 731554},
+
+/* 800Hz cut-off frequency and Gain = -20dB */
+				{0, 0, 0, 0, 0, 0, 0, 0, 0, -1510844,
+				4532536, -4532536, 1510844, 0, 0, 0, 0,
+				0, 0, 0, 0, 0, 6802833, -682266, 731554},
+};
+
+/*
+ * Coefficients for DL2EQ_L
+ */
+const s32 dl20_equ_coeffs[NBDL20EQ_PROFILES][NBDL2COEFFS] = {
+/* Flat response with Gain = 0dB */
+				{0, 0, 0, 0, 0,
+				0, 0, 0, 0, 0,
+				0, 0, 0x040002, 0, 0,
+				0, 0, 0, 0, 0,
+				0, 0, 0, 0, 0},
+
+/* 800Hz cut-off frequency and Gain = 0dB */
+				{0, 0, 0, 0, 0, 0, 0, 0, 0, -7554223,
+				708210, -708206, 7554225, 0, 0, 0, 0,
+				0, 0, 0, 0, 0, 6802833, -682266, 731554},
+
+/* 800Hz cut-off frequency and Gain = -12dB */
+				{0, 0, 0, 0, 0, 0, 0, 0, 0, -3777112,
+				5665669, -5665667, 3777112, 0, 0, 0, 0,
+				0, 0, 0, 0, 0, 6802833, -682266, 731554},
+
+/* 800Hz cut-off frequency and Gain = -20dB */
+				{0, 0, 0, 0, 0, 0, 0, 0, 0, -1510844,
+				4532536, -4532536, 1510844, 0, 0, 0, 0,
+				0, 0, 0, 0, 0, 6802833, -682266, 731554},
+};
+
+/*
+ * Coefficients for DL2_EQ_R
+ */
+const s32 dl21_equ_coeffs[NBDL20EQ_PROFILES][NBDL2COEFFS] = {
+/* Flat response with Gain = 0dB */
+				{0, 0, 0, 0, 0,
+				0, 0, 0, 0, 0,
+				0, 0, 0x040002, 0, 0,
+				0, 0, 0, 0, 0,
+				0, 0, 0, 0, 0},
+
+/* 800Hz cut-off frequency and Gain = 0dB */
+				{0, 0, 0, 0, 0, 0, 0, 0, 0, -7554223,
+				708210, -708206, 7554225, 0, 0, 0, 0,
+				0, 0, 0, 0, 0, 6802833, -682266, 731554},
+
+/*800Hz cut-off frequency and Gain = -12dB */
+				{0, 0, 0, 0, 0, 0, 0, 0, 0, -3777112,
+				5665669, -5665667, 3777112, 0, 0, 0, 0,
+				0, 0, 0, 0, 0, 6802833, -682266, 731554},
+
+/* 800Hz cut-off frequency and Gain = -20dB */
+				{0, 0, 0, 0, 0, 0, 0, 0, 0, -1510844,
+				4532536, -4532536, 1510844, 0, 0, 0, 0,
+				0, 0, 0, 0, 0, 6802833, -682266, 731554},
+};
+
+/*
+ * Coefficients for DMICEQ
+ */
+const u32 dmic_equ_coeffs[NBDMICEQ_PROFILES][NBDMICCOEFFS] = {
+/* 20kHz cut-off frequency and Gain = 0dB */
+				{-4119413, -192384, -341428, -348088,
+				-151380, 151380, 348088, 341428, 192384,
+				4119419, 1938156, -6935719, 775202,
+				-1801934, 2997698, -3692214, 3406822,
+				-2280190, 1042982},
+
+/* 20kHz cut-off frequency and Gain = -12dB */
+				{-1029873, -3078121, -5462817, -5569389,
+				-2422069, 2422071, 5569391, 5462819,
+				3078123, 1029875, 1938188, -6935811,
+				775210, -1801950, 2997722, -3692238,
+				3406838, -2280198, 1042982},
+
+/* 20kHz cut-off frequency and Gain = -18dB */
+				{-514937, -1539061, -2731409, -2784693,
+				-1211033, 1211035, 2784695, 2731411,
+				1539063, 514939, 1938188, -6935811,
+				775210, -1801950, 2997722, -3692238,
+				3406838, -2280198, 1042982},
+};
+
+/*
+ * Coefficients for AMICEQ
+ */
+const u32 amic_equ_coeffs[NBAMICEQ_PROFILES][NBAMICCOEFFS] = {
+/* 20kHz cut-off frequency and Gain = 0dB */
+				{-4119413, -192384, -341428, -348088,
+				-151380, 151380, 348088, 341428, 192384,
+				4119419, 1938156, -6935719, 775202,
+				-1801934, 2997698, -3692214, 3406822,
+				-2280190, 1042982},
+
+/* 20kHz cut-off frequency and Gain = -12dB */
+				{-1029873, -3078121, -5462817, -5569389,
+				-2422069, 2422071, 5569391, 5462819,
+				3078123, 1029875, 1938188, -6935811,
+				775210, -1801950, 2997722, -3692238,
+				3406838, -2280198, 1042982},
+
+/* 20kHz cut-off frequency and Gain = -18dB */
+				{-514937, -1539061, -2731409, -2784693,
+				-1211033, 1211035, 2784695, 2731411,
+				1539063, 514939, 1938188, -6935811,
+				775210, -1801950, 2997722, -3692238,
+				3406838, -2280198, 1042982},
+};
+
+
+/*
+ * Coefficients for SDTEQ
+ */
+const u32 sdt_equ_coeffs[NBSDTEQ_PROFILES][NBSDTCOEFFS] = {
+/* Flat response with Gain = 0dB */
+				{0, 0, 0, 0, 0x040002, 0, 0, 0, 0},
+
+/* 800Hz cut-off frequency and Gain = 0dB  */
+				{0, -7554223, 708210, -708206, 7554225,
+				0, 6802833, -682266, 731554},
+
+/* 800Hz cut-off frequency and Gain = -12dB */
+				{0, -3777112, 5665669, -5665667, 3777112,
+				0, 6802833, -682266, 731554},
+
+/* 800Hz cut-off frequency and Gain = -20dB */
+				{0, -1510844, 4532536, -4532536, 1510844,
+				0, 6802833, -682266, 731554}
+};
+
+#endif	/* End of __OMAP_ABE_COEFFICIENTS_H__ */
diff --git a/sound/soc/omap/omap-abe-dsp.c b/sound/soc/omap/omap-abe-dsp.c
new file mode 100644
index 0000000..0b9826f
--- /dev/null
+++ b/sound/soc/omap/omap-abe-dsp.c
@@ -0,0 +1,2161 @@
+/*
+ * omap-abe-dsp.c
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ * Copyright (C) 2010 Texas Instruments Inc.
+ *
+ * Author : Liam Girdwood <lrg@slimlogic.co.uk>
+ *
+ */
+
+#undef DEBUG
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/init.h>
+#include <linux/delay.h>
+#include <linux/pm.h>
+#include <linux/i2c.h>
+#include <linux/gpio.h>
+#include <linux/platform_device.h>
+#include <linux/workqueue.h>
+#include <linux/i2c/twl.h>
+#include <linux/clk.h>
+#include <linux/err.h>
+#include <linux/slab.h>
+#include <linux/pm_runtime.h>
+#include <linux/dma-mapping.h>
+
+#include <plat/omap_hwmod.h>
+#include <plat/omap_device.h>
+#include <plat/dma.h>
+#include <plat/omap-pm.h>
+#include <plat/prcm.h>
+#include "../../../arch/arm/mach-omap2/powerdomain.h"
+#include "../../../arch/arm/mach-omap2/pm.h"
+
+
+#include <sound/core.h>
+#include <sound/pcm.h>
+#include <sound/pcm_params.h>
+#include <sound/soc.h>
+#include <sound/soc-dapm.h>
+#include <sound/initval.h>
+#include <sound/tlv.h>
+#include <sound/omap-abe-dsp.h>
+
+#include "omap-abe-dsp.h"
+#include "omap-abe-coef.h"
+#include "omap-abe.h"
+#include "abe/abe_main.h"
+
+// TODO: change to S16 and use ARM SIMD to re-format to S32
+#define ABE_FORMATS	 (SNDRV_PCM_FMTBIT_S32_LE)
+
+// TODO: make all these into virtual registers or similar - split out by type */
+#define ABE_NUM_MIXERS		22
+#define ABE_NUM_MUXES		12
+#define ABE_NUM_WIDGETS	        46	/* TODO - refine this val */
+#define ABE_NUM_DAPM_REG		\
+	(ABE_NUM_MIXERS + ABE_NUM_MUXES + ABE_NUM_WIDGETS)
+#define ABE_WIDGET_START	(ABE_NUM_MIXERS + ABE_NUM_MUXES)
+#define ABE_WIDGET_END	(ABE_WIDGET_START + ABE_NUM_WIDGETS)
+#define ABE_BE_START		(ABE_WIDGET_START + 7)
+#define ABE_BE_END	(ABE_BE_START + 10)
+#define ABE_MUX_BASE	ABE_NUM_MIXERS
+
+/* Uplink MUX path identifiers from ROUTE_UL */
+#define ABE_MM_UL1(x)		(x + ABE_NUM_MIXERS)
+#define ABE_MM_UL2(x)		(x + ABE_NUM_MIXERS + 8)
+#define ABE_VX_UL(x)			(x + ABE_NUM_MIXERS + 10)
+#define ABE_WIDGET(x)		(x + ABE_NUM_MIXERS + ABE_NUM_MUXES)
+//#define ABE_BE_WIDGET(x)		(x + ABE_NUM_MIXERS + ABE_NUM_MUXES)
+
+#define VIRT_SWITCH	0
+
+// TODO: OPP bitmask - Use HAL version after update
+#define ABE_OPP_25		0
+#define ABE_OPP_50		1
+#define ABE_OPP_100		2
+
+#define ABE_ROUTES_UL		14
+
+/* TODO: fine tune for ping pong - buffer is 2 periods of 12k each*/
+static const struct snd_pcm_hardware omap_abe_hardware = {
+	.info			= SNDRV_PCM_INFO_MMAP |
+				  SNDRV_PCM_INFO_MMAP_VALID |
+				  SNDRV_PCM_INFO_INTERLEAVED |
+				  SNDRV_PCM_INFO_BLOCK_TRANSFER |
+				  SNDRV_PCM_INFO_PAUSE |
+				  SNDRV_PCM_INFO_RESUME,
+	.formats		= SNDRV_PCM_FMTBIT_S16_LE |
+				  SNDRV_PCM_FMTBIT_S32_LE,
+	.period_bytes_min	= 4 * 1024,
+	.period_bytes_max	= 24 * 1024,
+	.periods_min		= 2,
+	.periods_max		= 2,
+	.buffer_bytes_max	= 24 * 1024 * 2,
+};
+
+/*
+ * ABE driver
+ *
+ * TODO: tasks 1,2,3,4,5,6,7,8 below
+ *
+ * This driver is responsible for :-
+ * 1) ABE init - including loading ABE firmware
+ * 2) ABE coefficient mgmt - inc user space re-calcs
+ * 8) Process ABE platform data
+ *
+ */
+
+/* ABE private data */
+struct abe_data {
+	struct omap4_abe_dsp_pdata *abe_pdata;
+	struct platform_device *pdev;
+	struct snd_soc_platform *platform;
+
+	struct delayed_work delayed_work;
+	struct mutex mutex;
+	struct mutex opp_mutex;
+
+	struct clk *clk;
+
+	void __iomem *io_base;
+	int irq;
+	int opp;
+
+	int fe_id;
+
+	unsigned int dl1_equ_profile;
+	unsigned int dl20_equ_profile;
+	unsigned int dl21_equ_profile;
+	unsigned int sdt_equ_profile;
+	unsigned int amic_equ_profile;
+	unsigned int dmic_equ_profile;
+
+	int active;
+
+	/* DAPM mixer config - TODO: some of this can be replaced with HAL update */
+	u32 dapm[ABE_NUM_DAPM_REG];
+
+	u16 router[16];
+
+	int loss_count;
+
+	int first_irq;
+
+	struct snd_pcm_substream *psubs;
+
+};
+
+static struct abe_data *abe;
+
+static struct powerdomain *abe_pwrdm;
+
+// TODO: map to the new version of HAL
+static unsigned int abe_dsp_read(struct snd_soc_platform *platform,
+		unsigned int reg)
+{
+	struct abe_data *priv = snd_soc_platform_get_drvdata(platform);
+	return priv->dapm[reg];
+}
+
+static int abe_dsp_write(struct snd_soc_platform *platform, unsigned int reg,
+		unsigned int val)
+{
+	struct abe_data *priv = snd_soc_platform_get_drvdata(platform);
+	priv->dapm[reg] = val;
+
+	//dev_dbg(platform->dev, "fe: %d widget %d %s\n", abe->fe_id,
+	//		reg - ABE_WIDGET_START, val ? "on" : "off");
+	return 0;
+}
+
+static void abe_irq_pingpong_subroutine(void)
+{
+	u32 dst, n_bytes;
+
+	abe_read_next_ping_pong_buffer(MM_DL_PORT, &dst, &n_bytes);
+	abe_set_ping_pong_buffer(MM_DL_PORT, n_bytes);
+
+	/* Do not call ALSA function for first IRQ */
+	if (abe->first_irq) {
+		abe->first_irq = 0;
+	} else {
+		if (abe->psubs)
+			snd_pcm_period_elapsed(abe->psubs);
+	}
+}
+
+static irqreturn_t abe_irq_handler(int irq, void *dev_id)
+{
+	/* TODO: do not use abe global structure to assign pdev */
+	struct platform_device *pdev = abe->pdev;
+
+	/* TODO: handle underruns/overruns/errors */
+	pm_runtime_get_sync(&pdev->dev);
+	abe_clear_irq();
+	abe_irq_processing();
+	pm_runtime_put_sync(&pdev->dev);
+
+	return IRQ_HANDLED;
+}
+
+static int abe_init_engine(struct snd_soc_platform *platform)
+{
+	struct abe_data *priv = snd_soc_platform_get_drvdata(platform);
+#ifndef CONFIG_PM_RUNTIME
+	struct omap4_abe_dsp_pdata *pdata = priv->abe_pdata;
+#endif
+	struct platform_device *pdev = priv->pdev;
+	abe_equ_t dl2_eq;
+	int ret = 0;
+
+	abe_init_mem(abe->io_base);
+
+	/* aess_clk has to be enabled to access hal register.
+	 * Disable the clk after it has been used.
+	 */
+	pm_runtime_get_sync(&pdev->dev);
+
+	ret = request_threaded_irq(abe->irq, NULL, abe_irq_handler,
+				IRQF_ONESHOT, "ABE", (void *)abe);
+	if (ret) {
+		dev_err(platform->dev, "request for ABE IRQ %d failed %d\n",
+				abe->irq, ret);
+		return ret;
+	}
+
+	abe_reset_hal();
+
+	abe_load_fw();	// TODO: use fw API here
+
+	/* Config OPP 100 for now */
+	mutex_lock(&abe->opp_mutex);
+	abe_set_opp_processing(ABE_OPP100);
+	abe->opp = 100;
+	mutex_unlock(&abe->opp_mutex);
+
+	/* "tick" of the audio engine */
+	abe_write_event_generator(EVENT_TIMER);
+
+	dl2_eq.equ_length = NBDL2COEFFS;
+
+	/* build the coefficient parameter for the equalizer api */
+	memcpy(dl2_eq.coef.type1, dl20_equ_coeffs[1],
+				sizeof(dl20_equ_coeffs[1]));
+
+	/* load the high-pass coefficient of IHF-Right */
+	abe_write_equalizer(EQ2L, &dl2_eq);
+	abe->dl20_equ_profile = 1;
+
+	/* build the coefficient parameter for the equalizer api */
+	memcpy(dl2_eq.coef.type1, dl21_equ_coeffs[1],
+				sizeof(dl21_equ_coeffs[1]));
+
+	/* load the high-pass coefficient of IHF-Left */
+	abe_write_equalizer(EQ2R, &dl2_eq);
+	abe->dl21_equ_profile = 1;
+
+	pm_runtime_put_sync(&pdev->dev);
+
+	/* set initial state to all-pass with gain=1 coefficients */
+	abe->amic_equ_profile = 0;
+	abe->dmic_equ_profile = 0;
+	abe->dl1_equ_profile = 0;
+	abe->sdt_equ_profile = 0;
+
+
+	return ret;
+}
+
+void abe_dsp_pm_get(void)
+{
+	/* TODO: do not use abe global structure to assign pdev */
+	struct platform_device *pdev = abe->pdev;
+
+	pm_runtime_get_sync(&pdev->dev);
+}
+
+void abe_dsp_pm_put(void)
+{
+	/* TODO: do not use abe global structure to assign pdev */
+	struct platform_device *pdev = abe->pdev;
+
+	pm_runtime_put_sync(&pdev->dev);
+}
+
+void abe_dsp_shutdown(void)
+{
+	if (!abe->active && !abe_check_activity()) {
+		abe_set_opp_processing(ABE_OPP25);
+		abe->opp = 25;
+		abe_stop_event_generator();
+		udelay(250);
+		/* FIXME: Dependency on PM framework */
+		//omap_device_set_rate(&pdev->dev, &pdev->dev, 0);
+	}
+}
+
+void abe_dsp_mcpdm_shutdown(void)
+{
+	mutex_lock(&abe->mutex);
+
+	abe_dsp_shutdown();
+
+	mutex_unlock(&abe->mutex);
+
+	return;
+}
+
+/*
+ * These TLV settings will need fine tuned for each individual control
+ */
+
+/* Media DL1 volume control from -120 to 30 dB in 1 dB steps */
+static DECLARE_TLV_DB_SCALE(mm_dl1_tlv, -12000, 100, 3000);
+
+/* Media DL1 volume control from -120 to 30 dB in 1 dB steps */
+static DECLARE_TLV_DB_SCALE(tones_dl1_tlv, -12000, 100, 3000);
+
+/* Media DL1 volume control from -120 to 30 dB in 1 dB steps */
+static DECLARE_TLV_DB_SCALE(voice_dl1_tlv, -12000, 100, 3000);
+
+/* Media DL1 volume control from -120 to 30 dB in 1 dB steps */
+static DECLARE_TLV_DB_SCALE(capture_dl1_tlv, -12000, 100, 3000);
+
+/* Media DL2 volume control from -120 to 30 dB in 1 dB steps */
+static DECLARE_TLV_DB_SCALE(mm_dl2_tlv, -12000, 100, 3000);
+
+/* Media DL2 volume control from -120 to 30 dB in 1 dB steps */
+static DECLARE_TLV_DB_SCALE(tones_dl2_tlv, -12000, 100, 3000);
+
+/* Media DL2 volume control from -120 to 30 dB in 1 dB steps */
+static DECLARE_TLV_DB_SCALE(voice_dl2_tlv, -12000, 100, 3000);
+
+/* Media DL2 volume control from -120 to 30 dB in 1 dB steps */
+static DECLARE_TLV_DB_SCALE(capture_dl2_tlv, -12000, 100, 3000);
+
+/* SDT volume control from -120 to 30 dB in 1 dB steps */
+static DECLARE_TLV_DB_SCALE(sdt_ul_tlv, -12000, 100, 3000);
+
+/* SDT volume control from -120 to 30 dB in 1 dB steps */
+static DECLARE_TLV_DB_SCALE(sdt_dl_tlv, -12000, 100, 3000);
+
+/* AUDUL volume control from -120 to 30 dB in 1 dB steps */
+static DECLARE_TLV_DB_SCALE(audul_mm_tlv, -12000, 100, 3000);
+
+/* AUDUL volume control from -120 to 30 dB in 1 dB steps */
+static DECLARE_TLV_DB_SCALE(audul_tones_tlv, -12000, 100, 3000);
+
+/* AUDUL volume control from -120 to 30 dB in 1 dB steps */
+static DECLARE_TLV_DB_SCALE(audul_vx_ul_tlv, -12000, 100, 3000);
+
+/* AUDUL volume control from -120 to 30 dB in 1 dB steps */
+static DECLARE_TLV_DB_SCALE(audul_vx_dl_tlv, -12000, 100, 3000);
+
+/* VXREC volume control from -120 to 30 dB in 1 dB steps */
+static DECLARE_TLV_DB_SCALE(vxrec_mm_dl_tlv, -12000, 100, 3000);
+
+/* VXREC volume control from -120 to 30 dB in 1 dB steps */
+static DECLARE_TLV_DB_SCALE(vxrec_tones_tlv, -12000, 100, 3000);
+
+/* VXREC volume control from -120 to 30 dB in 1 dB steps */
+static DECLARE_TLV_DB_SCALE(vxrec_vx_dl_tlv, -12000, 100, 3000);
+
+/* VXREC volume control from -120 to 30 dB in 1 dB steps */
+static DECLARE_TLV_DB_SCALE(vxrec_vx_ul_tlv, -12000, 100, 3000);
+
+/* DMIC volume control from -120 to 30 dB in 1 dB steps */
+static DECLARE_TLV_DB_SCALE(dmic_tlv, -12000, 100, 3000);
+
+//TODO: we have to use the shift value atm to represent register id due to current HAL
+static int dl1_put_mixer(struct snd_kcontrol *kcontrol,
+	struct snd_ctl_elem_value *ucontrol)
+{
+	struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol);
+	struct soc_mixer_control *mc =
+		(struct soc_mixer_control *)kcontrol->private_value;
+
+	/* TODO: do not use abe global structure to assign pdev */
+	struct platform_device *pdev = abe->pdev;
+
+	pm_runtime_get_sync(&pdev->dev);
+
+	if (ucontrol->value.integer.value[0]) {
+		abe->dapm[mc->shift] = ucontrol->value.integer.value[0];
+		snd_soc_dapm_mixer_update_power(widget, kcontrol, 1);
+		abe_enable_gain(MIXDL1, mc->reg);
+	} else {
+		abe->dapm[mc->shift] = ucontrol->value.integer.value[0];
+		snd_soc_dapm_mixer_update_power(widget, kcontrol, 0);
+		abe_disable_gain(MIXDL1, mc->reg);
+	}
+	pm_runtime_put_sync(&pdev->dev);
+
+	return 1;
+}
+
+static int dl2_put_mixer(struct snd_kcontrol *kcontrol,
+	struct snd_ctl_elem_value *ucontrol)
+{
+	struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol);
+	struct soc_mixer_control *mc =
+		(struct soc_mixer_control *)kcontrol->private_value;
+
+	/* TODO: do not use abe global structure to assign pdev */
+	struct platform_device *pdev = abe->pdev;
+
+	pm_runtime_get_sync(&pdev->dev);
+
+	if (ucontrol->value.integer.value[0]) {
+		abe->dapm[mc->shift] = ucontrol->value.integer.value[0];
+		snd_soc_dapm_mixer_update_power(widget, kcontrol, 1);
+		abe_enable_gain(MIXDL2, mc->reg);
+	} else {
+		abe->dapm[mc->shift] = ucontrol->value.integer.value[0];
+		snd_soc_dapm_mixer_update_power(widget, kcontrol, 0);
+		abe_disable_gain(MIXDL2, mc->reg);
+	}
+
+	pm_runtime_put_sync(&pdev->dev);
+	return 1;
+}
+
+static int audio_ul_put_mixer(struct snd_kcontrol *kcontrol,
+	struct snd_ctl_elem_value *ucontrol)
+{
+	struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol);
+	struct soc_mixer_control *mc =
+		(struct soc_mixer_control *)kcontrol->private_value;
+
+	/* TODO: do not use abe global structure to assign pdev */
+	struct platform_device *pdev = abe->pdev;
+
+	pm_runtime_get_sync(&pdev->dev);
+
+	if (ucontrol->value.integer.value[0]) {
+		abe->dapm[mc->shift] = ucontrol->value.integer.value[0];
+		snd_soc_dapm_mixer_update_power(widget, kcontrol, 1);
+		abe_enable_gain(MIXAUDUL, mc->reg);
+	} else {
+		abe->dapm[mc->shift] = ucontrol->value.integer.value[0];
+		snd_soc_dapm_mixer_update_power(widget, kcontrol, 0);
+		abe_disable_gain(MIXAUDUL, mc->reg);
+	}
+	pm_runtime_put_sync(&pdev->dev);
+
+	return 1;
+}
+
+static int vxrec_put_mixer(struct snd_kcontrol *kcontrol,
+	struct snd_ctl_elem_value *ucontrol)
+{
+	struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol);
+	struct soc_mixer_control *mc =
+		(struct soc_mixer_control *)kcontrol->private_value;
+
+	/* TODO: do not use abe global structure to assign pdev */
+	struct platform_device *pdev = abe->pdev;
+
+	pm_runtime_get_sync(&pdev->dev);
+
+	if (ucontrol->value.integer.value[0]) {
+		abe->dapm[mc->shift] = ucontrol->value.integer.value[0];
+		snd_soc_dapm_mixer_update_power(widget, kcontrol, 1);
+		abe_enable_gain(MIXVXREC, mc->reg);
+	} else {
+		abe->dapm[mc->shift] = ucontrol->value.integer.value[0];
+		snd_soc_dapm_mixer_update_power(widget, kcontrol, 0);
+		abe_disable_gain(MIXVXREC, mc->reg);
+	}
+	pm_runtime_put_sync(&pdev->dev);
+
+	return 1;
+}
+
+static int sdt_put_mixer(struct snd_kcontrol *kcontrol,
+	struct snd_ctl_elem_value *ucontrol)
+{
+	struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol);
+	struct soc_mixer_control *mc =
+		(struct soc_mixer_control *)kcontrol->private_value;
+
+	/* TODO: do not use abe global structure to assign pdev */
+	struct platform_device *pdev = abe->pdev;
+
+	pm_runtime_get_sync(&pdev->dev);
+
+	if (ucontrol->value.integer.value[0]) {
+		abe->dapm[mc->shift] = ucontrol->value.integer.value[0];
+		snd_soc_dapm_mixer_update_power(widget, kcontrol, 1);
+		abe_enable_gain(MIXSDT, mc->reg);
+	} else {
+		abe->dapm[mc->shift] = ucontrol->value.integer.value[0];
+		snd_soc_dapm_mixer_update_power(widget, kcontrol, 0);
+		abe_disable_gain(MIXSDT, mc->reg);
+	}
+	pm_runtime_put_sync(&pdev->dev);
+
+	return 1;
+}
+
+static int abe_get_mixer(struct snd_kcontrol *kcontrol,
+	struct snd_ctl_elem_value *ucontrol)
+{
+	struct soc_mixer_control *mc =
+		(struct soc_mixer_control *)kcontrol->private_value;
+
+	ucontrol->value.integer.value[0] = abe->dapm[mc->shift];
+
+	return 0;
+}
+
+/* router IDs that match our mixer strings */
+static const abe_router_t router[] = {
+		ZERO_labelID, /* strangely this is not 0 */
+		DMIC1_L_labelID, DMIC1_R_labelID,
+		DMIC2_L_labelID, DMIC2_R_labelID,
+		DMIC3_L_labelID, DMIC3_R_labelID,
+		BT_UL_L_labelID, BT_UL_R_labelID,
+		AMIC_L_labelID, AMIC_R_labelID,
+		VX_REC_L_labelID, VX_REC_R_labelID,
+};
+
+static int ul_mux_put_route(struct snd_kcontrol *kcontrol,
+	struct snd_ctl_elem_value *ucontrol)
+{
+	struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol);
+	struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
+	int mux = ucontrol->value.enumerated.item[0];
+	int reg = e->reg - ABE_MUX_BASE, i;
+
+	/* TODO: do not use abe global structure to assign pdev */
+	struct platform_device *pdev = abe->pdev;
+
+	pm_runtime_get_sync(&pdev->dev);
+
+	if (mux >= ABE_ROUTES_UL)
+		return 0;
+
+	if (reg < 8) {
+		/* 0  .. 9   = MM_UL */
+		abe->router[reg] = router[mux];
+	} else if (reg < 12) {
+		/* 10 .. 11  = MM_UL2 */
+		/* 12 .. 13  = VX_UL */
+		abe->router[reg + 2] = router[mux];
+	}
+
+	/* there is a 2 slot gap in the table, making it ABE_ROUTES_UL + 2 in size */
+	for (i = 0; i < ABE_ROUTES_UL + 2; i++)
+		dev_dbg(widget->dapm->dev, "router table [%d] = %d\n", i, abe->router[i]);
+
+	/* 2nd arg here is unused */
+	abe_set_router_configuration(UPROUTE, 0, (u32 *)abe->router);
+
+	abe->dapm[e->reg] = ucontrol->value.integer.value[0];
+	snd_soc_dapm_mux_update_power(widget, kcontrol, abe->dapm[e->reg], mux, e);
+	pm_runtime_put_sync(&pdev->dev);
+
+	return 1;
+}
+
+static int ul_mux_get_route(struct snd_kcontrol *kcontrol,
+	struct snd_ctl_elem_value *ucontrol)
+{
+	struct soc_enum *e =
+		(struct soc_enum *)kcontrol->private_value;
+
+	// TODO: get mux via HAL
+
+	ucontrol->value.integer.value[0] = abe->dapm[e->reg];
+	return 0;
+}
+
+
+static int abe_put_switch(struct snd_kcontrol *kcontrol,
+	struct snd_ctl_elem_value *ucontrol)
+{
+	struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol);
+	struct soc_mixer_control *mc =
+		(struct soc_mixer_control *)kcontrol->private_value;
+
+	/* TODO: do not use abe global structure to assign pdev */
+	struct platform_device *pdev = abe->pdev;
+
+	pm_runtime_get_sync(&pdev->dev);
+
+	if (ucontrol->value.integer.value[0]) {
+		abe->dapm[mc->shift] = ucontrol->value.integer.value[0];
+		snd_soc_dapm_mixer_update_power(widget, kcontrol, 1);
+	} else {
+		abe->dapm[mc->shift] = ucontrol->value.integer.value[0];
+		snd_soc_dapm_mixer_update_power(widget, kcontrol, 0);
+	}
+	pm_runtime_put_sync(&pdev->dev);
+
+	return 1;
+}
+
+
+static int volume_put_sdt_mixer(struct snd_kcontrol *kcontrol,
+	struct snd_ctl_elem_value *ucontrol)
+{
+	struct soc_mixer_control *mc =
+		(struct soc_mixer_control *)kcontrol->private_value;
+
+	/* TODO: do not use abe global structure to assign pdev */
+	struct platform_device *pdev = abe->pdev;
+
+	pm_runtime_get_sync(&pdev->dev);
+
+	abe_write_mixer(MIXSDT, -12000 + (ucontrol->value.integer.value[0] * 100),
+				RAMP_0MS, mc->reg);
+	pm_runtime_put_sync(&pdev->dev);
+
+	return 1;
+}
+
+static int volume_put_audul_mixer(struct snd_kcontrol *kcontrol,
+	struct snd_ctl_elem_value *ucontrol)
+{
+	struct soc_mixer_control *mc =
+		(struct soc_mixer_control *)kcontrol->private_value;
+
+	/* TODO: do not use abe global structure to assign pdev */
+	struct platform_device *pdev = abe->pdev;
+
+	pm_runtime_get_sync(&pdev->dev);
+	abe_write_mixer(MIXAUDUL, -12000 + (ucontrol->value.integer.value[0] * 100),
+				RAMP_0MS, mc->reg);
+	pm_runtime_put_sync(&pdev->dev);
+
+	return 1;
+}
+
+static int volume_put_vxrec_mixer(struct snd_kcontrol *kcontrol,
+	struct snd_ctl_elem_value *ucontrol)
+{
+	struct soc_mixer_control *mc =
+		(struct soc_mixer_control *)kcontrol->private_value;
+	/* TODO: do not use abe global structure to assign pdev */
+	struct platform_device *pdev = abe->pdev;
+
+	pm_runtime_get_sync(&pdev->dev);
+	abe_write_mixer(MIXVXREC, -12000 + (ucontrol->value.integer.value[0] * 100),
+				RAMP_0MS, mc->reg);
+	pm_runtime_put_sync(&pdev->dev);
+
+	return 1;
+}
+
+static int volume_put_dl1_mixer(struct snd_kcontrol *kcontrol,
+	struct snd_ctl_elem_value *ucontrol)
+{
+	struct soc_mixer_control *mc =
+		(struct soc_mixer_control *)kcontrol->private_value;
+	/* TODO: do not use abe global structure to assign pdev */
+	struct platform_device *pdev = abe->pdev;
+
+	pm_runtime_get_sync(&pdev->dev);
+	abe_write_mixer(MIXDL1, -12000 + (ucontrol->value.integer.value[0] * 100),
+				RAMP_0MS, mc->reg);
+	pm_runtime_put_sync(&pdev->dev);
+
+	return 1;
+}
+
+static int volume_put_dl2_mixer(struct snd_kcontrol *kcontrol,
+	struct snd_ctl_elem_value *ucontrol)
+{
+	struct soc_mixer_control *mc =
+		(struct soc_mixer_control *)kcontrol->private_value;
+	/* TODO: do not use abe global structure to assign pdev */
+	struct platform_device *pdev = abe->pdev;
+
+	pm_runtime_get_sync(&pdev->dev);
+	abe_write_mixer(MIXDL2, -12000 + (ucontrol->value.integer.value[0] * 100),
+				RAMP_0MS, mc->reg);
+	pm_runtime_put_sync(&pdev->dev);
+
+	return 1;
+}
+
+static int volume_put_dmic(struct snd_kcontrol *kcontrol,
+	struct snd_ctl_elem_value *ucontrol)
+{
+	struct soc_mixer_control *mc =
+		(struct soc_mixer_control *)kcontrol->private_value;
+	/* TODO: do not use abe global structure to assign pdev */
+	struct platform_device *pdev = abe->pdev;
+
+	pm_runtime_get_sync(&pdev->dev);
+	abe_write_gain(mc->reg,
+		       -12000 + (ucontrol->value.integer.value[0] * 100),
+		       RAMP_20MS, mc->shift);
+	abe_write_gain(mc->reg,
+		       -12000 + (ucontrol->value.integer.value[1] * 100),
+		       RAMP_20MS, mc->rshift);
+	pm_runtime_put_sync(&pdev->dev);
+
+	return 1;
+}
+
+static int volume_get_dl1_mixer(struct snd_kcontrol *kcontrol,
+	struct snd_ctl_elem_value *ucontrol)
+{
+	struct soc_mixer_control *mc =
+		(struct soc_mixer_control *)kcontrol->private_value;
+	u32 val;
+	/* TODO: do not use abe global structure to assign pdev */
+	struct platform_device *pdev = abe->pdev;
+
+	pm_runtime_get_sync(&pdev->dev);
+	abe_read_mixer(MIXDL1, &val, mc->reg);
+	ucontrol->value.integer.value[0] = (val + 12000) / 100;
+	pm_runtime_put_sync(&pdev->dev);
+
+	return 0;
+}
+
+static int volume_get_dl2_mixer(struct snd_kcontrol *kcontrol,
+	struct snd_ctl_elem_value *ucontrol)
+{
+	struct soc_mixer_control *mc =
+		(struct soc_mixer_control *)kcontrol->private_value;
+	/* TODO: do not use abe global structure to assign pdev */
+	struct platform_device *pdev = abe->pdev;
+	u32 val;
+
+	pm_runtime_get_sync(&pdev->dev);
+	abe_read_mixer(MIXDL2, &val, mc->reg);
+	ucontrol->value.integer.value[0] = (val + 12000) / 100;
+	pm_runtime_put_sync(&pdev->dev);
+
+	return 0;
+}
+
+static int volume_get_audul_mixer(struct snd_kcontrol *kcontrol,
+	struct snd_ctl_elem_value *ucontrol)
+{
+	struct soc_mixer_control *mc =
+		(struct soc_mixer_control *)kcontrol->private_value;
+	/* TODO: do not use abe global structure to assign pdev */
+	struct platform_device *pdev = abe->pdev;
+	u32 val;
+
+	pm_runtime_get_sync(&pdev->dev);
+	abe_read_mixer(MIXAUDUL, &val, mc->reg);
+	ucontrol->value.integer.value[0] = (val + 12000) / 100;
+	pm_runtime_put_sync(&pdev->dev);
+
+	return 0;
+}
+
+static int volume_get_vxrec_mixer(struct snd_kcontrol *kcontrol,
+	struct snd_ctl_elem_value *ucontrol)
+{
+	struct soc_mixer_control *mc =
+		(struct soc_mixer_control *)kcontrol->private_value;
+	/* TODO: do not use abe global structure to assign pdev */
+	struct platform_device *pdev = abe->pdev;
+	u32 val;
+
+	pm_runtime_get_sync(&pdev->dev);
+	abe_read_mixer(MIXVXREC, &val, mc->reg);
+	ucontrol->value.integer.value[0] = (val + 12000) / 100;
+	pm_runtime_put_sync(&pdev->dev);
+
+	return 0;
+}
+
+static int volume_get_sdt_mixer(struct snd_kcontrol *kcontrol,
+	struct snd_ctl_elem_value *ucontrol)
+{
+	struct soc_mixer_control *mc =
+		(struct soc_mixer_control *)kcontrol->private_value;
+	/* TODO: do not use abe global structure to assign pdev */
+	struct platform_device *pdev = abe->pdev;
+	u32 val;
+
+	pm_runtime_get_sync(&pdev->dev);
+	abe_read_mixer(MIXSDT, &val, mc->reg);
+	ucontrol->value.integer.value[0] = (val + 12000) / 100;
+	pm_runtime_put_sync(&pdev->dev);
+
+	return 0;
+}
+
+static int volume_get_dmic(struct snd_kcontrol *kcontrol,
+	struct snd_ctl_elem_value *ucontrol)
+{
+	struct soc_mixer_control *mc =
+		(struct soc_mixer_control *)kcontrol->private_value;
+	/* TODO: do not use abe global structure to assign pdev */
+	struct platform_device *pdev = abe->pdev;
+	u32 val;
+
+	pm_runtime_get_sync(&pdev->dev);
+	abe_read_gain(mc->reg, &val, mc->shift);
+	ucontrol->value.integer.value[0] = (val + 12000) / 100;
+	abe_read_gain(mc->reg, &val, mc->rshift);
+	ucontrol->value.integer.value[1] = (val + 12000) / 100;
+	pm_runtime_put_sync(&pdev->dev);
+
+	return 0;
+}
+
+static int abe_get_equalizer(struct snd_kcontrol *kcontrol,
+			struct snd_ctl_elem_value *ucontrol)
+{
+	struct soc_enum *eqc = (struct soc_enum *)kcontrol->private_value;
+	switch (eqc->reg) {
+	case EQ1:
+		ucontrol->value.integer.value[0] = abe->dl1_equ_profile;
+		break;
+	case EQ2L:
+		ucontrol->value.integer.value[0] = abe->dl20_equ_profile;
+		break;
+	case EQ2R:
+		ucontrol->value.integer.value[0] = abe->dl21_equ_profile;
+		break;
+	case EQAMIC:
+		ucontrol->value.integer.value[0] = abe->amic_equ_profile;
+		break;
+	case EQDMIC:
+		ucontrol->value.integer.value[0] = abe->dmic_equ_profile;
+		break;
+	case EQSDT:
+		ucontrol->value.integer.value[0] = abe->sdt_equ_profile;
+		break;
+	default:
+		break;
+	}
+
+	return 0;
+}
+
+static void abe_dsp_set_equalizer(unsigned int id, unsigned int profile)
+{
+	/* TODO: do not use abe global structure to assign pdev */
+	struct platform_device *pdev = abe->pdev;
+	abe_equ_t equ_params;
+
+	switch (id) {
+	case EQ1:
+		equ_params.equ_length = NBDL1COEFFS;
+		memcpy(equ_params.coef.type1, dl1_equ_coeffs[profile],
+				sizeof(dl1_equ_coeffs[profile]));
+		abe->dl1_equ_profile = profile;
+		break;
+	case EQ2L:
+		equ_params.equ_length = NBDL2COEFFS;
+		memcpy(equ_params.coef.type1, dl20_equ_coeffs[profile],
+				sizeof(dl20_equ_coeffs[profile]));
+		abe->dl20_equ_profile = profile;
+		break;
+	case EQ2R:
+		equ_params.equ_length = NBDL2COEFFS;
+		memcpy(equ_params.coef.type1, dl21_equ_coeffs[profile],
+				sizeof(dl21_equ_coeffs[profile]));
+		abe->dl21_equ_profile = profile;
+		break;
+	case EQAMIC:
+		equ_params.equ_length = NBAMICCOEFFS;
+		memcpy(equ_params.coef.type1, amic_equ_coeffs[profile],
+				sizeof(amic_equ_coeffs[profile]));
+		abe->amic_equ_profile = profile;
+		break;
+	case EQDMIC:
+		equ_params.equ_length = NBDMICCOEFFS;
+		memcpy(equ_params.coef.type1, dmic_equ_coeffs[profile],
+				sizeof(dmic_equ_coeffs[profile]));
+		abe->dmic_equ_profile = profile;
+		break;
+	case EQSDT:
+		equ_params.equ_length = NBSDTCOEFFS;
+		memcpy(equ_params.coef.type1, sdt_equ_coeffs[profile],
+				sizeof(sdt_equ_coeffs[profile]));
+		abe->sdt_equ_profile = profile;
+		break;
+	default:
+		return;
+	}
+
+	pm_runtime_get_sync(&pdev->dev);
+	abe_write_equalizer(id, &equ_params);
+	pm_runtime_put_sync(&pdev->dev);
+}
+
+static int abe_put_equalizer(struct snd_kcontrol *kcontrol,
+			struct snd_ctl_elem_value *ucontrol)
+{
+	struct soc_enum *eqc = (struct soc_enum *)kcontrol->private_value;
+	u16 val = ucontrol->value.enumerated.item[0];
+
+	abe_dsp_set_equalizer(eqc->reg, val);
+
+	return 1;
+}
+
+static const char *dl1_equ_texts[] = {
+	"Flat response",
+	"High-pass 0dB",
+	"High-pass -12dB",
+	"High-pass -20dB",
+};
+
+static const char *dl20_equ_texts[] = {
+	"Flat response",
+	"High-pass 0dB",
+	"High-pass -12dB",
+	"High-pass -20dB",
+};
+
+static const char *dl21_equ_texts[] = {
+	"Flat response",
+	"High-pass 0dB",
+	"High-pass -12dB",
+	"High-pass -20dB",
+};
+
+static const char *amic_equ_texts[] = {
+	"High-pass 0dB",
+	"High-pass -12dB",
+	"High-pass -18dB",
+};
+
+static const char *dmic_equ_texts[] = {
+	"High-pass 0dB",
+	"High-pass -12dB",
+	"High-pass -18dB",
+};
+
+static const char *sdt_equ_texts[] = {
+	"Flat response",
+	"High-pass 0dB",
+	"High-pass -12dB",
+	"High-pass -20dB",
+};
+
+static const struct soc_enum dl1_equalizer_enum =
+	SOC_ENUM_SINGLE(EQ1, 0, NBDL1EQ_PROFILES, dl1_equ_texts);
+
+static const struct soc_enum dl20_equalizer_enum =
+	SOC_ENUM_SINGLE(EQ2L, 0, NBDL20EQ_PROFILES, dl20_equ_texts);
+
+static const struct soc_enum dl21_equalizer_enum =
+	SOC_ENUM_SINGLE(EQ2R, 0, NBDL21EQ_PROFILES, dl21_equ_texts);
+
+static const struct soc_enum amic_equalizer_enum =
+	SOC_ENUM_SINGLE(EQAMIC, 0, NBAMICEQ_PROFILES, amic_equ_texts);
+
+static const struct soc_enum dmic_equalizer_enum =
+	SOC_ENUM_SINGLE(EQDMIC, 0, NBDMICEQ_PROFILES, dmic_equ_texts);
+
+static const struct soc_enum sdt_equalizer_enum =
+	SOC_ENUM_SINGLE(EQSDT, 0, NBSDTEQ_PROFILES, sdt_equ_texts);
+
+static const char *route_ul_texts[] =
+	{"None", "DMic0L", "DMic0R", "DMic1L", "DMic1R", "DMic2L", "DMic2R",
+	"BT Left", "BT Right", "AMic0", "AMic1", "VX Left", "VX Right"};
+
+/* ROUTE_UL Mux table */
+static const struct soc_enum abe_enum[] = {
+		SOC_ENUM_SINGLE(ABE_MM_UL1(0), 0, 13, route_ul_texts),
+		SOC_ENUM_SINGLE(ABE_MM_UL1(1), 0, 13, route_ul_texts),
+		SOC_ENUM_SINGLE(ABE_MM_UL1(2), 0, 13, route_ul_texts),
+		SOC_ENUM_SINGLE(ABE_MM_UL1(3), 0, 13, route_ul_texts),
+		SOC_ENUM_SINGLE(ABE_MM_UL1(4), 0, 13, route_ul_texts),
+		SOC_ENUM_SINGLE(ABE_MM_UL1(5), 0, 13, route_ul_texts),
+		SOC_ENUM_SINGLE(ABE_MM_UL1(6), 0, 13, route_ul_texts),
+		SOC_ENUM_SINGLE(ABE_MM_UL1(7), 0, 13, route_ul_texts),
+		SOC_ENUM_SINGLE(ABE_MM_UL2(0), 0, 13, route_ul_texts),
+		SOC_ENUM_SINGLE(ABE_MM_UL2(1), 0, 13, route_ul_texts),
+		SOC_ENUM_SINGLE(ABE_VX_UL(0), 0, 13, route_ul_texts),
+		SOC_ENUM_SINGLE(ABE_VX_UL(1), 0, 13, route_ul_texts),
+};
+
+static const struct snd_kcontrol_new mm_ul00_control =
+	SOC_DAPM_ENUM_EXT("Route", abe_enum[0],
+	ul_mux_get_route, ul_mux_put_route);
+
+static const struct snd_kcontrol_new mm_ul01_control =
+	SOC_DAPM_ENUM_EXT("Route", abe_enum[1],
+	ul_mux_get_route, ul_mux_put_route);
+
+static const struct snd_kcontrol_new mm_ul02_control =
+	SOC_DAPM_ENUM_EXT("Route", abe_enum[2],
+	ul_mux_get_route, ul_mux_put_route);
+
+static const struct snd_kcontrol_new mm_ul03_control =
+	SOC_DAPM_ENUM_EXT("Route", abe_enum[3],
+	ul_mux_get_route, ul_mux_put_route);
+
+static const struct snd_kcontrol_new mm_ul04_control =
+	SOC_DAPM_ENUM_EXT("Route", abe_enum[4],
+	ul_mux_get_route, ul_mux_put_route);
+
+static const struct snd_kcontrol_new mm_ul05_control =
+	SOC_DAPM_ENUM_EXT("Route", abe_enum[5],
+	ul_mux_get_route, ul_mux_put_route);
+
+static const struct snd_kcontrol_new mm_ul06_control =
+	SOC_DAPM_ENUM_EXT("Route", abe_enum[6],
+	ul_mux_get_route, ul_mux_put_route);
+
+static const struct snd_kcontrol_new mm_ul07_control =
+	SOC_DAPM_ENUM_EXT("Route", abe_enum[7],
+	ul_mux_get_route, ul_mux_put_route);
+
+static const struct snd_kcontrol_new mm_ul10_control =
+	SOC_DAPM_ENUM_EXT("Route", abe_enum[8],
+	ul_mux_get_route, ul_mux_put_route);
+
+static const struct snd_kcontrol_new mm_ul11_control =
+	SOC_DAPM_ENUM_EXT("Route", abe_enum[9],
+	ul_mux_get_route, ul_mux_put_route);
+
+static const struct snd_kcontrol_new mm_vx0_control =
+	SOC_DAPM_ENUM_EXT("Route", abe_enum[10],
+	ul_mux_get_route, ul_mux_put_route);
+
+static const struct snd_kcontrol_new mm_vx1_control =
+	SOC_DAPM_ENUM_EXT("Route", abe_enum[11],
+	ul_mux_get_route, ul_mux_put_route);
+
+/* DL1 mixer paths */
+static const struct snd_kcontrol_new dl1_mixer_controls[] = {
+	SOC_SINGLE_EXT("Tones", MIX_DL1_INPUT_TONES, 0, 1, 0,
+		abe_get_mixer, dl1_put_mixer),
+	SOC_SINGLE_EXT("Voice", MIX_DL1_INPUT_VX_DL, 1, 1, 0,
+		abe_get_mixer, dl1_put_mixer),
+	SOC_SINGLE_EXT("Capture", MIX_DL1_INPUT_MM_UL2, 2, 1, 0,
+		abe_get_mixer, dl1_put_mixer),
+	SOC_SINGLE_EXT("Multimedia", MIX_DL1_INPUT_MM_DL, 3, 1, 0,
+		abe_get_mixer, dl1_put_mixer),
+};
+
+/* DL2 mixer paths */
+static const struct snd_kcontrol_new dl2_mixer_controls[] = {
+	SOC_SINGLE_EXT("Tones", MIX_DL2_INPUT_TONES, 4, 1, 0,
+		abe_get_mixer, dl2_put_mixer),
+	SOC_SINGLE_EXT("Voice", MIX_DL2_INPUT_VX_DL, 5, 1, 0,
+		abe_get_mixer, dl2_put_mixer),
+	SOC_SINGLE_EXT("Capture", MIX_DL2_INPUT_MM_UL2, 6, 1, 0,
+		abe_get_mixer, dl2_put_mixer),
+	SOC_SINGLE_EXT("Multimedia", MIX_DL2_INPUT_MM_DL, 7, 1, 0,
+		abe_get_mixer, dl2_put_mixer),
+};
+
+/* AUDUL ("Voice Capture Mixer") mixer paths */
+static const struct snd_kcontrol_new audio_ul_mixer_controls[] = {
+	SOC_SINGLE_EXT("Tones Playback", MIX_AUDUL_INPUT_TONES, 8, 1, 0,
+		abe_get_mixer, audio_ul_put_mixer),
+	SOC_SINGLE_EXT("Media Playback", MIX_AUDUL_INPUT_MM_DL, 9, 1, 0,
+		abe_get_mixer, audio_ul_put_mixer),
+	SOC_SINGLE_EXT("Capture", MIX_AUDUL_INPUT_UPLINK, 10, 1, 0,
+		abe_get_mixer, audio_ul_put_mixer),
+};
+
+/* VXREC ("Capture Mixer")  mixer paths */
+static const struct snd_kcontrol_new vx_rec_mixer_controls[] = {
+	SOC_SINGLE_EXT("Tones", MIX_VXREC_INPUT_TONES, 11, 1, 0,
+		abe_get_mixer, vxrec_put_mixer),
+	SOC_SINGLE_EXT("Voice Playback", MIX_VXREC_INPUT_VX_DL, 12, 1, 0,
+		abe_get_mixer, vxrec_put_mixer),
+	SOC_SINGLE_EXT("Voice Capture", MIX_VXREC_INPUT_VX_UL, 13, 1, 0,
+		abe_get_mixer, vxrec_put_mixer),
+	SOC_SINGLE_EXT("Media Playback", MIX_VXREC_INPUT_MM_DL, 14, 1, 0,
+		abe_get_mixer, vxrec_put_mixer),
+};
+
+/* SDT ("Sidetone Mixer") mixer paths */
+static const struct snd_kcontrol_new sdt_mixer_controls[] = {
+	SOC_SINGLE_EXT("Capture", MIX_SDT_INPUT_UP_MIXER, 15, 1, 0,
+		abe_get_mixer, sdt_put_mixer),
+	SOC_SINGLE_EXT("Playback", MIX_SDT_INPUT_DL1_MIXER, 16, 1, 0,
+		abe_get_mixer, sdt_put_mixer),
+};
+
+/* Virtual PDM_DL Switch */
+static const struct snd_kcontrol_new pdm_dl1_switch_controls =
+	SOC_SINGLE_EXT("Switch", VIRT_SWITCH, 17, 1, 0,
+			abe_get_mixer, abe_put_switch);
+
+/* Virtual BT_VX_DL Switch */
+static const struct snd_kcontrol_new bt_vx_dl_switch_controls =
+	SOC_SINGLE_EXT("Switch", VIRT_SWITCH, 18, 1, 0,
+			abe_get_mixer, abe_put_switch);
+
+/* Virtual MM_EXT_DL Switch */
+static const struct snd_kcontrol_new mm_ext_dl_switch_controls =
+	SOC_SINGLE_EXT("Switch", VIRT_SWITCH, 19, 1, 0,
+			abe_get_mixer, abe_put_switch);
+
+/* Virtual MM_EXT_UL Switch */
+static const struct snd_kcontrol_new mm_ext_ul_switch_controls =
+	SOC_SINGLE_EXT("Switch", VIRT_SWITCH, 20, 1, 0,
+			abe_get_mixer, abe_put_switch);
+
+/* Virtual PDM_UL Switch */
+static const struct snd_kcontrol_new pdm_ul1_switch_controls =
+	SOC_SINGLE_EXT("Switch", VIRT_SWITCH, 21, 1, 0,
+			abe_get_mixer, abe_put_switch);
+
+static const struct snd_kcontrol_new abe_controls[] = {
+	/* DL1 mixer gains */
+	SOC_SINGLE_EXT_TLV("DL1 Media Playback Volume",
+		MIX_DL1_INPUT_MM_DL, 0, 149, 0,
+		volume_get_dl1_mixer, volume_put_dl1_mixer, mm_dl1_tlv),
+	SOC_SINGLE_EXT_TLV("DL1 Tones Playback Volume",
+		MIX_DL1_INPUT_TONES, 0, 149, 0,
+		volume_get_dl1_mixer, volume_put_dl1_mixer, tones_dl1_tlv),
+	SOC_SINGLE_EXT_TLV("DL1 Voice Playback Volume",
+		MIX_DL1_INPUT_VX_DL, 0, 149, 0,
+		volume_get_dl1_mixer, volume_put_dl1_mixer, voice_dl1_tlv),
+	SOC_SINGLE_EXT_TLV("DL1 Capture Playback Volume",
+		MIX_DL1_INPUT_MM_UL2, 0, 149, 0,
+		volume_get_dl1_mixer, volume_put_dl1_mixer, capture_dl1_tlv),
+
+	/* DL2 mixer gains */
+	SOC_SINGLE_EXT_TLV("DL2 Media Playback Volume",
+		MIX_DL2_INPUT_MM_DL, 0, 149, 0,
+		volume_get_dl2_mixer, volume_put_dl2_mixer, mm_dl2_tlv),
+	SOC_SINGLE_EXT_TLV("DL2 Tones Playback Volume",
+		MIX_DL2_INPUT_TONES, 0, 149, 0,
+		volume_get_dl2_mixer, volume_put_dl2_mixer, tones_dl2_tlv),
+	SOC_SINGLE_EXT_TLV("DL2 Voice Playback Volume",
+		MIX_DL2_INPUT_VX_DL, 0, 149, 0,
+		volume_get_dl2_mixer, volume_put_dl2_mixer, voice_dl2_tlv),
+	SOC_SINGLE_EXT_TLV("DL2 Capture Playback Volume",
+		MIX_DL2_INPUT_MM_UL2, 0, 149, 0,
+		volume_get_dl2_mixer, volume_put_dl2_mixer, capture_dl2_tlv),
+
+	/* VXREC mixer gains */
+	SOC_SINGLE_EXT_TLV("VXREC Media Volume",
+		MIX_VXREC_INPUT_MM_DL, 0, 149, 0,
+		volume_get_vxrec_mixer, volume_put_vxrec_mixer, vxrec_mm_dl_tlv),
+	SOC_SINGLE_EXT_TLV("VXREC Tones Volume",
+		MIX_VXREC_INPUT_TONES, 0, 149, 0,
+		volume_get_vxrec_mixer, volume_put_vxrec_mixer, vxrec_tones_tlv),
+	SOC_SINGLE_EXT_TLV("VXREC Voice DL Volume",
+		MIX_VXREC_INPUT_VX_UL, 0, 149, 0,
+		volume_get_vxrec_mixer, volume_put_vxrec_mixer, vxrec_vx_dl_tlv),
+	SOC_SINGLE_EXT_TLV("VXREC Voice UL Volume",
+		MIX_VXREC_INPUT_VX_DL, 0, 149, 0,
+		volume_get_vxrec_mixer, volume_put_vxrec_mixer, vxrec_vx_ul_tlv),
+
+	/* AUDUL mixer gains */
+	SOC_SINGLE_EXT_TLV("AUDUL Media Volume",
+		MIX_AUDUL_INPUT_MM_DL, 0, 149, 0,
+		volume_get_audul_mixer, volume_put_audul_mixer, audul_mm_tlv),
+	SOC_SINGLE_EXT_TLV("AUDUL Tones Volume",
+		MIX_AUDUL_INPUT_TONES, 0, 149, 0,
+		volume_get_audul_mixer, volume_put_audul_mixer, audul_tones_tlv),
+	SOC_SINGLE_EXT_TLV("AUDUL Voice UL Volume",
+		MIX_AUDUL_INPUT_UPLINK, 0, 149, 0,
+		volume_get_audul_mixer, volume_put_audul_mixer, audul_vx_ul_tlv),
+	SOC_SINGLE_EXT_TLV("AUDUL Voice DL Volume",
+		MIX_AUDUL_INPUT_VX_DL, 0, 149, 0,
+		volume_get_audul_mixer, volume_put_audul_mixer, audul_vx_dl_tlv),
+
+	/* SDT mixer gains */
+	SOC_SINGLE_EXT_TLV("SDT UL Volume",
+		MIX_SDT_INPUT_UP_MIXER, 0, 149, 0,
+		volume_get_sdt_mixer, volume_put_sdt_mixer, sdt_ul_tlv),
+	SOC_SINGLE_EXT_TLV("SDT DL Volume",
+		MIX_SDT_INPUT_DL1_MIXER, 0, 149, 0,
+		volume_get_sdt_mixer, volume_put_sdt_mixer, sdt_dl_tlv),
+
+	/* DMIC gains */
+	SOC_DOUBLE_EXT_TLV("DMIC1 UL Volume",
+		GAINS_DMIC1, GAIN_LEFT_OFFSET, GAIN_RIGHT_OFFSET, 149, 0,
+		volume_get_dmic, volume_put_dmic, dmic_tlv),
+
+	SOC_DOUBLE_EXT_TLV("DMIC2 UL Volume",
+		GAINS_DMIC2, GAIN_LEFT_OFFSET, GAIN_RIGHT_OFFSET, 149, 0,
+		volume_get_dmic, volume_put_dmic, dmic_tlv),
+
+	SOC_DOUBLE_EXT_TLV("DMIC3 UL Volume",
+		GAINS_DMIC3, GAIN_LEFT_OFFSET, GAIN_RIGHT_OFFSET, 149, 0,
+		volume_get_dmic, volume_put_dmic, dmic_tlv),
+
+	SOC_ENUM_EXT("DL1 Equalizer",
+			dl1_equalizer_enum ,
+			abe_get_equalizer, abe_put_equalizer),
+
+	SOC_ENUM_EXT("DL2 Left Equalizer",
+			dl20_equalizer_enum ,
+			abe_get_equalizer, abe_put_equalizer),
+
+	SOC_ENUM_EXT("DL2 Right Equalizer",
+			dl21_equalizer_enum ,
+			abe_get_equalizer, abe_put_equalizer),
+
+	SOC_ENUM_EXT("AMIC Equalizer",
+			amic_equalizer_enum ,
+			abe_get_equalizer, abe_put_equalizer),
+
+	SOC_ENUM_EXT("DMIC Equalizer",
+			dmic_equalizer_enum ,
+			abe_get_equalizer, abe_put_equalizer),
+
+	SOC_ENUM_EXT("Sidetone Equalizer",
+			sdt_equalizer_enum ,
+			abe_get_equalizer, abe_put_equalizer),
+};
+
+static const struct snd_soc_dapm_widget abe_dapm_widgets[] = {
+
+	/* Frontend AIFs */
+	SND_SOC_DAPM_AIF_IN("TONES_DL", "Tones Playback", 0,
+			ABE_WIDGET(0), ABE_OPP_25, 0),
+	SND_SOC_DAPM_AIF_IN("VX_DL", "Voice Playback", 0,
+			ABE_WIDGET(1), ABE_OPP_50, 0),
+	SND_SOC_DAPM_AIF_OUT("VX_UL", "Voice Capture", 0,
+			ABE_WIDGET(2), ABE_OPP_50, 0),
+	/* the MM_UL mapping is intentional */
+	SND_SOC_DAPM_AIF_OUT("MM_UL1", "MultiMedia1 Capture", 0,
+			ABE_WIDGET(3), ABE_OPP_100, 0),
+	SND_SOC_DAPM_AIF_OUT("MM_UL2", "MultiMedia2 Capture", 0,
+			ABE_WIDGET(4), ABE_OPP_50, 0),
+	SND_SOC_DAPM_AIF_IN("MM_DL", " MultiMedia1 Playback", 0,
+			ABE_WIDGET(5), ABE_OPP_25, 0),
+	SND_SOC_DAPM_AIF_IN("MM_DL_LP", " MultiMedia1 LP Playback", 0,
+			ABE_WIDGET(5), ABE_OPP_25, 0),
+	SND_SOC_DAPM_AIF_IN("VIB_DL", "Vibra Playback", 0,
+			ABE_WIDGET(6), ABE_OPP_100, 0),
+	SND_SOC_DAPM_AIF_IN("MODEM_DL", "MODEM Playback", 0,
+			ABE_WIDGET(7), ABE_OPP_50, 0),
+	SND_SOC_DAPM_AIF_OUT("MODEM_UL", "MODEM Capture", 0,
+			ABE_WIDGET(8), ABE_OPP_50, 0),
+
+	/* Backend DAIs  */
+	// FIXME: must match BE order in abe_dai.h
+	SND_SOC_DAPM_AIF_IN("PDM_UL1", "Analog Capture", 0,
+			ABE_WIDGET(9), ABE_OPP_50, 0),
+	SND_SOC_DAPM_AIF_OUT("PDM_DL1", "HS Playback", 0,
+			ABE_WIDGET(10), ABE_OPP_25, 0),
+	SND_SOC_DAPM_AIF_OUT("PDM_DL2", "HF Playback", 0,
+			ABE_WIDGET(11), ABE_OPP_100, 0),
+	SND_SOC_DAPM_AIF_OUT("PDM_VIB", "Vibra Playback", 0,
+			ABE_WIDGET(12), ABE_OPP_100, 0),
+	SND_SOC_DAPM_AIF_IN("BT_VX_UL", "BT Capture", 0,
+			ABE_WIDGET(13), ABE_OPP_50, 0),
+	SND_SOC_DAPM_AIF_OUT("BT_VX_DL", "BT Playback", 0,
+			ABE_WIDGET(14), ABE_OPP_50, 0),
+	SND_SOC_DAPM_AIF_IN("MM_EXT_UL", "FM Capture", 0,
+			ABE_WIDGET(15), ABE_OPP_50, 0),
+	SND_SOC_DAPM_AIF_OUT("MM_EXT_DL", "FM Playback", 0,
+			ABE_WIDGET(16), ABE_OPP_25, 0),
+	SND_SOC_DAPM_AIF_IN("DMIC0", "DMIC0 Capture", 0,
+			ABE_WIDGET(17), ABE_OPP_50, 0),
+	SND_SOC_DAPM_AIF_IN("DMIC1", "DMIC1 Capture", 0,
+			ABE_WIDGET(18), ABE_OPP_50, 0),
+	SND_SOC_DAPM_AIF_IN("DMIC2", "DMIC2 Capture", 0,
+			ABE_WIDGET(19), ABE_OPP_50, 0),
+
+	/* ROUTE_UL Capture Muxes */
+	SND_SOC_DAPM_MUX("MUX_UL00",
+			ABE_WIDGET(20), ABE_OPP_50, 0, &mm_ul00_control),
+	SND_SOC_DAPM_MUX("MUX_UL01",
+			ABE_WIDGET(21), ABE_OPP_50, 0, &mm_ul01_control),
+	SND_SOC_DAPM_MUX("MUX_UL02",
+			ABE_WIDGET(22), ABE_OPP_50, 0, &mm_ul02_control),
+	SND_SOC_DAPM_MUX("MUX_UL03",
+			ABE_WIDGET(23), ABE_OPP_50, 0, &mm_ul03_control),
+	SND_SOC_DAPM_MUX("MUX_UL04",
+			ABE_WIDGET(24), ABE_OPP_50, 0, &mm_ul04_control),
+	SND_SOC_DAPM_MUX("MUX_UL05",
+			ABE_WIDGET(25), ABE_OPP_50, 0, &mm_ul05_control),
+	SND_SOC_DAPM_MUX("MUX_UL06",
+			ABE_WIDGET(26), ABE_OPP_50, 0, &mm_ul06_control),
+	SND_SOC_DAPM_MUX("MUX_UL07",
+			ABE_WIDGET(27), ABE_OPP_50, 0, &mm_ul07_control),
+	SND_SOC_DAPM_MUX("MUX_UL10",
+			ABE_WIDGET(28), ABE_OPP_50, 0, &mm_ul10_control),
+	SND_SOC_DAPM_MUX("MUX_UL11",
+			ABE_WIDGET(29), ABE_OPP_50, 0, &mm_ul11_control),
+	SND_SOC_DAPM_MUX("MUX_VX0",
+			ABE_WIDGET(30), ABE_OPP_50, 0, &mm_vx0_control),
+	SND_SOC_DAPM_MUX("MUX_VX1",
+			ABE_WIDGET(31), ABE_OPP_50, 0, &mm_vx1_control),
+
+	/* DL1 & DL2 Playback Mixers */
+	SND_SOC_DAPM_MIXER("DL1 Mixer",
+			ABE_WIDGET(32), ABE_OPP_25, 0, dl1_mixer_controls,
+			ARRAY_SIZE(dl1_mixer_controls)),
+	SND_SOC_DAPM_MIXER("DL2 Mixer",
+			ABE_WIDGET(33), ABE_OPP_100, 0, dl2_mixer_controls,
+			ARRAY_SIZE(dl2_mixer_controls)),
+
+	/* DL1 Mixer Input volumes ?????*/
+	SND_SOC_DAPM_PGA("DL1 Media Volume",
+			ABE_WIDGET(34), 0, 0, NULL, 0),
+
+	/* AUDIO_UL_MIXER */
+	SND_SOC_DAPM_MIXER("Voice Capture Mixer",
+			ABE_WIDGET(35), ABE_OPP_50, 0, audio_ul_mixer_controls,
+			ARRAY_SIZE(audio_ul_mixer_controls)),
+
+	/* VX_REC_MIXER */
+	SND_SOC_DAPM_MIXER("Capture Mixer",
+			ABE_WIDGET(36), ABE_OPP_50, 0, vx_rec_mixer_controls,
+			ARRAY_SIZE(vx_rec_mixer_controls)),
+
+	/* SDT_MIXER */
+	SND_SOC_DAPM_MIXER("Sidetone Mixer",
+			ABE_WIDGET(37), ABE_OPP_25, 0, sdt_mixer_controls,
+			ARRAY_SIZE(sdt_mixer_controls)),
+
+	/*
+	 * The Following three are virtual switches to select the output port
+	 * after DL1 Gain - HAL V0.6x
+	 */
+
+	/* Virtual PDM_DL1 Switch */
+	SND_SOC_DAPM_MIXER("DL1 PDM",
+			ABE_WIDGET(38), ABE_OPP_25, 0, &pdm_dl1_switch_controls, 1),
+
+	/* Virtual BT_VX_DL Switch */
+	SND_SOC_DAPM_MIXER("DL1 BT_VX",
+			ABE_WIDGET(39), ABE_OPP_50, 0, &bt_vx_dl_switch_controls, 1),
+
+	/* Virtual MM_EXT_DL Switch TODO: confrm OPP level here */
+	SND_SOC_DAPM_MIXER("DL1 MM_EXT",
+			ABE_WIDGET(40), ABE_OPP_50, 0, &mm_ext_dl_switch_controls, 1),
+
+	/*
+	 * The Following three are virtual switches to select the input port
+	 * before AMIC_UL enters ROUTE_UL - HAL V0.6x
+	 */
+
+	/* Virtual MM_EXT_UL Switch */
+	SND_SOC_DAPM_MIXER("AMIC_UL MM_EXT",
+			ABE_WIDGET(41), ABE_OPP_50, 0, &mm_ext_ul_switch_controls, 1),
+
+	/* Virtual PDM_UL1 Switch */
+	SND_SOC_DAPM_MIXER("AMIC_UL PDM",
+			ABE_WIDGET(42), ABE_OPP_50, 0, &pdm_ul1_switch_controls, 1),
+
+	/* Virtual to join MM_EXT and PDM+UL1 switches */
+	SND_SOC_DAPM_MIXER("AMIC_UL", SND_SOC_NOPM, 0, 0, NULL, 0),
+
+	/* Virtuals to join our capture sources */
+	SND_SOC_DAPM_MIXER("Sidetone Capture VMixer", SND_SOC_NOPM, 0, 0, NULL, 0),
+	SND_SOC_DAPM_MIXER("Voice Capture VMixer", SND_SOC_NOPM, 0, 0, NULL, 0),
+	SND_SOC_DAPM_MIXER("DL1 Capture VMixer", SND_SOC_NOPM, 0, 0, NULL, 0),
+	SND_SOC_DAPM_MIXER("DL2 Capture VMixer", SND_SOC_NOPM, 0, 0, NULL, 0),
+
+	/* Join our MM_DL and MM_DL_LP playback */
+	SND_SOC_DAPM_MIXER("MM_DL VMixer", SND_SOC_NOPM, 0, 0, NULL, 0),
+
+	/* Virtual MODEM and VX_UL mixer */
+	SND_SOC_DAPM_MIXER("VX UL VMixer", SND_SOC_NOPM, 0, 0, NULL, 0),
+	SND_SOC_DAPM_MIXER("VX DL VMixer", SND_SOC_NOPM, 0, 0, NULL, 0),
+
+	/* Virtual Pins to force backends ON atm */
+	SND_SOC_DAPM_OUTPUT("BE_OUT"),
+	SND_SOC_DAPM_INPUT("BE_IN"),
+};
+
+static const struct snd_soc_dapm_route intercon[] = {
+
+	/* MUX_UL00 - ROUTE_UL - Chan 0  */
+	{"MUX_UL00", "DMic0L", "DMIC0"},
+	{"MUX_UL00", "DMic0R", "DMIC0"},
+	{"MUX_UL00", "DMic1L", "DMIC1"},
+	{"MUX_UL00", "DMic1R", "DMIC1"},
+	{"MUX_UL00", "DMic2L", "DMIC2"},
+	{"MUX_UL00", "DMic2R", "DMIC2"},
+	{"MUX_UL00", "BT Left", "BT_VX_UL"},
+	{"MUX_UL00", "BT Right", "BT_VX_UL"},
+	{"MUX_UL00", "AMic0", "AMIC_UL"},
+	{"MUX_UL00", "AMic1", "AMIC_UL"},
+	{"MUX_UL00", "VX Left", "Capture Mixer"},
+	{"MUX_UL00", "VX Right", "Capture Mixer"},
+	{"MM_UL1", NULL, "MUX_UL00"},
+
+	/* MUX_UL01 - ROUTE_UL - Chan 1  */
+	{"MUX_UL01", "DMic0L", "DMIC0"},
+	{"MUX_UL01", "DMic0R", "DMIC0"},
+	{"MUX_UL01", "DMic1L", "DMIC1"},
+	{"MUX_UL01", "DMic1R", "DMIC1"},
+	{"MUX_UL01", "DMic2L", "DMIC2"},
+	{"MUX_UL01", "DMic2R", "DMIC2"},
+	{"MUX_UL01", "BT Left", "BT_VX_UL"},
+	{"MUX_UL01", "BT Right", "BT_VX_UL"},
+	{"MUX_UL01", "AMic0", "AMIC_UL"},
+	{"MUX_UL01", "AMic1", "AMIC_UL"},
+	{"MUX_UL01", "VX Left", "Capture Mixer"},
+	{"MUX_UL01", "VX Right", "Capture Mixer"},
+	{"MM_UL1", NULL, "MUX_UL01"},
+
+	/* MUX_UL02 - ROUTE_UL - Chan 2  */
+	{"MUX_UL02", "DMic0L", "DMIC0"},
+	{"MUX_UL02", "DMic0R", "DMIC0"},
+	{"MUX_UL02", "DMic1L", "DMIC1"},
+	{"MUX_UL02", "DMic1R", "DMIC1"},
+	{"MUX_UL02", "DMic2L", "DMIC2"},
+	{"MUX_UL02", "DMic2R", "DMIC2"},
+	{"MUX_UL02", "BT Left", "BT_VX_UL"},
+	{"MUX_UL02", "BT Right", "BT_VX_UL"},
+	{"MUX_UL02", "AMic0", "AMIC_UL"},
+	{"MUX_UL02", "AMic1", "AMIC_UL"},
+	{"MUX_UL02", "VX Left", "Capture Mixer"},
+	{"MUX_UL02", "VX Right", "Capture Mixer"},
+	{"MM_UL1", NULL, "MUX_UL02"},
+
+	/* MUX_UL03 - ROUTE_UL - Chan 3  */
+	{"MUX_UL03", "DMic0L", "DMIC0"},
+	{"MUX_UL03", "DMic0R", "DMIC0"},
+	{"MUX_UL03", "DMic1L", "DMIC1"},
+	{"MUX_UL03", "DMic1R", "DMIC1"},
+	{"MUX_UL03", "DMic2L", "DMIC2"},
+	{"MUX_UL03", "DMic2R", "DMIC2"},
+	{"MUX_UL03", "BT Left", "BT_VX_UL"},
+	{"MUX_UL03", "BT Right", "BT_VX_UL"},
+	{"MUX_UL03", "AMic0", "AMIC_UL"},
+	{"MUX_UL03", "AMic1", "AMIC_UL"},
+	{"MUX_UL03", "VX Left", "Capture Mixer"},
+	{"MUX_UL03", "VX Right", "Capture Mixer"},
+	{"MM_UL1", NULL, "MUX_UL03"},
+
+	/* MUX_UL04 - ROUTE_UL - Chan 4  */
+	{"MUX_UL04", "DMic0L", "DMIC0"},
+	{"MUX_UL04", "DMic0R", "DMIC0"},
+	{"MUX_UL04", "DMic1L", "DMIC1"},
+	{"MUX_UL04", "DMic1R", "DMIC1"},
+	{"MUX_UL04", "DMic2L", "DMIC2"},
+	{"MUX_UL04", "DMic2R", "DMIC2"},
+	{"MUX_UL04", "BT Left", "BT_VX_UL"},
+	{"MUX_UL04", "BT Right", "BT_VX_UL"},
+	{"MUX_UL04", "AMic0", "AMIC_UL"},
+	{"MUX_UL04", "AMic1", "AMIC_UL"},
+	{"MUX_UL04", "VX Left", "Capture Mixer"},
+	{"MUX_UL04", "VX Right", "Capture Mixer"},
+	{"MM_UL1", NULL, "MUX_UL04"},
+
+	/* MUX_UL05 - ROUTE_UL - Chan 5  */
+	{"MUX_UL05", "DMic0L", "DMIC0"},
+	{"MUX_UL05", "DMic0R", "DMIC0"},
+	{"MUX_UL05", "DMic1L", "DMIC1"},
+	{"MUX_UL05", "DMic1R", "DMIC1"},
+	{"MUX_UL05", "DMic2L", "DMIC2"},
+	{"MUX_UL05", "DMic2R", "DMIC2"},
+	{"MUX_UL05", "BT Left", "BT_VX_UL"},
+	{"MUX_UL05", "BT Right", "BT_VX_UL"},
+	{"MUX_UL05", "AMic0", "AMIC_UL"},
+	{"MUX_UL05", "AMic1", "AMIC_UL"},
+	{"MUX_UL05", "VX Left", "Capture Mixer"},
+	{"MUX_UL05", "VX Right", "Capture Mixer"},
+	{"MM_UL1", NULL, "MUX_UL05"},
+
+	/* MUX_UL06 - ROUTE_UL - Chan 6  */
+	{"MUX_UL06", "DMic0L", "DMIC0"},
+	{"MUX_UL06", "DMic0R", "DMIC0"},
+	{"MUX_UL06", "DMic1L", "DMIC1"},
+	{"MUX_UL06", "DMic1R", "DMIC1"},
+	{"MUX_UL06", "DMic2L", "DMIC2"},
+	{"MUX_UL06", "DMic2R", "DMIC2"},
+	{"MUX_UL06", "BT Left", "BT_VX_UL"},
+	{"MUX_UL06", "BT Right", "BT_VX_UL"},
+	{"MUX_UL06", "AMic0", "AMIC_UL"},
+	{"MUX_UL06", "AMic1", "AMIC_UL"},
+	{"MUX_UL06", "VX Left", "Capture Mixer"},
+	{"MUX_UL06", "VX Right", "Capture Mixer"},
+	{"MM_UL1", NULL, "MUX_UL06"},
+
+	/* MUX_UL07 - ROUTE_UL - Chan 7  */
+	{"MUX_UL07", "DMic0L", "DMIC0"},
+	{"MUX_UL07", "DMic0R", "DMIC0"},
+	{"MUX_UL07", "DMic1L", "DMIC1"},
+	{"MUX_UL07", "DMic1R", "DMIC1"},
+	{"MUX_UL07", "DMic2L", "DMIC2"},
+	{"MUX_UL07", "DMic2R", "DMIC2"},
+	{"MUX_UL07", "BT Left", "BT_VX_UL"},
+	{"MUX_UL07", "BT Right", "BT_VX_UL"},
+	{"MUX_UL07", "AMic0", "AMIC_UL"},
+	{"MUX_UL07", "AMic1", "AMIC_UL"},
+	{"MUX_UL07", "VX Left", "Capture Mixer"},
+	{"MUX_UL07", "VX Right", "Capture Mixer"},
+	{"MM_UL1", NULL, "MUX_UL07"},
+
+	/* MUX_UL10 - ROUTE_UL - Chan 10  */
+	{"MUX_UL10", "DMic0L", "DMIC0"},
+	{"MUX_UL10", "DMic0R", "DMIC0"},
+	{"MUX_UL10", "DMic1L", "DMIC1"},
+	{"MUX_UL10", "DMic1R", "DMIC1"},
+	{"MUX_UL10", "DMic2L", "DMIC2"},
+	{"MUX_UL10", "DMic2R", "DMIC2"},
+	{"MUX_UL10", "BT Left", "BT_VX_UL"},
+	{"MUX_UL10", "BT Right", "BT_VX_UL"},
+	{"MUX_UL10", "AMic0", "AMIC_UL"},
+	{"MUX_UL10", "AMic1", "AMIC_UL"},
+	{"MUX_UL10", "VX Left", "Capture Mixer"},
+	{"MUX_UL10", "VX Right", "Capture Mixer"},
+	{"MM_UL2", NULL, "MUX_UL10"},
+
+	/* MUX_UL11 - ROUTE_UL - Chan 11  */
+	{"MUX_UL11", "DMic0L", "DMIC0"},
+	{"MUX_UL11", "DMic0R", "DMIC0"},
+	{"MUX_UL11", "DMic1L", "DMIC1"},
+	{"MUX_UL11", "DMic1R", "DMIC1"},
+	{"MUX_UL11", "DMic2L", "DMIC2"},
+	{"MUX_UL11", "DMic2R", "DMIC2"},
+	{"MUX_UL11", "BT Left", "BT_VX_UL"},
+	{"MUX_UL11", "BT Right", "BT_VX_UL"},
+	{"MUX_UL11", "AMic0", "AMIC_UL"},
+	{"MUX_UL11", "AMic1", "AMIC_UL"},
+	{"MUX_UL11", "VX Left", "Capture Mixer"},
+	{"MUX_UL11", "VX Right", "Capture Mixer"},
+	{"MM_UL2", NULL, "MUX_UL11"},
+
+	/* MUX_VX0 - ROUTE_UL - Chan 20  */
+	{"MUX_VX0", "DMic0L", "DMIC0"},
+	{"MUX_VX0", "DMic0R", "DMIC0"},
+	{"MUX_VX0", "DMic1L", "DMIC1"},
+	{"MUX_VX0", "DMic1R", "DMIC1"},
+	{"MUX_VX0", "DMic2L", "DMIC2"},
+	{"MUX_VX0", "DMic2R", "DMIC2"},
+	{"MUX_VX0", "BT Left", "BT_VX_UL"},
+	{"MUX_VX0", "BT Right", "BT_VX_UL"},
+	{"MUX_VX0", "AMic0", "AMIC_UL"},
+	{"MUX_VX0", "AMic1", "AMIC_UL"},
+	{"MUX_VX0", "VX Left", "Capture Mixer"},
+	{"MUX_VX0", "VX Right", "Capture Mixer"},
+
+	/* MUX_VX1 - ROUTE_UL - Chan 20  */
+	{"MUX_VX1", "DMic0L", "DMIC0"},
+	{"MUX_VX1", "DMic0R", "DMIC0"},
+	{"MUX_VX1", "DMic1L", "DMIC1"},
+	{"MUX_VX1", "DMic1R", "DMIC1"},
+	{"MUX_VX1", "DMic2L", "DMIC2"},
+	{"MUX_VX1", "DMic2R", "DMIC2"},
+	{"MUX_VX1", "BT Left", "BT_VX_UL"},
+	{"MUX_VX1", "BT Right", "BT_VX_UL"},
+	{"MUX_VX1", "AMic0", "AMIC_UL"},
+	{"MUX_VX1", "AMic1", "AMIC_UL"},
+	{"MUX_VX1", "VX Left", "Capture Mixer"},
+	{"MUX_VX1", "VX Right", "Capture Mixer"},
+
+	/* Capture Input Selection  for AMIC_UL  */
+	{"AMIC_UL MM_EXT", "Switch", "MM_EXT_UL"},
+	{"AMIC_UL PDM", "Switch", "PDM_UL1"},
+	{"AMIC_UL", NULL, "AMIC_UL MM_EXT"},
+	{"AMIC_UL", NULL, "AMIC_UL PDM"},
+
+	/* Headset (DL1)  playback path */
+	{"DL1 Mixer", "Tones", "TONES_DL"},
+	{"DL1 Mixer", "Voice", "VX DL VMixer"},
+	{"DL1 Mixer", "Capture", "DL1 Capture VMixer"},
+	{"DL1 Capture VMixer", NULL, "MUX_UL10"},
+	{"DL1 Capture VMixer", NULL, "MUX_UL11"},
+	{"DL1 Mixer", "Multimedia", "MM_DL VMixer"},
+	{"MM_DL VMixer", NULL, "MM_DL"},
+	{"MM_DL VMixer", NULL, "MM_DL_LP"},
+
+	/* Sidetone Mixer */
+	{"Sidetone Mixer", "Playback", "DL1 Mixer"},
+	{"Sidetone Mixer", "Capture", "Sidetone Capture VMixer"},
+	{"Sidetone Capture VMixer", NULL, "MUX_VX0"},
+	{"Sidetone Capture VMixer", NULL, "MUX_VX1"},
+
+	/* Playback Output selection after DL1 Gain */
+	{"DL1 BT_VX", "Switch", "Sidetone Mixer"},
+	{"DL1 MM_EXT", "Switch", "Sidetone Mixer"},
+	{"DL1 PDM", "Switch", "Sidetone Mixer"},
+	{"PDM_DL1", NULL, "DL1 PDM"},
+	{"BT_VX_DL", NULL, "DL1 BT_VX"},
+	{"MM_EXT_DL", NULL, "DL1 MM_EXT"},
+
+	/* Handsfree (DL2) playback path */
+	{"DL2 Mixer", "Tones", "TONES_DL"},
+	{"DL2 Mixer", "Voice", "VX DL VMixer"},
+	{"DL2 Mixer", "Capture", "DL2 Capture VMixer"},
+	{"DL2 Capture VMixer", NULL, "MUX_UL10"},
+	{"DL2 Capture VMixer", NULL, "MUX_UL11"},
+	{"DL2 Mixer", "Multimedia", "MM_DL VMixer"},
+	{"MM_DL VMixer", NULL, "MM_DL"},
+	{"MM_DL VMixer", NULL, "MM_DL_LP"},
+	{"PDM_DL2", NULL, "DL2 Mixer"},
+
+	/* VxREC Mixer */
+	{"Capture Mixer", "Tones", "TONES_DL"},
+	{"Capture Mixer", "Voice Playback", "VX DL VMixer"},
+	{"Capture Mixer", "Voice Capture", "VX UL VMixer"},
+	{"Capture Mixer", "Media Playback", "MM_DL VMixer"},
+	{"MM_DL VMixer", NULL, "MM_DL"},
+	{"MM_DL VMixer", NULL, "MM_DL_LP"},
+
+	/* Audio UL mixer */
+	{"Voice Capture Mixer", "Tones Playback", "TONES_DL"},
+	{"Voice Capture Mixer", "Media Playback", "MM_DL VMixer"},
+	{"MM_DL VMixer", NULL, "MM_DL"},
+	{"MM_DL VMixer", NULL, "MM_DL_LP"},
+	{"Voice Capture Mixer", "Capture", "Voice Capture VMixer"},
+	{"Voice Capture VMixer", NULL, "MUX_VX0"},
+	{"Voice Capture VMixer", NULL, "MUX_VX1"},
+
+	/* BT */
+	{"VX UL VMixer", NULL, "Voice Capture Mixer"},
+
+	/* Vibra */
+	{"PDM_VIB", NULL, "VIB_DL"},
+
+	/* VX and MODEM */
+	{"VX_UL", NULL, "VX UL VMixer"},
+	{"MODEM_UL", NULL, "VX UL VMixer"},
+	{"VX DL VMixer", NULL, "VX_DL"},
+	{"VX DL VMixer", NULL, "MODEM_DL"},
+
+	/* Backend Enablement - TODO: maybe re-work*/
+	{"BE_OUT", NULL, "PDM_DL1"},
+	{"BE_OUT", NULL, "PDM_DL2"},
+	{"BE_OUT", NULL, "PDM_VIB"},
+	{"BE_OUT", NULL, "MM_EXT_DL"},
+	{"BE_OUT", NULL, "BT_VX_DL"},
+	{"PDM_UL1", NULL, "BE_IN"},
+	{"BT_VX_UL", NULL, "BE_IN"},
+	{"MM_EXT_UL", NULL, "BE_IN"},
+	{"DMIC0", NULL, "BE_IN"},
+	{"DMIC1", NULL, "BE_IN"},
+	{"DMIC2", NULL, "BE_IN"},
+};
+
+static int abe_add_widgets(struct snd_soc_platform *platform)
+{
+	snd_soc_add_platform_controls(platform, abe_controls,
+				ARRAY_SIZE(abe_controls));
+
+	snd_soc_dapm_new_controls(&platform->dapm, abe_dapm_widgets,
+				 ARRAY_SIZE(abe_dapm_widgets));
+
+	snd_soc_dapm_add_routes(&platform->dapm, intercon, ARRAY_SIZE(intercon));
+
+	snd_soc_dapm_new_widgets(&platform->dapm);
+
+	return 0;
+}
+
+static int aess_set_opp_mode(void)
+{
+	/* TODO: do not use abe global structure to assign pdev */
+	struct platform_device *pdev = abe->pdev;
+	int i, opp = 0;
+
+	pm_runtime_get_sync(&pdev->dev);
+
+	mutex_lock(&abe->opp_mutex);
+
+	/* now calculate OPP level based upon DAPM widget status */
+	for (i = ABE_WIDGET_START; i < ABE_WIDGET_END; i++)
+		opp |= abe->dapm[i];
+
+	opp = (1 << (fls(opp) - 1)) * 25;
+
+	if (abe->opp > opp) {
+		/* Decrease OPP mode - no need of OPP100% */
+		switch (opp) {
+		case 25:
+			abe_set_opp_processing(ABE_OPP25);
+			udelay(250);
+			/* FIXME: Dependency on PM framework */
+			//omap_device_set_rate(&pdev->dev, &pdev->dev, 98000000);
+			break;
+		case 50:
+		default:
+			abe_set_opp_processing(ABE_OPP50);
+			udelay(250);
+			/* FIXME: Dependency on PM framework */
+			//omap_device_set_rate(&pdev->dev, &pdev->dev, 98000000);
+			break;
+		}
+	} else if (abe->opp < opp) {
+		/* Increase OPP mode */
+		switch (opp) {
+		case 25:
+			/* FIXME: Dependency on PM framework */
+			//omap_device_set_rate(&pdev->dev, &pdev->dev, 98000000);
+			abe_set_opp_processing(ABE_OPP25);
+			break;
+		case 50:
+			/* FIXME: Dependency on PM framework */
+			//omap_device_set_rate(&pdev->dev, &pdev->dev, 98000000);
+			abe_set_opp_processing(ABE_OPP50);
+			break;
+		case 100:
+		default:
+			/* FIXME: Dependency on PM framework  */
+			//omap_device_set_rate(&pdev->dev, &pdev->dev, 196000000);
+			abe_set_opp_processing(ABE_OPP100);
+			break;
+		}
+	}
+	abe->opp = opp;
+
+	mutex_unlock(&abe->opp_mutex);
+
+	pm_runtime_put_sync(&pdev->dev);
+
+	return 0;
+}
+
+static int abe_probe(struct snd_soc_platform *platform)
+{
+	abe_init_engine(platform);
+	abe_add_widgets(platform);
+	abe->platform = platform;
+	return 0;
+}
+
+static int  abe_remove(struct snd_soc_platform *platform)
+{
+	return 0;
+}
+
+static int aess_save_context(struct abe_data *abe)
+{
+	struct platform_device *pdev = abe->pdev;
+	struct omap4_abe_dsp_pdata *pdata = pdev->dev.platform_data;
+
+	/* TODO: Find a better way to save/retore gains after OFF mode */
+	abe_mute_gain(MIXSDT, MIX_SDT_INPUT_UP_MIXER);
+	abe_mute_gain(MIXSDT, MIX_SDT_INPUT_DL1_MIXER);
+	abe_mute_gain(MIXAUDUL, MIX_AUDUL_INPUT_MM_DL);
+	abe_mute_gain(MIXAUDUL, MIX_AUDUL_INPUT_TONES);
+	abe_mute_gain(MIXAUDUL, MIX_AUDUL_INPUT_UPLINK);
+	abe_mute_gain(MIXAUDUL, MIX_AUDUL_INPUT_VX_DL);
+	abe_mute_gain(MIXVXREC, MIX_VXREC_INPUT_TONES);
+	abe_mute_gain(MIXVXREC, MIX_VXREC_INPUT_VX_DL);
+	abe_mute_gain(MIXVXREC, MIX_VXREC_INPUT_MM_DL);
+	abe_mute_gain(MIXVXREC, MIX_VXREC_INPUT_VX_UL);
+	abe_mute_gain(MIXDL1, MIX_DL1_INPUT_MM_DL);
+	abe_mute_gain(MIXDL1, MIX_DL1_INPUT_MM_UL2);
+	abe_mute_gain(MIXDL1, MIX_DL1_INPUT_VX_DL);
+	abe_mute_gain(MIXDL1, MIX_DL1_INPUT_TONES);
+	abe_mute_gain(MIXDL2, MIX_DL2_INPUT_TONES);
+	abe_mute_gain(MIXDL2, MIX_DL2_INPUT_VX_DL);
+	abe_mute_gain(MIXDL2, MIX_DL2_INPUT_MM_DL);
+	abe_mute_gain(MIXDL2, MIX_DL2_INPUT_MM_UL2);
+	abe_mute_gain(MIXECHO, MIX_ECHO_DL1);
+	abe_mute_gain(MIXECHO, MIX_ECHO_DL2);
+	abe_mute_gain(GAINS_DMIC1, GAIN_LEFT_OFFSET);
+	abe_mute_gain(GAINS_DMIC1, GAIN_RIGHT_OFFSET);
+	abe_mute_gain(GAINS_DMIC2, GAIN_LEFT_OFFSET);
+	abe_mute_gain(GAINS_DMIC2, GAIN_RIGHT_OFFSET);
+	abe_mute_gain(GAINS_DMIC3, GAIN_LEFT_OFFSET);
+	abe_mute_gain(GAINS_DMIC3, GAIN_RIGHT_OFFSET);
+	abe_mute_gain(GAINS_AMIC, GAIN_LEFT_OFFSET);
+	abe_mute_gain(GAINS_AMIC, GAIN_RIGHT_OFFSET);
+
+	if (pdata->get_context_loss_count)
+		abe->loss_count = pdata->get_context_loss_count(&pdev->dev);
+
+	return 0;
+}
+
+static int aess_restore_context(struct abe_data *abe)
+{
+	struct platform_device *pdev = abe->pdev;
+	struct omap4_abe_dsp_pdata *pdata = pdev->dev.platform_data;
+	int loss_count = 0;
+/* FIXME: Dependency on PM framework */
+//	omap_device_set_rate(&pdev->dev, &pdev->dev, 98000000);
+
+	if (pdata->get_context_loss_count)
+		loss_count = pdata->get_context_loss_count(&pdev->dev);
+
+	if  (loss_count != abe->loss_count)
+		abe_reload_fw();
+
+	/* TODO: Find a better way to save/retore gains after dor OFF mode */
+	abe_unmute_gain(MIXSDT, MIX_SDT_INPUT_UP_MIXER);
+	abe_unmute_gain(MIXSDT, MIX_SDT_INPUT_DL1_MIXER);
+	abe_unmute_gain(MIXAUDUL, MIX_AUDUL_INPUT_MM_DL);
+	abe_unmute_gain(MIXAUDUL, MIX_AUDUL_INPUT_TONES);
+	abe_unmute_gain(MIXAUDUL, MIX_AUDUL_INPUT_UPLINK);
+	abe_unmute_gain(MIXAUDUL, MIX_AUDUL_INPUT_VX_DL);
+	abe_unmute_gain(MIXVXREC, MIX_VXREC_INPUT_TONES);
+	abe_unmute_gain(MIXVXREC, MIX_VXREC_INPUT_VX_DL);
+	abe_unmute_gain(MIXVXREC, MIX_VXREC_INPUT_MM_DL);
+	abe_unmute_gain(MIXVXREC, MIX_VXREC_INPUT_VX_UL);
+	abe_unmute_gain(MIXDL1, MIX_DL1_INPUT_MM_DL);
+	abe_unmute_gain(MIXDL1, MIX_DL1_INPUT_MM_UL2);
+	abe_unmute_gain(MIXDL1, MIX_DL1_INPUT_VX_DL);
+	abe_unmute_gain(MIXDL1, MIX_DL1_INPUT_TONES);
+	abe_unmute_gain(MIXDL2, MIX_DL2_INPUT_TONES);
+	abe_unmute_gain(MIXDL2, MIX_DL2_INPUT_VX_DL);
+	abe_unmute_gain(MIXDL2, MIX_DL2_INPUT_MM_DL);
+	abe_unmute_gain(MIXDL2, MIX_DL2_INPUT_MM_UL2);
+	abe_unmute_gain(MIXECHO, MIX_ECHO_DL1);
+	abe_unmute_gain(MIXECHO, MIX_ECHO_DL2);
+	abe_unmute_gain(GAINS_DMIC1, GAIN_LEFT_OFFSET);
+	abe_unmute_gain(GAINS_DMIC1, GAIN_RIGHT_OFFSET);
+	abe_unmute_gain(GAINS_DMIC2, GAIN_LEFT_OFFSET);
+	abe_unmute_gain(GAINS_DMIC2, GAIN_RIGHT_OFFSET);
+	abe_unmute_gain(GAINS_DMIC3, GAIN_LEFT_OFFSET);
+	abe_unmute_gain(GAINS_DMIC3, GAIN_RIGHT_OFFSET);
+	abe_unmute_gain(GAINS_AMIC, GAIN_LEFT_OFFSET);
+	abe_unmute_gain(GAINS_AMIC, GAIN_RIGHT_OFFSET);
+
+	abe_dsp_set_equalizer(EQ1, abe->dl1_equ_profile);
+	abe_dsp_set_equalizer(EQ2L, abe->dl20_equ_profile);
+	abe_dsp_set_equalizer(EQ2R, abe->dl21_equ_profile);
+	abe_dsp_set_equalizer(EQAMIC, abe->amic_equ_profile);
+	abe_dsp_set_equalizer(EQDMIC, abe->dmic_equ_profile);
+	abe_dsp_set_equalizer(EQSDT, abe->sdt_equ_profile);
+
+	abe_set_router_configuration(UPROUTE, 0, (u32 *)abe->router);
+
+	return 0;
+}
+
+static int aess_open(struct snd_pcm_substream *substream)
+{
+	struct snd_soc_pcm_runtime *rtd = substream->private_data;
+	struct snd_soc_dai *dai = rtd->cpu_dai;
+	/* TODO: do not use abe global structure to assign pdev */
+	struct platform_device *pdev = abe->pdev;
+	int ret = 0;
+
+	mutex_lock(&abe->mutex);
+
+	abe->fe_id = dai->id;
+	dev_dbg(&rtd->dev, "%s ID %d\n", __func__, dai->id);
+
+	pm_runtime_get_sync(&pdev->dev);
+
+	if (!abe->active++) {
+		abe->opp = 0;
+		aess_restore_context(abe);
+		aess_set_opp_mode();
+		abe_wakeup();
+	}
+
+	switch (dai->id) {
+	case ABE_FRONTEND_DAI_MODEM:
+		break;
+	case ABE_FRONTEND_DAI_LP_MEDIA:
+		snd_soc_set_runtime_hwparams(substream, &omap_abe_hardware);
+		ret = snd_pcm_hw_constraint_step(substream->runtime, 0,
+					 SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 1024);
+		break;
+	default:
+		break;
+	}
+
+	mutex_unlock(&abe->mutex);
+	return ret;
+}
+
+static int abe_ping_pong_init(struct snd_pcm_hw_params *params,
+	struct snd_pcm_substream *substream)
+{
+	struct snd_pcm_runtime *runtime = substream->runtime;
+	abe_data_format_t format;
+	size_t period_size;
+	u32 dst;
+
+	/*Storing substream pointer for irq*/
+	abe->psubs = substream;
+
+	format.f = params_rate(params);
+	format.samp_format = STEREO_16_16;
+
+	if (format.f == 44100)
+		abe_write_event_generator(EVENT_44100);
+
+	period_size = params_period_bytes(params);
+
+	/*Adding ping pong buffer subroutine*/
+	abe_add_subroutine(&abe_irq_pingpong_player_id,
+				(abe_subroutine2) abe_irq_pingpong_subroutine,
+				SUB_0_PARAM, (u32 *)0);
+
+	/* Connect a Ping-Pong cache-flush protocol to MM_DL port */
+	abe_connect_irq_ping_pong_port(MM_DL_PORT, &format,
+				abe_irq_pingpong_player_id,
+				period_size, &dst,
+				PING_PONG_WITH_MCU_IRQ);
+
+	/* Memory mapping for hw params */
+	runtime->dma_area  = abe->io_base + ABE_DMEM_BASE_OFFSET_MPU +
+				ABE_VM_AESS_OFFSET + dst;
+	runtime->dma_addr  = 0;
+	runtime->dma_bytes = period_size * 2;
+
+	/* Need to set the first buffer in order to get interrupt */
+	abe_set_ping_pong_buffer(MM_DL_PORT, period_size);
+	abe->first_irq = 1;
+
+	return 0;
+}
+
+static int aess_hw_params(struct snd_pcm_substream *substream,
+	struct snd_pcm_hw_params *params)
+{
+	struct snd_soc_pcm_runtime *rtd = substream->private_data;
+	struct snd_soc_dai *dai = rtd->cpu_dai;
+	int ret = 0;
+
+	dev_dbg(&rtd->dev, "%s ID %d\n", __func__, dai->id);
+
+	switch (dai->id) {
+	case ABE_FRONTEND_DAI_MODEM:
+		break;
+	case ABE_FRONTEND_DAI_LP_MEDIA:
+		ret = abe_ping_pong_init(params, substream);
+		if (ret < 0)
+			return ret;
+		break;
+	default:
+		break;
+	}
+
+	return 0;
+}
+
+static int aess_prepare(struct snd_pcm_substream *substream)
+{
+	struct snd_soc_pcm_runtime  *rtd = substream->private_data;
+
+
+	mutex_lock(&abe->mutex);
+
+	dev_dbg(&rtd->dev, "%s ID %d\n", __func__, rtd->cpu_dai->id);
+
+	aess_set_opp_mode();
+
+	mutex_unlock(&abe->mutex);
+	return 0;
+}
+
+static int aess_close(struct snd_pcm_substream *substream)
+{
+	struct snd_soc_pcm_runtime  *rtd = substream->private_data;
+	struct snd_soc_dai *dai = rtd->cpu_dai;
+	/* TODO: do not use abe global structure to assign pdev */
+	struct platform_device *pdev = abe->pdev;
+
+	mutex_lock(&abe->mutex);
+
+	abe->fe_id = dai->id;
+	dev_dbg(&rtd->dev, "%s ID %d\n", __func__, dai->id);
+
+	if (!--abe->active) {
+		abe_disable_irq();
+		aess_save_context(abe);
+		abe_dsp_shutdown();
+	}
+	pm_runtime_put_sync(&pdev->dev);
+
+	mutex_unlock(&abe->mutex);
+	return 0;
+}
+
+static int aess_mmap(struct snd_pcm_substream *substream,
+	struct vm_area_struct *vma)
+{
+	int offset, size, err;
+
+	/* TODO: we may need to check for underrun. */
+	vma->vm_flags |= VM_IO | VM_RESERVED;
+	vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
+	size = vma->vm_end - vma->vm_start;
+	offset = vma->vm_pgoff << PAGE_SHIFT;
+
+	err = io_remap_pfn_range(vma, vma->vm_start,
+			(ABE_DMEM_BASE_ADDRESS_MPU +
+			ABE_DMEM_BASE_OFFSET_PING_PONG + offset) >> PAGE_SHIFT,
+			size, vma->vm_page_prot);
+
+	if (err)
+		return -EAGAIN;
+
+	return 0;
+}
+
+static snd_pcm_uframes_t aess_pointer(struct snd_pcm_substream *substream)
+{
+	snd_pcm_uframes_t offset;
+	u32 pingpong;
+
+	abe_read_offset_from_ping_buffer(MM_DL_PORT, &pingpong);
+	offset = (snd_pcm_uframes_t)pingpong;
+/*
+	if (offset >= runtime->buffer_size)
+		offset = 0;
+*/
+	return offset;
+}
+
+
+static struct snd_pcm_ops omap_aess_pcm_ops = {
+	.open           = aess_open,
+	.hw_params	= aess_hw_params,
+	.prepare	= aess_prepare,
+	.close	        = aess_close,
+	.pointer	= aess_pointer,
+	.mmap		= aess_mmap,
+};
+
+static int aess_stream_event(struct snd_soc_dapm_context *dapm)
+{
+	/* TODO: do not use abe global structure to assign pdev */
+	struct platform_device *pdev = abe->pdev;
+
+	if (abe->active) {
+		pm_runtime_get_sync(&pdev->dev);
+		aess_set_opp_mode();
+		pm_runtime_put_sync(&pdev->dev);
+	}
+
+	return 0;
+}
+
+static struct snd_soc_platform_driver omap_aess_platform = {
+	.ops	= &omap_aess_pcm_ops,
+	.probe = abe_probe,
+	.remove = abe_remove,
+	.read = abe_dsp_read,
+	.write = abe_dsp_write,
+	.stream_event = aess_stream_event,
+};
+
+/* FIXME: Dependency on PM framework */
+#if 0//
+defined(CONFIG_PM)
+static int omap_pm_abe_get_dev_context_loss_count(struct device *dev)
+{
+
+	int ret;
+
+	ret = prm_read_mod_reg(abe_pwrdm->prcm_offs,
+			abe_pwrdm->context_offset);
+
+	if ((ret & 0x0001) == 0x0001) {
+		prm_write_mod_reg(0x0001, abe_pwrdm->prcm_offs,
+			abe_pwrdm->context_offset);
+		ret &= ~0x0001;
+	}
+
+	if ((ret & 0x0100) == 0x0100)
+		prm_write_mod_reg(0x0100, abe_pwrdm->prcm_offs,
+			abe_pwrdm->context_offset);
+
+	return ret;
+}
+
+#else
+#define omap_pm_abe_get_dev_context_loss_count NULL
+#endif
+
+static int __devinit abe_engine_probe(struct platform_device *pdev)
+{
+	struct omap_hwmod *oh;
+	struct omap4_abe_dsp_pdata *pdata = pdev->dev.platform_data;
+	int ret = -EINVAL, i;
+
+	oh = omap_hwmod_lookup("omap-aess-audio");
+	if (oh == NULL) {
+		dev_err(&pdev->dev, "no hwmod device found\n");
+		return -ENODEV;
+	}
+
+	abe = kzalloc(sizeof(struct abe_data), GFP_KERNEL);
+	if (abe == NULL)
+		return -ENOMEM;
+	dev_set_drvdata(&pdev->dev, abe);
+
+	/* ZERO_labelID should really be 0 */
+	for (i = 0; i < ABE_ROUTES_UL + 2; i++)
+		abe->router[i] = ZERO_labelID;
+
+	abe->io_base = omap_hwmod_get_mpu_rt_va(oh);
+	if (!abe->io_base) {
+		ret = -ENOMEM;
+		goto err;
+	}
+
+	abe->irq = platform_get_irq(pdev, 0);
+	if (abe->irq < 0) {
+		ret = abe->irq;
+		goto err;
+	}
+
+#if defined(CONFIG_PM)
+	abe_pwrdm = pwrdm_lookup("abe_pwrdm");
+	if (!abe_pwrdm)
+		return -ENODEV;
+
+	pdata->get_context_loss_count = omap_pm_abe_get_dev_context_loss_count;
+#endif
+
+	pm_runtime_enable(&pdev->dev);
+
+	abe->abe_pdata = pdata;
+	abe->pdev = pdev;
+
+	mutex_init(&abe->mutex);
+	mutex_init(&abe->opp_mutex);
+
+	ret = snd_soc_register_platform(&pdev->dev,
+			&omap_aess_platform);
+	if (ret == 0)
+		return 0;
+
+err:
+	kfree(abe);
+	return ret;
+}
+
+static int __devexit abe_engine_remove(struct platform_device *pdev)
+{
+	struct abe_data *priv = dev_get_drvdata(&pdev->dev);
+
+	snd_soc_unregister_platform(&pdev->dev);
+	kfree(priv);
+	return 0;
+}
+
+static struct platform_driver omap_aess_driver = {
+	.driver = {
+		.name = "omap-aess-audio",
+		.owner = THIS_MODULE,
+	},
+	.probe = abe_engine_probe,
+	.remove = __devexit_p(abe_engine_remove),
+};
+
+static int __init abe_engine_init(void)
+{
+	return platform_driver_register(&omap_aess_driver);
+}
+module_init(abe_engine_init);
+
+static void __exit abe_engine_exit(void)
+{
+	platform_driver_unregister(&omap_aess_driver);
+}
+module_exit(abe_engine_exit);
+
+MODULE_DESCRIPTION("ASoC OMAP4 ABE");
+MODULE_AUTHOR("Liam Girdwood <lrg@slimlogic.co.uk>");
+MODULE_LICENSE("GPL");
diff --git a/sound/soc/omap/omap-abe-dsp.h b/sound/soc/omap/omap-abe-dsp.h
new file mode 100644
index 0000000..90d856d
--- /dev/null
+++ b/sound/soc/omap/omap-abe-dsp.h
@@ -0,0 +1,36 @@
+/*
+ * omap-abe-dsp.h
+ *
+ * Copyright (C) 2010 Texas Instruments
+ *
+ * Contact: Liam Girdwood <lrg@slimlogic.co.uk>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#ifndef __OMAP_ABE_DSP_H__
+#define __OMAP_ABE_DSP_H__
+
+#define ABE_DMEM_BASE_OFFSET_MPU	0x80000		/* Ping start offset of DMEM */
+#define ABE_DMEM_BASE_ADDRESS_MPU	0x49080000L	/* Pong start offset of DMEM */
+#define ABE_DMEM_BASE_OFFSET_PING_PONG	0x4000		/* Ping pong buffer DMEM offset */
+#define ABE_VM_AESS_OFFSET		0x400000	/* AESS VM offset for DMEM */
+
+void abe_dsp_mcpdm_shutdown(void);
+void abe_dsp_pm_get(void);
+void abe_dsp_pm_put(void);
+
+#endif	/* End of __OMAP_ABE_DSP_H__ */
-- 
1.7.4.1