Hallo Takashi,

here is a patch which sports complete us428 initialisation via hotplug,
an INSTALL and a README.
I took the phase 1 firmware files from usb-midi-firmware project.
Also fixed are some compile warnings.
Maybe the Makefile.am is not completely correct as 
I hardcoded the directory /etc/hotplug/usb. But maybe also this is the 
standard place to put such hotplug files?
Well....here it works.
Please put the stuffs to CVS.
The driver from CVS also works here.

Thanks,
Karsten


Attachment: usx2yloader adds for 0.3.tar.bz2
Description: application/tbz

Index: Makefile.am
===================================================================
RCS file: /cvsroot/alsa/alsa-tools/usx2yloader/Makefile.am,v
retrieving revision 1.1
diff -u -r1.1 Makefile.am
--- Makefile.am	8 Sep 2003 11:12:31 -0000	1.1
+++ Makefile.am	18 Sep 2003 20:08:53 -0000
@@ -11,6 +11,11 @@
 
 EXTRA_DIST = depcomp
 
+hotplug_files = tascam_fw.usermap tascam_fw tascam_fpga
+hotplugdir = /etc/hotplug/usb
+hotplug_SCRIPTS = $(hotplug_files)
+
+
 alsa-dist: distdir
 	@rm -rf ../distdir/usx2yloader
 	@mkdir -p ../distdir/usx2yloader
Index: configure.in
===================================================================
RCS file: /cvsroot/alsa/alsa-tools/usx2yloader/configure.in,v
retrieving revision 1.1
diff -u -r1.1 configure.in
--- configure.in	8 Sep 2003 11:12:31 -0000	1.1
+++ configure.in	18 Sep 2003 20:08:53 -0000
@@ -1,5 +1,5 @@
 AC_INIT(usx2yloader.c)
-AM_INIT_AUTOMAKE(usx2yloader, 0.2)
+AM_INIT_AUTOMAKE(usx2yloader, 0.3)
 AC_PROG_CC
 AC_PROG_INSTALL
 AC_HEADER_STDC
Index: usx2yloader.c
===================================================================
RCS file: /cvsroot/alsa/alsa-tools/usx2yloader/usx2yloader.c,v
retrieving revision 1.1
diff -u -r1.1 usx2yloader.c
--- usx2yloader.c	8 Sep 2003 11:12:31 -0000	1.1
+++ usx2yloader.c	18 Sep 2003 20:08:54 -0000
@@ -63,15 +63,17 @@
 
 
 /*
- * read a xilinx bitstream file
+ * read a xilinx bitstream file.
+ * NOTE: This interprets somehow differently from the vxloaders read_xilinx_image()!
+ * I took this from rbtload.c of the project usb-midi-fw.sf.net.
  */
 static int read_xilinx_image(snd_hwdep_dsp_image_t *img, const char *fname)
 {
 	FILE *fp;
 	char buf[256];
-	int data, c, idx, length;
+	int data = 0, c = 0, idx = 0, length = 0;
 	char *p;
-	char *imgbuf;
+	char *imgbuf = 0;
 
 	if ((fp = fopen(fname, "r")) == NULL) {
 		fprintf(stderr, PROGNAME ": cannot open %s\n", fname);
@@ -79,10 +81,6 @@
 	}
 	snd_hwdep_dsp_image_set_name(img, fname);
 
-	c = 0;
-	data = 0;
-	idx = 0;
-	length = 0;
 	while (fgets(buf, sizeof(buf), fp)) {
 		if (strncmp(buf, "Bits:", 5) == 0) {
 			for (p = buf + 5; *p && isspace(*p); p++);
@@ -140,15 +138,13 @@
 			}
 		}
 	}
-	if (c)
-		imgbuf[idx++] = data;
-	if (idx != length) {
-		fprintf(stderr,
-			PROGNAME ": length doesn't match: %d != %d\n", idx,
-			length);
+	if (idx != length || 0 == imgbuf) {
+		fprintf(stderr, PROGNAME ": length doesn't match: %d != %d\n", idx, length);
 		fclose(fp);
 		return -EINVAL;
 	}
+	if (c)
+		imgbuf[idx++] = data;
 	snd_hwdep_dsp_image_set_length(img, length);
 	snd_hwdep_dsp_image_set_image(img, imgbuf);
 	fclose(fp);
@@ -223,7 +219,6 @@
 	len = strlen(temp);
 
 	while (fgets(buf, sizeof(buf), fp)) {
-		int prepad;
 		if (strncmp(buf, temp, len))
 			continue;
 
@@ -303,7 +298,7 @@
 {
 	snd_hwdep_t *hw;
 	const char *id;
-	int err, is_pcmcia;
+	int err;
 	unsigned int idx, dsps, loaded;
 	snd_hwdep_dsp_status_t *stat;
 
Index: firmware/Makefile.am
===================================================================
RCS file: /cvsroot/alsa/alsa-tools/usx2yloader/firmware/Makefile.am,v
retrieving revision 1.1
diff -u -r1.1 Makefile.am
--- firmware/Makefile.am	8 Sep 2003 11:12:31 -0000	1.1
+++ firmware/Makefile.am	18 Sep 2003 20:08:54 -0000
@@ -1,5 +1,4 @@
-cfg_files = us428.conf us428.prepad us428.rbt
-
+cfg_files = us428.conf us428.prepad us428.rbt tascam_loader.ihx us428fw.ihx
 EXTRA_DIST = $(cfg_files)
 
 firmwaredir = $(datadir)/alsa/firmware

Reply via email to