summaryrefslogtreecommitdiff
path: root/wcfxs.c
diff options
context:
space:
mode:
Diffstat (limited to 'wcfxs.c')
-rwxr-xr-xwcfxs.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/wcfxs.c b/wcfxs.c
index 9b33b04..228cfcc 100755
--- a/wcfxs.c
+++ b/wcfxs.c
@@ -279,6 +279,12 @@ static inline void write_8bits(struct wcfxs *wc, unsigned char bits)
{
/* Drop chip select */
int x;
+ wc->ios |= BIT_SCLK;
+ outb(wc->ios, wc->ioaddr + WC_AUXD);
+ outb(wc->ios, wc->ioaddr + WC_AUXD);
+ outb(wc->ios, wc->ioaddr + WC_AUXD);
+ outb(wc->ios, wc->ioaddr + WC_AUXD);
+ outb(wc->ios, wc->ioaddr + WC_AUXD);
wc->ios &= ~BIT_CS;
outb(wc->ios, wc->ioaddr + WC_AUXD);
for (x=0;x<8;x++) {
@@ -289,9 +295,13 @@ static inline void write_8bits(struct wcfxs *wc, unsigned char bits)
wc->ios &= ~BIT_SDI;
wc->ios &= ~BIT_SCLK;
outb(wc->ios, wc->ioaddr + WC_AUXD);
+ outb(wc->ios, wc->ioaddr + WC_AUXD);
+ outb(wc->ios, wc->ioaddr + WC_AUXD);
/* Now raise SCLK high again and repeat */
wc->ios |= BIT_SCLK;
outb(wc->ios, wc->ioaddr + WC_AUXD);
+ outb(wc->ios, wc->ioaddr + WC_AUXD);
+ outb(wc->ios, wc->ioaddr + WC_AUXD);
bits <<= 1;
}
/* Finally raise CS back high again */
@@ -300,21 +310,29 @@ static inline void write_8bits(struct wcfxs *wc, unsigned char bits)
outb(wc->ios, wc->ioaddr + WC_AUXD);
outb(wc->ios, wc->ioaddr + WC_AUXD);
outb(wc->ios, wc->ioaddr + WC_AUXD);
+ outb(wc->ios, wc->ioaddr + WC_AUXD);
+ outb(wc->ios, wc->ioaddr + WC_AUXD);
+ outb(wc->ios, wc->ioaddr + WC_AUXD);
+ outb(wc->ios, wc->ioaddr + WC_AUXD);
}
static inline unsigned char read_8bits(struct wcfxs *wc)
{
unsigned char res=0, c;
int x;
+ wc->ios |= BIT_SCLK;
+ outb(wc->ios, wc->ioaddr + WC_AUXD);
+ outb(wc->ios, wc->ioaddr + WC_AUXD);
/* Drop chip select */
wc->ios &= ~BIT_CS;
outb(wc->ios, wc->ioaddr + WC_AUXD);
+ outb(wc->ios, wc->ioaddr + WC_AUXD);
for (x=0;x<8;x++) {
res <<= 1;
/* Get SCLK */
wc->ios &= ~BIT_SCLK;
outb(wc->ios, wc->ioaddr + WC_AUXD);
-
+ outb(wc->ios, wc->ioaddr + WC_AUXD);
/* Read back the value */
c = inb(wc->ioaddr + WC_AUXR);
if (c & BIT_SDO)
@@ -322,6 +340,9 @@ static inline unsigned char read_8bits(struct wcfxs *wc)
/* Now raise SCLK high again */
wc->ios |= BIT_SCLK;
outb(wc->ios, wc->ioaddr + WC_AUXD);
+ outb(wc->ios, wc->ioaddr + WC_AUXD);
+ outb(wc->ios, wc->ioaddr + WC_AUXD);
+ outb(wc->ios, wc->ioaddr + WC_AUXD);
}
/* Finally raise CS back high again */
wc->ios |= BIT_CS;
@@ -329,6 +350,8 @@ static inline unsigned char read_8bits(struct wcfxs *wc)
outb(wc->ios, wc->ioaddr + WC_AUXD);
outb(wc->ios, wc->ioaddr + WC_AUXD);
outb(wc->ios, wc->ioaddr + WC_AUXD);
+ wc->ios &= ~BIT_SCLK;
+ outb(wc->ios, wc->ioaddr + WC_AUXD);
/* And return our result */
return res;
@@ -500,10 +523,12 @@ static int wcfxs_proslic_insane(struct wcfxs *wc, int card)
if (debug)
printk("ProSLIC on module %d, product %d, version %d\n", card, (blah & 0x30) >> 4, (blah & 0xf));
+#if 0
if ((blah & 0x30) >> 4) {
printk("ProSLIC on module %d is not a 3210.\n", card);
return -1;
}
+#endif
if ((blah & 0xf) < 3) {
printk("ProSLIC 3210 version %d is too old\n", blah & 0xf);
return -1;
@@ -511,7 +536,7 @@ static int wcfxs_proslic_insane(struct wcfxs *wc, int card)
blah = wcfxs_getreg(wc, card, 8);
if (blah != 0x2) {
- printk("ProSLIC on module %d insane (1)\n", card);
+ printk("ProSLIC on module %d insane (1) %d should be 2\n", card, blah);
return -1;
}
@@ -1237,3 +1262,6 @@ MODULE_LICENSE("GPL");
module_init(wcfxs_init);
module_exit(wcfxs_cleanup);
+
+
+