[parisc-linux-cvs] linux-2.6 tausq

Randolph Chung randolph at tausq.org
Fri Oct 1 14:11:01 MDT 2004


> Modified files:
> 	drivers/input/keyboard: Kconfig hil_kbd.c 
> 	drivers/input/serio: hil_mlc.c 
> 
> Log message:
> Update hil driver to use new serio interface. Builds, but not tested!!

<tausq> what do we want to do with the HIL problem?
* tausq has a patch to make it build, but have no devices to test
<willy> Just commit it.  Somebody else will make it work ;-)

Index: drivers/input/keyboard/Kconfig
===================================================================
RCS file: /var/cvs/linux-2.6/drivers/input/keyboard/Kconfig,v
retrieving revision 1.22
diff -u -p -r1.22 Kconfig
--- drivers/input/keyboard/Kconfig	30 Sep 2004 20:08:10 -0000	1.22
+++ drivers/input/keyboard/Kconfig	1 Oct 2004 20:07:54 -0000
@@ -158,6 +158,7 @@ config KEYBOARD_HIL
 	default y
 	select HP_SDC
  	select HIL_MLC
+	select SERIO
 	help
 	  The "Human Interface Loop" is a older, 8-channel USB-like
 	  controller used in several Hewlett Packard models.
Index: drivers/input/keyboard/hil_kbd.c
===================================================================
RCS file: /var/cvs/linux-2.6/drivers/input/keyboard/hil_kbd.c,v
retrieving revision 1.9
diff -u -p -r1.9 hil_kbd.c
--- drivers/input/keyboard/hil_kbd.c	11 Jul 2004 22:03:48 -0000	1.9
+++ drivers/input/keyboard/hil_kbd.c	1 Oct 2004 20:07:54 -0000
@@ -245,7 +245,7 @@ static void hil_kbd_disconnect(struct se
 	kfree(kbd);
 }
 
-static void hil_kbd_connect(struct serio *serio, struct serio_dev *dev)
+static void hil_kbd_connect(struct serio *serio, struct serio_driver *drv)
 {
 	struct hil_kbd	*kbd;
 	uint8_t		did, *idd;
@@ -256,7 +256,7 @@ static void hil_kbd_connect(struct serio
 	if (!(kbd = kmalloc(sizeof(struct hil_kbd), GFP_KERNEL))) return;
 	memset(kbd, 0, sizeof(struct hil_kbd));
 
-	if (serio_open(serio, dev)) goto bail0;
+	if (serio_open(serio, drv)) goto bail0;
 
 	serio->private = kbd;
 	kbd->serio = serio;
@@ -351,21 +351,25 @@ static void hil_kbd_connect(struct serio
 }
 
 
-struct serio_dev hil_kbd_serio_dev = {
-	.connect =	hil_kbd_connect,
-	.disconnect =	hil_kbd_disconnect,
-	.interrupt =	hil_kbd_interrupt
+struct serio_driver hil_kbd_serio_drv = {
+	.driver		= {
+		.name	= "hil_kbd",
+	},
+	.description	= "HP HIL keyboard driver",
+	.connect 	= hil_kbd_connect,
+	.disconnect 	= hil_kbd_disconnect,
+	.interrupt 	= hil_kbd_interrupt
 };
 
 static int __init hil_kbd_init(void)
 {
-	serio_register_device(&hil_kbd_serio_dev);
+	serio_register_driver(&hil_kbd_serio_drv);
         return 0;
 }
                 
 static void __exit hil_kbd_exit(void)
 {
-	serio_unregister_device(&hil_kbd_serio_dev);
+	serio_unregister_driver(&hil_kbd_serio_drv);
 }
                         
 module_init(hil_kbd_init);
Index: drivers/input/serio/hil_mlc.c
===================================================================
RCS file: /var/cvs/linux-2.6/drivers/input/serio/hil_mlc.c,v
retrieving revision 1.8
diff -u -p -r1.8 hil_mlc.c
--- drivers/input/serio/hil_mlc.c	6 Jan 2004 22:31:59 -0000	1.8
+++ drivers/input/serio/hil_mlc.c	1 Oct 2004 20:07:54 -0000
@@ -149,35 +149,35 @@ static inline void hil_mlc_clean_serio_m
 static void hil_mlc_send_polls(hil_mlc *mlc) {
 	int did, i, cnt;
 	struct serio *serio;
-	struct serio_dev *dev;
+	struct serio_driver *drv;
 
 	i = cnt = 0;
 	did = (mlc->ipacket[0] & HIL_PKT_ADDR_MASK) >> 8;
 	serio = did ? &(mlc->serio[mlc->di_map[did - 1]]) : NULL;
-	dev = (serio != NULL) ? serio->dev : NULL;
+	drv = (serio != NULL) ? serio->drv : NULL;
 
 	while (mlc->icount < 15 - i) {
 		hil_packet p;
 		p = mlc->ipacket[i];
 		if (did != (p & HIL_PKT_ADDR_MASK) >> 8) {
-			if (dev == NULL || dev->interrupt == NULL) goto skip;
+			if (drv == NULL || drv->interrupt == NULL) goto skip;
 
-			dev->interrupt(serio, 0, 0, NULL);
-			dev->interrupt(serio, HIL_ERR_INT >> 16, 0, NULL);
-			dev->interrupt(serio, HIL_PKT_CMD >> 8,  0, NULL);
-			dev->interrupt(serio, HIL_CMD_POL + cnt, 0, NULL);
+			drv->interrupt(serio, 0, 0, NULL);
+			drv->interrupt(serio, HIL_ERR_INT >> 16, 0, NULL);
+			drv->interrupt(serio, HIL_PKT_CMD >> 8,  0, NULL);
+			drv->interrupt(serio, HIL_CMD_POL + cnt, 0, NULL);
 		skip:
 			did = (p & HIL_PKT_ADDR_MASK) >> 8;
 			serio = did ? &(mlc->serio[mlc->di_map[did-1]]) : NULL;
-			dev = (serio != NULL) ? serio->dev : NULL;
+			drv = (serio != NULL) ? serio->drv : NULL;
 			cnt = 0;
 		}
 		cnt++; i++;
-		if (dev == NULL || dev->interrupt == NULL) continue;
-		dev->interrupt(serio, (p >> 24), 0, NULL);
-		dev->interrupt(serio, (p >> 16) & 0xff, 0, NULL);
-		dev->interrupt(serio, (p >> 8) & ~HIL_PKT_ADDR_MASK, 0, NULL);
-		dev->interrupt(serio, p & 0xff, 0, NULL);
+		if (drv == NULL || drv->interrupt == NULL) continue;
+		drv->interrupt(serio, (p >> 24), 0, NULL);
+		drv->interrupt(serio, (p >> 16) & 0xff, 0, NULL);
+		drv->interrupt(serio, (p >> 8) & ~HIL_PKT_ADDR_MASK, 0, NULL);
+		drv->interrupt(serio, p & 0xff, 0, NULL);
 	}
 }
 
@@ -728,10 +728,10 @@ void hil_mlcs_timer (unsigned long data)
 static int hil_mlc_serio_write(struct serio *serio, unsigned char c) {
 	struct hil_mlc_serio_map *map;
 	struct hil_mlc *mlc;
-	struct serio_dev *dev;
+	struct serio_driver *drv;
 	uint8_t *idx, *last;
 
-	map = serio->driver;
+	map = serio->port_data;
 	if (map == NULL) {
 		BUG();
 		return -EIO;
@@ -771,8 +771,8 @@ static int hil_mlc_serio_write(struct se
 	mlc->serio_oidx[map->didx]++;
 	return -EIO;
  emu:
-	dev = serio->dev;
-	if (dev == NULL) {
+	drv = serio->drv;
+	if (drv == NULL) {
 		BUG();
 		return -EIO;
 	}
@@ -780,16 +780,16 @@ static int hil_mlc_serio_write(struct se
 	while ((last != idx) && (*last == 0)) last--;
 
 	while (idx != last) {
-		dev->interrupt(serio, 0, 0, NULL);
-		dev->interrupt(serio, HIL_ERR_INT >> 16, 0, NULL);
-		dev->interrupt(serio, 0, 0, NULL);
-		dev->interrupt(serio, *idx, 0, NULL);
+		drv->interrupt(serio, 0, 0, NULL);
+		drv->interrupt(serio, HIL_ERR_INT >> 16, 0, NULL);
+		drv->interrupt(serio, 0, 0, NULL);
+		drv->interrupt(serio, *idx, 0, NULL);
 		idx++;
 	}
-	dev->interrupt(serio, 0, 0, NULL);
-	dev->interrupt(serio, HIL_ERR_INT >> 16, 0, NULL);
-	dev->interrupt(serio, HIL_PKT_CMD >> 8, 0, NULL);
-	dev->interrupt(serio, *idx, 0, NULL);
+	drv->interrupt(serio, 0, 0, NULL);
+	drv->interrupt(serio, HIL_ERR_INT >> 16, 0, NULL);
+	drv->interrupt(serio, HIL_PKT_CMD >> 8, 0, NULL);
+	drv->interrupt(serio, *idx, 0, NULL);
 	
 	mlc->serio_oidx[map->didx] = 0;
 	mlc->serio_opacket[map->didx] = 0;
@@ -803,7 +803,7 @@ static int hil_mlc_serio_open(struct ser
 
 	if (serio->private != NULL) return -EBUSY;
 
-	map = serio->driver;
+	map = serio->port_data;
 	if (map == NULL) {
 		BUG();
 		return -ENODEV;
@@ -823,7 +823,7 @@ static void hil_mlc_serio_close(struct s
 	struct hil_mlc_serio_map *map;
 	struct hil_mlc *mlc;
 
-	map = serio->driver;
+	map = serio->port_data;
 	if (map == NULL) {
 		BUG();
 		return;
@@ -837,7 +837,7 @@ static void hil_mlc_serio_close(struct s
 	mlc->dec_use_count();
 
 	serio->private = NULL;
-	serio->dev = NULL;
+	serio->drv = NULL;
 	/* TODO wake up interruptable */
 }
 
@@ -874,7 +874,7 @@ int hil_mlc_register(hil_mlc *mlc) {
 		mlc->serio[i].write		= hil_mlc_serio_write;
 		mlc->serio[i].open		= hil_mlc_serio_open;
 		mlc->serio[i].close		= hil_mlc_serio_close;
-		mlc->serio[i].driver		= &(mlc->serio_map[i]);
+		mlc->serio[i].port_data		= &(mlc->serio_map[i]);
 		mlc->serio_map[i].mlc		= mlc;
 		mlc->serio_map[i].didx		= i;
 		mlc->serio_map[i].di_revmap	= -1;

-- 
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/


More information about the parisc-linux-cvs mailing list