3 * Initialization code for OPTI MAD16 interface chip by
4 * Davor Jadrijevic <davor@emard.pub.hr>
5 * (Included by ad1848.c when MAD16 support is enabled)
7 * It looks like MAD16 is similar than the Mozart chip (OAK OTI-601).
8 * It could be even possible that these chips are exactly the same. Can
9 * anybody confirm this?
12 static void wr_a_mad16(int base, int v, int a)
18 static void wr_b_mad16(int base, int v, int a)
25 static int rd_a_mad16(int base, int a)
28 return INB(base + 0x11);
32 static int rd_b_mad16(int base, int a)
35 return INB(base + 0xd);
39 static int rd_0_mad16(int base, int a)
42 return INB(base + 0xf);
45 static void wr_ad(int base, int v, int a)
51 static int rd_ad(int base, int a)
58 static int mad16init(int adr)
63 static int ad1848_bases[] =
64 { 0x220, -1, -1, 0x240, -1, -1, -1, -1, 0x530, 0xE80, 0xF40, 0x604, 0 };
66 int mad16_base = 0xf80, ad1848_base;
69 for(j = 0; (j < 16) && (ad1848_bases[j] != 0); j++)
70 if(adr == ad1848_bases[j])
73 if( (ad1848_base = ad1848_bases[j]) < 0x530)
75 printk("Unknown MAD16 setting 0x%3X\n", adr);
79 /* printk("OPTi MAD16 WSS at 0x%3X\n", ad1848_base); */
81 rd_b_mad16(mad16_base, 0xe2);
82 wr_a_mad16(mad16_base, 0x1a, 0xe2);
83 wr_b_mad16(mad16_base, j * 16 + 1, 0xe2);
84 wr_a_mad16(mad16_base, 0x1a, 0xe2);
85 for( i = 0; i < 10000; i++)
86 if( (INB(ad1848_base+4) & 0x80) == 0 )