All of lore.kernel.org
 help / color / mirror / Atom feed
* usx2yloader 0.3
@ 2003-09-18 20:57 Karsten Wiese
  2003-09-23 14:01 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Karsten Wiese @ 2003-09-18 20:57 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel

[-- Attachment #1: Type: text/plain, Size: 492 bytes --]

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 #2: usx2yloader adds for 0.3.tar.bz2 --]
[-- Type: application/x-tbz, Size: 11656 bytes --]

[-- Attachment #3: usx2yloader.patch.0.3 --]
[-- Type: text/x-diff, Size: 3439 bytes --]

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

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

* Re: usx2yloader 0.3
  2003-09-18 20:57 usx2yloader 0.3 Karsten Wiese
@ 2003-09-23 14:01 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2003-09-23 14:01 UTC (permalink / raw)
  To: Karsten Wiese; +Cc: alsa-devel

Hi Karsten,

At Thu, 18 Sep 2003 22:57:40 +0200,
Karsten Wiese wrote:
> 
> Hallo Takashi,
> 
> here is a patch which sports complete us428 initialisation via hotplug,
> an INSTALL and a README.

thanks, i'll commit them.

> 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?

i think so.  in case it's not, we can add a configure option.


thanks!

Takashi


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

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

end of thread, other threads:[~2003-09-23 14:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-18 20:57 usx2yloader 0.3 Karsten Wiese
2003-09-23 14:01 ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.