[alsa-devel] [PATCH] ASoC: Update omap/ams-delta for TTY API change

Janusz Krzysztofik jkrzyszt at tis.icnet.pl
Thu May 12 19:29:31 CEST 2011


Following the receive_buf() change to return the number of bytes 
received, the cx20442 CODEC driver was updated to report that we 
accepted all the data that was offered to us. Do the same with the 
corresponding Amstrad Delta sound card level wrapper function, which is 
actually registered as the tty line discipline callback instead of the 
the CODEC function, which it then calls.

Signed-off-by: Janusz Krzysztofik <jkrzyszt at tis.icnet.pl>
---
 sound/soc/omap/ams-delta.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

--- git/sound/soc/omap/ams-delta.c.orig	2011-04-09 00:39:54.000000000 
+0200
+++ git/sound/soc/omap/ams-delta.c	2011-05-12 18:50:33.000000000 +0200
@@ -331,7 +331,7 @@ static int cx81801_hangup(struct tty_str
 }
 
 /* Line discipline .recieve_buf() */
-static void cx81801_receive(struct tty_struct *tty,
+static unsigned int cx81801_receive(struct tty_struct *tty,
 				const unsigned char *cp, char *fp, int count)
 {
 	struct snd_soc_codec *codec = tty->disc_data;
@@ -347,7 +347,7 @@ static void cx81801_receive(struct tty_s
 		/* Initialize timer used for config pulse generation */
 		setup_timer(&cx81801_timer, cx81801_timeout, 0);
 
-		v253_ops.receive_buf(tty, cp, fp, count);
+		ret = v253_ops.receive_buf(tty, cp, fp, count);
 
 		/* Link hook switch to DAPM pins */
 		ret = snd_soc_jack_add_pins(&ams_delta_hook_switch,
@@ -358,10 +358,10 @@ static void cx81801_receive(struct tty_s
 				"Failed to link hook switch to DAPM pins, "
 				"will continue with hook switch unlinked.\n");
 
-		return;
+		return count;
 	}
 
-	v253_ops.receive_buf(tty, cp, fp, count);
+	ret = v253_ops.receive_buf(tty, cp, fp, count);
 
 	for (c = &cp[count - 1]; c >= cp; c--) {
 		if (*c != '\r')
@@ -381,6 +381,7 @@ static void cx81801_receive(struct tty_s
 						AMS_DELTA_LATCH2_MODEM_CODEC);
 		break;
 	}
+	return count;
 }
 
 /* Line discipline .write_wakeup() */


More information about the Alsa-devel mailing list