X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fchar%2Ftoshiba.c;fp=drivers%2Fchar%2Ftoshiba.c;h=0c6f521abd0e37ec25c0f726d4fa26661475fcda;hb=64ba3f394c830ec48a1c31b53dcae312c56f1604;hp=dd36fd04a8421c8c873e7754408ca196de64eaf7;hpb=be1e6109ac94a859551f8e1774eb9a8469fe055c;p=linux-2.6.git diff --git a/drivers/char/toshiba.c b/drivers/char/toshiba.c index dd36fd04a..0c6f521ab 100644 --- a/drivers/char/toshiba.c +++ b/drivers/char/toshiba.c @@ -92,7 +92,7 @@ static int tosh_ioctl(struct inode *, struct file *, unsigned int, unsigned long); -static const struct file_operations tosh_fops = { +static struct file_operations tosh_fops = { .owner = THIS_MODULE, .ioctl = tosh_ioctl, }; @@ -355,14 +355,14 @@ static void tosh_set_fn_port(void) /* * Get the machine identification number of the current model */ -static int tosh_get_machine_id(void __iomem *bios) +static int tosh_get_machine_id(void) { int id; SMMRegisters regs; unsigned short bx,cx; unsigned long address; - id = (0x100*(int) readb(bios+0xfffe))+((int) readb(bios+0xfffa)); + id = (0x100*(int) isa_readb(0xffffe))+((int) isa_readb(0xffffa)); /* do we have a SCTTable machine identication number on our hands */ @@ -388,12 +388,12 @@ static int tosh_get_machine_id(void __iomem *bios) /* now twiddle with our pointer a bit */ - address = bx; - cx = readw(bios + address); - address = 9+bx+cx; - cx = readw(bios + address); - address = 0xa+cx; - cx = readw(bios + address); + address = 0x000f0000+bx; + cx = isa_readw(address); + address = 0x000f0009+bx+cx; + cx = isa_readw(address); + address = 0x000f000a+cx; + cx = isa_readw(address); /* now construct our machine identification number */ @@ -416,18 +416,13 @@ static int tosh_probe(void) int i,major,minor,day,year,month,flag; unsigned char signature[7] = { 0x54,0x4f,0x53,0x48,0x49,0x42,0x41 }; SMMRegisters regs; - void __iomem *bios = ioremap(0xf0000, 0x10000); - - if (!bios) - return -ENOMEM; /* extra sanity check for the string "TOSHIBA" in the BIOS because some machines that are not Toshiba's pass the next test */ for (i=0;i<7;i++) { - if (readb(bios+0xe010+i)!=signature[i]) { + if (isa_readb(0xfe010+i)!=signature[i]) { printk("toshiba: not a supported Toshiba laptop\n"); - iounmap(bios); return -ENODEV; } } @@ -443,7 +438,6 @@ static int tosh_probe(void) if ((flag==1) || ((regs.eax & 0xff00)==0x8600)) { printk("toshiba: not a supported Toshiba laptop\n"); - iounmap(bios); return -ENODEV; } @@ -453,19 +447,19 @@ static int tosh_probe(void) /* next get the machine ID of the current laptop */ - tosh_id = tosh_get_machine_id(bios); + tosh_id = tosh_get_machine_id(); /* get the BIOS version */ - major = readb(bios+0xe009)-'0'; - minor = ((readb(bios+0xe00b)-'0')*10)+(readb(bios+0xe00c)-'0'); + major = isa_readb(0xfe009)-'0'; + minor = ((isa_readb(0xfe00b)-'0')*10)+(isa_readb(0xfe00c)-'0'); tosh_bios = (major*0x100)+minor; /* get the BIOS date */ - day = ((readb(bios+0xfff5)-'0')*10)+(readb(bios+0xfff6)-'0'); - month = ((readb(bios+0xfff8)-'0')*10)+(readb(bios+0xfff9)-'0'); - year = ((readb(bios+0xfffb)-'0')*10)+(readb(bios+0xfffc)-'0'); + day = ((isa_readb(0xffff5)-'0')*10)+(isa_readb(0xffff6)-'0'); + month = ((isa_readb(0xffff8)-'0')*10)+(isa_readb(0xffff9)-'0'); + year = ((isa_readb(0xffffb)-'0')*10)+(isa_readb(0xffffc)-'0'); tosh_date = (((year-90) & 0x1f)<<10) | ((month & 0xf)<<6) | ((day & 0x1f)<<1); @@ -482,8 +476,6 @@ static int tosh_probe(void) if ((tosh_id==0xfccb) || (tosh_id==0xfccc)) tosh_fan = 1; - iounmap(bios); - return 0; }