public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] Toshiba Laptop Support and IRQ Locks
@ 2002-09-10 22:25 rwhron
  0 siblings, 0 replies; 7+ messages in thread
From: rwhron @ 2002-09-10 22:25 UTC (permalink / raw)
  To: jonathan, john.weber; +Cc: linux-kernel

> Alrighty then, the patch below uses spinlocks instead of cli() and
> friends -- to conform to the new irq locking mechanism -- and some minor
> module changes while we're at it.

The patch seems mangled in:
http://marc.theaimsgroup.com/?l=linux-kernel&m=102832986723995&w=2
I'd like to try it if someone has an unmangled version.

2.5.34 compile on my toshiba tecra 8000 stopped with:

drivers/built-in.o: In function `tosh_fn_status':
drivers/built-in.o(.text+0x17569): undefined reference to `save_flags'
drivers/built-in.o(.text+0x1756e): undefined reference to `cli'
drivers/built-in.o(.text+0x1757f): undefined reference to `restore_flags'
drivers/built-in.o: In function `tosh_emulate_fan':

The patch below gets it to compile and boot.

diff -ruN linux-2.5.34/drivers/char/toshiba.c linux/drivers/char/toshiba.c
--- linux-2.5.34/drivers/char/toshiba.c 2002-05-21 01:07:42.000000000 -0400
+++ linux/drivers/char/toshiba.c        2002-09-10 17:30:27.000000000 -0400
@@ -57,6 +57,7 @@
 #define TOSH_DEBUG 0

 #include <linux/module.h>
+#include <linux/interrupt.h>
 #include <linux/version.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>

The keyboard isn't working though.  That may be a config issue.

egrep ^C.*INPUT .config
CONFIG_INPUT=y
CONFIG_INPUT_MOUSEDEV=y
CONFIG_INPUT_MOUSEDEV_PSAUX=y
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
CONFIG_INPUT_KEYBOARD=y

I haven't tried 2.5 on the laptop for a long time.  
Anyone running 2.5 on a toshiba laptop?  A tecra 8000?

-- 
Randy Hron
http://home.earthlink.net/~rwhron/kernel/bigbox.html


^ permalink raw reply	[flat|nested] 7+ messages in thread
* [PATCH] Toshiba Laptop Support and IRQ Locks
@ 2002-08-02 16:03 John Weber
  2002-08-02 17:55 ` Alan Cox
  0 siblings, 1 reply; 7+ messages in thread
From: John Weber @ 2002-08-02 16:03 UTC (permalink / raw)
  To: linux-kernel

Hi,

Toshiba laptop support is broken.  Here's my rookie attempt at fixing it.

--- linux-2.5.30/drivers/char/toshiba.c	2002-08-01 17:16:39.000000000 -0400
+++ linux-bleed/drivers/char/toshiba.c	2002-08-02 11:37:14.000000000 -0400
@@ -82,6 +82,8 @@

  static int tosh_fn = 0;

+extern rwlock_t tosh_lock;
+
  MODULE_PARM(tosh_fn, "i");

  MODULE_LICENSE("GPL");
@@ -114,11 +116,10 @@
  	if (tosh_fn!=0) {
  		scan = inb(tosh_fn);
  	} else {
- 
	save_flags(flags);
- 
	cli();
+ 
         write_lock_irq(&tosh_lock);
  		outb(0x8e, 0xe4);
  		scan = inb(0xe5);
- 
	restore_flags(flags);
+ 
	write_unlock_irq(&tosh_lock);
  	}

          return (int) scan;
@@ -141,35 +142,32 @@
  	if (tosh_id==0xfccb) {
  		if (eax==0xfe00) {
  	 
	/* fan status */
- 
		save_flags(flags);
- 
		cli();
+ 
	        write_lock_irq(&tosh_lock);
  	 
	outb(0xbe, 0xe4);
  	 
	al = inb(0xe5);
- 
		restore_flags(flags);
+ 
		write_unlock_irq(&tosh_lock);
  	 
	regs->eax = 0x00;
  	 
	regs->ecx = (unsigned int) (al & 0x01);
  		}
  		if ((eax==0xff00) && (ecx==0x0000)) {
  	 
	/* fan off */
- 
		save_flags(flags);
- 
		cli();
+ 
	        write_lock_irq(&tosh_lock);
  	 
	outb(0xbe, 0xe4);
  	 
	al = inb(0xe5);
  	 
	outb(0xbe, 0xe4);
  	 
	outb (al | 0x01, 0xe5);
- 
		restore_flags(flags);
+ 
		write_unlock_irq(&tosh_lock);
  	 
	regs->eax = 0x00;
  	 
	regs->ecx = 0x00;
  		}
  		if ((eax==0xff00) && (ecx==0x0001)) {
  	 
	/* fan on */
- 
		save_flags(flags);
- 
		cli();
+ 
	        write_lock_irq(&tosh_lock);
  	 
	outb(0xbe, 0xe4);
  	 
	al = inb(0xe5);
  	 
	outb(0xbe, 0xe4);
  	 
	outb(al & 0xfe, 0xe5);
- 
		restore_flags(flags);
+ 
		write_unlock_irq(&tosh_lock);
  	 
	regs->eax = 0x00;
  	 
	regs->ecx = 0x01;
  		}
@@ -180,33 +178,30 @@
  	if (tosh_id==0xfccc) {
  		if (eax==0xfe00) {
  	 
	/* fan status */
- 
		save_flags(flags);
- 
		cli();
+ 
	        write_lock_irq(&tosh_lock);
  	 
	outb(0xe0, 0xe4);
  	 
	al = inb(0xe5);
- 
		restore_flags(flags);
+ 
		write_unlock_irq(&tosh_lock);
  	 
	regs->eax = 0x00;
  	 
	regs->ecx = al & 0x01;
  		}
  		if ((eax==0xff00) && (ecx==0x0000)) {
  	 
	/* fan off */
- 
		save_flags(flags);
- 
		cli();
+ 
	        write_lock_irq(&tosh_lock);
  	 
	outb(0xe0, 0xe4);
  	 
	al = inb(0xe5);
  	 
	outw(0xe0 | ((al & 0xfe) << 8), 0xe4);
- 
		restore_flags(flags);
+ 
		write_unlock_irq(&tosh_lock);
  	 
	regs->eax = 0x00;
  	 
	regs->ecx = 0x00;
  		}
  		if ((eax==0xff00) && (ecx==0x0001)) {
  	 
	/* fan on */
- 
		save_flags(flags);
- 
		cli();
+ 
	        write_lock_irq(&tosh_lock);
  	 
	outb(0xe0, 0xe4);
  	 
	al = inb(0xe5);
  	 
	outw(0xe0 | ((al | 0x01) << 8), 0xe4);
- 
		restore_flags(flags);
+ 
		write_unlock_irq(&tosh_lock);
  	 
	regs->eax = 0x00;
  	 
	regs->ecx = 0x01;
  		}


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2002-09-10 22:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-10 22:25 [PATCH] Toshiba Laptop Support and IRQ Locks rwhron
  -- strict thread matches above, loose matches on Subject: below --
2002-08-02 16:03 John Weber
2002-08-02 17:55 ` Alan Cox
2002-08-02 19:40   ` Jonathan Buzzard
2002-08-02 19:49     ` Brian Gerst
2002-08-04  4:27       ` Jonathan Buzzard
2002-08-02 23:05   ` John Weber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox