mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 2.6 IrDA] 3/11: esi-sir: dongle api change
@ 2004-01-24  2:20 Jean Tourrilhes
  0 siblings, 0 replies; only message in thread
From: Jean Tourrilhes @ 2004-01-24  2:20 UTC (permalink / raw)
  To: David S. Miller, Linux kernel mailing list

ir262_dongles-3_esi-sir.diff :
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		<Patch from Martin Diehl>
* convert to de-virtualized sirdev helpers
* add probably missing dongle power-up operation


diff -u -p linux/drivers/net/irda.d6/esi-sir.c  linux/drivers/net/irda/esi-sir.c
--- linux/drivers/net/irda.d6/esi-sir.c	Wed Dec 17 18:59:18 2003
+++ linux/drivers/net/irda/esi-sir.c	Thu Jan 22 16:43:22 2004
@@ -68,11 +68,14 @@ static int esi_open(struct sir_dev *dev)
 {
 	struct qos_info *qos = &dev->qos;
 
+	/* Power up and set dongle to 9600 baud */
+	sirdev_set_dtr_rts(dev, FALSE, TRUE);
+
 	qos->baud_rate.bits &= IR_9600|IR_19200|IR_115200;
 	qos->min_turn_time.bits = 0x01; /* Needs at least 10 ms */
 	irda_qos_bits_to_value(qos);
 
-	/* shouldn't we do set_dtr_rts(FALSE, TRUE) here (power up at 9600)? */
+	/* irda thread waits 50 msec for power settling */
 
 	return 0;
 }
@@ -80,7 +83,7 @@ static int esi_open(struct sir_dev *dev)
 static int esi_close(struct sir_dev *dev)
 {
 	/* Power off dongle */
-	dev->set_dtr_rts(dev, FALSE, FALSE);
+	sirdev_set_dtr_rts(dev, FALSE, FALSE);
 
 	return 0;
 }
@@ -88,11 +91,13 @@ static int esi_close(struct sir_dev *dev
 /*
  * Function esi_change_speed (task)
  *
- *    Set the speed for the Extended Systems JetEye PC ESI-9680 type dongle
+ * Set the speed for the Extended Systems JetEye PC ESI-9680 type dongle
+ * Apparently (see old esi-driver) no delays are needed here...
  *
  */
 static int esi_change_speed(struct sir_dev *dev, unsigned speed)
 {
+	int ret = 0;
 	int dtr, rts;
 	
 	switch (speed) {
@@ -104,6 +109,7 @@ static int esi_change_speed(struct sir_d
 		dtr = rts = TRUE;
 		break;
 	default:
+		ret = -EINVAL;
 		speed = 9600;
 		/* fall through */
 	case 9600:
@@ -113,12 +119,10 @@ static int esi_change_speed(struct sir_d
 	}
 
 	/* Change speed of dongle */
-	dev->set_dtr_rts(dev, dtr, rts);
+	sirdev_set_dtr_rts(dev, dtr, rts);
 	dev->speed = speed;
 
-	/* do we need some delay for power stabilization? */
-
-	return 0;
+	return ret;
 }
 
 /*
@@ -129,9 +133,18 @@ static int esi_change_speed(struct sir_d
  */
 static int esi_reset(struct sir_dev *dev)
 {
-	dev->set_dtr_rts(dev, FALSE, FALSE);
+	sirdev_set_dtr_rts(dev, FALSE, FALSE);
+
+	/* Hm, the old esi-driver left the dongle unpowered relying on
+	 * the following speed change to repower. This might work for
+	 * the esi because we only need the modem lines. However, now the
+	 * general rule is reset must bring the dongle to some working
+	 * well-known state because speed change might write to registers.
+	 * The old esi-driver didn't any delay here - let's hope it' fine.
+	 */
 
-	/* Hm, probably repower to 9600 and some delays? */
+	sirdev_set_dtr_rts(dev, FALSE, TRUE);
+	dev->speed = 9600;
 
 	return 0;
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-01-24  2:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-24  2:20 [PATCH 2.6 IrDA] 3/11: esi-sir: dongle api change Jean Tourrilhes

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

all inboxes | Powered by JetHome®