LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* WHATIS scan_keyb
@ 2007-02-09 15:11 Jiri Slaby
  2007-02-09 17:37 ` Andi Kleen
  0 siblings, 1 reply; 4+ messages in thread
From: Jiri Slaby @ 2007-02-09 15:11 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: Dmitry Torokhov

Hi.

What's drivers/char/scan_keyb.{c,h} for, when it's referenced in no place (aside 
a fact, that it uses some old API and hence is broken)?

$ grep -r scan_keyb *
drivers/char/scan_keyb.c: *     $Id: scan_keyb.c,v 1.2 2000/07/04 06:24:42 
yaegashi Exp $
drivers/char/scan_keyb.c:struct scan_keyboard {
drivers/char/scan_keyb.c:       struct scan_keyboard *next;
drivers/char/scan_keyb.c:static struct scan_keyboard *keyboards=NULL;
drivers/char/scan_keyb.c:       struct scan_keyboard *kbd;
drivers/char/scan_keyb.c:int register_scan_keyboard(int (*scan)(unsigned char 
*buffer),
drivers/char/scan_keyb.c:       struct scan_keyboard *kbd;
drivers/char/scan_keyb.c:       kbd = kmalloc(sizeof(struct scan_keyboard), 
GFP_KERNEL);
drivers/char/scan_keyb.h: *     $Id: scan_keyb.h,v 1.1 2000/06/10 21:45:30 
yaegashi Exp $
drivers/char/scan_keyb.h:int register_scan_keyboard(int (*scan)(unsigned char 
*buffer),

thanks,
-- 
http://www.fi.muni.cz/~xslaby/            Jiri Slaby
faculty of informatics, masaryk university, brno, cz
e-mail: jirislaby gmail com, gpg pubkey fingerprint:
B674 9967 0407 CE62 ACC8  22A0 32CC 55C3 39D4 7A7E

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

* Re: WHATIS scan_keyb
  2007-02-09 17:37 ` Andi Kleen
@ 2007-02-09 17:00   ` Dmitry Torokhov
  2007-02-09 17:06     ` [PATCH 1/1] Input: scan_keyb, remove it Jiri Slaby
  0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Torokhov @ 2007-02-09 17:00 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Jiri Slaby, Linux Kernel Mailing List

On 2/9/07, Andi Kleen <ak@suse.de> wrote:
> Jiri Slaby <jirislaby@gmail.com> writes:
>
> > Hi.
> >
> > What's drivers/char/scan_keyb.{c,h} for, when it's referenced in no
> > place (aside a fact, that it uses some old API and hence is broken)?
>
> iirc it was an interface for braille reader modules. Probably they
> never made it into tree.
>

It looks like it is a generic portion of drivers for scan-matrix
keyboards. I think we can nuke it.

-- 
Dmitry

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

* [PATCH 1/1] Input: scan_keyb, remove it
  2007-02-09 17:00   ` Dmitry Torokhov
@ 2007-02-09 17:06     ` Jiri Slaby
  0 siblings, 0 replies; 4+ messages in thread
From: Jiri Slaby @ 2007-02-09 17:06 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, Dmitry Torokhov

Dmitry Torokhov wrote:
> On 2/9/07, Andi Kleen <ak@suse.de> wrote:
> > Jiri Slaby <jirislaby@gmail.com> writes:
> >
> > > Hi.
> > >
> > > What's drivers/char/scan_keyb.{c,h} for, when it's referenced in no
> > > place (aside a fact, that it uses some old API and hence is broken)?
> >
> > iirc it was an interface for braille reader modules. Probably they
> > never made it into tree.
> 
> It looks like it is a generic portion of drivers for scan-matrix
> keyboards. I think we can nuke it.

Ok, thanks, the patch follows.

--

scan_keyb, remove it

It's currently unused (unreferenced) beside the fact it's broken.

Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>

---
commit a638eeb20ea2777e9c457d6c853cccfc0f821443
tree d5ca43cbd6da5fbc87fdb071610a9706c107b122
parent 402d1a46b4d96c5df8e4db00c62592cb66b8c292
author Jiri Slaby <jirislaby@gmail.com> Fri, 09 Feb 2007 18:03:48 +0100
committer Jiri Slaby <jirislaby@gmail.com> Fri, 09 Feb 2007 18:03:48 +0100

 drivers/char/scan_keyb.c |  148 ----------------------------------------------
 drivers/char/scan_keyb.h |   15 -----
 2 files changed, 0 insertions(+), 163 deletions(-)

diff --git a/drivers/char/scan_keyb.c b/drivers/char/scan_keyb.c
deleted file mode 100644
index 6bf551d..0000000
--- a/drivers/char/scan_keyb.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- *	$Id: scan_keyb.c,v 1.2 2000/07/04 06:24:42 yaegashi Exp $ 
- *	Copyright (C) 2000 YAEGASHI Takeshi
- *	Generic scan keyboard driver
- */
-
-#include <linux/spinlock.h>
-#include <linux/interrupt.h>
-#include <linux/tty.h>
-#include <linux/mm.h>
-#include <linux/signal.h>
-#include <linux/init.h>
-#include <linux/kbd_ll.h>
-#include <linux/delay.h>
-#include <linux/random.h>
-#include <linux/poll.h>
-#include <linux/miscdevice.h>
-#include <linux/slab.h>
-#include <linux/kbd_kern.h>
-#include <linux/timer.h>
-
-#define SCANHZ	(HZ/20)
-
-struct scan_keyboard {
-	struct scan_keyboard *next;
-	int (*scan)(unsigned char *buffer);
-	const unsigned char *table;
-	unsigned char *s0, *s1;
-	int length;
-};
-
-static int scan_jiffies=0;
-static struct scan_keyboard *keyboards=NULL;
-struct timer_list scan_timer;
-
-static void check_kbd(const unsigned char *table,
-		      unsigned char *new, unsigned char *old, int length)
-{
-	int need_tasklet_schedule=0;
-	unsigned int xor, bit;
-	
-	while(length-->0) {
-		if((xor=*new^*old)==0) {
-			table+=8;
-		}
-		else {
-			for(bit=0x01; bit<0x100; bit<<=1) {
-				if(xor&bit) {
-					handle_scancode(*table, !(*new&bit));
-					need_tasklet_schedule=1;
-#if 0
-					printk("0x%x %s\n", *table, (*new&bit)?"released":"pressed");
-#endif
-				}
-				table++;
-			}
-		}
-		new++; old++;
-	}
-
-	if(need_tasklet_schedule)
-		tasklet_schedule(&keyboard_tasklet);
-}
-
-
-static void scan_kbd(unsigned long dummy)
-{
-	struct scan_keyboard *kbd;
-
-	scan_jiffies++;
-
-	for(kbd=keyboards; kbd!=NULL; kbd=kbd->next) {
-		if(scan_jiffies&1) {
-			if(!kbd->scan(kbd->s0))
-				check_kbd(kbd->table,
-					  kbd->s0, kbd->s1, kbd->length);
-			else
-				memcpy(kbd->s0, kbd->s1, kbd->length);
-		}
-		else {
-			if(!kbd->scan(kbd->s1))
-				check_kbd(kbd->table,
-					  kbd->s1, kbd->s0, kbd->length);
-			else
-				memcpy(kbd->s1, kbd->s0, kbd->length);
-		}
-		
-	}
-
-	init_timer(&scan_timer);
-	scan_timer.expires = jiffies + SCANHZ;
-	scan_timer.data = 0;
-	scan_timer.function = scan_kbd;
-	add_timer(&scan_timer);
-}
-
-
-int register_scan_keyboard(int (*scan)(unsigned char *buffer),
-			   const unsigned char *table,
-			   int length)
-{
-	struct scan_keyboard *kbd;
-
-	kbd = kmalloc(sizeof(struct scan_keyboard), GFP_KERNEL);
-	if (kbd == NULL)
-		goto error_out;
-
-	kbd->scan=scan;
-	kbd->table=table;
-	kbd->length=length;
-
-	kbd->s0 = kmalloc(length, GFP_KERNEL);
-	if (kbd->s0 == NULL)
-		goto error_free_kbd;
-
-	kbd->s1 = kmalloc(length, GFP_KERNEL);
-	if (kbd->s1 == NULL)
-		goto error_free_s0;
-
-	memset(kbd->s0, -1, kbd->length);
-	memset(kbd->s1, -1, kbd->length);
-	
-	kbd->next=keyboards;
-	keyboards=kbd;
-
-	return 0;
-
- error_free_s0:
-	kfree(kbd->s0);
-
- error_free_kbd:
-	kfree(kbd);
-
- error_out:
-	return -ENOMEM;
-}
-			      
-			      
-void __init scan_kbd_init(void)
-{
-	init_timer(&scan_timer);
-	scan_timer.expires = jiffies + SCANHZ;
-	scan_timer.data = 0;
-	scan_timer.function = scan_kbd;
-	add_timer(&scan_timer);
-
-	printk(KERN_INFO "Generic scan keyboard driver initialized\n");
-}
diff --git a/drivers/char/scan_keyb.h b/drivers/char/scan_keyb.h
deleted file mode 100644
index b4b6112..0000000
--- a/drivers/char/scan_keyb.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifndef	__DRIVER_CHAR_SCAN_KEYB_H
-#define	__DRIVER_CHAR_SCAN_KEYB_H
-/*
- *	$Id: scan_keyb.h,v 1.1 2000/06/10 21:45:30 yaegashi Exp $
- *	Copyright (C) 2000 YAEGASHI Takeshi
- *	Generic scan keyboard driver
- */
-
-int register_scan_keyboard(int (*scan)(unsigned char *buffer),
-			   const unsigned char *table,
-			   int length);
-
-void __init scan_kbd_init(void);
-
-#endif

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

* Re: WHATIS scan_keyb
  2007-02-09 15:11 WHATIS scan_keyb Jiri Slaby
@ 2007-02-09 17:37 ` Andi Kleen
  2007-02-09 17:00   ` Dmitry Torokhov
  0 siblings, 1 reply; 4+ messages in thread
From: Andi Kleen @ 2007-02-09 17:37 UTC (permalink / raw)
  To: Jiri Slaby; +Cc: Linux Kernel Mailing List, Dmitry Torokhov

Jiri Slaby <jirislaby@gmail.com> writes:

> Hi.
> 
> What's drivers/char/scan_keyb.{c,h} for, when it's referenced in no
> place (aside a fact, that it uses some old API and hence is broken)?

iirc it was an interface for braille reader modules. Probably they
never made it into tree.

-Andi


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

end of thread, other threads:[~2007-02-09 17:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-09 15:11 WHATIS scan_keyb Jiri Slaby
2007-02-09 17:37 ` Andi Kleen
2007-02-09 17:00   ` Dmitry Torokhov
2007-02-09 17:06     ` [PATCH 1/1] Input: scan_keyb, remove it Jiri Slaby

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).