summaryrefslogtreecommitdiffstats
path: root/meta-moblin/packages/linux/linux-moblin-2.6.29.1/linux-2.6.29-timberdale.patch
blob: c36e5ba4addc6a08cdcbaf37ef866c6b052d772d (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
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
Patch provided by Mocean in order to enable the timberdale subsystem of the Russelville board. 
  
Signed-off-by: Joel Clark <joel.clark@intel.com>
Acked-by: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Todd Brandt todd.e.brandt@intel.com


diff -uNr linux-2.6.29-clean/drivers/gpio/Kconfig linux-2.6.29/drivers/gpio/Kconfig
--- linux-2.6.29-clean/drivers/gpio/Kconfig	2009-04-01 09:20:23.000000000 -0700
+++ linux-2.6.29/drivers/gpio/Kconfig	2009-04-06 13:51:47.000000000 -0700
@@ -161,6 +161,12 @@
 
 	  If unsure, say N.
 
+config GPIO_TIMBERDALE
+	tristate "Support for timberdale GPIO"
+	depends on MFD_TIMBERDALE && GPIOLIB
+	---help---
+	Add support for GPIO usage of some pins of the timberdale FPGA.
+
 comment "SPI GPIO expanders:"
 
 config GPIO_MAX7301
diff -uNr linux-2.6.29-clean/drivers/gpio/Makefile linux-2.6.29/drivers/gpio/Makefile
--- linux-2.6.29-clean/drivers/gpio/Makefile	2009-04-01 09:20:23.000000000 -0700
+++ linux-2.6.29/drivers/gpio/Makefile	2009-04-06 13:51:47.000000000 -0700
@@ -12,3 +12,4 @@
 obj-$(CONFIG_GPIO_TWL4030)	+= twl4030-gpio.o
 obj-$(CONFIG_GPIO_XILINX)	+= xilinx_gpio.o
 obj-$(CONFIG_GPIO_BT8XX)	+= bt8xxgpio.o
+obj-$(CONFIG_GPIO_TIMBERDALE)	+= timbgpio.o
diff -uNr linux-2.6.29-clean/drivers/gpio/timbgpio.c linux-2.6.29/drivers/gpio/timbgpio.c
--- linux-2.6.29-clean/drivers/gpio/timbgpio.c	1969-12-31 16:00:00.000000000 -0800
+++ linux-2.6.29/drivers/gpio/timbgpio.c	2009-04-06 13:51:47.000000000 -0700
@@ -0,0 +1,275 @@
+/*
+ * timbgpio.c timberdale FPGA GPIO driver
+ * Copyright (c) 2009 Intel Corporation
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/* Supports:
+ * Timberdale FPGA GPIO
+ */
+
+#include <linux/module.h>
+#include <linux/gpio.h>
+#include <linux/pci.h>
+#include <linux/platform_device.h>
+#include <linux/interrupt.h>
+
+#include "timbgpio.h"
+
+static u32 timbgpio_configure(struct gpio_chip *gpio, unsigned nr,
+						unsigned off, unsigned val)
+{
+	struct timbgpio *tgpio = container_of(gpio, struct timbgpio, gpio);
+
+	u32 config, oldconfig, wconfig;
+
+	mutex_lock(&tgpio->lock);
+	config = ioread32(tgpio->membase + off);
+	oldconfig = config;
+
+	if (val)
+		config |= (1 << nr);
+	else
+		config &= ~(1 << nr);
+
+	iowrite32(config, tgpio->membase + off);
+	wconfig = ioread32(tgpio->membase + off);
+	mutex_unlock(&tgpio->lock);
+
+	return oldconfig;
+}
+
+static int timbgpio_gpio_direction_input(struct gpio_chip *gpio, unsigned nr)
+{
+	timbgpio_configure(gpio, nr, TGPIODIR, 1);
+	return 0;
+}
+
+static int timbgpio_gpio_get(struct gpio_chip *gpio, unsigned nr)
+{
+	struct timbgpio *tgpio = container_of(gpio, struct timbgpio, gpio);
+	u32 value;
+
+	value = ioread32(tgpio->membase + TGPIOVAL);
+	return (value & (1 << nr)) ? 1 : 0;
+}
+
+static int timbgpio_gpio_direction_output(struct gpio_chip *gpio,
+						unsigned nr, int val)
+{
+	timbgpio_configure(gpio, nr, TGPIODIR, 0);
+	return 0;
+}
+
+
+
+static void timbgpio_gpio_set(struct gpio_chip *gpio,
+				unsigned nr, int val)
+{
+	timbgpio_configure(gpio, nr, TGPIOVAL, val);
+}
+
+/*
+ * Function to control flank or level triggered GPIO pin
+ * @nr - pin
+ * @ val - 1: flank, 0: level
+ *
+ */
+static void timbgpio_gpio_flnk_lvl_ctrl(struct gpio_chip *gpio,
+						unsigned nr, int val)
+{
+	timbgpio_configure(gpio, nr, TGPIOFLK, val);
+}
+EXPORT_SYMBOL(timbgpio_gpio_flnk_lvl_ctrl);
+
+/*
+ * Enable or disable interrupt
+ *
+ */
+static void timbgpio_gpio_int_ctrl(struct gpio_chip *gpio,
+					unsigned nr, int val)
+{
+	timbgpio_configure(gpio, nr, TGPIOINT, val);
+}
+EXPORT_SYMBOL(timbgpio_gpio_int_ctrl);
+
+/*
+ * @val - 1: Asserted high or on positive flank, 0: Asserted low or on negative flank
+ *
+ */
+static void timbgpio_gpio_lvl_ctrl(struct gpio_chip *gpio,
+					unsigned nr, int val)
+{
+	timbgpio_configure(gpio, nr, TGPIOLVL, val);
+}
+EXPORT_SYMBOL(timbgpio_gpio_lvl_ctrl);
+
+static void timbgpio_gpio_int_clr(struct gpio_chip *gpio,
+					unsigned nr, int val)
+{
+	timbgpio_configure(gpio, nr, TGPIOINT_CLR, val);
+}
+EXPORT_SYMBOL(timbgpio_gpio_int_clr);
+
+
+static irqreturn_t timbgpio_handleinterrupt(int irq, void *devid)
+{
+	struct timbgpio *tgpio = (struct timbgpio *)devid;
+
+	iowrite32(0xffffffff, tgpio->membase + TGPIOINT_CLR);
+
+	return IRQ_HANDLED;
+}
+
+static int timbgpio_probe(struct platform_device *dev)
+{
+	int err, irq;
+	struct gpio_chip *gc;
+	struct timbgpio *tgpio;
+	struct resource *iomem, *rscr;
+
+	iomem = platform_get_resource(dev, IORESOURCE_MEM, 0);
+	if (!iomem) {
+		err = -EINVAL;
+		goto err_mem;
+	}
+
+	tgpio = kzalloc(sizeof(*tgpio), GFP_KERNEL);
+	if (!tgpio) {
+		err = -EINVAL;
+		goto err_mem;
+	}
+
+	mutex_init(&tgpio->lock);
+
+	rscr = &tgpio->rscr;
+	rscr->name = "timb-gpio";
+	rscr->start = iomem->start;
+	rscr->end = iomem->end;
+	rscr->flags = IORESOURCE_MEM;
+
+	err = request_resource(iomem, rscr);
+	if (err)
+		goto err_request;
+
+	tgpio->membase = ioremap(rscr->start, resource_size(rscr));
+	if (!tgpio->membase) {
+		err = -ENOMEM;
+		goto err_ioremap;
+	}
+
+	gc = &tgpio->gpio;
+
+	gc->label = "timbgpio";
+	gc->owner = THIS_MODULE;
+	gc->direction_input = timbgpio_gpio_direction_input;
+	gc->get = timbgpio_gpio_get;
+	gc->direction_output = timbgpio_gpio_direction_output;
+	gc->set = timbgpio_gpio_set;
+	gc->dbg_show = NULL;
+	gc->base = 0;
+	gc->ngpio = TIMB_NR_GPIOS;
+	gc->can_sleep = 0;
+
+	err = gpiochip_add(gc);
+	if (err)
+		goto err_chipadd;
+
+	platform_set_drvdata(dev, tgpio);
+
+	/* register interrupt */
+	irq = platform_get_irq(dev, 0);
+	if (irq < 0)
+		goto err_get_irq;
+
+	/* clear pending interrupts */
+	iowrite32(0xffffffff, tgpio->membase + TGPIOINT_CLR);
+	iowrite32(0x0, tgpio->membase + TGPIOINT);
+
+	/* request IRQ */
+	err = request_irq(irq, timbgpio_handleinterrupt, IRQF_SHARED,
+			  "timb-gpio", tgpio);
+	if (err) {
+		printk(KERN_ERR "timbgpio: Failed to request IRQ\n");
+		goto err_get_irq;
+	}
+
+	return err;
+
+err_get_irq:
+	err = gpiochip_remove(&tgpio->gpio);
+	if (err)
+		printk(KERN_ERR "timbgpio: failed to remove gpio_chip\n");
+err_chipadd:
+	iounmap(tgpio->membase);
+err_ioremap:
+	release_resource(&tgpio->rscr);
+err_request:
+	kfree(tgpio);
+err_mem:
+	printk(KERN_ERR "timberdale: Failed to register GPIOs: %d\n", err);
+
+	return err;
+}
+
+static int timbgpio_remove(struct platform_device *dev)
+{
+	int err;
+	struct timbgpio *tgpio = platform_get_drvdata(dev);
+
+	/* disable interrupts */
+	iowrite32(0x0, tgpio->membase + TGPIOINT);
+
+	free_irq(platform_get_irq(dev, 0), tgpio);
+	err = gpiochip_remove(&tgpio->gpio);
+	if (err)
+		printk(KERN_ERR "timbgpio: failed to remove gpio_chip\n");
+
+	iounmap(tgpio->membase);
+	release_resource(&tgpio->rscr);
+	kfree(tgpio);
+
+	return 0;
+}
+
+static struct platform_driver timbgpio_platform_driver = {
+	.driver = {
+		.name	= "timb-gpio",
+		.owner	= THIS_MODULE,
+	},
+	.probe		= timbgpio_probe,
+	.remove		= timbgpio_remove,
+};
+
+/*--------------------------------------------------------------------------*/
+
+static int __init timbgpio_init(void)
+{
+	return platform_driver_register(&timbgpio_platform_driver);
+}
+
+static void __exit timbgpio_exit(void)
+{
+	platform_driver_unregister(&timbgpio_platform_driver);
+}
+
+module_init(timbgpio_init);
+module_exit(timbgpio_exit);
+
+MODULE_DESCRIPTION("Timberdale GPIO driver");
+MODULE_LICENSE("GPL v2");
+MODULE_AUTHOR("Mocean Laboratories");
+MODULE_ALIAS("platform:timb-gpio");
+
diff -uNr linux-2.6.29-clean/drivers/gpio/timbgpio.h linux-2.6.29/drivers/gpio/timbgpio.h
--- linux-2.6.29-clean/drivers/gpio/timbgpio.h	1969-12-31 16:00:00.000000000 -0800
+++ linux-2.6.29/drivers/gpio/timbgpio.h	2009-04-06 13:51:47.000000000 -0700
@@ -0,0 +1,48 @@
+/*
+ * timbgpio.h timberdale FPGA GPIO driver defines
+ * Copyright (c) 2009 Intel Corporation
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/* Supports:
+ * Timberdale FPGA GPIO
+ */
+
+#ifndef _TIMBGPIO_H_
+#define _TIMBGPIO_H_
+
+#include <linux/mutex.h>
+#include <linux/gpio.h>
+
+#define TIMB_NR_GPIOS 16
+
+#define TGPIOVAL 	0
+#define TGPIODIR 	0x04
+#define TGPIOINT 	0x08
+#define TGPIOINT_STATUS	0x0c
+#define TGPIOINT_PENDING 0x10
+#define TGPIOINT_CLR	0x14
+#define TGPIOFLK 	0x18
+#define TGPIOLVL 	0x1c
+
+struct timbgpio {
+	void __iomem		*membase;
+	struct resource		rscr;
+	struct mutex		lock; /* mutual exclusion */
+	struct pci_dev		*pdev;
+	struct gpio_chip	gpio;
+};
+
+#endif
diff -uNr linux-2.6.29-clean/drivers/i2c/busses/i2c-ocores.c linux-2.6.29/drivers/i2c/busses/i2c-ocores.c
--- linux-2.6.29-clean/drivers/i2c/busses/i2c-ocores.c	2009-04-01 09:20:24.000000000 -0700
+++ linux-2.6.29/drivers/i2c/busses/i2c-ocores.c	2009-04-06 13:51:47.000000000 -0700
@@ -216,6 +216,7 @@
 	struct ocores_i2c_platform_data *pdata;
 	struct resource *res, *res2;
 	int ret;
+	u8 i;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!res)
@@ -271,6 +272,10 @@
 		goto add_adapter_failed;
 	}
 
+	/* add in known devices to the bus */
+	for (i = 0; i < pdata->num_devices; i++)
+		i2c_new_device(&i2c->adap, pdata->devices + i);
+
 	return 0;
 
 add_adapter_failed:
diff -uNr linux-2.6.29-clean/drivers/input/touchscreen/Kconfig linux-2.6.29/drivers/input/touchscreen/Kconfig
--- linux-2.6.29-clean/drivers/input/touchscreen/Kconfig	2009-04-01 09:20:23.000000000 -0700
+++ linux-2.6.29/drivers/input/touchscreen/Kconfig	2009-04-06 13:51:47.000000000 -0700
@@ -397,6 +397,17 @@
 	  To compile this driver as a module, choose M here: the
 	  module will be called touchit213.
 
+config TOUCHSCREEN_TSC2003
+	tristate "TSC2003 based touchscreens"
+	depends on I2C
+	help
+	  Say Y here if you have a TSC2003 based touchscreen.
+
+	  If unsure, say N.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called tsc2003.
+
 config TOUCHSCREEN_TSC2007
 	tristate "TSC2007 based touchscreens"
 	depends on I2C
diff -uNr linux-2.6.29-clean/drivers/input/touchscreen/Makefile linux-2.6.29/drivers/input/touchscreen/Makefile
--- linux-2.6.29-clean/drivers/input/touchscreen/Makefile	2009-04-01 09:20:23.000000000 -0700
+++ linux-2.6.29/drivers/input/touchscreen/Makefile	2009-04-06 13:51:47.000000000 -0700
@@ -25,6 +25,7 @@
 obj-$(CONFIG_TOUCHSCREEN_TOUCHIT213)	+= touchit213.o
 obj-$(CONFIG_TOUCHSCREEN_TOUCHRIGHT)	+= touchright.o
 obj-$(CONFIG_TOUCHSCREEN_TOUCHWIN)	+= touchwin.o
+obj-$(CONFIG_TOUCHSCREEN_TSC2003)	+= tsc2003.o
 obj-$(CONFIG_TOUCHSCREEN_TSC2007)	+= tsc2007.o
 obj-$(CONFIG_TOUCHSCREEN_UCB1400)	+= ucb1400_ts.o
 obj-$(CONFIG_TOUCHSCREEN_WACOM_W8001)	+= wacom_w8001.o
diff -uNr linux-2.6.29-clean/drivers/input/touchscreen/tsc2003.c linux-2.6.29/drivers/input/touchscreen/tsc2003.c
--- linux-2.6.29-clean/drivers/input/touchscreen/tsc2003.c	1969-12-31 16:00:00.000000000 -0800
+++ linux-2.6.29/drivers/input/touchscreen/tsc2003.c	2009-04-06 13:51:47.000000000 -0700
@@ -0,0 +1,387 @@
+/*
+ * tsc2003.c Driver for TI TSC2003 touch screen controller
+ * Copyright (c) 2009 Intel Corporation
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/* Supports:
+ * TI TSC2003
+ *
+ * Inspired by tsc2007, Copyright (c) 2008 MtekVision Co., Ltd.
+ */
+#include <linux/module.h>
+#include <linux/input.h>
+#include <linux/interrupt.h>
+#include <linux/i2c.h>
+#include <linux/i2c/tsc2007.h>
+#include <linux/kthread.h>
+#include <linux/semaphore.h>
+
+#define TSC2003_DRIVER_NAME		"tsc2003"
+
+#define TS_POLL_PERIOD	20		/* ms delay between samples */
+
+#define TSC2003_MEASURE_TEMP0		(0x0 << 4)
+#define TSC2003_MEASURE_AUX		(0x2 << 4)
+#define TSC2003_MEASURE_TEMP1		(0x4 << 4)
+#define TSC2003_ACTIVATE_XN		(0x8 << 4)
+#define TSC2003_ACTIVATE_YN		(0x9 << 4)
+#define TSC2003_ACTIVATE_YP_XN		(0xa << 4)
+#define TSC2003_SETUP			(0xb << 4)
+#define TSC2003_MEASURE_X		(0xc << 4)
+#define TSC2003_MEASURE_Y		(0xd << 4)
+#define TSC2003_MEASURE_Z1		(0xe << 4)
+#define TSC2003_MEASURE_Z2		(0xf << 4)
+
+#define TSC2003_POWER_OFF_IRQ_EN	(0x0 << 2)
+#define TSC2003_ADC_ON_IRQ_DIS0		(0x1 << 2)
+#define TSC2003_ADC_OFF_IRQ_EN		(0x2 << 2)
+#define TSC2003_ADC_ON_IRQ_DIS1		(0x3 << 2)
+
+#define TSC2003_12BIT			(0x0 << 1)
+#define TSC2003_8BIT			(0x1 << 1)
+
+#define	MAX_12BIT			((1 << 12) - 1)
+
+#define ADC_ON_12BIT	(TSC2003_12BIT | TSC2003_ADC_ON_IRQ_DIS0)
+
+#define READ_Y		(ADC_ON_12BIT | TSC2003_MEASURE_Y)
+#define READ_Z1		(ADC_ON_12BIT | TSC2003_MEASURE_Z1)
+#define READ_Z2		(ADC_ON_12BIT | TSC2003_MEASURE_Z2)
+#define READ_X		(ADC_ON_12BIT | TSC2003_MEASURE_X)
+#define PWRDOWN		(TSC2003_12BIT | TSC2003_POWER_OFF_IRQ_EN)
+
+struct ts_event {
+	int	x;
+	int	y;
+	int	z1, z2;
+};
+
+struct tsc2003 {
+	struct input_dev	*input;
+	char			phys[32];
+	struct task_struct	*task;
+	struct ts_event		tc;
+	struct completion 	penirq_completion;
+
+	struct i2c_client	*client;
+
+	u16			model;
+	u16			x_plate_ohms;
+
+	unsigned		pendown;
+};
+
+static inline int tsc2003_xfer(struct tsc2003 *tsc, u8 cmd)
+{
+	s32 data;
+	u16 val;
+
+	data = i2c_smbus_read_word_data(tsc->client, cmd);
+	if (data < 0) {
+		dev_err(&tsc->client->dev, "i2c io error: %d\n", data);
+		return data;
+	}
+
+	/* The protocol and raw data format from i2c interface:
+	 * S Addr Wr [A] Comm [A] S Addr Rd [A] [DataLow] A [DataHigh] NA P
+	 * Where DataLow has [D11-D4], DataHigh has [D3-D0 << 4 | Dummy 4bit].
+	 */
+	val = swab16(data) >> 4;
+
+	dev_dbg(&tsc->client->dev, "data: 0x%x, val: 0x%x\n", data, val);
+
+	return val;
+}
+
+static void tsc2003_send_event(void *tsc)
+{
+	struct tsc2003	*ts = tsc;
+	struct input_dev *input = ts->input;
+	u32		rt = 0;
+	u16		x, y, z1, z2;
+
+	x = ts->tc.x;
+	y = ts->tc.y;
+	z1 = ts->tc.z1;
+	z2 = ts->tc.z2;
+
+	/* range filtering */
+	if (x == MAX_12BIT)
+		x = 0;
+
+	if (likely(x && z1)) {
+		/* compute touch pressure resistance using equation #1 */
+		rt = z2;
+		rt -= z1;
+		rt *= x;
+		rt *= ts->x_plate_ohms;
+		rt /= z1;
+		rt = (rt + 2047) >> 12;
+	}
+
+	/* Sample found inconsistent by debouncing or pressure is beyond
+	 * the maximum. Don't report it to user space, repeat at least
+	 * once more the measurement
+	 */
+	if (rt > MAX_12BIT)
+		return;
+
+	/* NOTE: We can't rely on the pressure to determine the pen down
+	 * state, even this controller has a pressure sensor.  The pressure
+	 * value can fluctuate for quite a while after lifting the pen and
+	 * in some cases may not even settle at the expected value.
+	 *
+	 * The only safe way to check for the pen up condition is in the
+	 * timer by reading the pen signal state (it's a GPIO _and_ IRQ).
+	 */
+	if (rt) {
+		if (!ts->pendown) {
+			dev_dbg(&ts->client->dev, "DOWN\n");
+
+			input_report_key(input, BTN_TOUCH, 1);
+			ts->pendown = 1;
+		}
+
+		input_report_abs(input, ABS_X, x);
+		input_report_abs(input, ABS_Y, y);
+		input_report_abs(input, ABS_PRESSURE, rt);
+
+		input_sync(input);
+
+		dev_dbg(&ts->client->dev, "point(%4d,%4d), pressure (%4u)\n",
+			x, y, rt);
+	} else if (ts->pendown) {
+		/* pen up */
+		dev_dbg(&ts->client->dev, "UP\n");
+		input_report_key(input, BTN_TOUCH, 0);
+		input_report_abs(input, ABS_PRESSURE, 0);
+		input_sync(input);
+
+		ts->pendown = 0;
+	}
+}
+
+static int tsc2003_power_off_irq_en(struct tsc2003 *tsc)
+{
+	/* power down */
+	return tsc2003_xfer(tsc, PWRDOWN);
+}
+
+static int tsc2003_read_values(struct tsc2003 *tsc)
+{
+	/* y- still on; turn on only y+ (and ADC) */
+	tsc->tc.y = tsc2003_xfer(tsc, READ_Y);
+	if (tsc->tc.y < 0)
+		return tsc->tc.y;
+
+	/* turn y- off, x+ on, then leave in lowpower */
+	tsc->tc.x = tsc2003_xfer(tsc, READ_X);
+	if (tsc->tc.x < 0)
+		return tsc->tc.x;
+
+	/* turn y+ off, x- on; we'll use formula #1 */
+	tsc->tc.z1 = tsc2003_xfer(tsc, READ_Z1);
+	if (tsc->tc.z1 < 0)
+		return tsc->tc.z1;
+
+	tsc->tc.z2 = tsc2003_xfer(tsc, READ_Z2);
+	if (tsc->tc.z2 < 0)
+		return tsc->tc.z2;
+
+	return 0;
+}
+
+
+static irqreturn_t tsc2003_irq(int irq, void *handle)
+{
+	struct tsc2003 *ts = handle;
+
+	/* do not call the synced version -> deadlock */
+	disable_irq_nosync(irq);
+	/* signal the thread to continue */
+	complete(&ts->penirq_completion);
+
+	return IRQ_HANDLED;
+}
+
+static int tsc2003_thread(void *d)
+{
+	struct tsc2003 *ts = (struct tsc2003 *)d;
+	int ret;
+
+	allow_signal(SIGKILL);
+
+	while (!signal_pending(current)) {
+		/* power down and wait for interrupt */
+		do {
+			/* loop because the I2C bus might be busy */
+			ret = msleep_interruptible(TS_POLL_PERIOD);
+			if (!ret)
+				ret = tsc2003_power_off_irq_en(ts);
+		} while (ret == -EAGAIN && !signal_pending(current));
+
+		if (signal_pending(current))
+			break;
+
+		ret = wait_for_completion_interruptible(&ts->penirq_completion);
+		if (!ret) {
+			int first = 1;
+			/* got IRQ, start poll, until pen is up */
+			while (!ret && !signal_pending(current)
+				&& (first || ts->pendown)) {
+				ret = tsc2003_read_values(ts);
+				if (!ret)
+					tsc2003_send_event(ts);
+				ret = msleep_interruptible(TS_POLL_PERIOD);
+				first = 0;
+			}
+
+			/* we re enable the interrupt */
+			if (!signal_pending(current))
+				enable_irq(ts->client->irq);
+		}
+	}
+
+	return 0;
+}
+
+static int tsc2003_probe(struct i2c_client *client,
+			const struct i2c_device_id *id)
+{
+	struct tsc2003 *ts;
+	struct tsc2007_platform_data *pdata = client->dev.platform_data;
+	struct input_dev *input_dev;
+	int err;
+
+	if (!pdata) {
+		dev_err(&client->dev, "platform data is required!\n");
+		return -EINVAL;
+	}
+
+	if (!i2c_check_functionality(client->adapter,
+				     I2C_FUNC_SMBUS_READ_WORD_DATA))
+		return -EIO;
+
+	ts = kzalloc(sizeof(struct tsc2003), GFP_KERNEL);
+	input_dev = input_allocate_device();
+	if (!ts || !input_dev) {
+		err = -ENOMEM;
+		goto err_free_mem;
+	}
+
+	ts->client = client;
+	i2c_set_clientdata(client, ts);
+
+	ts->input = input_dev;
+
+	ts->model             = pdata->model;
+	ts->x_plate_ohms      = pdata->x_plate_ohms;
+
+	snprintf(ts->phys, sizeof(ts->phys),
+		 "%s/input0", dev_name(&client->dev));
+
+	input_dev->name = TSC2003_DRIVER_NAME" Touchscreen";
+	input_dev->phys = ts->phys;
+	input_dev->id.bustype = BUS_I2C;
+
+	input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
+	input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
+
+	input_set_abs_params(input_dev, ABS_X, 0, MAX_12BIT, 0, 0);
+	input_set_abs_params(input_dev, ABS_Y, 0, MAX_12BIT, 0, 0);
+	input_set_abs_params(input_dev, ABS_PRESSURE, 0, MAX_12BIT, 0, 0);
+
+	init_completion(&ts->penirq_completion);
+
+	ts->task = kthread_run(tsc2003_thread, ts, TSC2003_DRIVER_NAME);
+	if (IS_ERR(ts->task)) {
+		err = PTR_ERR(ts->task);
+		goto err_free_mem;
+	}
+
+	err = request_irq(client->irq, tsc2003_irq, 0,
+			client->dev.driver->name, ts);
+	if (err < 0) {
+		dev_err(&client->dev, "irq %d busy?\n", client->irq);
+		goto err_free_thread;
+	}
+
+	err = input_register_device(input_dev);
+	if (err)
+		goto err_free_irq;
+
+	dev_info(&client->dev, "registered with irq (%d)\n", client->irq);
+
+	return 0;
+
+ err_free_irq:
+	free_irq(client->irq, ts);
+ err_free_thread:
+	kthread_stop(ts->task);
+ err_free_mem:
+	input_free_device(input_dev);
+	kfree(ts);
+	return err;
+}
+
+static int tsc2003_remove(struct i2c_client *client)
+{
+	struct tsc2003 *ts = i2c_get_clientdata(client);
+
+	free_irq(client->irq, ts);
+	send_sig(SIGKILL, ts->task, 1);
+	kthread_stop(ts->task);
+	input_unregister_device(ts->input);
+	kfree(ts);
+
+	return 0;
+}
+
+static struct i2c_device_id tsc2003_idtable[] = {
+	{ TSC2003_DRIVER_NAME, 0 },
+	{ }
+};
+
+MODULE_DEVICE_TABLE(i2c, tsc2003_idtable);
+
+static struct i2c_driver tsc2003_driver = {
+	.driver = {
+		.owner	= THIS_MODULE,
+		.name	= TSC2003_DRIVER_NAME,
+		.bus = &i2c_bus_type,
+	},
+	.id_table	= tsc2003_idtable,
+	.probe		= tsc2003_probe,
+	.remove		= tsc2003_remove,
+};
+
+static int __init tsc2003_init(void)
+{
+	return i2c_add_driver(&tsc2003_driver);
+}
+
+static void __exit tsc2003_exit(void)
+{
+	i2c_del_driver(&tsc2003_driver);
+}
+
+module_init(tsc2003_init);
+module_exit(tsc2003_exit);
+
+MODULE_AUTHOR("Mocean Laboratories <info@mocean-labs.com>");
+MODULE_DESCRIPTION("TSC2003 TouchScreen Driver");
+MODULE_LICENSE("GPL v2");
+
diff -uNr linux-2.6.29-clean/drivers/media/video/adv7180.c linux-2.6.29/drivers/media/video/adv7180.c
--- linux-2.6.29-clean/drivers/media/video/adv7180.c	1969-12-31 16:00:00.000000000 -0800
+++ linux-2.6.29/drivers/media/video/adv7180.c	2009-04-06 13:51:47.000000000 -0700
@@ -0,0 +1,361 @@
+/*
+ * adv7180.c Analog Devices ADV7180 video decoder driver
+ * Copyright (c) 2009 Intel Corporation
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/delay.h>
+#include <linux/errno.h>
+#include <linux/fs.h>
+#include <linux/kernel.h>
+#include <linux/major.h>
+#include <linux/slab.h>
+#include <linux/mm.h>
+#include <linux/signal.h>
+#include <linux/types.h>
+#include <linux/io.h>
+#include <asm/pgtable.h>
+#include <asm/page.h>
+#include <linux/uaccess.h>
+
+#include <linux/i2c-ocores.h>
+#include <linux/platform_device.h>
+#include <linux/i2c.h>
+#include <linux/i2c-id.h>
+#include <linux/videodev.h>
+#include <linux/video_decoder.h>
+#include <media/v4l2-ioctl.h>
+#include <media/adv7180.h>
+
+
+MODULE_DESCRIPTION("Analog Devices ADV7180 video decoder driver");
+MODULE_AUTHOR("Mocean Laboratories");
+MODULE_LICENSE("GPL v2");
+
+static inline int adv7180_write(struct i2c_client *client,
+						u8 reg, u8 value)
+{
+	struct adv7180 *decoder = i2c_get_clientdata(client);
+
+	decoder->reg[reg] = value;
+	return i2c_smbus_write_byte_data(client, reg, value);
+}
+
+static inline int adv7180_read(struct i2c_client *client, u8 reg)
+{
+	return i2c_smbus_read_byte_data(client, reg);
+}
+
+static int adv7180_write_block(struct i2c_client *client,
+			const u8 *data, unsigned int len)
+{
+	int ret = -1;
+	u8 reg;
+
+	/* the adv7180 has an autoincrement function, use it if
+	 * the adapter understands raw I2C */
+	if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
+		/* do raw I2C, not smbus compatible */
+		struct adv7180 *decoder = i2c_get_clientdata(client);
+		u8 block_data[32];
+		int block_len;
+
+		while (len >= 2) {
+			block_len = 0;
+			reg = data[0];
+			block_data[block_len++] = reg;
+			do {
+				block_data[block_len++] =
+					decoder->reg[reg++] = data[1];
+				len -= 2;
+				data += 2;
+			} while (len >= 2 && data[0] == reg &&
+					block_len < 32);
+
+			ret = i2c_master_send(client, block_data, block_len);
+			if (ret < 0)
+				break;
+		}
+	} else {
+		/* do some slow I2C emulation kind of thing */
+		while (len >= 2) {
+			reg = *data++;
+			ret = adv7180_write(client, reg, *data++);
+			if (ret < 0)
+				break;
+
+			len -= 2;
+		}
+	}
+
+	return ret;
+}
+#ifdef CONFIG_MFD_TIMBERDALE
+static irqreturn_t adv7180_irq(int irq, void *dev_id)
+{
+	struct adv7180 *decoder = (struct adv7180 *) dev_id;
+
+	/* Activate access to sub-regs */
+	adv7180_write(decoder->client, ADV7180_ADI_CTRL, ADI_ENABLE);
+
+	/* TODO: implement a real interrupt handler
+	 * for now just
+	 * clear all four regs
+	 */
+	adv7180_write_block(decoder->client, reset_icr, sizeof(reset_icr));
+
+	return IRQ_HANDLED;
+}
+#endif
+static int adv7180_command(struct i2c_client *client,
+					unsigned int cmd, void *arg)
+{
+	struct adv7180 *decoder = i2c_get_clientdata(client);
+	int *iarg = (int *)arg;
+	int status;
+
+	switch (cmd) {
+
+	case DECODER_INIT:
+		adv7180_write(client, 0x0f, 0x80); /* Reset */
+		break;
+
+	case DECODER_GET_CAPABILITIES:
+	{
+		struct video_decoder_capability *cap = arg;
+		cap->flags = VIDEO_DECODER_PAL |
+				VIDEO_DECODER_NTSC |
+				VIDEO_DECODER_SECAM |
+				VIDEO_DECODER_AUTO;
+		cap->inputs = 3;
+		cap->outputs = 1;
+	}
+	break;
+
+	case DECODER_GET_STATUS:
+	{
+		*iarg = 0;
+		status = adv7180_read(client, ADV7180_SR);
+		if ((status & ADV7180_STATUS_PAL))
+			*iarg = (*iarg | DECODER_STATUS_PAL);
+
+		if ((status & ADV7180_STATUS_NTSC))
+			*iarg = (*iarg | DECODER_STATUS_NTSC);
+
+		if ((status & ADV7180_STATUS_SECAM))
+			*iarg = (*iarg | DECODER_STATUS_SECAM);
+	}
+	break;
+
+	case DECODER_SET_NORM:
+	{
+		int v = *(int *) arg;
+		if (decoder->norm != v) {
+			decoder->norm = v;
+			switch (v) {
+			case VIDEO_MODE_NTSC:
+				adv7180_write(client, ADV7180_IN_CTRL, 0x40);
+				break;
+			case VIDEO_MODE_PAL:
+				adv7180_write(client, ADV7180_IN_CTRL, 0x70);
+				break;
+			case VIDEO_MODE_SECAM:
+				adv7180_write(client, ADV7180_IN_CTRL, 0x90);
+				break;
+			case VIDEO_MODE_AUTO:
+				adv7180_write(client, ADV7180_IN_CTRL, 0x00);
+				break;
+			default:
+				return -EPERM;
+			}
+		}
+	}
+	break;
+
+	case DECODER_SET_INPUT:
+	{
+		int v = *(int *) arg;
+		if (decoder->input != v) {
+			decoder->input = v;
+
+			switch (v) {
+			case CVBS:
+				adv7180_write_block(client, init_cvbs_64,
+							sizeof(init_cvbs_64));
+				break;
+			case SVIDEO:
+				adv7180_write_block(client, init_svideo_64,
+							sizeof(init_svideo_64));
+				break;
+			case YPbPr:
+				adv7180_write_block(client, init_ypbpr_64,
+							sizeof(init_ypbpr_64));
+				break;
+			default:
+				return -EINVAL;
+			}
+		}
+	}
+	break;
+
+	case DECODER_SET_OUTPUT:
+	{
+	}
+	break;
+
+	case DECODER_ENABLE_OUTPUT:
+	{
+	}
+	break;
+
+	case DECODER_SET_PICTURE:
+	{
+	}
+	break;
+
+	case DECODER_DUMP:
+	{
+		adv7180_write(client, 1, 0x88);
+	}
+	break;
+
+	default:
+		return -EINVAL;
+	}
+	return 0;
+}
+
+/* ----------------------------------------------------------------------- */
+
+/*
+ * Generic i2c probe
+ * concerning the addresses: i2c wants 7 bit (without the r/w bit), so '>>1'
+ */
+static unsigned short normal_i2c[] = {
+	0x40 >> 1, 0x41 >> 1,
+	I2C_ADV7180 >> 1, 0x43 >> 1,
+	I2C_CLIENT_END
+};
+
+I2C_CLIENT_INSMOD;
+
+static int adv7180_detect(struct i2c_client *client, int kind,
+			  struct i2c_board_info *info)
+{
+	struct i2c_adapter *adapter = client->adapter;
+
+	if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE
+				     | I2C_FUNC_SMBUS_WRITE_BYTE_DATA))
+		return -ENODEV;
+
+	/* Is chip alive ? */
+	if (adv7180_read(client, 0x11) != 0x1b)
+		return -ENODEV;
+
+	strlcpy(info->type, DRIVER_NAME, I2C_NAME_SIZE);
+
+	return 0;
+}
+
+static int adv7180_probe(struct i2c_client *client,
+			const struct i2c_device_id *id)
+{
+	int err = 0;
+	struct adv7180 *decoder;
+
+	printk(KERN_INFO DRIVER_NAME" chip found @ 0x%x (%s)\n",
+		client->addr << 1, client->adapter->name);
+
+	decoder = kzalloc(sizeof(struct adv7180), GFP_KERNEL);
+	if (decoder == NULL)
+		return -ENOMEM;
+
+	decoder->norm = VIDEO_MODE_PAL | VIDEO_MODE_NTSC |
+			VIDEO_MODE_SECAM |
+			VIDEO_MODE_AUTO;
+	decoder->input = CVBS;
+	decoder->enable = 1;
+	decoder->client = client;
+	i2c_set_clientdata(client, decoder);
+#ifdef CONFIG_MFD_TIMBERDALE
+	err = request_irq(client->irq, adv7180_irq, 0,
+				client->dev.driver->name, decoder);
+	if (err < 0) {
+		dev_err(&client->dev, "irq %d busy?\n", client->irq);
+		goto err_free_dec;
+	}
+	dev_info(&client->dev, "registered with irq (%d)\n", client->irq);
+#endif
+	adv7180_command(client, DECODER_INIT, NULL); /* Reset */
+
+	return 0;
+#ifdef CONFIG_MFD_TIMBERDALE
+err_free_dec:
+	kfree(decoder);
+
+	return err;
+#endif
+}
+
+static int adv7180_remove(struct i2c_client *client)
+{
+	struct adv7180 *decoder = i2c_get_clientdata(client);
+#ifdef CONFIG_MFD_TIMBERDALE
+	free_irq(client->irq, decoder);
+#endif
+	kfree(decoder);
+	return 0;
+}
+
+/* ----------------------------------------------------------------------- */
+static const struct i2c_device_id adv7180_id[] = {
+	{ DRIVER_NAME, 0 },
+	{ }
+};
+MODULE_DEVICE_TABLE(i2c, adv7180_id);
+
+static struct i2c_driver i2c_driver_adv7180 = {
+	.driver = {
+		.owner = THIS_MODULE,
+		.name = DRIVER_NAME,
+		.bus = &i2c_bus_type,
+	},
+
+	.id_table = adv7180_id,
+	.probe = adv7180_probe,
+	.remove = adv7180_remove,
+
+	.class = 0xffffffff,
+	.detect = adv7180_detect,
+	.address_data	= &addr_data,
+
+	.command = adv7180_command,
+};
+
+static int __init adv7180_init(void)
+{
+	return i2c_add_driver(&i2c_driver_adv7180);
+}
+
+static void __exit adv7180_exit(void)
+{
+	i2c_del_driver(&i2c_driver_adv7180);
+}
+
+module_init(adv7180_init);
+module_exit(adv7180_exit);
diff -uNr linux-2.6.29-clean/drivers/media/video/Kconfig linux-2.6.29/drivers/media/video/Kconfig
--- linux-2.6.29-clean/drivers/media/video/Kconfig	2009-04-01 09:20:24.000000000 -0700
+++ linux-2.6.29/drivers/media/video/Kconfig	2009-04-06 13:51:47.000000000 -0700
@@ -251,6 +251,15 @@
 
 comment "Video decoders"
 
+config VIDEO_ADV7180
+	tristate "Analog Devices ADV7180 decoder"
+	depends on VIDEO_V4L1 && I2C
+	---help---
+	  Support for the Analog Devices ADV7180 video decoder.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called adv7180.
+
 config VIDEO_BT819
 	tristate "BT819A VideoStream decoder"
 	depends on VIDEO_V4L1 && I2C
@@ -800,6 +809,12 @@
 	---help---
 	  This is a v4l2 driver for the TI OMAP2 camera capture interface
 
+config VIDEO_TIMBERDALE
+	tristate "Support for timberdale Video In/LogiWIN"
+	depends on VIDEO_V4L2 && MFD_TIMBERDALE_DMA
+	---help---
+	Add support for the Video In peripherial of the timberdale FPGA.
+
 #
 # USB Multimedia device configuration
 #
diff -uNr linux-2.6.29-clean/drivers/media/video/Makefile linux-2.6.29/drivers/media/video/Makefile
--- linux-2.6.29-clean/drivers/media/video/Makefile	2009-04-01 09:20:24.000000000 -0700
+++ linux-2.6.29/drivers/media/video/Makefile	2009-04-06 13:51:47.000000000 -0700
@@ -52,6 +52,7 @@
 obj-$(CONFIG_VIDEO_SAA7191) += saa7191.o
 obj-$(CONFIG_VIDEO_ADV7170) += adv7170.o
 obj-$(CONFIG_VIDEO_ADV7175) += adv7175.o
+obj-$(CONFIG_VIDEO_ADV7180) += adv7180.o
 obj-$(CONFIG_VIDEO_VPX3220) += vpx3220.o
 obj-$(CONFIG_VIDEO_BT819) += bt819.o
 obj-$(CONFIG_VIDEO_BT856) += bt856.o
@@ -148,6 +149,8 @@
 
 obj-$(CONFIG_VIDEO_AU0828) += au0828/
 
+obj-$(CONFIG_VIDEO_TIMBERDALE)	+= timblogiw.o
+
 obj-$(CONFIG_USB_VIDEO_CLASS)	+= uvc/
 
 EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core
diff -uNr linux-2.6.29-clean/drivers/media/video/timblogiw.c linux-2.6.29/drivers/media/video/timblogiw.c
--- linux-2.6.29-clean/drivers/media/video/timblogiw.c	1969-12-31 16:00:00.000000000 -0800
+++ linux-2.6.29/drivers/media/video/timblogiw.c	2009-04-06 13:51:47.000000000 -0700
@@ -0,0 +1,930 @@
+/*
+ * timblogiw.c timberdale FPGA LogiWin Video In driver
+ * Copyright (c) 2009 Intel Corporation
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/* Supports:
+ * Timberdale FPGA LogiWin Video In
+ */
+
+#include <linux/list.h>
+#include <linux/version.h>
+#include <linux/module.h>
+#include <linux/pci.h>
+#include <linux/dma-mapping.h>
+#include <media/v4l2-common.h>
+#include <media/v4l2-ioctl.h>
+#include <linux/platform_device.h>
+#include <linux/interrupt.h>
+#include "timblogiw.h"
+#include <linux/mfd/timbdma.h>
+
+
+#define TIMBLOGIW_CTRL 0x40
+
+#define TIMBLOGIW_H_SCALE 0x20
+#define TIMBLOGIW_V_SCALE 0x28
+
+#define TIMBLOGIW_X_CROP 0x58
+#define TIMBLOGIW_Y_CROP 0x60
+
+#define TIMBLOGIW_W_CROP 0x00
+#define TIMBLOGIW_H_CROP 0x08
+
+#define TIMBLOGIW_VERSION_CODE 0x02
+
+#define TIMBLOGIW_FRAME		0x10
+#define TIMBLOGIW_DROP		0x20
+
+#define TIMBLOGIW_BUF	0x04
+#define TIMBLOGIW_TBI	0x2c
+#define TIMBLOGIW_BPL	0x30
+
+#define dbg(...)
+
+const struct timblogiw_tvnorm timblogiw_tvnorms[] = {
+	{
+		.v4l2_id		= V4L2_STD_PAL,
+		.name			= "PAL",
+		.swidth			= 720,
+		.sheight		= 576
+	},
+	{
+		.v4l2_id		= V4L2_STD_NTSC_M,
+		.name			= "NTSC",
+		.swidth			= 720,
+		.sheight		= 480
+	}
+};
+
+static void timblogiw_handleframe(unsigned long arg)
+{
+	struct timblogiw_frame *f;
+	struct timblogiw *lw = (struct timblogiw *)arg;
+
+	spin_lock_bh(&lw->queue_lock);
+	if (!list_empty(&lw->inqueue)) {
+		/* put the entry in the outqueue */
+		f = list_entry(lw->inqueue.next, struct timblogiw_frame, frame);
+
+		/* copy data from the DMA buffer */
+		memcpy(f->bufmem, lw->dma.filled->buf, f->buf.length);
+		/* buffer consumed */
+		lw->dma.filled = NULL;
+
+		do_gettimeofday(&f->buf.timestamp);
+		f->buf.sequence = ++lw->frame_count;
+		f->buf.field = V4L2_FIELD_NONE;
+		f->state = F_DONE;
+		f->buf.bytesused = lw->frame_size;
+		list_move_tail(&f->frame, &lw->outqueue);
+		/* wake up any waiter */
+		wake_up(&lw->wait_frame);
+	}
+	spin_unlock_bh(&lw->queue_lock);
+}
+
+static int timblogiw_isr(u32 flag, void *pdev)
+{
+	struct timblogiw *lw = (struct timblogiw *)pdev;
+
+	if (!lw->dma.filled) {
+		/* no stored transfer so far, store this, and flip to next */
+		lw->dma.filled = lw->dma.transfer + lw->dma.curr;
+		lw->dma.curr = !lw->dma.curr;
+	}
+
+	if (lw->stream == STREAM_ON)
+		timb_start_dma(DMA_IRQ_VIDEO_RX,
+			lw->dma.transfer[lw->dma.curr].handle, lw->frame_size,
+			lw->bytesperline);
+
+	if (flag & DMA_IRQ_VIDEO_DROP)
+		dbg("%s: frame dropped\n", __func__);
+	if (flag & DMA_IRQ_VIDEO_RX) {
+		dbg("%s: frame RX\n", __func__);
+		tasklet_schedule(&lw->tasklet);
+	}
+	return 0;
+}
+
+static void timblogiw_empty_framequeues(struct timblogiw *lw)
+{
+	u32 i;
+
+	dbg("%s\n", __func__);
+
+	INIT_LIST_HEAD(&lw->inqueue);
+	INIT_LIST_HEAD(&lw->outqueue);
+
+	for (i = 0; i < lw->num_frames; i++) {
+		lw->frame[i].state = F_UNUSED;
+		lw->frame[i].buf.bytesused = 0;
+	}
+}
+
+u32 timblogiw_request_buffers(struct timblogiw *lw, u32 count)
+{
+	/* needs to be page aligned cause the */
+	/* buffers can be mapped individually! */
+	const size_t imagesize = PAGE_ALIGN(lw->frame_size);
+	void *buff = NULL;
+	u32 i;
+
+	dbg("%s - request of %i buffers of size %zi\n",
+		__func__, count, lw->frame_size);
+
+	lw->dma.transfer[0].buf = pci_alloc_consistent(lw->dev, imagesize,
+		&lw->dma.transfer[0].handle);
+	lw->dma.transfer[1].buf = pci_alloc_consistent(lw->dev, imagesize,
+		&lw->dma.transfer[1].handle);
+	if ((lw->dma.transfer[0].buf == NULL) ||
+		(lw->dma.transfer[1].buf == NULL)) {
+		printk(KERN_ALERT "alloc failed\n");
+		if (lw->dma.transfer[0].buf != NULL)
+			pci_free_consistent(lw->dev, imagesize,
+				lw->dma.transfer[0].buf,
+				lw->dma.transfer[0].handle);
+		if (lw->dma.transfer[1].buf != NULL)
+			pci_free_consistent(lw->dev, imagesize,
+				lw->dma.transfer[1].buf,
+				lw->dma.transfer[1].handle);
+		return 0;
+	}
+
+	if (count > TIMBLOGIW_NUM_FRAMES)
+		count = TIMBLOGIW_NUM_FRAMES;
+
+	lw->num_frames = count;
+	while (lw->num_frames > 0) {
+		buff = vmalloc_32(lw->num_frames * imagesize);
+		if (buff) {
+			memset(buff, 0, lw->num_frames * imagesize);
+			break;
+		}
+		lw->num_frames--;
+	}
+
+	for (i = 0; i < lw->num_frames; i++) {
+		lw->frame[i].bufmem = buff + i * imagesize;
+		lw->frame[i].buf.index = i;
+		lw->frame[i].buf.m.offset = i * imagesize;
+		lw->frame[i].buf.length = lw->frame_size;
+		lw->frame[i].buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+		lw->frame[i].buf.sequence = 0;
+		lw->frame[i].buf.field = V4L2_FIELD_NONE;
+		lw->frame[i].buf.memory = V4L2_MEMORY_MMAP;
+		lw->frame[i].buf.flags = 0;
+	}
+
+	lw->dma.curr = 0;
+	lw->dma.filled = NULL;
+	return lw->num_frames;
+}
+
+void timblogiw_release_buffers(struct timblogiw *lw)
+{
+	dbg("%s\n", __func__);
+
+	if (lw->frame[0].bufmem != NULL) {
+		vfree(lw->frame[0].bufmem);
+		lw->frame[0].bufmem = NULL;
+		lw->num_frames = TIMBLOGIW_NUM_FRAMES;
+		pci_free_consistent(lw->dev, lw->frame_size,
+			lw->dma.transfer[0].buf, lw->dma.transfer[0].handle);
+		pci_free_consistent(lw->dev, lw->frame_size,
+			lw->dma.transfer[1].buf, lw->dma.transfer[1].handle);
+	}
+}
+
+/* IOCTL functions */
+
+static int timblogiw_g_fmt(struct timblogiw *lw, struct v4l2_format *format)
+{
+	dbg("%s -\n",  __func__);
+
+	if (format->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
+		return -EINVAL;
+
+	format->fmt.pix.width = lw->width;
+	format->fmt.pix.height = lw->height;
+	format->fmt.pix.pixelformat = V4L2_PIX_FMT_YUYV;
+	format->fmt.pix.bytesperline = lw->bytesperline;
+	format->fmt.pix.sizeimage = lw->frame_size;
+	format->fmt.pix.colorspace = V4L2_COLORSPACE_SMPTE170M;
+	format->fmt.pix.field = V4L2_FIELD_NONE;
+	return 0;
+}
+
+static int timblogiw_s_fmt(struct timblogiw *lw, struct v4l2_format *format)
+{
+	struct v4l2_pix_format *pix = &format->fmt.pix;
+	dbg("%s - type: %d\n", __func__, format->type);
+
+	if (format->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
+		return -EINVAL;
+
+	if ((lw->height != pix->height) || (lw->width != lw->width))
+		return -EINVAL;
+
+	if (format->fmt.pix.field != V4L2_FIELD_NONE)
+		return -EINVAL;
+
+	dbg("%s - width=%d, height=%d, pixelformat=%d, field=%d\n"
+		"bytes per line %d, size image: %d, colorspace: %d\n",
+		__func__,
+		pix->width, pix->height, pix->pixelformat, pix->field,
+		pix->bytesperline, pix->sizeimage, pix->colorspace);
+
+	return 0;
+}
+
+static int timblogiw_querycap(struct timblogiw *lw,
+	struct v4l2_capability *cap)
+{
+	memset(cap, 0, sizeof(*cap));
+	strncpy(cap->card, "Timberdale Video", sizeof(cap->card)-1);
+	strncpy(cap->driver, "Timblogiw", sizeof(cap->card)-1);
+	cap->version = TIMBLOGIW_VERSION_CODE;
+	cap->capabilities = V4L2_CAP_VIDEO_CAPTURE |
+		V4L2_CAP_STREAMING;
+
+	return 0;
+}
+
+static int timblogiw_enum_fmt(struct timblogiw *lw, struct v4l2_fmtdesc *fmt)
+{
+	dbg("%s - VIDIOC_ENUM_FMT\n", __func__);
+
+	if (fmt->index != 0)
+		return -EINVAL;
+	memset(fmt, 0, sizeof(*fmt));
+	fmt->index = 0;
+	fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+	strncpy(fmt->description, "4:2:2, packed, YUYV",
+		sizeof(fmt->description)-1);
+	fmt->pixelformat = V4L2_PIX_FMT_YUYV;
+	memset(fmt->reserved, 0, sizeof(fmt->reserved));
+
+	return 0;
+}
+
+static int timblogiw_reqbufs(struct timblogiw *lw,
+	struct v4l2_requestbuffers *rb)
+{
+	if (rb->type != V4L2_BUF_TYPE_VIDEO_CAPTURE ||
+		rb->memory != V4L2_MEMORY_MMAP)
+		return -EINVAL;
+
+	timblogiw_empty_framequeues(lw);
+
+	timblogiw_release_buffers(lw);
+	if (rb->count)
+		rb->count = timblogiw_request_buffers(lw, rb->count);
+
+	dbg("%s - VIDIOC_REQBUFS: io method is mmap. num bufs %i\n",
+		__func__, rb->count);
+
+	return 0;
+}
+
+static int timblogiw_querybuf(struct timblogiw *lw, struct v4l2_buffer *b)
+{
+	if (b->type != V4L2_BUF_TYPE_VIDEO_CAPTURE ||
+		b->index >= lw->num_frames)
+		return -EINVAL;
+
+	memcpy(b, &lw->frame[b->index].buf, sizeof(*b));
+
+	if (lw->frame[b->index].vma_use_count)
+		b->flags |= V4L2_BUF_FLAG_MAPPED;
+
+	if (lw->frame[b->index].state == F_DONE)
+		b->flags |= V4L2_BUF_FLAG_DONE;
+	else if (lw->frame[b->index].state != F_UNUSED)
+		b->flags |= V4L2_BUF_FLAG_QUEUED;
+
+	return 0;
+}
+
+static int timblogiw_qbuf(struct timblogiw *lw, struct v4l2_buffer *b)
+{
+	unsigned long lock_flags;
+
+	if (b->type != V4L2_BUF_TYPE_VIDEO_CAPTURE ||
+		b->index >= lw->num_frames)
+		return -EINVAL;
+
+	if (lw->frame[b->index].state != F_UNUSED)
+		return -EAGAIN;
+
+	if (b->memory != V4L2_MEMORY_MMAP)
+		return -EINVAL;
+
+	lw->frame[b->index].state = F_QUEUED;
+
+	spin_lock_irqsave(&lw->queue_lock, lock_flags);
+	list_add_tail(&lw->frame[b->index].frame, &lw->inqueue);
+	spin_unlock_irqrestore(&lw->queue_lock, lock_flags);
+
+	return 0;
+}
+
+static int timblogiw_dqbuf(struct timblogiw *lw, struct file *file,
+	struct v4l2_buffer *b)
+{
+	struct timblogiw_frame *f;
+	unsigned long lock_flags;
+	int ret = 0;
+
+	if (b->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) {
+		dbg("%s - VIDIOC_DQBUF, illegal buf type!\n",
+			__func__);
+		return -EINVAL;
+	}
+
+	if (list_empty(&lw->outqueue)) {
+		if (file->f_flags & O_NONBLOCK)
+			return -EAGAIN;
+
+		ret = wait_event_interruptible(lw->wait_frame,
+			!list_empty(&lw->outqueue));
+		if (ret)
+			return ret;
+	}
+
+	spin_lock_irqsave(&lw->queue_lock, lock_flags);
+	f = list_entry(lw->outqueue.next,
+			struct timblogiw_frame, frame);
+	list_del(lw->outqueue.next);
+	spin_unlock_irqrestore(&lw->queue_lock, lock_flags);
+
+	f->state = F_UNUSED;
+	memcpy(b, &f->buf, sizeof(*b));
+
+	if (f->vma_use_count)
+		b->flags |= V4L2_BUF_FLAG_MAPPED;
+
+	return 0;
+}
+
+static int timblogiw_enumstd(struct timblogiw *lw, struct v4l2_standard *std)
+{
+	if (std->index != 0)
+		return -EINVAL;
+
+	memset(std, 0, sizeof(*std));
+	std->index = 0;
+
+	std->id = V4L2_STD_PAL;
+	strncpy(std->name, "PAL", sizeof(std->name)-1);
+
+	return 0;
+}
+
+static int timblogiw_g_std(struct timblogiw *lw, v4l2_std_id *std)
+{
+	*std = V4L2_STD_PAL;
+	return 0;
+}
+
+static int timblogiw_s_std(struct timblogiw *lw, v4l2_std_id *std)
+{
+	if (!(*std & V4L2_STD_PAL))
+		return -EINVAL;
+	return 0;
+}
+
+static int timblogiw_enuminput(struct timblogiw *lw, struct v4l2_input *inp)
+{
+	if (inp->index != 0)
+		return -EINVAL;
+
+	memset(inp, 0, sizeof(*inp));
+	inp->index = 0;
+
+	strncpy(inp->name, "Timb input 1", sizeof(inp->name) - 1);
+	inp->type = V4L2_INPUT_TYPE_CAMERA;
+	inp->std = V4L2_STD_ALL;
+
+	return 0;
+}
+
+static int timblogiw_g_input(struct timblogiw *lw, int *input)
+{
+	*input = 0;
+
+	return 0;
+}
+
+static int timblogiw_s_input(struct timblogiw *lw, int *input)
+{
+	if (*input != 0)
+		return -EINVAL;
+	return 0;
+}
+
+static int timblogiw_streamon(struct timblogiw *lw, int *type)
+{
+	struct timblogiw_frame *f;
+
+	if (*type != V4L2_BUF_TYPE_VIDEO_CAPTURE) {
+		dbg("%s - No capture device\n", __func__);
+		return -EINVAL;
+	}
+
+	if (list_empty(&lw->inqueue)) {
+		dbg("%s - inqueue is empty\n", __func__);
+		return -EINVAL;
+	}
+
+	if (lw->stream == STREAM_ON)
+		return 0;
+
+	lw->stream = STREAM_ON;
+
+	f = list_entry(lw->inqueue.next,
+		struct timblogiw_frame, frame);
+
+	dbg("%s - f size: %d, bpr: %d, dma addr: %x\n", __func__,
+		lw->frame_size, lw->bytesperline,
+		(unsigned int)lw->dma.transfer[lw->dma.curr].handle);
+	timb_start_dma(DMA_IRQ_VIDEO_RX,
+		lw->dma.transfer[lw->dma.curr].handle,
+		lw->frame_size, lw->bytesperline);
+
+	return 0;
+}
+
+static int timblogiw_streamoff(struct timblogiw *lw, int *type)
+{
+	if (*type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
+		return -EINVAL;
+
+	if (lw->stream == STREAM_ON) {
+		unsigned long lock_flags;
+		spin_lock_irqsave(&lw->queue_lock, lock_flags);
+		timb_stop_dma(DMA_IRQ_VIDEO_RX);
+		lw->stream = STREAM_OFF;
+		spin_unlock_irqrestore(&lw->queue_lock, lock_flags);
+	}
+	timblogiw_empty_framequeues(lw);
+
+	return 0;
+}
+
+static int timblogiw_querystd(struct timblogiw *lw, v4l2_std_id *std)
+{
+	/* TODO: Ask encoder */
+	*std = V4L2_STD_PAL;
+	return 0;
+}
+
+static int timblogiw_enum_framsizes(struct timblogiw *lw,
+	struct v4l2_frmsizeenum *fsize)
+{
+	if ((fsize->index != 0) ||
+		(fsize->pixel_format != V4L2_PIX_FMT_YUYV))
+		return -EINVAL;
+
+	fsize->type = V4L2_FRMSIZE_TYPE_DISCRETE;
+	fsize->discrete.width = lw->width;
+	fsize->discrete.height = lw->height;
+
+	return 0;
+}
+
+static int timblogiw_g_parm(struct timblogiw *lw, struct v4l2_streamparm *sp)
+{
+	if (sp->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
+		return -EINVAL;
+
+	sp->parm.capture.extendedmode = 0;
+	sp->parm.capture.readbuffers = lw->num_frames;
+	return 0;
+}
+
+/*******************************
+ * Device Operations functions *
+ *******************************/
+
+static int timblogiw_open(struct file *file)
+{
+	struct video_device *vdev = video_devdata(file);
+	struct timblogiw *lw = video_get_drvdata(vdev);
+
+	dbg("%s -\n", __func__);
+
+	mutex_init(&lw->fileop_lock);
+	spin_lock_init(&lw->queue_lock);
+	init_waitqueue_head(&lw->wait_frame);
+
+	mutex_lock(&lw->lock);
+
+	lw->width = 720; /* TODO: Should depend on tv norm */
+	lw->height = 576;
+	lw->frame_size = lw->width * lw->height * 2;
+	lw->bytesperline = lw->width * 2;
+
+	file->private_data = lw;
+	lw->stream = STREAM_OFF;
+	lw->num_frames = TIMBLOGIW_NUM_FRAMES;
+
+	timblogiw_empty_framequeues(lw);
+
+	timb_set_dma_interruptcb(DMA_IRQ_VIDEO_RX | DMA_IRQ_VIDEO_DROP,
+		timblogiw_isr, (void *)lw);
+
+	mutex_unlock(&lw->lock);
+
+	return 0;
+}
+
+static int timblogiw_close(struct file *file)
+{
+	struct timblogiw *lw = file->private_data;
+
+	dbg("%s - entry\n", __func__);
+
+	mutex_lock(&lw->lock);
+
+	timb_stop_dma(DMA_IRQ_VIDEO_RX);
+	timb_set_dma_interruptcb(DMA_IRQ_VIDEO_RX | DMA_IRQ_VIDEO_DROP, NULL,
+		NULL);
+	timblogiw_release_buffers(lw);
+
+	mutex_unlock(&lw->lock);
+	return 0;
+}
+
+static ssize_t timblogiw_read(struct file *file, char __user *data,
+	size_t count, loff_t *ppos)
+{
+	dbg("%s - read request\n", __func__);
+	return -EINVAL;
+}
+
+static void timblogiw_vm_open(struct vm_area_struct *vma)
+{
+	struct timblogiw_frame *f = vma->vm_private_data;
+	f->vma_use_count++;
+}
+
+static void timblogiw_vm_close(struct vm_area_struct *vma)
+{
+	struct timblogiw_frame *f = vma->vm_private_data;
+	f->vma_use_count--;
+}
+
+static struct vm_operations_struct timblogiw_vm_ops = {
+	.open = timblogiw_vm_open,
+	.close = timblogiw_vm_close,
+};
+
+static int timblogiw_mmap(struct file *filp, struct vm_area_struct *vma)
+{
+	unsigned long size = vma->vm_end - vma->vm_start, start = vma->vm_start;
+	void *pos;
+	u32 i;
+	int ret = -EINVAL;
+
+	struct timblogiw *lw = filp->private_data;
+	dbg("%s\n", __func__);
+
+	if (mutex_lock_interruptible(&lw->fileop_lock))
+		return -ERESTARTSYS;
+
+	if (!(vma->vm_flags & VM_WRITE) ||
+		size != PAGE_ALIGN(lw->frame[0].buf.length))
+		goto error_unlock;
+
+	for (i = 0; i < lw->num_frames; i++)
+		if ((lw->frame[i].buf.m.offset >> PAGE_SHIFT) == vma->vm_pgoff)
+			break;
+
+	if (i == lw->num_frames) {
+		dbg("%s - user supplied mapping address is out of range\n",
+			__func__);
+		goto error_unlock;
+	}
+
+	vma->vm_flags |= VM_IO;
+	vma->vm_flags |= VM_RESERVED;	/* Do not swap out this VMA */
+
+	pos = lw->frame[i].bufmem;
+	while (size > 0) {		/* size is page-aligned */
+		if (vm_insert_page(vma, start, vmalloc_to_page(pos))) {
+			dbg("%s - vm_insert_page failed\n", __func__);
+			ret = -EAGAIN;
+			goto error_unlock;
+		}
+		start += PAGE_SIZE;
+		pos += PAGE_SIZE;
+		size -= PAGE_SIZE;
+	}
+
+	vma->vm_ops = &timblogiw_vm_ops;
+	vma->vm_private_data = &lw->frame[i];
+	timblogiw_vm_open(vma);
+	ret = 0;
+
+error_unlock:
+	mutex_unlock(&lw->fileop_lock);
+	return ret;
+}
+
+static long
+timblogiw_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
+{
+	struct timblogiw *lw = file->private_data;
+
+	switch (cmd) {
+
+	case VIDIOC_QUERYCAP:
+	{
+		dbg("%s - VIDIOC_QUERYCAP\n", __func__);
+		return timblogiw_querycap(lw, (struct v4l2_capability *)arg);
+	}
+
+	case VIDIOC_ENUM_FMT:
+	{
+		dbg("%s - VIDIOC_ENUM_FMT\n", __func__);
+		return timblogiw_enum_fmt(lw, (struct v4l2_fmtdesc *)arg);
+	}
+
+	case VIDIOC_G_FMT:
+	{
+		dbg("%s - VIDIOC_G_FMT\n", __func__);
+		return timblogiw_g_fmt(lw, (struct v4l2_format *) arg);
+	}
+
+	case VIDIOC_TRY_FMT:
+	case VIDIOC_S_FMT:
+	{
+		dbg("%s - VIDIOC_S_FMT\n", __func__);
+		return timblogiw_s_fmt(lw, (struct v4l2_format *)arg);
+	}
+
+	case VIDIOC_REQBUFS:
+	{
+		dbg("%s - VIDIOC_REQBUFS\n", __func__);
+		return timblogiw_reqbufs(lw, (struct v4l2_requestbuffers *)arg);
+	}
+
+	case VIDIOC_QUERYBUF:
+	{
+		dbg("%s - VIDIOC_QUERYBUF\n", __func__);
+		return timblogiw_querybuf(lw, (struct v4l2_buffer *)arg);
+	}
+
+	case VIDIOC_QBUF:
+	{
+		return timblogiw_qbuf(lw, (struct v4l2_buffer *)arg);
+	}
+
+	case VIDIOC_DQBUF:
+	{
+		return timblogiw_dqbuf(lw, file, (struct v4l2_buffer *)arg);
+	}
+
+	case VIDIOC_ENUMSTD:
+	{
+		dbg("%s - VIDIOC_ENUMSTD\n", __func__);
+		return timblogiw_enumstd(lw, (struct v4l2_standard *)arg);
+	}
+
+	case VIDIOC_G_STD:
+	{
+		dbg("%s - VIDIOC_G_STD\n", __func__);
+		return timblogiw_g_std(lw, (v4l2_std_id *)arg);
+	}
+
+	case VIDIOC_S_STD:
+	{
+		dbg("%s - VIDIOC_S_STD\n", __func__);
+		return timblogiw_s_std(lw, (v4l2_std_id *)arg);
+	}
+
+	case VIDIOC_ENUMINPUT:
+	{
+		dbg("%s - VIDIOC_ENUMINPUT\n", __func__);
+		return timblogiw_enuminput(lw, (struct v4l2_input *)arg);
+	}
+
+	case VIDIOC_G_INPUT:
+	{
+		dbg("%s - VIDIOC_G_INPUT\n", __func__);
+		return timblogiw_g_input(lw, (int *)arg);
+	}
+
+	case VIDIOC_S_INPUT:
+	{
+		dbg("%s - VIDIOC_S_INPUT\n", __func__);
+		return timblogiw_s_input(lw, (int *)arg);
+	}
+
+	case VIDIOC_STREAMON:
+	{
+		dbg("%s - VIDIOC_STREAMON\n", __func__);
+		return timblogiw_streamon(lw, (int *)arg);
+	}
+
+	case VIDIOC_STREAMOFF:
+	{
+		dbg("%s - VIDIOC_STREAMOFF\n", __func__);
+		return timblogiw_streamoff(lw, (int *)arg);
+	}
+
+	case VIDIOC_QUERYSTD:
+	{
+		dbg("%s - VIDIOC_QUERYSTD\n", __func__);
+		return timblogiw_querystd(lw, (v4l2_std_id *)arg);
+	}
+
+	case VIDIOC_ENUM_FRAMESIZES:
+	{
+		dbg("%s - VIDIOC_ENUM_FRAMESIZES\n", __func__);
+		return timblogiw_enum_framsizes(lw,
+			(struct v4l2_frmsizeenum *)arg);
+	}
+
+	case VIDIOC_G_PARM:
+	{
+		dbg("%s - VIDIOC_G_PARM\n", __func__);
+		return timblogiw_g_parm(lw, (struct v4l2_streamparm *)arg);
+	}
+
+	default:
+	{
+		dbg("%s Unknown command, dir: %x, type: %x, nr: %x, size: %x\n",
+			__func__,
+			_IOC_DIR(cmd),
+			_IOC_TYPE(cmd),
+			_IOC_NR(cmd),
+			_IOC_SIZE(cmd));
+		break;
+	}
+	}
+
+	return -EINVAL;
+}
+
+void timblogiw_vdev_release(struct video_device *vdev)
+{
+	kfree(vdev);
+}
+
+static const struct v4l2_file_operations timblogiw_fops = {
+	.owner		= THIS_MODULE,
+	.open	 	= timblogiw_open,
+	.release	= timblogiw_close,
+	.ioctl		= timblogiw_ioctl,
+	.mmap		= timblogiw_mmap,
+	.read		= timblogiw_read,
+};
+
+static const struct video_device timblogiw_template = {
+	.name		= TIMBLOGIWIN_NAME,
+	.fops		= &timblogiw_fops,
+	.release	= &timblogiw_vdev_release,
+	.minor		= -1
+};
+
+static int timblogiw_probe(struct platform_device *dev)
+{
+	int err;
+	struct timblogiw *lw;
+	struct resource *iomem;
+
+	iomem = platform_get_resource(dev, IORESOURCE_MEM, 0);
+	if (!iomem) {
+		err = -EINVAL;
+		goto err_mem;
+	}
+
+	lw = kzalloc(sizeof(*lw), GFP_KERNEL);
+	if (!lw) {
+		err = -EINVAL;
+		goto err_mem;
+	}
+
+	/* find the PCI device from the parent... */
+	if (!dev->dev.parent) {
+		printk(KERN_ERR "timblogwi: No parent device found??\n");
+		err = -ENODEV;
+		goto err_mem;
+	}
+
+	lw->dev = container_of(dev->dev.parent, struct pci_dev, dev);
+
+	mutex_init(&lw->lock);
+
+	lw->video_dev = video_device_alloc();
+	if (!lw->video_dev) {
+		err = -ENOMEM;
+		goto err_video_req;
+	}
+	*lw->video_dev = timblogiw_template;
+
+	err = video_register_device(lw->video_dev, VFL_TYPE_GRABBER, 0);
+	if (err) {
+		video_device_release(lw->video_dev);
+		printk(KERN_ALERT "Error reg video\n");
+		goto err_video_req;
+	}
+
+	tasklet_init(&lw->tasklet, timblogiw_handleframe, (unsigned long)lw);
+
+	if (!request_mem_region(iomem->start, resource_size(iomem),
+		"timb-video")) {
+		err = -EBUSY;
+		goto err_request;
+	}
+
+	lw->membase = ioremap(iomem->start, resource_size(iomem));
+	if (!lw->membase) {
+		err = -ENOMEM;
+		goto err_ioremap;
+	}
+
+	platform_set_drvdata(dev, lw);
+	video_set_drvdata(lw->video_dev, lw);
+
+	return 0;
+
+err_ioremap:
+	release_mem_region(iomem->start, resource_size(iomem));
+err_request:
+	if (-1 != lw->video_dev->minor)
+		video_unregister_device(lw->video_dev);
+	else
+		video_device_release(lw->video_dev);
+err_video_req:
+	kfree(lw);
+err_mem:
+	printk(KERN_ERR
+		"timberdale: Failed to register Timberdale Video In: %d\n",
+		err);
+
+	return err;
+}
+
+static int timblogiw_remove(struct platform_device *dev)
+{
+	struct timblogiw *lw = platform_get_drvdata(dev);
+	struct resource *iomem = platform_get_resource(dev, IORESOURCE_MEM, 0);
+
+	if (-1 != lw->video_dev->minor)
+		video_unregister_device(lw->video_dev);
+	else
+		video_device_release(lw->video_dev);
+
+	tasklet_kill(&lw->tasklet);
+	iounmap(lw->membase);
+	release_mem_region(iomem->start, resource_size(iomem));
+	kfree(lw);
+
+	return 0;
+}
+
+static struct platform_driver timblogiw_platform_driver = {
+	.driver = {
+		.name	= "timb-video",
+		.owner	= THIS_MODULE,
+	},
+	.probe		= timblogiw_probe,
+	.remove		= timblogiw_remove,
+};
+
+/*--------------------------------------------------------------------------*/
+
+static int __init timblogiw_init(void)
+{
+	return platform_driver_register(&timblogiw_platform_driver);
+}
+
+static void __exit timblogiw_exit(void)
+{
+	platform_driver_unregister(&timblogiw_platform_driver);
+}
+
+module_init(timblogiw_init);
+module_exit(timblogiw_exit);
+
+MODULE_DESCRIPTION("Timberdale Video In driver");
+MODULE_LICENSE("GPL v2");
+MODULE_ALIAS("platform:timb-video");
+
diff -uNr linux-2.6.29-clean/drivers/media/video/timblogiw.h linux-2.6.29/drivers/media/video/timblogiw.h
--- linux-2.6.29-clean/drivers/media/video/timblogiw.h	1969-12-31 16:00:00.000000000 -0800
+++ linux-2.6.29/drivers/media/video/timblogiw.h	2009-04-06 13:51:47.000000000 -0700
@@ -0,0 +1,95 @@
+/*
+ * timblogiw.h timberdale FPGA LogiWin Video In driver defines
+ * Copyright (c) 2009 Intel Corporation
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/* Supports:
+ * Timberdale FPGA LogiWin Video In
+ */
+
+#ifndef _TIMBLOGIW_H
+#define _TIMBLOGIW_H
+
+#include <linux/interrupt.h>
+
+#define TIMBLOGIWIN_NAME    "Timberdale Video-In"
+
+#define TIMBLOGIW_NUM_FRAMES	10
+
+
+enum timblogiw_stream_state {
+	STREAM_OFF,
+	STREAM_ON,
+};
+
+enum timblogiw_frame_state {
+	F_UNUSED = 0,
+	F_QUEUED,
+	F_GRABBING,
+	F_DONE,
+	F_ERROR,
+};
+
+struct timblogiw_frame {
+	void				*bufmem;
+	struct v4l2_buffer		buf;
+	enum timblogiw_frame_state	state;
+	struct list_head		frame;
+	unsigned long			vma_use_count;
+};
+
+struct timblogiw_tvnorm {
+	int     v4l2_id;
+	char    *name;
+	u16     swidth;
+	u16     sheight;
+};
+
+
+struct timbdma_transfer {
+	dma_addr_t	handle;
+	void		*buf;
+};
+
+struct timbdma_control {
+	struct timbdma_transfer	transfer[2];
+	struct timbdma_transfer *filled;
+	int curr;
+};
+
+struct timblogiw {
+	struct i2c_client		*decoder;
+	struct timblogiw_frame		frame[TIMBLOGIW_NUM_FRAMES];
+	int				num_frames;
+	unsigned int			frame_count;
+	struct list_head		inqueue, outqueue;
+	spinlock_t			queue_lock; /* mutual exclusion */
+	enum timblogiw_stream_state	stream;
+	struct video_device		*video_dev;
+	struct mutex			lock, fileop_lock;
+	wait_queue_head_t		wait_frame;
+	int				width;
+	int				height;
+	u32				frame_size;
+	int				bytesperline;
+	struct pci_dev			*dev;
+	struct timbdma_control		dma;
+	void __iomem			*membase;
+	struct tasklet_struct		tasklet;
+};
+
+#endif /* _TIMBLOGIW_H */
+
diff -uNr linux-2.6.29-clean/drivers/mfd/Kconfig linux-2.6.29/drivers/mfd/Kconfig
--- linux-2.6.29-clean/drivers/mfd/Kconfig	2009-04-01 09:20:24.000000000 -0700
+++ linux-2.6.29/drivers/mfd/Kconfig	2009-04-06 13:51:47.000000000 -0700
@@ -240,6 +240,27 @@
 	 Say yes here if you want to include support GPIO for pins on
 	 the PCF50633 chip.
 
+config MFD_TIMBERDALE
+	bool "Support for Timberdale"
+	select MFD_CORE
+	---help---
+	This is the core driver for the timberdale FPGA. This device is a
+	multifunctioanl device which may provide numerous interfaces.
+
+config MFD_TIMBERDALE_DMA
+	tristate "Support for timberdale DMA"
+	depends on MFD_TIMBERDALE
+	---help---
+	Add support the DMA block inside the timberdale FPGA. This to be able
+	to do DMA transfers directly to some of the blocks inside the FPGA
+
+config MFD_TIMBERDALE_I2S
+	tristate "Support for timberdale I2S bus"
+	depends on MFD_TIMBERDALE
+	---help---
+	Add support for the I2S bus handled by timberdale FPGA.
+	I2S RX and TX instances are then available for other devices to make use of.
+
 endmenu
 
 menu "Multimedia Capabilities Port drivers"
diff -uNr linux-2.6.29-clean/drivers/mfd/Makefile linux-2.6.29/drivers/mfd/Makefile
--- linux-2.6.29-clean/drivers/mfd/Makefile	2009-04-01 09:20:24.000000000 -0700
+++ linux-2.6.29/drivers/mfd/Makefile	2009-04-06 13:51:47.000000000 -0700
@@ -40,4 +40,8 @@
 
 obj-$(CONFIG_MFD_PCF50633)	+= pcf50633-core.o
 obj-$(CONFIG_PCF50633_ADC)	+= pcf50633-adc.o
-obj-$(CONFIG_PCF50633_GPIO)	+= pcf50633-gpio.o
\ No newline at end of file
+obj-$(CONFIG_PCF50633_GPIO)	+= pcf50633-gpio.o
+
+obj-$(CONFIG_MFD_TIMBERDALE)		+= timberdale.o
+obj-$(CONFIG_MFD_TIMBERDALE_DMA)	+= timbdma.o
+obj-$(CONFIG_MFD_TIMBERDALE_I2S)	+= timbi2s.o
diff -uNr linux-2.6.29-clean/drivers/mfd/timbdma.c linux-2.6.29/drivers/mfd/timbdma.c
--- linux-2.6.29-clean/drivers/mfd/timbdma.c	1969-12-31 16:00:00.000000000 -0800
+++ linux-2.6.29/drivers/mfd/timbdma.c	2009-04-06 13:51:47.000000000 -0700
@@ -0,0 +1,301 @@
+/*
+ * timbdma.c timberdale FPGA DMA driver
+ * Copyright (c) 2009 Intel Corporation
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/* Supports:
+ * Timberdale FPGA DMA engine
+ */
+
+#include <linux/version.h>
+#include <linux/module.h>
+#include <linux/pci.h>
+#include <linux/interrupt.h>
+#include <linux/platform_device.h>
+
+#include <linux/mfd/timbdma.h>
+
+static struct timbdma_dev *self_g;
+
+static irqreturn_t timbdma_handleinterrupt(int irq, void *devid)
+{
+	struct timbdma_dev *dev = (struct timbdma_dev *)devid;
+	int ipr;
+	int i;
+
+	ipr = ioread32(dev->membase + timbdma_ctrlmap_TIMBPEND);
+
+	/* ack */
+	iowrite32(ipr, dev->membase + timbdma_ctrlmap_TIMBSTATUS);
+
+	/* call the callbacks */
+	for (i = 0; i < DMA_IRQS; i++) {
+		int mask = 1 << i;
+		if ((ipr & mask) && dev->callbacks[i])
+			dev->callbacks[i](mask, dev->callback_data[i]);
+	}
+
+	if (ipr)
+		return IRQ_HANDLED;
+	else
+		return IRQ_NONE;
+}
+
+
+void timb_start_dma(u32 flag, unsigned long buf, int len, int bytes_per_row)
+{
+	int i;
+	unsigned long irqflags;
+	struct timbdma_dev *dev = self_g;
+
+	spin_lock_irqsave(&dev->lock, irqflags);
+
+	/* now enable the DMA transfer */
+	for (i = 0; i < DMA_IRQS; i++)
+		if (flag & (1 << i)) {
+			u32 offset = i / 2 * 0x40;
+
+			if (!(i % 2)) {
+				/* RX */
+				/* bytes per row */
+				iowrite32(bytes_per_row, dev->membase + offset +
+					timbdma_dmacfg_BPERROW);
+				/* address high */
+				iowrite32(0, dev->membase + offset +
+					timbdma_dmacfg_RXSTARTH);
+				/* address low */
+				iowrite32(buf, dev->membase + offset +
+					timbdma_dmacfg_RXSTARTL);
+				/* Length */
+				iowrite32(len, dev->membase + offset +
+					timbdma_dmacfg_RXLENGTH);
+				/* Clear rx sw read pointer */
+				iowrite32(0, dev->membase + offset +
+					timbdma_dmacfg_RXSWRP);
+				/* enable the transfer */
+				iowrite32(1, dev->membase + offset +
+					timbdma_dmacfg_RXENABLE);
+			} else {
+				/* TX */
+				/* address high */
+				iowrite32(0, dev->membase + offset +
+					timbdma_dmacfg_TXSTARTH);
+				/* address low */
+				iowrite32(buf, dev->membase + offset +
+					timbdma_dmacfg_TXSTARTL);
+				/* Length */
+				iowrite32(len, dev->membase + offset +
+					timbdma_dmacfg_TXLENGTH);
+				/* Set tx sw write pointer */
+				iowrite32(len, dev->membase + offset +
+					timbdma_dmacfg_TXSWWP);
+			}
+
+			/* only allow one bit in the flag field */
+			break;
+		}
+	spin_unlock_irqrestore(&dev->lock, irqflags);
+}
+EXPORT_SYMBOL(timb_start_dma);
+
+void *timb_stop_dma(u32 flags)
+{
+	int i;
+	unsigned long irqflags;
+	struct timbdma_dev *dev = self_g;
+	void *result = 0;
+
+	spin_lock_irqsave(&dev->lock, irqflags);
+
+	/* now disable the DMA transfers */
+	for (i = 0; i < DMA_IRQS; i++)
+		if (flags & (1 << i)) {
+			/*
+				RX enable registers are located at:
+				0x14
+				0x54
+				0x94
+
+				TX SW pointer registers are located at:
+				0x24
+				0x64
+			*/
+			u32 offset = i / 2 * 0x40;
+			u32 result_offset = offset;
+			if (!(i % 2)) {
+				/* even -> RX enable */
+				offset += timbdma_dmacfg_RXENABLE;
+				result_offset += timbdma_dmacfg_RXFPGAWP;
+			} else {
+				/* odd -> TX SW pointer reg */
+				offset += timbdma_dmacfg_TXSWWP;
+				result_offset = timbdma_dmacfg_TXFPGARP;
+			}
+
+			iowrite32(0, dev->membase + offset);
+			/* check how far the FPGA has written/read */
+			result = (void *)ioread32(dev->membase + result_offset);
+		}
+
+	/* ack any pending IRQs */
+	iowrite32(flags, dev->membase + timbdma_ctrlmap_TIMBSTATUS);
+
+	spin_unlock_irqrestore(&dev->lock, irqflags);
+
+	return result;
+}
+EXPORT_SYMBOL(timb_stop_dma);
+
+void timb_set_dma_interruptcb(u32 flags, timbdma_interruptcb icb, void *data)
+{
+	int i;
+	unsigned long irqflags;
+	struct timbdma_dev *dev = self_g;
+	u32 ier;
+
+	spin_lock_irqsave(&dev->lock, irqflags);
+
+	for (i = 0; i < DMA_IRQS; i++)
+		if (flags & (1 << i)) {
+			dev->callbacks[i] = icb;
+			dev->callback_data[i] = data;
+		}
+
+	/* Ack any pending IRQ */
+	iowrite32(flags, dev->membase + timbdma_ctrlmap_TIMBSTATUS);
+
+	/* if a null callback is given -> clear interrupt, else -> enable */
+	ier = ioread32(dev->membase + timbdma_ctrlmap_TIMBENABLE);
+	if (icb != NULL)
+		ier |= flags;
+	else
+		ier &= ~flags;
+	iowrite32(ier, dev->membase + timbdma_ctrlmap_TIMBENABLE);
+
+	spin_unlock_irqrestore(&dev->lock, irqflags);
+}
+EXPORT_SYMBOL(timb_set_dma_interruptcb);
+
+static int timbdma_probe(struct platform_device *dev)
+{
+	int err, irq;
+	struct timbdma_dev *self;
+	struct resource *iomem;
+
+	iomem = platform_get_resource(dev, IORESOURCE_MEM, 0);
+	if (!iomem) {
+		err = -EINVAL;
+		goto err_mem;
+	}
+
+	self = kzalloc(sizeof(*self), GFP_KERNEL);
+	if (!self) {
+		err = -EINVAL;
+		goto err_mem;
+	}
+
+	spin_lock_init(&self->lock);
+
+	if (!request_mem_region(iomem->start,
+		resource_size(iomem), "timb-dma")) {
+		err = -EBUSY;
+		goto err_request;
+	}
+
+	self->membase = ioremap(iomem->start, resource_size(iomem));
+	if (!self->membase) {
+		printk(KERN_ERR "timbdma: Failed to remap I/O memory\n");
+		err = -ENOMEM;
+		goto err_ioremap;
+	}
+
+	/* register interrupt */
+	irq = platform_get_irq(dev, 0);
+	if (irq < 0) {
+		err = irq;
+		goto err_get_irq;
+	}
+
+	/* request IRQ */
+	err = request_irq(irq, timbdma_handleinterrupt, IRQF_SHARED,
+			  "timb-dma", self);
+	if (err) {
+		printk(KERN_ERR "timbdma: Failed to request IRQ\n");
+		goto err_get_irq;
+	}
+
+	platform_set_drvdata(dev, self);
+
+	/* assign the global pointer */
+	self_g = self;
+
+	return 0;
+
+err_get_irq:
+	iounmap(self->membase);
+err_ioremap:
+	release_mem_region(iomem->start, resource_size(iomem));
+err_request:
+	kfree(self);
+err_mem:
+	printk(KERN_ERR "timberdale: Failed to register Timberdale DMA: %d\n",
+		err);
+
+	return err;
+}
+
+static int timbdma_remove(struct platform_device *dev)
+{
+	struct timbdma_dev *self = platform_get_drvdata(dev);
+	struct resource *iomem = platform_get_resource(dev, IORESOURCE_MEM, 0);
+
+	free_irq(platform_get_irq(dev, 0), self);
+	iounmap(self->membase);
+	release_mem_region(iomem->start, resource_size(iomem));
+	kfree(self);
+	self_g = NULL;
+	return 0;
+}
+
+static struct platform_driver timbdma_platform_driver = {
+	.driver = {
+		.name	= "timb-dma",
+		.owner	= THIS_MODULE,
+	},
+	.probe		= timbdma_probe,
+	.remove		= timbdma_remove,
+};
+
+/*--------------------------------------------------------------------------*/
+
+static int __init timbdma_init(void)
+{
+	self_g = NULL;
+	return platform_driver_register(&timbdma_platform_driver);
+}
+
+static void __exit timbdma_exit(void)
+{
+	platform_driver_unregister(&timbdma_platform_driver);
+}
+
+module_init(timbdma_init);
+module_exit(timbdma_exit);
+
+MODULE_DESCRIPTION("Timberdale DMA driver");
+MODULE_LICENSE("GPL v2");
+MODULE_ALIAS("platform:timb-dma");
+
diff -uNr linux-2.6.29-clean/drivers/mfd/timberdale.c linux-2.6.29/drivers/mfd/timberdale.c
--- linux-2.6.29-clean/drivers/mfd/timberdale.c	1969-12-31 16:00:00.000000000 -0800
+++ linux-2.6.29/drivers/mfd/timberdale.c	2009-04-06 13:51:47.000000000 -0700
@@ -0,0 +1,599 @@
+/*
+ * timberdale.c timberdale FPGA mfd shim driver
+ * Copyright (c) 2009 Intel Corporation
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/* Supports:
+ * Timberdale FPGA
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/pci.h>
+#include <linux/msi.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/platform_device.h>
+#include <linux/mfd/core.h>
+#include <linux/irq.h>
+
+#include <linux/i2c.h>
+#include <linux/i2c-ocores.h>
+#include <linux/i2c/tsc2007.h>
+#include <linux/spi/xilinx_spi.h>
+#include "timberdale.h"
+
+struct timberdale_device {
+	resource_size_t		intc_mapbase;
+	resource_size_t		ctl_mapbase;
+	unsigned char __iomem   *intc_membase;
+	unsigned char __iomem   *ctl_membase;
+	int			irq_base;
+	u32			irq_ack_mask;
+	/* locking from interrupts while modifiying registers */
+	spinlock_t		lock;
+};
+
+/*--------------------------------------------------------------------------*/
+
+struct tsc2007_platform_data timberdale_tsc2007_platform_data = {
+	.model = 2003,
+	.x_plate_ohms = 100
+};
+
+struct i2c_board_info timberdale_i2c_board_info[] = {
+	{
+		I2C_BOARD_INFO("tsc2003", 0x48),
+		.platform_data = &timberdale_tsc2007_platform_data,
+		.irq = IRQ_TIMBERDALE_TSC_INT
+	},
+	{
+		I2C_BOARD_INFO("adv7180", 0x42 >> 1),
+		.irq = IRQ_TIMBERDALE_ADV7180
+	}
+};
+
+static __devinitdata struct ocores_i2c_platform_data
+timberdale_i2c_platform_data = {
+	.regstep = 4,
+	.clock_khz = 62500,
+	.devices = timberdale_i2c_board_info,
+	.num_devices = ARRAY_SIZE(timberdale_i2c_board_info)
+};
+
+const static __devinitconst struct resource timberdale_i2c_resources[] = {
+	{
+		.start	= I2COFFSET,
+		.end	= I2CEND,
+		.flags	= IORESOURCE_MEM,
+	},
+	{
+		.start 	= IRQ_TIMBERDALE_I2C,
+		.end	= IRQ_TIMBERDALE_I2C,
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+static __devinitdata struct xspi_platform_data timberdale_xspi_platorm_data = {
+	.bus_num = -1,
+	/* according to spec. we can have up to 32 slaves however,
+	 * as of current(2009-03-06) revision of
+	 * Timberdale we can only handle 3 right now
+	 */
+	.num_chipselect = 3,
+	.speed_hz = 1953125, /* hardcoded value in IP, for now */
+	.cr_offset = 0x60,
+	.sr_offset = 0x64,
+	.txd_offset = 0x68,
+	.rxd_offset = 0x6c,
+	.ssr_offset = 0x70
+};
+
+const static __devinitconst struct resource timberdale_spi_resources[] = {
+	{
+		.start 	= SPIOFFSET,
+		.end	= SPIEND,
+		.flags	= IORESOURCE_MEM,
+	},
+	{
+		.start	= IRQ_TIMBERDALE_SPI,
+		.end	= IRQ_TIMBERDALE_SPI,
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+const static __devinitconst struct resource timberdale_eth_resources[] = {
+	{
+		.start	= ETHOFFSET,
+		.end	= ETHEND,
+		.flags	= IORESOURCE_MEM,
+	},
+	{
+		.start	= IRQ_TIMBERDALE_ETHSW_IF,
+		.end	= IRQ_TIMBERDALE_ETHSW_IF,
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+const static __devinitconst struct resource timberdale_gpio_resources[] = {
+	{
+		.start	= GPIOOFFSET,
+		.end	= GPIOEND,
+		.flags	= IORESOURCE_MEM,
+	},
+	{
+		.start	= IRQ_TIMBERDALE_GPIO,
+		.end	= IRQ_TIMBERDALE_GPIO,
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+
+const static __devinitconst struct resource timberdale_most_resources[] = {
+	{
+		.start	= MOSTOFFSET,
+		.end	= MOSTEND,
+		.flags	= IORESOURCE_MEM,
+	},
+	{
+		.start	= IRQ_TIMBERDALE_MLB,
+		.end	= IRQ_TIMBERDALE_MLB,
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+const static __devinitconst struct resource timberdale_uart_resources[] = {
+	{
+		.start	= UARTOFFSET,
+		.end	= UARTEND,
+		.flags	= IORESOURCE_MEM,
+	},
+	{
+		.start	= IRQ_TIMBERDALE_UART,
+		.end	= IRQ_TIMBERDALE_UART,
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+const static __devinitconst struct resource timberdale_i2s_resources[] = {
+	{
+		.start	= I2SOFFSET,
+		.end	= I2SEND,
+		.flags	= IORESOURCE_MEM,
+	},
+	{
+		.start	= IRQ_TIMBERDALE_I2S,
+		.end	= IRQ_TIMBERDALE_I2S,
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+const static __devinitconst struct resource timberdale_video_resources[] = {
+	{
+		.start	= LOGIWOFFSET,
+		.end	= LOGIWEND,
+		.flags	= IORESOURCE_MEM,
+	},
+	/*
+	note that the "frame buffer" is located in DMA area
+	starting at 0x1200000
+	*/
+};
+
+const static __devinitconst struct resource timberdale_dma_resources[] = {
+	{
+		.start	= DMAOFFSET,
+		.end	= DMAEND,
+		.flags	= IORESOURCE_MEM,
+	},
+	{
+		.start	= IRQ_TIMBERDALE_DMA,
+		.end	= IRQ_TIMBERDALE_DMA,
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+static __devinitdata struct mfd_cell timberdale_cells_bar0[] = {
+	{
+		.name = "timb-uart",
+		.num_resources = ARRAY_SIZE(timberdale_uart_resources),
+		.resources = timberdale_uart_resources,
+	},
+	{
+		.name = "ocores-i2c",
+		.num_resources = ARRAY_SIZE(timberdale_i2c_resources),
+		.resources = timberdale_i2c_resources,
+		.platform_data = &timberdale_i2c_platform_data,
+		.data_size = sizeof(timberdale_i2c_platform_data),
+	},
+	{
+		.name = "timb-gpio",
+		.num_resources = ARRAY_SIZE(timberdale_gpio_resources),
+		.resources = timberdale_gpio_resources,
+	},
+	{
+		.name = "timb-i2s",
+		.num_resources = ARRAY_SIZE(timberdale_i2s_resources),
+		.resources = timberdale_i2s_resources,
+	},
+	{
+		.name = "timb-most",
+		.num_resources = ARRAY_SIZE(timberdale_most_resources),
+		.resources = timberdale_most_resources,
+	},
+	{
+		.name = "timb-video",
+		.num_resources = ARRAY_SIZE(timberdale_video_resources),
+		.resources = timberdale_video_resources,
+	},
+	{
+		.name = "xilinx_spi",
+		.num_resources = ARRAY_SIZE(timberdale_spi_resources),
+		.resources = timberdale_spi_resources,
+		.platform_data = &timberdale_xspi_platorm_data,
+		.data_size = sizeof(timberdale_xspi_platorm_data),
+	},
+	{
+		.name = "ks884x",
+		.num_resources = ARRAY_SIZE(timberdale_eth_resources),
+		.resources = timberdale_eth_resources,
+	},
+	{
+		.name = "timb-dma",
+		.num_resources = ARRAY_SIZE(timberdale_dma_resources),
+		.resources = timberdale_dma_resources,
+	},
+};
+
+static const __devinitconst struct resource timberdale_sdhc_resources_bar1[] = {
+	{
+		.start	= SDHC0OFFSET,
+		.end	= SDHC0END,
+		.flags	= IORESOURCE_MEM,
+	},
+	{
+		.start	= IRQ_TIMBERDALE_SDHC,
+		.end	= IRQ_TIMBERDALE_SDHC,
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+static __devinitdata struct mfd_cell timberdale_cells_bar1[] = {
+	{
+		.name = "sdhci",
+		.num_resources = ARRAY_SIZE(timberdale_sdhc_resources_bar1),
+		.resources = timberdale_sdhc_resources_bar1,
+	},
+};
+
+/*--------------------------------------------------------------------------*/
+
+
+/* Handle the timberdale interrupt mux */
+static void timberdale_irq(unsigned int irq, struct irq_desc *desc)
+{
+	struct timberdale_device *priv = get_irq_data(irq);
+	unsigned int i, ipr;
+
+	desc->chip->ack(irq);
+
+	while ((ipr = ioread32(priv->intc_membase + IPR))) {
+		priv->irq_ack_mask = 0;
+		for (i = 0; i < TIMBERDALE_NR_IRQS; i++)
+			if (ipr & (1 << i))
+				generic_handle_irq(priv->irq_base + i);
+		if (priv->irq_ack_mask)
+			iowrite32(priv->irq_ack_mask, priv->intc_membase + IAR);
+	}
+}
+
+static void timberdale_irq_mask(unsigned int irq)
+{
+	struct timberdale_device *priv = get_irq_chip_data(irq);
+	unsigned long flags;
+
+	spin_lock_irqsave(&priv->lock, flags);
+	iowrite32(1 << (irq - priv->irq_base), priv->intc_membase + CIE);
+	spin_unlock_irqrestore(&priv->lock, flags);
+}
+
+static void timberdale_irq_unmask(unsigned int irq)
+{
+	struct timberdale_device *priv = get_irq_chip_data(irq);
+	unsigned long flags;
+
+	spin_lock_irqsave(&priv->lock, flags);
+	iowrite32(1 << (irq - priv->irq_base), priv->intc_membase + SIE);
+	spin_unlock_irqrestore(&priv->lock, flags);
+}
+
+static void timberdale_irq_ack(unsigned int irq)
+{
+	struct timberdale_device *priv = get_irq_chip_data(irq);
+	unsigned long flags;
+	u32 ack_mask = 1 << (irq - priv->irq_base);
+
+	spin_lock_irqsave(&priv->lock, flags);
+	/* if edge triggered, ack directly. Otherwhise ack in the end of
+	 * irq handler
+	 */
+	if (ack_mask & IRQ_TIMBERDALE_EDGE_MASK)
+		iowrite32(ack_mask, priv->intc_membase + IAR);
+	else
+		priv->irq_ack_mask |= ack_mask;
+	spin_unlock_irqrestore(&priv->lock, flags);
+}
+
+static struct irq_chip timberdale_chip = {
+	.name		= "timberdale",
+	.ack		= timberdale_irq_ack,
+	.mask		= timberdale_irq_mask,
+	.unmask		= timberdale_irq_unmask,
+	.disable	= timberdale_irq_mask,
+	.enable		= timberdale_irq_unmask,
+};
+
+/*--------------------------------------------------------------------------*/
+
+/* Install the IRQ handler */
+static void timberdale_attach_irq(struct pci_dev *dev)
+{
+	struct timberdale_device *priv = pci_get_drvdata(dev);
+	unsigned int irq, irq_base;
+
+	irq_base = priv->irq_base;
+	for (irq = irq_base; irq < irq_base + TIMBERDALE_NR_IRQS; irq++) {
+		set_irq_chip_and_handler_name(irq, &timberdale_chip,
+			handle_edge_irq, "mux");
+
+		set_irq_chip_data(irq, priv);
+
+#ifdef CONFIG_ARM
+		set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+#endif
+	}
+
+	set_irq_data(dev->irq, priv);
+	set_irq_chained_handler(dev->irq, timberdale_irq);
+}
+
+static void timberdale_detach_irq(struct pci_dev *dev)
+{
+	struct timberdale_device *priv = pci_get_drvdata(dev);
+	unsigned int irq, irq_base;
+
+	irq_base = priv->irq_base;
+
+	set_irq_chained_handler(dev->irq, NULL);
+	set_irq_data(dev->irq, NULL);
+
+	for (irq = irq_base; irq < irq_base + TIMBERDALE_NR_IRQS; irq++) {
+#ifdef CONFIG_ARM
+		set_irq_flags(irq, 0);
+#endif
+		set_irq_chip(irq, NULL);
+		set_irq_chip_data(irq, NULL);
+	}
+}
+
+static int __devinit timb_probe(struct pci_dev *dev,
+	const struct pci_device_id *id)
+{
+	struct timberdale_device *priv;
+	int err, i;
+	u16 ver;
+	resource_size_t mapbase;
+
+	priv = kzalloc(sizeof(*priv), GFP_KERNEL);
+	if (!priv)
+		return -ENOMEM;
+
+	spin_lock_init(&priv->lock);
+	pci_set_drvdata(dev, priv);
+
+	err = pci_enable_device(dev);
+	if (err)
+		goto err_enable;
+
+	mapbase = pci_resource_start(dev, 0);
+	if (!mapbase) {
+		printk(KERN_ERR "timberdale: No resource\n");
+		goto err_start;
+	}
+
+	/* create a resource for the Interrupt controller registers */
+	priv->intc_mapbase = mapbase + INTCOFFSET;
+	if (!request_mem_region(priv->intc_mapbase, INTCSIZE, "timb-intc")) {
+		printk(KERN_ERR "timberdale: Failed to request intc mem\n");
+		goto err_request;
+	}
+
+	/* create a resource for the PCI master register */
+	priv->ctl_mapbase = mapbase + CHIPCTLOFFSET;
+	if (!request_mem_region(priv->ctl_mapbase, CHIPCTLSIZE, "timb-intc")) {
+		printk(KERN_ERR "timberdale: Failed to request ctl mem\n");
+		goto err_request_ctl;
+	}
+
+	priv->intc_membase = ioremap(priv->intc_mapbase, INTCSIZE);
+	if (!priv->intc_membase) {
+		printk(KERN_ALERT "timberdale: Map error, intc\n");
+		goto err_ioremap;
+	}
+
+	priv->ctl_membase = ioremap(priv->ctl_mapbase, CHIPCTLSIZE);
+	if (!priv->ctl_membase) {
+		printk(KERN_ALERT "timberdale: Map error, ctl\n");
+		goto err_ioremap_ctl;
+	}
+
+	err = pci_enable_msi(dev);
+	if (err) {
+		printk(KERN_WARNING "timberdale: MSI init failed: %d\n", err);
+		goto err_msi;
+	}
+
+	/* Reset all FPGA PLB peripherals */
+	iowrite32(0x1, priv->ctl_membase + MAYSVILLERST);
+
+	/* at this stage the FPGA does not generate a
+	 * unique interrupt per function, to emulate real interrupts
+	 * we assign them a faked interrupt which we issue in the
+	 * interrupt handler. For now just hard code a base number
+	 */
+	priv->irq_base = NR_IRQS - TIMBERDALE_NR_IRQS - 1;
+	if (priv->irq_base < dev->irq)
+		/* ops the device itself got the IRQ in the end... */
+		priv->irq_base = 400;
+
+	timberdale_attach_irq(dev);
+
+	/* update IRQ offsets in I2C board info */
+	for (i = 0; i < ARRAY_SIZE(timberdale_i2c_board_info); i++)
+		timberdale_i2c_board_info[i].irq += priv->irq_base;
+
+	/* don't leave platform_data empty on any device */
+	for (i = 0; i < ARRAY_SIZE(timberdale_cells_bar0); i++)
+		if (timberdale_cells_bar0[i].platform_data == NULL) {
+			timberdale_cells_bar0[i].platform_data =
+				timberdale_cells_bar0 + i;
+			timberdale_cells_bar0[i].data_size =
+				sizeof(timberdale_cells_bar0[i]);
+		}
+
+	err = mfd_add_devices(&dev->dev, -1,
+		timberdale_cells_bar0, ARRAY_SIZE(timberdale_cells_bar0),
+		&dev->resource[0], priv->irq_base);
+	if (err)
+		printk(KERN_WARNING
+			"timberdale: mfd_add_devices failed: %d\n", err);
+	else {
+		err = mfd_add_devices(&dev->dev, -1,
+			timberdale_cells_bar1,
+			ARRAY_SIZE(timberdale_cells_bar1),
+			&dev->resource[1], priv->irq_base);
+
+		if (err)
+			printk(KERN_WARNING
+				"timberdale: timb_add_sdhci failed: %d\n", err);
+	}
+
+	if (err)
+		goto err_mfd;
+
+	ver = ioread16(priv->ctl_membase + TIMB_REV);
+
+	printk(KERN_INFO "Found Maysville Card. Rev: %d\n", ver);
+
+	/* Enable interrupts and wire the hardware interrupts */
+	iowrite32(0x3, priv->intc_membase + MER);
+
+	return 0;
+err_mfd:
+	timberdale_detach_irq(dev);
+	pci_disable_msi(dev);
+err_msi:
+	iounmap(priv->ctl_membase);
+err_ioremap_ctl:
+	iounmap(priv->intc_membase);
+err_ioremap:
+	release_mem_region(priv->ctl_mapbase, CHIPCTLSIZE);
+err_request_ctl:
+	release_mem_region(priv->intc_mapbase, INTCSIZE);
+err_request:
+	pci_set_drvdata(dev, NULL);
+err_start:
+	pci_disable_device(dev);
+err_enable:
+	kfree(priv);
+	pci_set_drvdata(dev, NULL);
+	return -ENODEV;
+}
+
+static void __devexit timb_remove(struct pci_dev *dev)
+{
+	/* clean up any allocated resources and stuff here.
+	 * like call release_region();
+	 */
+	struct timberdale_device *priv;
+
+	priv = pci_get_drvdata(dev);
+
+	mfd_remove_devices(&dev->dev);
+
+	timberdale_detach_irq(dev);
+
+	iowrite32(0xffffffff, priv->intc_membase + IAR);
+	iowrite32(0, priv->intc_membase + MER);
+	iowrite32(0, priv->intc_membase + IER);
+
+	iounmap(priv->ctl_membase);
+	iounmap(priv->intc_membase);
+	release_mem_region(priv->ctl_mapbase, CHIPCTLSIZE);
+	release_mem_region(priv->intc_mapbase, INTCSIZE);
+
+	pci_disable_msi(dev);
+	pci_disable_device(dev);
+	pci_set_drvdata(dev, NULL);
+	kfree(priv);
+}
+
+static struct pci_device_id timberdale_pci_tbl[] = {
+	{ PCI_DEVICE(PCI_VENDOR_ID_TIMB, PCI_DEVICE_ID_TIMB) },
+	{ 0 }
+};
+MODULE_DEVICE_TABLE(pci, timberdale_pci_tbl);
+
+static struct pci_driver timberdale_pci_driver = {
+	.name = "timberdale",
+	.id_table = timberdale_pci_tbl,
+	.probe = timb_probe,
+	.remove = timb_remove,
+};
+
+static int __init timberdale_init(void)
+{
+	int err;
+
+	err = pci_register_driver(&timberdale_pci_driver);
+	if (err < 0) {
+		printk(KERN_ERR
+			"Failed to register PCI driver for %s device.\n",
+			timberdale_pci_driver.name);
+		return -ENODEV;
+	}
+
+	printk(KERN_INFO "Driver for %s has been successfully registered.\n",
+		timberdale_pci_driver.name);
+
+	return 0;
+}
+
+static void __exit timberdale_exit(void)
+{
+	pci_unregister_driver(&timberdale_pci_driver);
+
+	printk(KERN_INFO "Driver for %s has been successfully unregistered.\n",
+				timberdale_pci_driver.name);
+}
+
+MODULE_LICENSE("GPL v2");
+MODULE_VERSION(DRV_VERSION);
+MODULE_AUTHOR("Richard Rojfors");
+
+module_init(timberdale_init);
+module_exit(timberdale_exit);
+
diff -uNr linux-2.6.29-clean/drivers/mfd/timberdale.h linux-2.6.29/drivers/mfd/timberdale.h
--- linux-2.6.29-clean/drivers/mfd/timberdale.h	1969-12-31 16:00:00.000000000 -0800
+++ linux-2.6.29/drivers/mfd/timberdale.h	2009-04-06 13:51:47.000000000 -0700
@@ -0,0 +1,114 @@
+/*
+ * timberdale.h timberdale FPGA mfd shim driver defines
+ * Copyright (c) 2009 Intel Corporation
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/* Supports:
+ * Timberdale FPGA
+ */
+
+#ifndef MFD_TIMBERDALE_H
+#define MFD_TIMBERDALE_H
+
+/* Registers of the interrupt controller */
+#define ISR		0x00
+#define IPR		0x04
+#define IER		0x08
+#define IAR		0x0c
+#define SIE		0x10
+#define CIE		0x14
+#define MER		0x1c
+
+/* Registers of the control area */
+#define TIMB_REV	0x00
+#define MAYSVILLERST	0x40
+
+
+#define I2COFFSET	0x0
+#define I2CEND		0x1f
+
+#define SPIOFFSET	0x80
+#define SPIEND		0xff
+
+#define ETHOFFSET	0x300
+#define ETHEND		0x30f
+
+#define GPIOOFFSET	0x400
+#define GPIOEND		0x7ff
+
+#define CHIPCTLOFFSET	0x800
+#define CHIPCTLEND	0x8ff
+#define CHIPCTLSIZE	(CHIPCTLEND - CHIPCTLOFFSET)
+
+#define INTCOFFSET	0xc00
+#define INTCEND		0xfff
+#define INTCSIZE	(INTCEND - INTCOFFSET)
+
+#define MOSTOFFSET	0x1000
+#define MOSTEND		0x13ff
+
+#define UARTOFFSET	0x1400
+#define UARTEND		0x17ff
+
+#define I2SOFFSET	0x1C00
+#define I2SEND		0x1fff
+
+#define LOGIWOFFSET	0x30000
+#define LOGIWEND	0x37fff
+
+#define DMAOFFSET	0x01000000
+#define DMAEND		0x013fffff
+
+/* SDHC0 is placed in PCI bar 1 */
+#define SDHC0OFFSET	0x00
+#define SDHC0END	0xff
+
+/* SDHC1 is placed in PCI bar 2 */
+#define SDHC1OFFSET	0x00
+#define SDHC1END	0xff
+
+#define PCI_VENDOR_ID_TIMB	0x10ee
+#define PCI_DEVICE_ID_TIMB	0xa123
+#define DRV_VERSION		"0.1"
+
+
+#define IRQ_TIMBERDALE_INIC	0
+#define IRQ_TIMBERDALE_MLB	1
+#define IRQ_TIMBERDALE_GPIO	2
+#define IRQ_TIMBERDALE_I2C	3
+#define IRQ_TIMBERDALE_UART	4
+#define IRQ_TIMBERDALE_DMA	5
+#define IRQ_TIMBERDALE_I2S	6
+#define IRQ_TIMBERDALE_TSC_INT	7
+#define IRQ_TIMBERDALE_SDHC	8
+#define IRQ_TIMBERDALE_ADV7180	9
+#define IRQ_TIMBERDALE_ETHSW_IF	10
+#define IRQ_TIMBERDALE_SPI	11
+
+#define TIMBERDALE_NR_IRQS	12
+
+/* Some of the interrupts are level triggered, some are edge triggered */
+#define IRQ_TIMBERDALE_EDGE_MASK ((1 << IRQ_TIMBERDALE_ADV7180) | \
+	(1 << IRQ_TIMBERDALE_TSC_INT) | (1 << IRQ_TIMBERDALE_DMA) | \
+	(1 << IRQ_TIMBERDALE_MLB) | (1 << IRQ_TIMBERDALE_INIC))
+
+#define IRQ_TIMBERDALE_LEVEL_MASK ((1 << IRQ_TIMBERDALE_SPI) | \
+	(1 << IRQ_TIMBERDALE_ETHSW_IF) | (1 << IRQ_TIMBERDALE_SDHC) | \
+	(1 << IRQ_TIMBERDALE_I2S) | (1 << IRQ_TIMBERDALE_UART) | \
+	(1 << IRQ_TIMBERDALE_I2C) | (1 << IRQ_TIMBERDALE_GPIO))
+
+#endif
+
diff -uNr linux-2.6.29-clean/drivers/mfd/timbi2s.c linux-2.6.29/drivers/mfd/timbi2s.c
--- linux-2.6.29-clean/drivers/mfd/timbi2s.c	1969-12-31 16:00:00.000000000 -0800
+++ linux-2.6.29/drivers/mfd/timbi2s.c	2009-04-06 13:51:47.000000000 -0700
@@ -0,0 +1,597 @@
+/*
+ * timbi2s.c timberdale FPGA I2S driver
+ * Copyright (c) 2009 Intel Corporation
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/* Supports:
+ * Timberdale FPGA I2S
+ *
+ * As of 2009-03-23 I2S instances
+ * are not configured as masters
+ *
+ * TODO: implement switching between master and slave
+ */
+
+#include <linux/io.h>
+#include <linux/fs.h>
+#include <linux/module.h>
+#include <linux/circ_buf.h>
+#include <linux/spinlock.h>
+#include <linux/workqueue.h>
+#include <linux/interrupt.h>
+#include <linux/platform_device.h>
+
+#include <linux/mfd/timbi2s.h>
+
+#define DRIVER_NAME "timb-i2s"
+
+#define I2S_CLOCK_SPEED 62500000 /* 62,5MHz */
+
+#define FIFO_FILL_SIZE 127
+#define I2S_BUFFER_SIZE PAGE_SIZE
+
+#define ALMOST_FULL 170
+#define ALMOST_EMPTY 85
+
+/* As of 2009-03-16, IP can instanciate max. 4 RX and 4 TX */
+#define MAX_TX_NR 4
+#define MAX_RX_NR 4
+/* and actually up and running only 4.
+ * 1 TX and 3 RX
+ */
+#define IP_I2S_NR 4
+#define REGSTEP 0x04
+
+#define VERSION		0x00
+#define I2S_UIR		0x04 /* Unit Interrupt Register */
+
+/* Registers for all possible I2S IP instances
+ * are the same as for first one (from 0x08 to 0x20)
+ */
+#define I2S_PRESCALE	0x08 /* Holds prescale value, if clock master */
+#define I2S_ICR		0x0c /* Interrupt Clear Register */
+#	define ICR_F	0x01 /* Full */
+#	define ICR_AF	0x02 /* Almost full */
+#	define ICR_AE	0x04 /* Almost empty */
+#	define ICR_RX_D	0x08 /* Data present, RX only */
+#	define ICR_TX_E	0x08 /* Epmty, TX only */
+
+#define I2S_IPR		0x10 /* Interrupt Pending Register */
+#define I2S_ISR		0x14 /* Interrupt Status Register */
+
+#define I2S_IER		0x18 /* Interrupt Enable Register */
+#	define IER_FF		0x01 /* RX/TX FIFO Full */
+#	define IER_FAF		0x02 /* RX/TX FIFO Almost Full */
+#	define IER_FAE		0x04 /* RX/TX FIFO Almost Empty */
+#	define IER_RX_DATA	0x08 /* RX. Data Present */
+#	define IER_TX_FE	0x08 /* TX. FIFO Empty */
+
+#define I2S_CTRL	0x1c /* Control Register */
+#	define CTRL_TX_ENABLE	0x01 /* Enable TX */
+#	define CTRL_RX_ENABLE	0x02 /* Enable RX */
+#	define CTRL_NONE	0x04 /* Not used */
+#	define CTRL_FIFO_CLR	0x08 /* FIFO Clear */
+#	define CTRL_SWR 	0x10 /* Soft reset */
+#	define CTRL_CLKMASTER	0x1000 /* IP I2S instance is master */
+#	define CTRL_IS_TX	0x40000000 /* IP I2S is an TX-instance */
+#	define CTRL_IS_RX	0x20000000 /* IP I2S is an RX-instance */
+
+#define I2S_FIFO 0x20 /* read/write FIFO */
+
+#define INC_HEAD(buf, size) \
+	(buf->head = (buf->head + 1) & (size-1))
+
+#define INC_TAIL(buf, size) \
+	(buf->tail = (buf->tail + 1) & (size-1))
+
+
+/* circular buffer */
+static struct circ_buf *timbi2s_buf_alloc(void);
+static void timbi2s_buf_free(struct circ_buf *cb);
+static void timbi2s_buf_clear(struct circ_buf *cb);
+
+static int timbi2s_fifo_read(struct circ_buf *cb, ssize_t count, long add);
+static int timbi2s_fifo_write(struct circ_buf *cb, ssize_t count, long add);
+
+static int timbi2s_ioctrl(struct timbi2s_dev *);
+
+static struct timbi2s_bus *bus_p;
+
+static int timbi2s_is_tx(struct timbi2s_dev *i2sdev)
+{
+	return (ioread32(i2sdev->membase + i2sdev->ctrl_offset)
+				& CTRL_IS_TX) ? 1 : 0;
+}
+
+static int timbi2s_is_rx(struct timbi2s_dev *i2sdev)
+{
+	return (ioread32(i2sdev->membase + i2sdev->ctrl_offset)
+				& CTRL_IS_RX) ? 1 : 0;
+}
+
+/* Return unused TX-instance */
+static struct timbi2s_dev *timbi2s_get_tx(void)
+{
+	struct timbi2s_dev *tdev, *tmp;
+
+	if (bus_p == NULL)
+		return NULL;
+
+	list_for_each_entry_safe(tdev, tmp, &bus_p->control->list, item) {
+		if (!tdev->in_use && timbi2s_is_tx(tdev)) {
+			tdev->in_use = 1;
+			return tdev;
+		}
+
+	}
+	return NULL;
+}
+EXPORT_SYMBOL_GPL(timbi2s_get_tx);
+
+/* Return unused RX-instance */
+static struct timbi2s_dev *timbi2s_get_rx(void)
+{
+	struct timbi2s_dev *tdev, *tmp;
+
+	if (bus_p == NULL)
+		return NULL;
+
+	list_for_each_entry_safe(tdev, tmp, &bus_p->control->list, item) {
+		if (!tdev->in_use && timbi2s_is_rx(tdev)) {
+			tdev->in_use = 1;
+			return tdev;
+		}
+
+	}
+	return NULL;
+}
+EXPORT_SYMBOL_GPL(timbi2s_get_rx);
+
+/* Flag TX/RX as unused and reset it */
+static void timbi2s_put(struct timbi2s_dev *tdev)
+{
+	if (tdev->in_use) {
+		tdev->in_use = 0;
+		timbi2s_ioctrl(tdev);
+	}
+}
+EXPORT_SYMBOL_GPL(timbi2s_put);
+
+/*
+ * Write data to the FIFO
+ */
+static void timbi2s_tx_handler(struct timbi2s_dev *i2sdev)
+{
+	u32 pend;
+
+	pend = ioread32(i2sdev->membase + i2sdev->ipr_offset);
+
+	if (pend & IER_FAE) {
+		timbi2s_fifo_write(i2sdev->buffer,
+				ALMOST_FULL - ALMOST_EMPTY,
+				  (unsigned long)i2sdev->membase +
+							i2sdev->fifo);
+		/* clear interrupt */
+		iowrite32(ICR_AE, i2sdev->membase + i2sdev->icr_offset);
+	}
+}
+
+/*
+ * Read data from the FIFO
+ */
+static void timbi2s_rx_handler(struct timbi2s_dev *i2sdev)
+{
+	u32 pend;
+	pend = ioread32(i2sdev->membase + i2sdev->ipr_offset);
+
+	if (pend & IER_FAE) {
+		timbi2s_fifo_read(i2sdev->buffer,
+				ALMOST_EMPTY,
+				(unsigned long)i2sdev->membase +
+							i2sdev->fifo);
+
+		/* clear interrupt */
+		iowrite32(ICR_AE | ICR_AF,
+					i2sdev->membase + i2sdev->icr_offset);
+	}
+}
+
+void timbi2s_int_handler(struct work_struct *workp)
+{
+	u32 pend, stat, i2stype;
+	unsigned long flags;
+	struct timbi2s_dev *i2sdev = container_of(workp,
+							struct timbi2s_dev,
+									work);
+
+	pend = ioread32(i2sdev->membase + i2sdev->ipr_offset);
+	stat = ioread32(i2sdev->membase + i2sdev->isr_offset);
+	i2stype = ioread32(i2sdev->membase + i2sdev->ctrl_offset);
+
+	spin_lock_irqsave(&i2sdev->lock, flags);
+
+	if (i2stype & CTRL_IS_RX) {
+		/* Enable Almost Empty Almost Full interrupt */
+		iowrite32(IER_FAE | IER_FAF,
+				i2sdev->membase + i2sdev->ier_offset);
+		/* Enable RX */
+		iowrite32(CTRL_RX_ENABLE,
+				i2sdev->membase + i2sdev->ctrl_offset);
+		timbi2s_rx_handler(i2sdev);
+	} else if (i2stype & CTRL_IS_TX) {
+		/* Enable Almost Empty interrupt */
+		iowrite32(IER_FAE, i2sdev->membase + i2sdev->ier_offset);
+		/* Enable TX */
+		iowrite32(CTRL_TX_ENABLE,
+				i2sdev->membase + i2sdev->ctrl_offset);
+		timbi2s_tx_handler(i2sdev);
+	}
+
+	spin_unlock_irqrestore(&i2sdev->lock, flags);
+}
+
+static int timbi2s_ioctrl(struct timbi2s_dev *i2sdev)
+{
+	u32 i2stype;
+
+	/* Reset */
+	iowrite8(CTRL_SWR, i2sdev->membase + i2sdev->ctrl_offset);
+	/* Clear IER */
+	iowrite32(0x00000000, i2sdev->membase + i2sdev->ier_offset);
+	/* Clear ICR */
+	iowrite32(0xffffffff, i2sdev->membase + i2sdev->icr_offset);
+
+	i2stype = ioread32(i2sdev->membase + i2sdev->ctrl_offset);
+
+	if (i2stype & CTRL_IS_TX)
+		printk(KERN_INFO DRIVER_NAME": found active I2S Transmitter\n");
+	else if (i2stype & CTRL_IS_RX)
+		printk(KERN_INFO DRIVER_NAME": found active I2S Receiver\n");
+
+	return 1;
+}
+EXPORT_SYMBOL_GPL(timbi2s_ioctrl);
+
+static struct circ_buf *timbi2s_buf_alloc(void)
+{
+	struct circ_buf *cb;
+
+	cb = kzalloc(sizeof(*cb), GFP_KERNEL);
+	if (cb == NULL)
+		return NULL;
+
+	cb->buf = kzalloc(I2S_BUFFER_SIZE, GFP_KERNEL);
+	if (cb->buf == NULL) {
+		kfree(cb);
+		return NULL;
+	}
+
+	timbi2s_buf_clear(cb);
+
+	return cb;
+}
+
+static void timbi2s_buf_free(struct circ_buf *cb)
+{
+	kfree(cb->buf);
+	kfree(cb);
+}
+
+static void timbi2s_buf_clear(struct circ_buf *cb)
+{
+	cb->head = 0;
+	cb->tail = cb->head;
+}
+
+/*
+ * Read data from the FIFO and write it to the given circular buffer
+ */
+static int timbi2s_fifo_read(struct circ_buf *cb, ssize_t count, long add)
+{
+	int c, ret = 0;
+
+	unsigned char *hi = (unsigned char *)ioread32((void *)(add >> 16));
+	unsigned char *lo = (unsigned char *)ioread32((void *)(add & 0xFFFF));
+
+	c = CIRC_SPACE_TO_END(cb->head, cb->tail, I2S_BUFFER_SIZE);
+	if (count < c)
+		c = count;
+
+	if (c <= 0)
+		return 1;
+
+	while (c >= 0) {
+		memcpy(cb->buf + cb->head, hi, 2);
+		INC_HEAD(cb, I2S_BUFFER_SIZE);
+
+		memcpy(cb->buf + cb->head, lo, 2);
+		INC_HEAD(cb, I2S_BUFFER_SIZE);
+		count -= 4;
+	}
+	return ret;
+}
+
+/*
+ * Get data from the circular buffer and write it to the given FIFO address
+ */
+static int timbi2s_fifo_write(struct circ_buf *cb, ssize_t count, long add)
+{
+	int c, ret = 0;
+
+	c = CIRC_CNT_TO_END(cb->head, cb->tail, I2S_BUFFER_SIZE);
+	if (count < c)
+		c = count;
+
+	if (c <= 0)
+		return 1;
+
+	while (c >= 0) {
+		iowrite32(*(s16 *)(cb->buf + cb->tail), (void *)(add >> 16));
+		INC_TAIL(cb, I2S_BUFFER_SIZE);
+
+		iowrite32(*(s16 *)(cb->buf + cb->tail), (void *)(add & 0xFFFF));
+		INC_TAIL(cb, I2S_BUFFER_SIZE);
+		count -= 4;
+	}
+
+	return ret;
+}
+
+static void timbi2s_control_destroy(struct timbi2s_bus_control *control)
+{
+	kfree(control);
+	control = NULL;
+}
+
+static void timbi2s_control_add_dev(struct timbi2s_dev *i2sdev)
+{
+	list_add(&i2sdev->item, &i2sdev->bus->control->list);
+}
+
+static void timbi2s_control_del_dev(struct timbi2s_dev *i2sdev)
+{
+	list_del(&i2sdev->item);
+	if (list_empty(&i2sdev->bus->control->list))
+		timbi2s_control_destroy(i2sdev->bus->control);
+}
+
+static irqreturn_t timbi2s_irq(int irq, void *dev_id)
+{
+	u8 pend;
+	u32 iunit;
+	int i;
+
+	struct timbi2s_bus *tbus = dev_id;
+	queue_work(tbus->workqueue, &tbus->work);
+
+	iunit = ioread32(tbus->membase + I2S_UIR);
+	/* Find out which I2S instance is interrupting */
+	for (i = 0; i < 32; i++) {
+		if ((1 << i) & iunit) {
+			pend = ioread8(tbus->membase +
+						(I2S_IPR + (i * REGSTEP * 7)));
+			iowrite8(pend, tbus->membase +
+						(I2S_ICR + (i * REGSTEP * 7)));
+		}
+	}
+
+	return IRQ_HANDLED;
+}
+
+static int __init timbi2s_probe(struct platform_device *dev)
+{
+	int err = 0;
+	struct timbi2s_dev *tdev, *tmp;
+	struct timbi2s_bus *tbus;
+	struct resource *iomem;
+	int i;
+
+	iomem = platform_get_resource(dev, IORESOURCE_MEM, 0);
+	if (!iomem) {
+		err = -EINVAL;
+		goto err_mem;
+	}
+
+	tbus = kzalloc(sizeof(*tbus), GFP_KERNEL);
+	if (!tbus) {
+		err = -EINVAL;
+		goto err_mem;
+	}
+
+	/* Init bus_control */
+	tbus->control = kzalloc(sizeof(struct timbi2s_bus_control), GFP_KERNEL);
+	if (!tbus->control) {
+		printk(KERN_ERR DRIVER_NAME
+				": Failed to allocate timbi2s_bus_control.\n");
+		err = -ENOMEM;
+		goto err_free;
+	}
+	INIT_LIST_HEAD(&tbus->control->list);
+
+	/* Init workqueue */
+	tbus->workqueue = create_singlethread_workqueue("timbi2s");
+	if (tbus->workqueue == NULL) {
+		printk(KERN_ERR DRIVER_NAME
+				": unable to create workqueue\n");
+		err = -ENOMEM;
+		goto err_control;
+	}
+	INIT_WORK(&tbus->work, timbi2s_int_handler);
+
+	if (!request_mem_region(iomem->start,
+				resource_size(iomem), DRIVER_NAME)) {
+		printk(KERN_EMERG DRIVER_NAME
+				": Mem region is already in use\n");
+		err = -ENXIO;
+		goto err_control;
+	}
+
+	tbus->membase = ioremap(iomem->start, resource_size(iomem));
+	if (tbus->membase == NULL) {
+		err = -ENOMEM;
+		goto err_request;
+	}
+
+	bus_p = tbus;
+
+
+
+	/* For now we have only 4 I2S instances in IP : 3 RX and 1 TX */
+	/* Note: TX'es are always on top */
+	/* TODO: auto-check how many are alive and bring them into control */
+	for (i = 0; i < IP_I2S_NR; i++) {
+		tdev = kzalloc(sizeof(*tdev), GFP_KERNEL);
+		if (!tdev) {
+			err = -EINVAL;
+			goto clean_list;
+		}
+
+		/* Allocate circ_buf */
+		tdev->buffer = timbi2s_buf_alloc();
+		if (tdev->buffer == NULL) {
+			printk(KERN_ERR "timbi2s: unable to allocate buffer\n");
+			goto clean_list;
+		}
+
+		INIT_LIST_HEAD(&tdev->item);
+		spin_lock_init(&tdev->lock);
+
+		/* set up offsets for each instance of I2S */
+		tdev->bus = tbus; /* ptr to our bus */
+		tdev->membase = tbus->membase;
+		tdev->in_use = 0;
+		tdev->pscale_offset = I2S_PRESCALE + (i * REGSTEP * 7);
+		tdev->icr_offset = I2S_ICR + (i * REGSTEP * 7);
+		tdev->isr_offset = I2S_ISR + (i * REGSTEP * 7);
+		tdev->ipr_offset = I2S_IPR + (i * REGSTEP * 7);
+		tdev->ier_offset = I2S_IER + (i * REGSTEP * 7);
+		tdev->ctrl_offset = I2S_CTRL + (i * REGSTEP * 7);
+		tdev->fifo = I2S_FIFO + (i * REGSTEP * 7);
+
+		/* Try to check and reset hardware */
+		if (timbi2s_ioctrl(tdev))
+			timbi2s_control_add_dev(tdev);
+
+		tdev = NULL;
+	}
+
+	tbus->irq = platform_get_irq(dev, 0);
+	if (tbus->irq < 0) {
+		err = -EINVAL;
+		goto clean_list;
+	}
+
+	err = request_irq(tbus->irq, timbi2s_irq, 0, DRIVER_NAME, tbus);
+	if (err != 0)
+		goto clean_list;
+
+	platform_set_drvdata(dev, tbus);
+
+	dev_info(&dev->dev, "Driver for Timberdale I2S (ver: %d)"
+				" has been successfully registered.\n",
+				ioread32(tbus->membase + 0x00));
+	return 0;
+
+clean_list:
+	list_for_each_entry_safe(tdev, tmp, &tbus->control->list, item) {
+		if (tdev->workqueue != NULL) {
+			flush_workqueue(tdev->workqueue);
+			destroy_workqueue(tdev->workqueue);
+		}
+
+		if (tdev->buffer != NULL)
+			timbi2s_buf_free(tdev->buffer);
+
+		timbi2s_control_del_dev(tdev);
+		kfree(tdev);
+	}
+	free_irq(tbus->irq, tbus);
+	iounmap(tbus->membase);
+err_request:
+	release_mem_region(iomem->start, resource_size(iomem));
+err_control:
+	if (tbus->control != NULL)
+		timbi2s_control_destroy(tbus->control);
+err_free:
+	kfree(tbus);
+err_mem:
+	printk(KERN_ERR
+		DRIVER_NAME": Failed to register Timberdale I2S: %d\n", err);
+
+	return err;
+}
+
+static int __devexit timbi2s_remove(struct platform_device *dev)
+{
+	struct timbi2s_bus *tbus;
+	struct timbi2s_dev *tdev, *tmp;
+	struct resource *r;
+
+	tbus = platform_get_drvdata(dev);
+	free_irq(tbus->irq, tbus);
+
+	r = platform_get_resource(dev, IORESOURCE_MEM, 0);
+
+	list_for_each_entry_safe(tdev, tmp, &tbus->control->list, item) {
+		if (tdev->workqueue != NULL) {
+			flush_workqueue(tdev->workqueue);
+			destroy_workqueue(tdev->workqueue);
+		}
+
+		if (tdev->buffer != NULL)
+			timbi2s_buf_free(tdev->buffer);
+
+		kfree(tdev);
+	}
+
+	iounmap(tdev->membase);
+	if (r)
+		release_mem_region(r->start, resource_size(r));
+
+	dev_info(&dev->dev, "Driver for Timberdale I2S has been"
+				" successfully unregistered.\n");
+
+	platform_set_drvdata(dev, 0);
+	return 0;
+}
+
+static struct platform_driver timbi2s_platform_driver = {
+	.driver = {
+		.name	= DRIVER_NAME,
+		.owner	= THIS_MODULE,
+	},
+	.probe		= timbi2s_probe,
+	.remove		= __devexit_p(timbi2s_remove),
+};
+
+/*--------------------------------------------------------------------------*/
+
+static int __init timbi2s_init(void)
+{
+	return platform_driver_register(&timbi2s_platform_driver);
+}
+
+static void __exit timbi2s_exit(void)
+{
+	platform_driver_unregister(&timbi2s_platform_driver);
+}
+
+module_init(timbi2s_init);
+module_exit(timbi2s_exit);
+
+MODULE_AUTHOR("Mocean Laboratories");
+MODULE_DESCRIPTION("Timberdale I2S bus driver");
+MODULE_LICENSE("GPL v2");
diff -uNr linux-2.6.29-clean/drivers/mmc/host/Kconfig linux-2.6.29/drivers/mmc/host/Kconfig
--- linux-2.6.29-clean/drivers/mmc/host/Kconfig	2009-04-01 09:20:24.000000000 -0700
+++ linux-2.6.29/drivers/mmc/host/Kconfig	2009-04-06 13:51:47.000000000 -0700
@@ -65,6 +65,16 @@
 
 	  If unsure, say Y.
 
+config MMC_SDHCI_PLTFM
+	tristate "SDHCI support on platform devices"
+	depends on MMC_SDHCI
+	help
+	  This selects the Secure Digital Host Controller Interface.
+
+	  If you have a controller with this interface, say Y or M here.
+
+	  If unsure, say N.
+
 config MMC_OMAP
 	tristate "TI OMAP Multimedia Card Interface support"
 	depends on ARCH_OMAP
diff -uNr linux-2.6.29-clean/drivers/mmc/host/Makefile linux-2.6.29/drivers/mmc/host/Makefile
--- linux-2.6.29-clean/drivers/mmc/host/Makefile	2009-04-01 09:20:24.000000000 -0700
+++ linux-2.6.29/drivers/mmc/host/Makefile	2009-04-06 13:51:47.000000000 -0700
@@ -13,6 +13,7 @@
 obj-$(CONFIG_MMC_SDHCI)		+= sdhci.o
 obj-$(CONFIG_MMC_SDHCI_PCI)	+= sdhci-pci.o
 obj-$(CONFIG_MMC_RICOH_MMC)	+= ricoh_mmc.o
+obj-$(CONFIG_MMC_SDHCI_PLTFM)	+= sdhci-pltfm.o
 obj-$(CONFIG_MMC_WBSD)		+= wbsd.o
 obj-$(CONFIG_MMC_AU1X)		+= au1xmmc.o
 obj-$(CONFIG_MMC_OMAP)		+= omap.o
diff -uNr linux-2.6.29-clean/drivers/mmc/host/sdhci-pltfm.c linux-2.6.29/drivers/mmc/host/sdhci-pltfm.c
--- linux-2.6.29-clean/drivers/mmc/host/sdhci-pltfm.c	1969-12-31 16:00:00.000000000 -0800
+++ linux-2.6.29/drivers/mmc/host/sdhci-pltfm.c	2009-04-06 13:51:47.000000000 -0700
@@ -0,0 +1,262 @@
+/*
+ * sdhci-pltfm.c Support for SDHCI platform devices
+ * Copyright (c) 2009 Intel Corporation
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/* Supports:
+ * SDHCI platform devices
+ *
+ * Inspired by sdhci-pci.c, by Pierre Ossman
+ */
+
+#include <linux/delay.h>
+#include <linux/highmem.h>
+#include <linux/platform_device.h>
+
+#include <linux/mmc/host.h>
+
+#include <linux/io.h>
+
+#include "sdhci.h"
+
+
+#define MAX_SLOTS	8
+
+struct sdhci_pltfm_chip;
+
+struct sdhci_pltfm_slot {
+	struct sdhci_pltfm_chip	*chip;
+	struct sdhci_host	*host;
+
+	int			pltfm_resource;
+};
+
+struct sdhci_pltfm_chip {
+	struct platform_device	*pdev;
+
+	unsigned int		quirks;
+
+	int			num_slots;	/* Slots on controller */
+	struct sdhci_pltfm_slot	*slots[MAX_SLOTS]; /* Pointers to host slots */
+};
+
+
+/*****************************************************************************\
+ *                                                                           *
+ * SDHCI core callbacks                                                      *
+ *                                                                           *
+\*****************************************************************************/
+
+static struct sdhci_ops sdhci_pltfm_ops = {
+};
+
+/*****************************************************************************\
+ *                                                                           *
+ * Device probing/removal                                                    *
+ *                                                                           *
+\*****************************************************************************/
+
+
+static struct sdhci_pltfm_slot * __devinit sdhci_pltfm_probe_slot(
+	struct platform_device *pdev, struct sdhci_pltfm_chip *chip,
+	int resource)
+{
+	struct sdhci_pltfm_slot *slot;
+	struct sdhci_host *host;
+	struct resource *iomem;
+	int ret;
+
+	iomem = platform_get_resource(pdev, IORESOURCE_MEM, resource);
+	if (!iomem)
+		return ERR_PTR(-ENODEV);
+
+	if (resource_size(iomem) != 0x100) {
+		dev_err(&pdev->dev, "Invalid iomem size. You may "
+			"experience problems.\n");
+	}
+
+	if (!pdev->dev.parent) {
+		dev_err(&pdev->dev, "The parent device be a PCI device\n");
+		return ERR_PTR(-ENODEV);
+	}
+
+	host = sdhci_alloc_host(pdev->dev.parent,
+		sizeof(struct sdhci_pltfm_slot));
+	if (IS_ERR(host))
+		return ERR_PTR(PTR_ERR(host));
+
+	slot = sdhci_priv(host);
+
+	slot->chip = chip;
+	slot->host = host;
+	slot->pltfm_resource = resource;
+
+	host->hw_name = "PLTFM";
+	host->ops = &sdhci_pltfm_ops;
+	host->quirks = chip->quirks;
+
+	host->irq = platform_get_irq(pdev, 0);
+
+	if (!request_mem_region(iomem->start, resource_size(iomem),
+		mmc_hostname(host->mmc))) {
+		dev_err(&pdev->dev, "cannot request region\n");
+		ret = -EBUSY;
+		goto free;
+	}
+
+	host->ioaddr = ioremap(iomem->start, resource_size(iomem));
+	if (!host->ioaddr) {
+		dev_err(&pdev->dev, "failed to remap registers\n");
+		goto release;
+	}
+
+	ret = sdhci_add_host(host);
+	if (ret)
+		goto unmap;
+
+	return slot;
+
+unmap:
+	iounmap(host->ioaddr);
+release:
+	release_mem_region(iomem->start, resource_size(iomem));
+free:
+	sdhci_free_host(host);
+
+	return ERR_PTR(ret);
+}
+
+static void sdhci_pltfm_remove_slot(struct sdhci_pltfm_slot *slot)
+{
+	int dead;
+	u32 scratch;
+	struct resource *iomem;
+
+	dead = 0;
+	scratch = readl(slot->host->ioaddr + SDHCI_INT_STATUS);
+	if (scratch == (u32)-1)
+		dead = 1;
+
+	sdhci_remove_host(slot->host, dead);
+
+	iounmap(slot->host->ioaddr);
+
+	iomem = platform_get_resource(slot->chip->pdev, IORESOURCE_MEM,
+		slot->pltfm_resource);
+	release_mem_region(iomem->start, resource_size(iomem));
+
+	sdhci_free_host(slot->host);
+}
+
+static int __devinit sdhci_pltfm_probe(struct platform_device *pdev)
+{
+	struct sdhci_pltfm_chip *chip;
+	struct sdhci_pltfm_slot *slot;
+	u8 slots;
+	int ret, i;
+
+	BUG_ON(pdev == NULL);
+
+	for (slots = 0; slots <= MAX_SLOTS; slots++)
+		if (!platform_get_resource(pdev, IORESOURCE_MEM, slots))
+			break;
+
+	BUG_ON(slots > MAX_SLOTS || slots == 0);
+
+	chip = kzalloc(sizeof(struct sdhci_pltfm_chip), GFP_KERNEL);
+	if (!chip) {
+		ret = -ENOMEM;
+		goto err;
+	}
+
+	chip->pdev = pdev;
+	chip->num_slots = slots;
+	platform_set_drvdata(pdev, chip);
+
+	for (i = 0; i < slots; i++) {
+		slot = sdhci_pltfm_probe_slot(pdev, chip, i);
+		if (IS_ERR(slot)) {
+			for (i--; i >= 0; i--)
+				sdhci_pltfm_remove_slot(chip->slots[i]);
+			ret = PTR_ERR(slot);
+			goto free;
+		}
+
+		chip->slots[i] = slot;
+	}
+
+	return 0;
+
+free:
+	platform_set_drvdata(pdev, NULL);
+	kfree(chip);
+
+err:
+	printk(KERN_ERR"Probing of sdhci-pltfm failed: %d\n", ret);
+	return ret;
+}
+
+static int __devexit sdhci_pltfm_remove(struct platform_device *pdev)
+{
+	int i;
+	struct sdhci_pltfm_chip *chip;
+
+	chip = platform_get_drvdata(pdev);
+
+	if (chip) {
+		for (i = 0; i < chip->num_slots; i++)
+			sdhci_pltfm_remove_slot(chip->slots[i]);
+
+		platform_set_drvdata(pdev, NULL);
+		kfree(chip);
+	}
+
+	return 0;
+}
+
+static struct platform_driver sdhci_pltfm_driver = {
+	.driver = {
+		.name	= "sdhci",
+		.owner	= THIS_MODULE,
+	},
+	.probe		= sdhci_pltfm_probe,
+	.remove		= __devexit_p(sdhci_pltfm_remove),
+};
+
+/*****************************************************************************\
+ *                                                                           *
+ * Driver init/exit                                                          *
+ *                                                                           *
+\*****************************************************************************/
+
+static int __init sdhci_drv_init(void)
+{
+	return platform_driver_register(&sdhci_pltfm_driver);
+}
+
+static void __exit sdhci_drv_exit(void)
+{
+	platform_driver_unregister(&sdhci_pltfm_driver);
+}
+
+module_init(sdhci_drv_init);
+module_exit(sdhci_drv_exit);
+
+MODULE_DESCRIPTION("Secure Digital Host Controller Interface platform driver");
+MODULE_AUTHOR("Mocean Laboratories <info@mocean-labs.com>");
+MODULE_LICENSE("GPL v2");
+MODULE_ALIAS("platform:sdhci");
+
diff -uNr linux-2.6.29-clean/drivers/serial/Kconfig linux-2.6.29/drivers/serial/Kconfig
--- linux-2.6.29-clean/drivers/serial/Kconfig	2009-04-01 09:20:24.000000000 -0700
+++ linux-2.6.29/drivers/serial/Kconfig	2009-04-06 13:51:47.000000000 -0700
@@ -1412,4 +1412,11 @@
 	default 19200 if (SERIAL_SPORT_BAUD_RATE_19200)
 	default 9600 if (SERIAL_SPORT_BAUD_RATE_9600)
 
+config SERIAL_TIMBERDALE
+	tristate "Support for timberdale UART"
+	depends on MFD_TIMBERDALE
+	select SERIAL_CORE
+	---help---
+	Add support for UART controller on timberdale.
+
 endmenu
diff -uNr linux-2.6.29-clean/drivers/serial/Makefile linux-2.6.29/drivers/serial/Makefile
--- linux-2.6.29-clean/drivers/serial/Makefile	2009-04-01 09:20:24.000000000 -0700
+++ linux-2.6.29/drivers/serial/Makefile	2009-04-06 13:51:47.000000000 -0700
@@ -76,3 +76,4 @@
 obj-$(CONFIG_SERIAL_KS8695) += serial_ks8695.o
 obj-$(CONFIG_KGDB_SERIAL_CONSOLE) += kgdboc.o
 obj-$(CONFIG_SERIAL_QE) += ucc_uart.o
+obj-$(CONFIG_SERIAL_TIMBERDALE)	+= timbuart.o
diff -uNr linux-2.6.29-clean/drivers/serial/timbuart.c linux-2.6.29/drivers/serial/timbuart.c
--- linux-2.6.29-clean/drivers/serial/timbuart.c	1969-12-31 16:00:00.000000000 -0800
+++ linux-2.6.29/drivers/serial/timbuart.c	2009-04-06 13:51:47.000000000 -0700
@@ -0,0 +1,519 @@
+/*
+ * timbuart.c timberdale FPGA UART driver
+ * Copyright (c) 2009 Intel Corporation
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/* Supports:
+ * Timberdale FPGA UART
+ */
+
+#include <linux/pci.h>
+#include <linux/interrupt.h>
+#include <linux/serial_core.h>
+#include <linux/kernel.h>
+#include <linux/platform_device.h>
+#include <linux/ioport.h>
+
+#include "timbuart.h"
+
+struct timbuart_port {
+	struct uart_port	port;
+	struct tasklet_struct	tasklet;
+	int			usedma;
+	u8			last_ier;
+	struct platform_device  *dev;
+};
+
+static int baudrates[] = {9600, 19200, 38400, 57600, 115200, 230400, 460800,
+	921600, 1843200, 3250000};
+
+static void timbuart_mctrl_check(struct uart_port *port, u8 isr, u8 *ier);
+
+static irqreturn_t timbuart_handleinterrupt(int irq, void *devid);
+
+static void timbuart_stop_rx(struct uart_port *port)
+{
+	/* spin lock held by upper layer, disable all RX interrupts */
+	u8 ier = ioread8(port->membase + TIMBUART_IER) & ~RXFLAGS;
+	iowrite8(ier, port->membase + TIMBUART_IER);
+}
+
+static void timbuart_stop_tx(struct uart_port *port)
+{
+	/* spinlock held by upper layer, disable TX interrupt */
+	u8 ier = ioread8(port->membase + TIMBUART_IER) & ~TXBAE;
+	iowrite8(ier, port->membase + TIMBUART_IER);
+}
+
+static void timbuart_start_tx(struct uart_port *port)
+{
+	struct timbuart_port *uart =
+		container_of(port, struct timbuart_port, port);
+
+	/* do not transfer anything here -> fire off the tasklet */
+	tasklet_schedule(&uart->tasklet);
+}
+
+static void timbuart_flush_buffer(struct uart_port *port)
+{
+	u8 ctl = ioread8(port->membase + TIMBUART_CTRL) | TIMBUART_CTRL_FLSHTX;
+
+	iowrite8(ctl, port->membase + TIMBUART_CTRL);
+	iowrite8(TXBF, port->membase + TIMBUART_ISR);
+}
+
+static void timbuart_rx_chars(struct uart_port *port)
+{
+	struct tty_struct *tty = port->info->port.tty;
+
+	while (ioread8(port->membase + TIMBUART_ISR) & RXDP) {
+		u8 ch = ioread8(port->membase + TIMBUART_RXFIFO);
+		/* ack */
+		iowrite8(RXDP, port->membase + TIMBUART_ISR);
+		port->icount.rx++;
+		tty_insert_flip_char(tty, ch, TTY_NORMAL);
+	}
+
+	spin_unlock(&port->lock);
+	tty_flip_buffer_push(port->info->port.tty);
+	spin_lock(&port->lock);
+
+	dev_dbg(port->dev, "%s - total read %d bytes\n",
+		__func__, port->icount.rx);
+}
+
+static void timbuart_tx_chars(struct uart_port *port)
+{
+	struct circ_buf *xmit = &port->info->xmit;
+
+	while (!(ioread8(port->membase + TIMBUART_ISR) & TXBF) &&
+		!uart_circ_empty(xmit)) {
+		iowrite8(xmit->buf[xmit->tail],
+			port->membase + TIMBUART_TXFIFO);
+		xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
+		port->icount.tx++;
+	}
+
+	dev_dbg(port->dev,
+		"%s - total written %d bytes, CTL: %x, RTS: %x, baud: %x\n",
+		 __func__,
+		port->icount.tx,
+		ioread8(port->membase + TIMBUART_CTRL),
+		port->mctrl & TIOCM_RTS,
+		ioread8(port->membase + TIMBUART_BAUDRATE));
+}
+
+static void timbuart_handle_tx_port(struct uart_port *port, u8 isr, u8 *ier)
+{
+	struct timbuart_port *uart =
+		container_of(port, struct timbuart_port, port);
+	struct circ_buf *xmit = &port->info->xmit;
+
+	if (uart_circ_empty(xmit) || uart_tx_stopped(port))
+		return;
+
+	if (port->x_char)
+		return;
+
+	if (isr & TXFLAGS) {
+		timbuart_tx_chars(port);
+		/* clear all TX interrupts */
+		iowrite8(TXFLAGS, port->membase + TIMBUART_ISR);
+
+		if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
+			uart_write_wakeup(port);
+	} else
+		/* Re-enable any tx interrupt */
+		*ier |= uart->last_ier & TXFLAGS;
+
+	/* enable interrupts if there are chars in the transmit buffer,
+	 * Or if we delivered some bytes and want the almost empty interrupt
+	 * we wake up the upper layer later when we got the interrupt
+	 * to give it some time to go out...
+	 */
+	if (!uart_circ_empty(xmit))
+		*ier |= TXBAE;
+
+	dev_dbg(port->dev, "%s - leaving\n", __func__);
+}
+
+void timbuart_handle_rx_port(struct uart_port *port, u8 isr, u8 *ier)
+{
+	if (isr & RXFLAGS) {
+		/* Some RX status is set */
+		if (isr & RXBF) {
+			u8 ctl = ioread8(port->membase + TIMBUART_CTRL) |
+				TIMBUART_CTRL_FLSHRX;
+			iowrite8(ctl, port->membase + TIMBUART_CTRL);
+			port->icount.overrun++;
+		} else if (isr & (RXDP))
+			timbuart_rx_chars(port);
+
+		/* ack all RX interrupts */
+		iowrite8(RXFLAGS, port->membase + TIMBUART_ISR);
+	}
+
+	/* always have the RX interrupts enabled */
+	*ier |= RXBAF | RXBF | RXTT;
+
+	dev_dbg(port->dev, "%s - leaving\n", __func__);
+}
+
+void timbuart_tasklet(unsigned long arg)
+{
+	struct timbuart_port *uart = (struct timbuart_port *)arg;
+	u8 isr, ier = 0;
+
+	spin_lock(&uart->port.lock);
+
+	isr = ioread8(uart->port.membase + TIMBUART_ISR);
+	dev_dbg(uart->port.dev, "%s ISR: %x\n", __func__, isr);
+
+	if (!uart->usedma)
+		timbuart_handle_tx_port(&uart->port, isr, &ier);
+
+	timbuart_mctrl_check(&uart->port, isr, &ier);
+
+	if (!uart->usedma)
+		timbuart_handle_rx_port(&uart->port, isr, &ier);
+
+	iowrite8(ier, uart->port.membase + TIMBUART_IER);
+
+	spin_unlock(&uart->port.lock);
+	dev_dbg(uart->port.dev, "%s leaving\n", __func__);
+}
+
+static unsigned int timbuart_tx_empty(struct uart_port *port)
+{
+	u8 isr = ioread8(port->membase + TIMBUART_ISR);
+
+	return (isr & TXBAE) ? TIOCSER_TEMT : 0;
+}
+
+static unsigned int timbuart_get_mctrl(struct uart_port *port)
+{
+	u8 cts = ioread8(port->membase + TIMBUART_CTRL);
+	dev_dbg(port->dev, "%s - cts %x\n", __func__, cts);
+
+	if (cts & TIMBUART_CTRL_CTS)
+		return TIOCM_CTS | TIOCM_DSR | TIOCM_CAR;
+	else
+		return TIOCM_DSR | TIOCM_CAR;
+}
+
+static void timbuart_set_mctrl(struct uart_port *port, unsigned int mctrl)
+{
+	dev_dbg(port->dev, "%s - %x\n", __func__, mctrl);
+
+	if (mctrl & TIOCM_RTS)
+		iowrite8(TIMBUART_CTRL_RTS, port->membase + TIMBUART_CTRL);
+	else
+		iowrite8(TIMBUART_CTRL_RTS, port->membase + TIMBUART_CTRL);
+}
+
+static void timbuart_mctrl_check(struct uart_port *port, u8 isr, u8 *ier)
+{
+	unsigned int cts;
+
+	if (isr & CTS_DELTA) {
+		/* ack */
+		iowrite8(CTS_DELTA, port->membase + TIMBUART_ISR);
+		cts = timbuart_get_mctrl(port);
+		uart_handle_cts_change(port, cts & TIOCM_CTS);
+		wake_up_interruptible(&port->info->delta_msr_wait);
+	}
+
+	*ier |= CTS_DELTA;
+}
+
+static void timbuart_enable_ms(struct uart_port *port)
+{
+	/* N/A */
+}
+
+static void timbuart_break_ctl(struct uart_port *port, int ctl)
+{
+	/* N/A */
+}
+
+static int timbuart_startup(struct uart_port *port)
+{
+	struct timbuart_port *uart =
+		container_of(port, struct timbuart_port, port);
+
+	dev_dbg(port->dev, "%s\n", __func__);
+
+	iowrite8(TIMBUART_CTRL_FLSHRX, port->membase + TIMBUART_CTRL);
+	iowrite8(0xff, port->membase + TIMBUART_ISR);
+	/* Enable all but TX interrupts */
+	iowrite8(RXBAF | RXBF | RXTT | CTS_DELTA,
+		port->membase + TIMBUART_IER);
+
+	return request_irq(port->irq, timbuart_handleinterrupt, IRQF_SHARED,
+		"timb-uart", uart);
+}
+
+static void timbuart_shutdown(struct uart_port *port)
+{
+	struct timbuart_port *uart =
+		container_of(port, struct timbuart_port, port);
+	dev_dbg(port->dev, "%s\n", __func__);
+	free_irq(port->irq, uart);
+	iowrite8(0, port->membase + TIMBUART_IER);
+}
+
+static int get_bindex(int baud)
+{
+	int i;
+
+	for (i = 0; i < ARRAY_SIZE(baudrates); i++)
+		if (baud == baudrates[i])
+			return i;
+
+	return -1;
+}
+
+static void timbuart_set_termios(struct uart_port *port,
+	struct ktermios *termios,
+	struct ktermios *old)
+{
+	unsigned int baud;
+	short bindex;
+	unsigned long flags;
+
+	baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk / 16);
+	bindex = get_bindex(baud);
+	dev_dbg(port->dev, "%s - bindex %d\n", __func__, bindex);
+
+	if (bindex < 0) {
+		printk(KERN_ALERT "timbuart: Unsupported baud rate\n");
+	} else {
+		spin_lock_irqsave(&port->lock, flags);
+		iowrite8((u8)bindex, port->membase + TIMBUART_BAUDRATE);
+		uart_update_timeout(port, termios->c_cflag, baud);
+		spin_unlock_irqrestore(&port->lock, flags);
+	}
+}
+
+static const char *timbuart_type(struct uart_port *port)
+{
+	return port->type == PORT_UNKNOWN ? "timbuart" : NULL;
+}
+
+/* We do not request/release mappings of the registers here,
+ * currently it's done in the proble function.
+ */
+static void timbuart_release_port(struct uart_port *port)
+{
+	struct platform_device *pdev = to_platform_device(port->dev);
+	int size =
+		resource_size(platform_get_resource(pdev, IORESOURCE_MEM, 0));
+
+	if (port->flags & UPF_IOREMAP) {
+		iounmap(port->membase);
+		port->membase = NULL;
+	}
+
+	release_mem_region(port->mapbase, size);
+}
+
+static int timbuart_request_port(struct uart_port *port)
+{
+	struct platform_device *pdev = to_platform_device(port->dev);
+	int size =
+		resource_size(platform_get_resource(pdev, IORESOURCE_MEM, 0));
+
+	if (!request_mem_region(port->mapbase, size, "timb-uart"))
+		return -EBUSY;
+
+	if (port->flags & UPF_IOREMAP) {
+		port->membase = ioremap(port->mapbase, size);
+		if (port->membase == NULL) {
+			release_mem_region(port->mapbase, size);
+			return -ENOMEM;
+		}
+	}
+
+	return 0;
+}
+
+static irqreturn_t timbuart_handleinterrupt(int irq, void *devid)
+{
+	struct timbuart_port *uart = (struct timbuart_port *)devid;
+
+	uart->last_ier = ioread8(uart->port.membase + TIMBUART_IER);
+
+	/* disable interrupts, let the tasklet enable them again if needed */
+	iowrite8(0, uart->port.membase + TIMBUART_IER);
+
+	/* fire off bottom half */
+	tasklet_schedule(&uart->tasklet);
+
+	return IRQ_HANDLED;
+}
+
+/*
+ * Configure/autoconfigure the port.
+ */
+static void timbuart_config_port(struct uart_port *port, int flags)
+{
+	if (flags & UART_CONFIG_TYPE) {
+		port->type = PORT_TIMBUART;
+		timbuart_request_port(port);
+	}
+}
+
+static int timbuart_verify_port(struct uart_port *port,
+	struct serial_struct *ser)
+{
+	/* we don't want the core code to modify any port params */
+	return -EINVAL;
+}
+
+static struct uart_ops timbuart_ops = {
+	.tx_empty = timbuart_tx_empty,
+	.set_mctrl = timbuart_set_mctrl,
+	.get_mctrl = timbuart_get_mctrl,
+	.stop_tx = timbuart_stop_tx,
+	.start_tx = timbuart_start_tx,
+	.flush_buffer = timbuart_flush_buffer,
+	.stop_rx = timbuart_stop_rx,
+	.enable_ms = timbuart_enable_ms,
+	.break_ctl = timbuart_break_ctl,
+	.startup = timbuart_startup,
+	.shutdown = timbuart_shutdown,
+	.set_termios = timbuart_set_termios,
+	.type = timbuart_type,
+	.release_port = timbuart_release_port,
+	.request_port = timbuart_request_port,
+	.config_port = timbuart_config_port,
+	.verify_port = timbuart_verify_port
+};
+
+static struct uart_driver timbuart_driver = {
+	.owner = THIS_MODULE,
+	.driver_name = "timberdale_uart",
+	.dev_name = "ttyTU",
+	.major = TIMBUART_MAJOR,
+	.minor = TIMBUART_MINOR,
+	.nr = 1
+};
+
+static int timbuart_probe(struct platform_device *dev)
+{
+	int err;
+	struct timbuart_port *uart;
+	struct resource *iomem;
+
+	dev_dbg(&dev->dev, "%s\n", __func__);
+
+	uart = kzalloc(sizeof(*uart), GFP_KERNEL);
+	if (!uart) {
+		err = -EINVAL;
+		goto err_mem;
+	}
+
+	uart->usedma = 0;
+
+	uart->port.uartclk = 3250000 * 16;
+	uart->port.fifosize  = TIMBUART_FIFO_SIZE;
+	uart->port.regshift  = 2;
+	uart->port.iotype  = UPIO_MEM;
+	uart->port.ops = &timbuart_ops;
+	uart->port.irq = 0;
+	uart->port.flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP;
+	uart->port.line  = 0;
+	uart->port.dev	= &dev->dev;
+
+	iomem = platform_get_resource(dev, IORESOURCE_MEM, 0);
+	if (!iomem) {
+		err = -ENOMEM;
+		goto err_register;
+	}
+	uart->port.mapbase = iomem->start;
+	uart->port.membase = NULL;
+
+	uart->port.irq = platform_get_irq(dev, 0);
+	if (uart->port.irq < 0) {
+		err = -EINVAL;
+		goto err_register;
+	}
+
+	tasklet_init(&uart->tasklet, timbuart_tasklet, (unsigned long)uart);
+
+	err = uart_register_driver(&timbuart_driver);
+	if (err)
+		goto err_register;
+
+	err = uart_add_one_port(&timbuart_driver, &uart->port);
+	if (err)
+		goto err_add_port;
+
+	platform_set_drvdata(dev, uart);
+
+	return 0;
+
+err_add_port:
+	uart_unregister_driver(&timbuart_driver);
+err_register:
+	kfree(uart);
+err_mem:
+	printk(KERN_ERR "timberdale: Failed to register Timberdale UART: %d\n",
+		err);
+
+	return err;
+}
+
+static int timbuart_remove(struct platform_device *dev)
+{
+	struct timbuart_port *uart = platform_get_drvdata(dev);
+
+	tasklet_kill(&uart->tasklet);
+	uart_remove_one_port(&timbuart_driver, &uart->port);
+	uart_unregister_driver(&timbuart_driver);
+	kfree(uart);
+
+	return 0;
+}
+
+static struct platform_driver timbuart_platform_driver = {
+	.driver = {
+		.name	= "timb-uart",
+		.owner	= THIS_MODULE,
+	},
+	.probe		= timbuart_probe,
+	.remove		= timbuart_remove,
+};
+
+/*--------------------------------------------------------------------------*/
+
+static int __init timbuart_init(void)
+{
+	return platform_driver_register(&timbuart_platform_driver);
+}
+
+static void __exit timbuart_exit(void)
+{
+	platform_driver_unregister(&timbuart_platform_driver);
+}
+
+module_init(timbuart_init);
+module_exit(timbuart_exit);
+
+MODULE_DESCRIPTION("Timberdale UART driver");
+MODULE_LICENSE("GPL v2");
+MODULE_ALIAS("platform:timb-uart");
+
diff -uNr linux-2.6.29-clean/drivers/serial/timbuart.h linux-2.6.29/drivers/serial/timbuart.h
--- linux-2.6.29-clean/drivers/serial/timbuart.h	1969-12-31 16:00:00.000000000 -0800
+++ linux-2.6.29/drivers/serial/timbuart.h	2009-04-06 13:51:47.000000000 -0700
@@ -0,0 +1,57 @@
+/*
+ * timbuart.c timberdale FPGA GPIO driver
+ * Copyright (c) 2009 Intel Corporation
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/* Supports:
+ * Timberdale FPGA UART
+ */
+
+#ifndef _TIMBUART_H
+#define _TIMBUART_H
+
+#define TIMBUART_FIFO_SIZE	2048
+
+#define TIMBUART_RXFIFO		0x08
+#define TIMBUART_TXFIFO		0x0c
+#define TIMBUART_IER		0x10
+#define TIMBUART_IPR		0x14
+#define TIMBUART_ISR		0x18
+#define TIMBUART_CTRL		0x1c
+#define TIMBUART_BAUDRATE	0x20
+
+#define TIMBUART_CTRL_RTS	0x01
+#define TIMBUART_CTRL_CTS	0x02
+#define TIMBUART_CTRL_FLSHTX	0x40
+#define TIMBUART_CTRL_FLSHRX	0x80
+
+#define TXBF		0x01
+#define TXBAE		0x02
+#define CTS_DELTA	0x04
+#define RXDP		0x08
+#define RXBAF		0x10
+#define RXBF		0x20
+#define RXTT		0x40
+#define RXBNAE		0x80
+
+#define RXFLAGS (RXDP | RXBAF | RXBF | RXTT | RXBNAE)
+#define TXFLAGS (TXBF | TXBAE)
+
+#define TIMBUART_MAJOR 204
+#define TIMBUART_MINOR 192
+
+#endif /* _TIMBUART_H */
+
diff -uNr linux-2.6.29-clean/drivers/spi/Kconfig linux-2.6.29/drivers/spi/Kconfig
--- linux-2.6.29-clean/drivers/spi/Kconfig	2009-04-01 09:20:25.000000000 -0700
+++ linux-2.6.29/drivers/spi/Kconfig	2009-04-06 13:51:47.000000000 -0700
@@ -211,8 +211,8 @@
 	  SPI driver for Toshiba TXx9 MIPS SoCs
 
 config SPI_XILINX
-	tristate "Xilinx SPI controller"
-	depends on XILINX_VIRTEX && EXPERIMENTAL
+	tristate "Xilinx SPI controller common module"
+	depends on EXPERIMENTAL
 	select SPI_BITBANG
 	help
 	  This exposes the SPI controller IP from the Xilinx EDK.
@@ -220,6 +220,25 @@
 	  See the "OPB Serial Peripheral Interface (SPI) (v1.00e)"
 	  Product Specification document (DS464) for hardware details.
 
+config SPI_XILINX_OF
+	tristate "Xilinx SPI controller OF device"
+	depends on SPI_XILINX && XILINX_VIRTEX
+	help
+	  This exposes the SPI controller IP from the Xilinx EDK.
+
+	  See the "OPB Serial Peripheral Interface (SPI) (v1.00e)"
+	  Product Specification document (DS464) for hardware details.
+
+config SPI_XILINX_PLTFM
+	tristate "Xilinx SPI controller platform device"
+	depends on SPI_XILINX
+	help
+	  This exposes the SPI controller IP from the Xilinx EDK.
+
+	  See the "OPB Serial Peripheral Interface (SPI) (v1.00e)"
+	  Product Specification document (DS464) for hardware details.
+
+
 #
 # Add new SPI master controllers in alphabetical order above this line
 #
diff -uNr linux-2.6.29-clean/drivers/spi/Makefile linux-2.6.29/drivers/spi/Makefile
--- linux-2.6.29-clean/drivers/spi/Makefile	2009-04-01 09:20:25.000000000 -0700
+++ linux-2.6.29/drivers/spi/Makefile	2009-04-06 13:51:47.000000000 -0700
@@ -29,6 +29,8 @@
 obj-$(CONFIG_SPI_S3C24XX)		+= spi_s3c24xx.o
 obj-$(CONFIG_SPI_TXX9)			+= spi_txx9.o
 obj-$(CONFIG_SPI_XILINX)		+= xilinx_spi.o
+obj-$(CONFIG_SPI_XILINX_OF)		+= xilinx_spi_of.o
+obj-$(CONFIG_SPI_XILINX_PLTFM)		+= xilinx_spi_pltfm.o
 obj-$(CONFIG_SPI_SH_SCI)		+= spi_sh_sci.o
 # 	... add above this line ...
 
diff -uNr linux-2.6.29-clean/drivers/spi/xilinx_spi.c linux-2.6.29/drivers/spi/xilinx_spi.c
--- linux-2.6.29-clean/drivers/spi/xilinx_spi.c	2009-04-01 09:20:25.000000000 -0700
+++ linux-2.6.29/drivers/spi/xilinx_spi.c	2009-04-06 13:51:47.000000000 -0700
@@ -14,22 +14,28 @@
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
-#include <linux/platform_device.h>
-
-#include <linux/of_platform.h>
-#include <linux/of_device.h>
-#include <linux/of_spi.h>
 
 #include <linux/spi/spi.h>
 #include <linux/spi/spi_bitbang.h>
 #include <linux/io.h>
 
-#define XILINX_SPI_NAME "xilinx_spi"
+#include "xilinx_spi.h"
+
+#ifndef CONFIG_PPC
+#define in_8(addr) ioread8(addr)
+#define in_be16(addr) ioread16(addr)
+#define in_be32(addr) ioread32(addr)
+
+#define out_8(addr, b) iowrite8(b, addr)
+#define out_be16(addr, w) iowrite16(w, addr)
+#define out_be32(addr, l) iowrite32(l, addr)
+#endif
+
 
 /* Register definitions as per "OPB Serial Peripheral Interface (SPI) (v1.00e)
  * Product Specification", DS464
  */
-#define XSPI_CR_OFFSET		0x62	/* 16-bit Control Register */
+#define XSPI_CR_OFFSET_DEF	0x62	/* 16-bit Control Register */
 
 #define XSPI_CR_ENABLE		0x02
 #define XSPI_CR_MASTER_MODE	0x04
@@ -41,7 +47,7 @@
 #define XSPI_CR_MANUAL_SSELECT	0x80
 #define XSPI_CR_TRANS_INHIBIT	0x100
 
-#define XSPI_SR_OFFSET		0x67	/* 8-bit Status Register */
+#define XSPI_SR_OFFSET_DEF	0x67	/* 8-bit Status Register */
 
 #define XSPI_SR_RX_EMPTY_MASK	0x01	/* Receive FIFO is empty */
 #define XSPI_SR_RX_FULL_MASK	0x02	/* Receive FIFO is full */
@@ -49,10 +55,10 @@
 #define XSPI_SR_TX_FULL_MASK	0x08	/* Transmit FIFO is full */
 #define XSPI_SR_MODE_FAULT_MASK	0x10	/* Mode fault error */
 
-#define XSPI_TXD_OFFSET		0x6b	/* 8-bit Data Transmit Register */
-#define XSPI_RXD_OFFSET		0x6f	/* 8-bit Data Receive Register */
+#define XSPI_TXD_OFFSET_DEF	0x6b	/* 8-bit Data Transmit Register */
+#define XSPI_RXD_OFFSET_DEF	0x6f	/* 8-bit Data Receive Register */
 
-#define XSPI_SSR_OFFSET		0x70	/* 32-bit Slave Select Register */
+#define XSPI_SSR_OFFSET_DEF	0x70	/* 32-bit Slave Select Register */
 
 /* Register definitions as per "OPB IPIF (v3.01c) Product Specification", DS414
  * IPIF registers are 32 bit
@@ -74,24 +80,10 @@
 #define XIPIF_V123B_RESETR_OFFSET	0x40	/* IPIF reset register */
 #define XIPIF_V123B_RESET_MASK		0x0a	/* the value to write */
 
-struct xilinx_spi {
-	/* bitbang has to be first */
-	struct spi_bitbang bitbang;
-	struct completion done;
-
-	void __iomem	*regs;	/* virt. address of the control registers */
-
-	u32		irq;
-
-	u32		speed_hz; /* SCK has a fixed frequency of speed_hz Hz */
-
-	u8 *rx_ptr;		/* pointer in the Tx buffer */
-	const u8 *tx_ptr;	/* pointer in the Rx buffer */
-	int remaining_bytes;	/* the number of bytes left to transfer */
-};
 
-static void xspi_init_hw(void __iomem *regs_base)
+void xspi_init_hw(struct xilinx_spi *xspi)
 {
+	void __iomem *regs_base = xspi->regs;
 	/* Reset the SPI device */
 	out_be32(regs_base + XIPIF_V123B_RESETR_OFFSET,
 		 XIPIF_V123B_RESET_MASK);
@@ -101,30 +93,31 @@
 	out_be32(regs_base + XIPIF_V123B_DGIER_OFFSET,
 		 XIPIF_V123B_GINTR_ENABLE);
 	/* Deselect the slave on the SPI bus */
-	out_be32(regs_base + XSPI_SSR_OFFSET, 0xffff);
+	out_be32(regs_base + xspi->ssr_offset, 0xffff);
 	/* Disable the transmitter, enable Manual Slave Select Assertion,
 	 * put SPI controller into master mode, and enable it */
-	out_be16(regs_base + XSPI_CR_OFFSET,
+	out_be16(regs_base + xspi->cr_offset,
 		 XSPI_CR_TRANS_INHIBIT | XSPI_CR_MANUAL_SSELECT
 		 | XSPI_CR_MASTER_MODE | XSPI_CR_ENABLE);
 }
+EXPORT_SYMBOL(xspi_init_hw);
 
-static void xilinx_spi_chipselect(struct spi_device *spi, int is_on)
+void xilinx_spi_chipselect(struct spi_device *spi, int is_on)
 {
 	struct xilinx_spi *xspi = spi_master_get_devdata(spi->master);
 
 	if (is_on == BITBANG_CS_INACTIVE) {
 		/* Deselect the slave on the SPI bus */
-		out_be32(xspi->regs + XSPI_SSR_OFFSET, 0xffff);
+		out_be32(xspi->regs + xspi->ssr_offset, 0xffff);
 	} else if (is_on == BITBANG_CS_ACTIVE) {
 		/* Set the SPI clock phase and polarity */
-		u16 cr = in_be16(xspi->regs + XSPI_CR_OFFSET)
+		u16 cr = in_be16(xspi->regs + xspi->cr_offset)
 			 & ~XSPI_CR_MODE_MASK;
 		if (spi->mode & SPI_CPHA)
 			cr |= XSPI_CR_CPHA;
 		if (spi->mode & SPI_CPOL)
 			cr |= XSPI_CR_CPOL;
-		out_be16(xspi->regs + XSPI_CR_OFFSET, cr);
+		out_be16(xspi->regs + xspi->cr_offset, cr);
 
 		/* We do not check spi->max_speed_hz here as the SPI clock
 		 * frequency is not software programmable (the IP block design
@@ -132,10 +125,11 @@
 		 */
 
 		/* Activate the chip select */
-		out_be32(xspi->regs + XSPI_SSR_OFFSET,
+		out_be32(xspi->regs + xspi->ssr_offset,
 			 ~(0x0001 << spi->chip_select));
 	}
 }
+EXPORT_SYMBOL(xilinx_spi_chipselect);
 
 /* spi_bitbang requires custom setup_transfer() to be defined if there is a
  * custom txrx_bufs(). We have nothing to setup here as the SPI IP block
@@ -143,8 +137,7 @@
  * Check for 8 bits per word. Chip select delay calculations could be
  * added here as soon as bitbang_work() can be made aware of the delay value.
  */
-static int xilinx_spi_setup_transfer(struct spi_device *spi,
-		struct spi_transfer *t)
+int xilinx_spi_setup_transfer(struct spi_device *spi, struct spi_transfer *t)
 {
 	u8 bits_per_word;
 
@@ -157,11 +150,12 @@
 
 	return 0;
 }
+EXPORT_SYMBOL(xilinx_spi_setup_transfer);
 
 /* the spi->mode bits understood by this driver: */
 #define MODEBITS (SPI_CPOL | SPI_CPHA)
 
-static int xilinx_spi_setup(struct spi_device *spi)
+int xilinx_spi_setup(struct spi_device *spi)
 {
 	struct spi_bitbang *bitbang;
 	struct xilinx_spi *xspi;
@@ -188,25 +182,25 @@
 
 	return 0;
 }
+EXPORT_SYMBOL(xilinx_spi_setup);
 
 static void xilinx_spi_fill_tx_fifo(struct xilinx_spi *xspi)
 {
 	u8 sr;
 
 	/* Fill the Tx FIFO with as many bytes as possible */
-	sr = in_8(xspi->regs + XSPI_SR_OFFSET);
+	sr = in_8(xspi->regs + xspi->sr_offset);
 	while ((sr & XSPI_SR_TX_FULL_MASK) == 0 && xspi->remaining_bytes > 0) {
-		if (xspi->tx_ptr) {
-			out_8(xspi->regs + XSPI_TXD_OFFSET, *xspi->tx_ptr++);
-		} else {
-			out_8(xspi->regs + XSPI_TXD_OFFSET, 0);
-		}
+		if (xspi->tx_ptr)
+			out_8(xspi->regs + xspi->txd_offset, *xspi->tx_ptr++);
+		else
+			out_8(xspi->regs + xspi->txd_offset, 0);
 		xspi->remaining_bytes--;
-		sr = in_8(xspi->regs + XSPI_SR_OFFSET);
+		sr = in_8(xspi->regs + xspi->sr_offset);
 	}
 }
 
-static int xilinx_spi_txrx_bufs(struct spi_device *spi, struct spi_transfer *t)
+int xilinx_spi_txrx_bufs(struct spi_device *spi, struct spi_transfer *t)
 {
 	struct xilinx_spi *xspi = spi_master_get_devdata(spi->master);
 	u32 ipif_ier;
@@ -229,8 +223,8 @@
 		 ipif_ier | XSPI_INTR_TX_EMPTY);
 
 	/* Start the transfer by not inhibiting the transmitter any longer */
-	cr = in_be16(xspi->regs + XSPI_CR_OFFSET) & ~XSPI_CR_TRANS_INHIBIT;
-	out_be16(xspi->regs + XSPI_CR_OFFSET, cr);
+	cr = in_be16(xspi->regs + xspi->cr_offset) & ~XSPI_CR_TRANS_INHIBIT;
+	out_be16(xspi->regs + xspi->cr_offset, cr);
 
 	wait_for_completion(&xspi->done);
 
@@ -239,14 +233,14 @@
 
 	return t->len - xspi->remaining_bytes;
 }
-
+EXPORT_SYMBOL(xilinx_spi_txrx_bufs);
 
 /* This driver supports single master mode only. Hence Tx FIFO Empty
  * is the only interrupt we care about.
  * Receive FIFO Overrun, Transmit FIFO Underrun, Mode Fault, and Slave Mode
  * Fault are not to happen.
  */
-static irqreturn_t xilinx_spi_irq(int irq, void *dev_id)
+irqreturn_t xilinx_spi_irq(int irq, void *dev_id)
 {
 	struct xilinx_spi *xspi = dev_id;
 	u32 ipif_isr;
@@ -264,20 +258,19 @@
 		 * transmitter while the Isr refills the transmit register/FIFO,
 		 * or make sure it is stopped if we're done.
 		 */
-		cr = in_be16(xspi->regs + XSPI_CR_OFFSET);
-		out_be16(xspi->regs + XSPI_CR_OFFSET,
+		cr = in_be16(xspi->regs + xspi->cr_offset);
+		out_be16(xspi->regs + xspi->cr_offset,
 			 cr | XSPI_CR_TRANS_INHIBIT);
 
 		/* Read out all the data from the Rx FIFO */
-		sr = in_8(xspi->regs + XSPI_SR_OFFSET);
+		sr = in_8(xspi->regs + xspi->sr_offset);
 		while ((sr & XSPI_SR_RX_EMPTY_MASK) == 0) {
 			u8 data;
 
-			data = in_8(xspi->regs + XSPI_RXD_OFFSET);
-			if (xspi->rx_ptr) {
+			data = in_8(xspi->regs + xspi->rxd_offset);
+			if (xspi->rx_ptr)
 				*xspi->rx_ptr++ = data;
-			}
-			sr = in_8(xspi->regs + XSPI_SR_OFFSET);
+			sr = in_8(xspi->regs + xspi->sr_offset);
 		}
 
 		/* See if there is more data to send */
@@ -286,7 +279,7 @@
 			/* Start the transfer by not inhibiting the
 			 * transmitter any longer
 			 */
-			out_be16(xspi->regs + XSPI_CR_OFFSET, cr);
+			out_be16(xspi->regs + xspi->cr_offset, cr);
 		} else {
 			/* No more data to send.
 			 * Indicate the transfer is completed.
@@ -297,167 +290,18 @@
 
 	return IRQ_HANDLED;
 }
+EXPORT_SYMBOL(xilinx_spi_irq);
 
-static int __init xilinx_spi_of_probe(struct of_device *ofdev,
-					const struct of_device_id *match)
-{
-	struct spi_master *master;
-	struct xilinx_spi *xspi;
-	struct resource r_irq_struct;
-	struct resource r_mem_struct;
-
-	struct resource *r_irq = &r_irq_struct;
-	struct resource *r_mem = &r_mem_struct;
-	int rc = 0;
-	const u32 *prop;
-	int len;
-
-	/* Get resources(memory, IRQ) associated with the device */
-	master = spi_alloc_master(&ofdev->dev, sizeof(struct xilinx_spi));
-
-	if (master == NULL) {
-		return -ENOMEM;
-	}
-
-	dev_set_drvdata(&ofdev->dev, master);
-
-	rc = of_address_to_resource(ofdev->node, 0, r_mem);
-	if (rc) {
-		dev_warn(&ofdev->dev, "invalid address\n");
-		goto put_master;
-	}
-
-	rc = of_irq_to_resource(ofdev->node, 0, r_irq);
-	if (rc == NO_IRQ) {
-		dev_warn(&ofdev->dev, "no IRQ found\n");
-		goto put_master;
-	}
-
-	xspi = spi_master_get_devdata(master);
-	xspi->bitbang.master = spi_master_get(master);
-	xspi->bitbang.chipselect = xilinx_spi_chipselect;
-	xspi->bitbang.setup_transfer = xilinx_spi_setup_transfer;
-	xspi->bitbang.txrx_bufs = xilinx_spi_txrx_bufs;
-	xspi->bitbang.master->setup = xilinx_spi_setup;
-	init_completion(&xspi->done);
-
-	xspi->irq = r_irq->start;
-
-	if (!request_mem_region(r_mem->start,
-			r_mem->end - r_mem->start + 1, XILINX_SPI_NAME)) {
-		rc = -ENXIO;
-		dev_warn(&ofdev->dev, "memory request failure\n");
-		goto put_master;
-	}
-
-	xspi->regs = ioremap(r_mem->start, r_mem->end - r_mem->start + 1);
-	if (xspi->regs == NULL) {
-		rc = -ENOMEM;
-		dev_warn(&ofdev->dev, "ioremap failure\n");
-		goto put_master;
-	}
-	xspi->irq = r_irq->start;
-
-	/* dynamic bus assignment */
-	master->bus_num = -1;
-
-	/* number of slave select bits is required */
-	prop = of_get_property(ofdev->node, "xlnx,num-ss-bits", &len);
-	if (!prop || len < sizeof(*prop)) {
-		dev_warn(&ofdev->dev, "no 'xlnx,num-ss-bits' property\n");
-		goto put_master;
-	}
-	master->num_chipselect = *prop;
-
-	/* SPI controller initializations */
-	xspi_init_hw(xspi->regs);
-
-	/* Register for SPI Interrupt */
-	rc = request_irq(xspi->irq, xilinx_spi_irq, 0, XILINX_SPI_NAME, xspi);
-	if (rc != 0) {
-		dev_warn(&ofdev->dev, "irq request failure: %d\n", xspi->irq);
-		goto unmap_io;
-	}
-
-	rc = spi_bitbang_start(&xspi->bitbang);
-	if (rc != 0) {
-		dev_err(&ofdev->dev, "spi_bitbang_start FAILED\n");
-		goto free_irq;
-	}
-
-	dev_info(&ofdev->dev, "at 0x%08X mapped to 0x%08X, irq=%d\n",
-			(unsigned int)r_mem->start, (u32)xspi->regs, xspi->irq);
-
-	/* Add any subnodes on the SPI bus */
-	of_register_spi_devices(master, ofdev->node);
-
-	return rc;
-
-free_irq:
-	free_irq(xspi->irq, xspi);
-unmap_io:
-	iounmap(xspi->regs);
-put_master:
-	spi_master_put(master);
-	return rc;
-}
-
-static int __devexit xilinx_spi_remove(struct of_device *ofdev)
+void xilinx_spi_set_default_reg_offsets(struct xilinx_spi *xspi)
 {
-	struct xilinx_spi *xspi;
-	struct spi_master *master;
-
-	master = platform_get_drvdata(ofdev);
-	xspi = spi_master_get_devdata(master);
-
-	spi_bitbang_stop(&xspi->bitbang);
-	free_irq(xspi->irq, xspi);
-	iounmap(xspi->regs);
-	dev_set_drvdata(&ofdev->dev, 0);
-	spi_master_put(xspi->bitbang.master);
-
-	return 0;
-}
-
-/* work with hotplug and coldplug */
-MODULE_ALIAS("platform:" XILINX_SPI_NAME);
-
-static int __exit xilinx_spi_of_remove(struct of_device *op)
-{
-	return xilinx_spi_remove(op);
+	xspi->cr_offset = XSPI_CR_OFFSET_DEF;
+	xspi->sr_offset = XSPI_SR_OFFSET_DEF;
+	xspi->txd_offset = XSPI_TXD_OFFSET_DEF;
+	xspi->rxd_offset = XSPI_RXD_OFFSET_DEF;
+	xspi->ssr_offset = XSPI_SSR_OFFSET_DEF;
 }
+EXPORT_SYMBOL(xilinx_spi_set_default_reg_offsets);
 
-static struct of_device_id xilinx_spi_of_match[] = {
-	{ .compatible = "xlnx,xps-spi-2.00.a", },
-	{ .compatible = "xlnx,xps-spi-2.00.b", },
-	{}
-};
-
-MODULE_DEVICE_TABLE(of, xilinx_spi_of_match);
-
-static struct of_platform_driver xilinx_spi_of_driver = {
-	.owner = THIS_MODULE,
-	.name = "xilinx-xps-spi",
-	.match_table = xilinx_spi_of_match,
-	.probe = xilinx_spi_of_probe,
-	.remove = __exit_p(xilinx_spi_of_remove),
-	.driver = {
-		.name = "xilinx-xps-spi",
-		.owner = THIS_MODULE,
-	},
-};
-
-static int __init xilinx_spi_init(void)
-{
-	return of_register_platform_driver(&xilinx_spi_of_driver);
-}
-module_init(xilinx_spi_init);
-
-static void __exit xilinx_spi_exit(void)
-{
-	of_unregister_platform_driver(&xilinx_spi_of_driver);
-}
-module_exit(xilinx_spi_exit);
 MODULE_AUTHOR("MontaVista Software, Inc. <source@mvista.com>");
 MODULE_DESCRIPTION("Xilinx SPI driver");
 MODULE_LICENSE("GPL");
diff -uNr linux-2.6.29-clean/drivers/spi/xilinx_spi.h linux-2.6.29/drivers/spi/xilinx_spi.h
--- linux-2.6.29-clean/drivers/spi/xilinx_spi.h	1969-12-31 16:00:00.000000000 -0800
+++ linux-2.6.29/drivers/spi/xilinx_spi.h	2009-04-06 13:51:47.000000000 -0700
@@ -0,0 +1,52 @@
+/*
+ * xilinx_spi.c
+ *
+ * Xilinx SPI controller driver (master mode only)
+ *
+ * Author: MontaVista Software, Inc.
+ *	source@mvista.com
+ *
+ * 2002-2007 (c) MontaVista Software, Inc.  This file is licensed under the
+ * terms of the GNU General Public License version 2.  This program is licensed
+ * "as is" without any warranty of any kind, whether express or implied.
+ */
+
+#ifndef _XILINX_SPI_H_
+#define _XILINX_SPI_H_ 1
+
+#include <linux/spi/spi.h>
+#include <linux/spi/spi_bitbang.h>
+
+#define XILINX_SPI_NAME "xilinx_spi"
+
+
+struct xilinx_spi {
+	/* bitbang has to be first */
+	struct spi_bitbang bitbang;
+	struct completion done;
+
+	void __iomem	*regs;	/* virt. address of the control registers */
+
+	u32		irq;
+
+	u32		speed_hz; /* SCK has a fixed frequency of speed_hz Hz */
+
+	u8 *rx_ptr;		/* pointer in the Tx buffer */
+	const u8 *tx_ptr;	/* pointer in the Rx buffer */
+	int remaining_bytes;	/* the number of bytes left to transfer */
+	/* offset to the XSPI regs, these might vary... */
+	u8 cr_offset;
+	u8 sr_offset;
+	u8 txd_offset;
+	u8 rxd_offset;
+	u8 ssr_offset;
+};
+
+void xspi_init_hw(struct xilinx_spi *xspi);
+void xilinx_spi_set_default_reg_offsets(struct xilinx_spi *xspi);
+void xilinx_spi_chipselect(struct spi_device *spi, int is_on);
+int xilinx_spi_setup_transfer(struct spi_device *spi, struct spi_transfer *t);
+int xilinx_spi_setup(struct spi_device *spi);
+int xilinx_spi_txrx_bufs(struct spi_device *spi, struct spi_transfer *t);
+irqreturn_t xilinx_spi_irq(int irq, void *dev_id);
+#endif
diff -uNr linux-2.6.29-clean/drivers/spi/xilinx_spi_of.c linux-2.6.29/drivers/spi/xilinx_spi_of.c
--- linux-2.6.29-clean/drivers/spi/xilinx_spi_of.c	1969-12-31 16:00:00.000000000 -0800
+++ linux-2.6.29/drivers/spi/xilinx_spi_of.c	2009-04-06 13:51:47.000000000 -0700
@@ -0,0 +1,193 @@
+/*
+ * xilinx_spi.c
+ *
+ * Xilinx SPI controller driver (master mode only)
+ *
+ * Author: MontaVista Software, Inc.
+ *	source@mvista.com
+ *
+ * 2002-2007 (c) MontaVista Software, Inc.  This file is licensed under the
+ * terms of the GNU General Public License version 2.  This program is licensed
+ * "as is" without any warranty of any kind, whether express or implied.
+ */
+
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/io.h>
+#include <linux/platform_device.h>
+
+#include <linux/of_platform.h>
+#include <linux/of_device.h>
+#include <linux/of_spi.h>
+
+#include <linux/spi/spi.h>
+#include <linux/spi/spi_bitbang.h>
+
+#include "xilinx_spi.h"
+
+
+static int __init xilinx_spi_of_probe(struct of_device *ofdev,
+					const struct of_device_id *match)
+{
+	struct spi_master *master;
+	struct xilinx_spi *xspi;
+	struct resource r_irq_struct;
+	struct resource r_mem_struct;
+
+	struct resource *r_irq = &r_irq_struct;
+	struct resource *r_mem = &r_mem_struct;
+	int rc = 0;
+	const u32 *prop;
+	int len;
+
+	/* Get resources(memory, IRQ) associated with the device */
+	master = spi_alloc_master(&ofdev->dev, sizeof(struct xilinx_spi));
+
+	if (master == NULL)
+		return -ENOMEM;
+
+	dev_set_drvdata(&ofdev->dev, master);
+
+	rc = of_address_to_resource(ofdev->node, 0, r_mem);
+	if (rc) {
+		dev_warn(&ofdev->dev, "invalid address\n");
+		goto put_master;
+	}
+
+	rc = of_irq_to_resource(ofdev->node, 0, r_irq);
+	if (rc == NO_IRQ) {
+		dev_warn(&ofdev->dev, "no IRQ found\n");
+		goto put_master;
+	}
+
+	xspi = spi_master_get_devdata(master);
+	xspi->bitbang.master = spi_master_get(master);
+	xspi->bitbang.chipselect = xilinx_spi_chipselect;
+	xspi->bitbang.setup_transfer = xilinx_spi_setup_transfer;
+	xspi->bitbang.txrx_bufs = xilinx_spi_txrx_bufs;
+	xspi->bitbang.master->setup = xilinx_spi_setup;
+	init_completion(&xspi->done);
+
+	xspi->irq = r_irq->start;
+
+	if (!request_mem_region(r_mem->start,
+			r_mem->end - r_mem->start + 1, XILINX_SPI_NAME)) {
+		rc = -ENXIO;
+		dev_warn(&ofdev->dev, "memory request failure\n");
+		goto put_master;
+	}
+
+	xspi->regs = ioremap(r_mem->start, r_mem->end - r_mem->start + 1);
+	if (xspi->regs == NULL) {
+		rc = -ENOMEM;
+		dev_warn(&ofdev->dev, "ioremap failure\n");
+		goto put_master;
+	}
+	xspi->irq = r_irq->start;
+
+	/* dynamic bus assignment */
+	master->bus_num = -1;
+
+	/* number of slave select bits is required */
+	prop = of_get_property(ofdev->node, "xlnx,num-ss-bits", &len);
+	if (!prop || len < sizeof(*prop)) {
+		dev_warn(&ofdev->dev, "no 'xlnx,num-ss-bits' property\n");
+		goto put_master;
+	}
+	master->num_chipselect = *prop;
+
+	xilinx_spi_set_default_reg_offsets(xspi);
+
+	/* SPI controller initializations */
+	xspi_init_hw(xspi->regs);
+
+	/* Register for SPI Interrupt */
+	rc = request_irq(xspi->irq, xilinx_spi_irq, 0, XILINX_SPI_NAME, xspi);
+	if (rc != 0) {
+		dev_warn(&ofdev->dev, "irq request failure: %d\n", xspi->irq);
+		goto unmap_io;
+	}
+
+	rc = spi_bitbang_start(&xspi->bitbang);
+	if (rc != 0) {
+		dev_err(&ofdev->dev, "spi_bitbang_start FAILED\n");
+		goto free_irq;
+	}
+
+	dev_info(&ofdev->dev, "at 0x%08X mapped to 0x%08X, irq=%d\n",
+			(unsigned int)r_mem->start, (u32)xspi->regs, xspi->irq);
+
+	/* Add any subnodes on the SPI bus */
+	of_register_spi_devices(master, ofdev->node);
+
+	return rc;
+
+free_irq:
+	free_irq(xspi->irq, xspi);
+unmap_io:
+	iounmap(xspi->regs);
+put_master:
+	spi_master_put(master);
+	return rc;
+}
+
+static int __devexit xilinx_spi_remove(struct of_device *ofdev)
+{
+	struct xilinx_spi *xspi;
+	struct spi_master *master;
+
+	master = platform_get_drvdata(ofdev);
+	xspi = spi_master_get_devdata(master);
+
+	spi_bitbang_stop(&xspi->bitbang);
+	free_irq(xspi->irq, xspi);
+	iounmap(xspi->regs);
+	dev_set_drvdata(&ofdev->dev, 0);
+	spi_master_put(xspi->bitbang.master);
+
+	return 0;
+}
+
+/* work with hotplug and coldplug */
+MODULE_ALIAS("platform:" XILINX_SPI_NAME);
+
+static int __exit xilinx_spi_of_remove(struct of_device *op)
+{
+	return xilinx_spi_remove(op);
+}
+
+static struct of_device_id xilinx_spi_of_match[] = {
+	{ .compatible = "xlnx,xps-spi-2.00.a", },
+	{ .compatible = "xlnx,xps-spi-2.00.b", },
+	{}
+};
+
+MODULE_DEVICE_TABLE(of, xilinx_spi_of_match);
+
+static struct of_platform_driver xilinx_spi_of_driver = {
+	.owner = THIS_MODULE,
+	.name = "xilinx-xps-spi",
+	.match_table = xilinx_spi_of_match,
+	.probe = xilinx_spi_of_probe,
+	.remove = __exit_p(xilinx_spi_of_remove),
+	.driver = {
+		.name = "xilinx-xps-spi",
+		.owner = THIS_MODULE,
+	},
+};
+
+static int __init xilinx_spi_init(void)
+{
+	return of_register_platform_driver(&xilinx_spi_of_driver);
+}
+module_init(xilinx_spi_init);
+
+static void __exit xilinx_spi_exit(void)
+{
+	of_unregister_platform_driver(&xilinx_spi_of_driver);
+}
+module_exit(xilinx_spi_exit);
+MODULE_AUTHOR("MontaVista Software, Inc. <source@mvista.com>");
+MODULE_DESCRIPTION("Xilinx SPI driver");
+MODULE_LICENSE("GPL");
diff -uNr linux-2.6.29-clean/drivers/spi/xilinx_spi_pltfm.c linux-2.6.29/drivers/spi/xilinx_spi_pltfm.c
--- linux-2.6.29-clean/drivers/spi/xilinx_spi_pltfm.c	1969-12-31 16:00:00.000000000 -0800
+++ linux-2.6.29/drivers/spi/xilinx_spi_pltfm.c	2009-04-06 13:51:47.000000000 -0700
@@ -0,0 +1,184 @@
+/*
+ * xilinx_spi_pltfm.c Support for Xilinx SPI platform devices
+ * Copyright (c) 2009 Intel Corporation
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/* Supports:
+ * Xilinx SPI devices as platform devices
+ *
+ * Inspired by xilinx_spi.c, 2002-2007 (c) MontaVista Software, Inc.
+ */
+
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/io.h>
+#include <linux/platform_device.h>
+
+#include <linux/spi/spi.h>
+#include <linux/spi/spi_bitbang.h>
+#include <linux/spi/xilinx_spi.h>
+
+#include "xilinx_spi.h"
+
+static int __init xilinx_spi_probe(struct platform_device *dev)
+{
+	int ret = 0;
+	struct spi_master *master;
+	struct xilinx_spi *xspi;
+	struct xspi_platform_data *pdata;
+	struct resource *r;
+
+	master = spi_alloc_master(&dev->dev, sizeof(struct xilinx_spi));
+
+	if (master == NULL)
+		return -ENOMEM;
+
+
+	platform_set_drvdata(dev, master);
+	pdata = dev->dev.platform_data;
+	if (pdata == NULL) {
+		ret = -ENODEV;
+		goto put_master;
+	}
+
+	r = platform_get_resource(dev, IORESOURCE_MEM, 0);
+	if (r == NULL) {
+		ret = -ENODEV;
+		goto put_master;
+	}
+
+	xspi = spi_master_get_devdata(master);
+	xspi->bitbang.master = spi_master_get(master);
+	xspi->bitbang.chipselect = xilinx_spi_chipselect;
+	xspi->bitbang.setup_transfer = xilinx_spi_setup_transfer;
+	xspi->bitbang.txrx_bufs = xilinx_spi_txrx_bufs;
+	xspi->bitbang.master->setup = xilinx_spi_setup;
+	init_completion(&xspi->done);
+
+	if (!request_mem_region(r->start, resource_size(r), XILINX_SPI_NAME)) {
+		ret = -ENXIO;
+		goto put_master;
+	}
+
+	xspi->regs = ioremap(r->start, resource_size(r));
+	if (xspi->regs == NULL) {
+		ret = -ENOMEM;
+		goto map_failed;
+	}
+
+	ret = platform_get_irq(dev, 0);
+	if (ret < 0) {
+		ret = -ENXIO;
+		goto unmap_io;
+	}
+	xspi->irq = ret;
+
+	master->bus_num = pdata->bus_num;
+	master->num_chipselect = pdata->num_chipselect;
+	xspi->speed_hz = pdata->speed_hz;
+	xilinx_spi_set_default_reg_offsets(xspi);
+	if (pdata->cr_offset)
+		xspi->cr_offset = pdata->cr_offset;
+	if (pdata->sr_offset)
+		xspi->sr_offset = pdata->sr_offset;
+	if (pdata->txd_offset)
+		xspi->txd_offset = pdata->txd_offset;
+	if (pdata->rxd_offset)
+		xspi->rxd_offset = pdata->rxd_offset;
+	if (pdata->ssr_offset)
+		xspi->ssr_offset = pdata->ssr_offset;
+
+	/* SPI controller initializations */
+	xspi_init_hw(xspi);
+
+	/* Register for SPI Interrupt */
+	ret = request_irq(xspi->irq, xilinx_spi_irq, 0, XILINX_SPI_NAME, xspi);
+	if (ret != 0)
+		goto unmap_io;
+
+	ret = spi_bitbang_start(&xspi->bitbang);
+	if (ret != 0) {
+		dev_err(&dev->dev, "spi_bitbang_start FAILED\n");
+		goto free_irq;
+	}
+
+	dev_info(&dev->dev, "at 0x%08X mapped to 0x%08X, irq=%d\n",
+			(u32)r->start, (u32)xspi->regs, xspi->irq);
+	return ret;
+
+free_irq:
+	free_irq(xspi->irq, xspi);
+unmap_io:
+	iounmap(xspi->regs);
+map_failed:
+	release_mem_region(r->start, resource_size(r));
+put_master:
+	spi_master_put(master);
+	return ret;
+}
+
+static int __devexit xilinx_spi_remove(struct platform_device *dev)
+{
+	struct xilinx_spi *xspi;
+	struct spi_master *master;
+	struct resource *r;
+
+	master = platform_get_drvdata(dev);
+	xspi = spi_master_get_devdata(master);
+	r = platform_get_resource(dev, IORESOURCE_MEM, 0);
+
+	spi_bitbang_stop(&xspi->bitbang);
+	free_irq(xspi->irq, xspi);
+	iounmap(xspi->regs);
+
+	if (r)
+		release_mem_region(r->start, resource_size(r));
+
+	platform_set_drvdata(dev, 0);
+	spi_master_put(xspi->bitbang.master);
+
+	return 0;
+}
+
+/* work with hotplug and coldplug */
+MODULE_ALIAS("platform:" XILINX_SPI_NAME);
+
+static struct platform_driver xilinx_spi_driver = {
+	.probe	= xilinx_spi_probe,
+	.remove	= __devexit_p(xilinx_spi_remove),
+	.driver = {
+		.name = XILINX_SPI_NAME,
+		.owner = THIS_MODULE,
+	},
+};
+
+static int __init xilinx_spi_init(void)
+{
+	return platform_driver_register(&xilinx_spi_driver);
+}
+module_init(xilinx_spi_init);
+
+static void __exit xilinx_spi_exit(void)
+{
+	platform_driver_unregister(&xilinx_spi_driver);
+}
+module_exit(xilinx_spi_exit);
+
+MODULE_AUTHOR("Mocean Laboratories <info@mocean-labs.com>");
+MODULE_DESCRIPTION("Xilinx SPI platform driver");
+MODULE_LICENSE("GPL v2");
+
diff -uNr linux-2.6.29-clean/include/linux/i2c-ocores.h linux-2.6.29/include/linux/i2c-ocores.h
--- linux-2.6.29-clean/include/linux/i2c-ocores.h	2009-04-01 09:20:20.000000000 -0700
+++ linux-2.6.29/include/linux/i2c-ocores.h	2009-04-06 13:51:47.000000000 -0700
@@ -14,6 +14,8 @@
 struct ocores_i2c_platform_data {
 	u32 regstep;   /* distance between registers */
 	u32 clock_khz; /* input clock in kHz */
+	u8 num_devices; /* number of devices in the devices list */
+	struct i2c_board_info const *devices; /* devices connected to the bus */
 };
 
 #endif /* _LINUX_I2C_OCORES_H */
diff -uNr linux-2.6.29-clean/include/linux/mfd/timbdma.h linux-2.6.29/include/linux/mfd/timbdma.h
--- linux-2.6.29-clean/include/linux/mfd/timbdma.h	1969-12-31 16:00:00.000000000 -0800
+++ linux-2.6.29/include/linux/mfd/timbdma.h	2009-04-06 13:51:47.000000000 -0700
@@ -0,0 +1,80 @@
+/*
+ * timbdma.h timberdale FPGA DMA driver defines
+ * Copyright (c) 2009 Intel Corporation
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/* Supports:
+ * Timberdale FPGA DMA engine
+ */
+
+#ifndef _TIMBDMA_H
+#define _TIMBDMA_H
+
+#include <linux/spinlock.h>
+
+
+#define DMA_IRQ_UART_RX		0x01
+#define DMA_IRQ_UART_TX		0x02
+#define DMA_IRQ_MLB_RX		0x04
+#define DMA_IRQ_MLB_TX		0x08
+#define DMA_IRQ_VIDEO_RX	0x10
+#define DMA_IRQ_VIDEO_DROP	0x20
+#define DMA_IRQS		6
+
+
+typedef int (*timbdma_interruptcb)(u32 flag, void *data);
+
+enum timbdma_ctrlmap {
+	timbdma_ctrlmap_DMACFGBTUART = 0x000000,
+	timbdma_ctrlmap_DMACFGMLBSY  = 0x000040,
+	timbdma_ctrlmap_DMACFGVIDEO  = 0x000080,
+	timbdma_ctrlmap_TIMBSTATUS   = 0x080000,
+	timbdma_ctrlmap_TIMBPEND     = 0x080004,
+	timbdma_ctrlmap_TIMBENABLE   = 0x080008,
+	timbdma_ctrlmap_VIDEOBUFFER  = 0x200000
+};
+
+enum timbdma_dmacfg {
+	timbdma_dmacfg_RXSTARTH  = 0x00,
+	timbdma_dmacfg_RXSTARTL  = 0x04,
+	timbdma_dmacfg_RXLENGTH  = 0x08,
+	timbdma_dmacfg_RXFPGAWP  = 0x0C,
+	timbdma_dmacfg_RXSWRP    = 0x10,
+	timbdma_dmacfg_RXENABLE  = 0x14,
+	timbdma_dmacfg_TXSTARTH  = 0x18,
+	timbdma_dmacfg_TXSTARTL  = 0x1C,
+	timbdma_dmacfg_TXLENGTH  = 0x20,
+	timbdma_dmacfg_TXSWWP    = 0x24,
+	timbdma_dmacfg_TXFPGARP  = 0x28,
+	timbdma_dmacfg_TXBEFINT  = 0x2C,
+	timbdma_dmacfg_BPERROW   = 0x30
+};
+
+struct timbdma_dev {
+	void __iomem		*membase;
+	timbdma_interruptcb	callbacks[DMA_IRQS];
+	void			*callback_data[DMA_IRQS];
+	spinlock_t		lock; /* mutual exclusion */
+};
+
+void timb_start_dma(u32 flag, unsigned long buf, int len, int bytes_per_row);
+
+void *timb_stop_dma(u32 flags);
+
+void timb_set_dma_interruptcb(u32 flags, timbdma_interruptcb icb, void *data);
+
+#endif /* _TIMBDMA_H */
+
diff -uNr linux-2.6.29-clean/include/linux/mfd/timbi2s.h linux-2.6.29/include/linux/mfd/timbi2s.h
--- linux-2.6.29-clean/include/linux/mfd/timbi2s.h	1969-12-31 16:00:00.000000000 -0800
+++ linux-2.6.29/include/linux/mfd/timbi2s.h	2009-04-06 13:51:47.000000000 -0700
@@ -0,0 +1,66 @@
+/*
+ * timbi2s.h timberdale FPGA I2S driver
+ * Copyright (c) 2009 Intel Corporation
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/* Supports:
+ * Timberdale FPGA I2S
+ */
+
+struct timbi2s_bus_control {
+	struct list_head list;
+};
+
+struct timbi2s_bus {
+	void __iomem			*membase;
+	u32				irq;
+	struct timbi2s_bus_control	*control;
+	struct workqueue_struct		*workqueue;
+	struct work_struct		work;
+};
+
+struct timbi2s_dev {
+	void __iomem			*membase;
+	u32				irq;
+	struct timbi2s_bus		*bus;
+	struct workqueue_struct		*workqueue;
+	struct work_struct		work;
+	u32				ioctrl;
+	u32				devid;
+	u8				timbi2s_rx;
+	u8				timbi2s_tx;
+	struct circ_buf			*buffer;
+	/* Register access */
+	spinlock_t			lock;
+
+	int in_use;
+	u8 pscale_offset; /* Prescale */
+	u8 icr_offset; /* Clear register */
+	u8 isr_offset; /* Status */
+	u8 ipr_offset; /* Pending register */
+	u8 ier_offset; /* Interrupt Enable register */
+	u8 ctrl_offset;
+	u8 fifo;
+
+	struct list_head item;
+};
+
+static struct timbi2s_dev *timbi2s_get_tx(void);
+static struct timbi2s_dev *timbi2s_get_rx(void);
+static void timbi2s_put(struct timbi2s_dev *tdev);
+
+static int timbi2s_ioctrl(struct timbi2s_dev *i2sdev);
+
diff -uNr linux-2.6.29-clean/include/linux/serial_core.h linux-2.6.29/include/linux/serial_core.h
--- linux-2.6.29-clean/include/linux/serial_core.h	2009-04-01 09:20:20.000000000 -0700
+++ linux-2.6.29/include/linux/serial_core.h	2009-04-06 13:51:47.000000000 -0700
@@ -164,6 +164,9 @@
 /* NWPSERIAL */
 #define PORT_NWPSERIAL	85
 
+/* Timberdale UART */
+#define PORT_TIMBUART	86
+
 #ifdef __KERNEL__
 
 #include <linux/compiler.h>
diff -uNr linux-2.6.29-clean/include/linux/spi/xilinx_spi.h linux-2.6.29/include/linux/spi/xilinx_spi.h
--- linux-2.6.29-clean/include/linux/spi/xilinx_spi.h	1969-12-31 16:00:00.000000000 -0800
+++ linux-2.6.29/include/linux/spi/xilinx_spi.h	2009-04-06 13:51:47.000000000 -0700
@@ -0,0 +1,17 @@
+#ifndef __LINUX_SPI_XILINX_SPI_H
+#define __LINUX_SPI_XILINX_SPI_H
+
+/* SPI Controller IP */
+struct xspi_platform_data {
+	s16 bus_num;
+	u16 num_chipselect;
+	u32 speed_hz;
+	u8 cr_offset;
+	u8 sr_offset;
+	u8 txd_offset;
+	u8 rxd_offset;
+	u8 ssr_offset;
+};
+
+#endif /* __LINUX_SPI_XILINX_SPI_H */
+
diff -uNr linux-2.6.29-clean/include/media/adv7180.h linux-2.6.29/include/media/adv7180.h
--- linux-2.6.29-clean/include/media/adv7180.h	1969-12-31 16:00:00.000000000 -0800
+++ linux-2.6.29/include/media/adv7180.h	2009-04-06 13:51:47.000000000 -0700
@@ -0,0 +1,127 @@
+/*
+ * adv7180.h Analog Devices ADV7180 video decoder driver defines
+ * Copyright (c) 2009 Intel Corporation
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#define DRIVER_NAME "adv7180"
+
+#define I2C_ADV7180	0x42
+#define ADV7180_NR_REG	0xfc
+
+#define ADV7180_IN_CTRL		0x00 /* Input CR */
+#define ADV7180_OUT_CTRL	0x03 /* Output CR */
+#define ADV7180_EXT_OUT_CTRL	0x04 /* Extended Output CR */
+
+#define ADV7180_ADI_CTRL	0x0e /* ADI CR */
+#	define ADI_ENABLE	0x20 /* Enable access to sub-regs */
+
+#define ADV7180_SR_1	0x10	/* Status Register 1 */
+#define ADV7180_SR_2	0x12
+#define ADV7180_SR_3	0x13
+
+/* Interrupt and VDP sub-registers */
+#define ADV7180_ISR_1	0x42	/* Interrupt Status Register 1 */
+#define ADV7180_ICR_1	0x43	/* Interrupt Clear Register 1 */
+
+#define ADV7180_ISR_2	0x46
+#define ADV7180_ICR_2	0x47
+
+#define ADV7180_ISR_3	0x4a
+#define ADV7180_ICR_3	0x4b
+
+#define ADV7180_ISR_4	0x4e
+#define ADV7180_ICR_4	0x4f
+/* */
+
+#define ADV7180_SR			0x10
+#define ADV7180_STATUS_NTSM		0x00 /* NTSM M/J */
+#define ADV7180_STATUS_NTSC		0x10 /* NTSC 4.43 */
+#define ADV7180_STATUS_PAL_M		0x20 /* PAL M */
+#define ADV7180_STATUS_PAL_60		0x30 /* PAL 60 */
+#define ADV7180_STATUS_PAL		0x40 /* PAL B/G/H/I/D */
+#define ADV7180_STATUS_SECAM		0x50 /* SECAM */
+#define ADV7180_STATUS_PAL_N		0x60 /* PAL Combination N */
+#define ADV7180_STATUS_SECAM_525	0x70 /* SECAM 525 */
+
+enum input_mode {
+	CVBS,   /* Composite */
+	SVIDEO, /* S-video */
+	YPbPr,  /* Component */
+};
+
+struct adv7180 {
+	unsigned char reg[ADV7180_NR_REG];
+	int norm;
+	enum input_mode input;
+	int enable;
+	struct i2c_client *client;
+};
+
+static const unsigned char reset_icr[] = {
+	ADV7180_ICR_1, 0x00,
+	ADV7180_ICR_2, 0x00,
+	ADV7180_ICR_3, 0x00,
+	ADV7180_ICR_4, 0x00,
+};
+
+/* ADV7180 LQFP-64. ADV7180.pdf, page 104 */
+static const unsigned char init_cvbs_64[] = {
+	0x00, 0x01, /* INSEL = CVBS in on Ain2 */
+	0x04, 0x57, /* Enable SFL */
+	0x17, 0x41, /* Select SH1 */
+
+	0x31, 0x02, /* Clear NEWAV_MODE, SAV/EAV to
+		     * suit ADV video encoders
+		     */
+	0x3d, 0xa2, /* MWE enable manual window,
+		     * color kill threshold to 2
+		     */
+	0x3e, 0x6a, /* BLM optimization */
+	0x3f, 0xa0, /* BGB optimization */
+	0x0e, 0x80, /* Hidden space */
+	0x55, 0x81, /* ADC configuration */
+	0x0e, 0x00, /* User space */
+};
+
+static const unsigned char init_svideo_64[] = {
+	0x00, 0x08, /* Insel = Y/C, Y = AIN3, C = AIN6 */
+	0x04, 0x57, /* Enable SFL */
+	0x31, 0x02, /* Clear NEWAV_MODE, SAV/EAV to
+		     * suit ADV video encoders
+		     */
+	0x3d, 0xa2, /* MWE enable manual window,
+		     * color kill threshold to 2
+		     */
+	0x3e, 0x6a, /* BLM optimization */
+	0x3f, 0xa0, /* BGB optimization */
+	0x58, 0x04, /* Mandatory write. This must be
+		     * performed for correct operation.
+		     */
+	0x0e, 0x80, /* Hidden space */
+	0x55, 0x81, /* ADC configuration */
+	0x0e, 0x00, /* User space */
+};
+
+static const unsigned char init_ypbpr_64[] = {
+	0x00, 0x09, /* INSEL = YPrPb, Y = AIN1, Pr = AIN4, Pb = AIN5 */
+	0x31, 0x02, /* Clear NEWAV_MODE, SAV/EAV to suit ADV video encoders */
+	0x3d, 0xa2, /* MWE enable manual window */
+	0x3e, 0x6a, /* BLM optimization */
+	0x3f, 0xa0, /* ADI recommended */
+	0x0e, 0x80, /* Hidden space */
+	0x55, 0x81, /* ADC configuration */
+	0x0e, 0x00, /* User space */
+};