[parisc-linux-cvs] 2.4.17-pa10, harmony-support for 715/old

Helge Deller deller@gmx.de
Tue, 15 Jan 2002 03:38:58 +0100


--------------Boundary-00=_YOKYMQZVUQ769MTZM3TD
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 8bit

On Tuesday 15 January 2002 03:37, Helge Deller wrote:
> CVSROOT:	/var/cvs
> Module name:	linux
> Changes by:	deller	02/01/14 19:37:01
>
> Modified files:
> 	.              : Makefile
> 	drivers/sound  : harmony.c
>
> Log message:
> - 2.4.17-pa10
> - new harmony driver version V0.9a
> - support for 715/old machines added (tested on 715/33)
> - removed changelist and added real copyright lines
> - added TODO list
> - new comments-layout


--------------Boundary-00=_YOKYMQZVUQ769MTZM3TD
Content-Type: text/plain;
  charset="iso-8859-1";
  name="diff"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="diff"

Index: Makefile
===================================================================
RCS file: /var/cvs/linux/Makefile,v
retrieving revision 1.247
diff -u -p -r1.247 Makefile
--- Makefile	2002/01/14 23:27:51	1.247
+++ Makefile	2002/01/15 02:33:33
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 4
 SUBLEVEL = 17
-EXTRAVERSION = -pa9
+EXTRAVERSION = -pa10
 
 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 
Index: drivers/sound/harmony.c
===================================================================
RCS file: /var/cvs/linux/drivers/sound/harmony.c,v
retrieving revision 1.22
diff -u -p -r1.22 harmony.c
--- drivers/sound/harmony.c	2002/01/15 01:12:57	1.22
+++ drivers/sound/harmony.c	2002/01/15 02:33:34
@@ -1,49 +1,27 @@
 /*
  	drivers/sound/harmony.c 
-	
-	This is a sound driver for Lasi's Harmony sound chip.  This is
-	unlikely to be used for anything other than on a HP PA-RISC.
-
-	Harmony is found in HP 712s, 715/new, and many other GSC based machines. 
 
-	Copyright 2000 (c) Linuxcare Canada, Alex deVries <alex@linuxcare.com>
+	This is a sound driver for ASP's and Lasi's Harmony sound chip
+	and is unlikely to be used for anything other than on a HP PA-RISC.
 
-Bugs:
+	Harmony is found in HP 712s, 715/new and many other GSC based machines.
+	On older 715 machines you'll find the technically identical chip 
+	called 'Vivace'. Both Harmony and Vicace are supported by this driver.
 
-1. Doesn't work on 715/old
+	Copyright 2000 (c) Linuxcare Canada, Alex deVries <alex@linuxcare.com>
+	Copyright 2001 (c) Jean-Christophe Vaugeois <vaugeoij@esiee.fr>
+	Copyright 2001 (c) Matthieu Delahaye <delahaym@esiee.fr>
+	Copyright 2000-2002 (c) Helge Deller <deller@gmx.de>
 
-This driver doesn't work on 715/old machines, which include the 715/75.  The
-chip used for this is technically called 'Vivace', which is identical to 
-Harmony.  Should be easy to fix.  It has something to do with the way it is
-reported by the inventory code.  The HPA is not that of Lasi or ASP so the
-interrupts aren't registered properly.
-
-
-Changes:
---------
-	
-2001-02-27: Matthieu Delahaye <delahaym@esiee.fr>
-	- mixer support via /dev/mixer
-	- supported formats (mono and stereo): 8bit mu-law, 8bit A-law, 16bit linear
-	- When playing is started without initialization of samples format,
-	  the driver tries to autodetect it. Standard rates are supported.
-	- active loop replaced by "wait_queue".
-	
-2001-02-27: Jean-Christophe Vaugeois <vaugeoij@esiee.fr>
-	- changed implementation of rotating buffers: 
-	  works now with any (>=3) number of buffers
-
-2001-02-27: Helge Deller <hdeller@redhat.de>
-	- modularisation, 
-	- cleanups
-
-2001-03-07: Matthieu Delahaye <delahaym@esiee.fr>
-	- added record functionality
-
-2001-12-31: Helge Deller <hdeller@gmx.de>
-	- if possible use DMA consistent memory
-	- many cleanups & fixes
-	- more OSS compatibility functions
+				
+TODO:
+	- fix SNDCTL_DSP_GETOSPACE and SNDCTL_DSP_GETISPACE ioctls to
+		return the real values
+	- add private ioctl for selecting line- or microphone input
+		(only one of them is available at the same time)
+	- implement gain meter ?
+	- add module parameters
+	- ...
 */
 
 #include <linux/delay.h>
@@ -62,8 +40,7 @@ Changes:
 
 
 #define PFX "harmony: "
-#define HARMONY_VERSION "V0.9"
-
+#define HARMONY_VERSION "V0.9a"
 
 #undef DEBUG
 #ifdef DEBUG
@@ -73,11 +50,9 @@ Changes:
 #endif
 
 
-
 #define MAX_BUFS 10		/* maximum number of rotating buffers */
 #define HARMONY_BUF_SIZE 4096	/* needs to be a multiple of PAGE_SIZE (4096)! */
 
-
 #define CNTL_C		0x80000000
 #define	CNTL_ST		0x00000020
 #define CNTL_44100	0x00000015	/* HARMONY_SR_44KHZ */
@@ -114,9 +89,9 @@ Changes:
 #define HARMONY_SR_33KHZ	0x16
 #define HARMONY_SR_6KHZ		0x17
 
-
-
-/* Some magics numbers used to auto-detect file formats */
+/*
+ * Some magics numbers used to auto-detect file formats
+ */
 
 #define HARMONY_MAGIC_8B_ULAW	1
 #define HARMONY_MAGIC_8B_ALAW	27
@@ -213,8 +188,9 @@ struct harmony_dev {
 static struct harmony_dev harmony;
 
 
-
-/* Dynamic sound buffer allocation and DMA memory */
+/*
+ * Dynamic sound buffer allocation and DMA memory
+ */
 
 struct harmony_buffer {
 	unsigned char *addr;
@@ -223,7 +199,10 @@ struct harmony_buffer {
 	int len;
 };
 
-/* the harmony memory buffers */
+/*
+ * Harmony memory buffers
+ */
+
 static struct harmony_buffer played_buf, recorded_buf, silent, graveyard;
 
 
@@ -272,7 +251,9 @@ static void __exit harmony_free_buffer(s
 
 
 
-/* Low-Level sound-chip programming */
+/*
+ * Low-Level sound-chip programming
+ */
 
 static void __inline__ harmony_wait_CNTL(void)
 {
@@ -294,7 +275,6 @@ static void harmony_update_control(void)
 	harmony.format_initialized = 1;
 	
 	/* initialize CNTL */
-	harmony_wait_CNTL();
 	gsc_writel(default_cntl, &harmony.hpa->cntl);
 }
 
@@ -351,13 +331,13 @@ static void harmony_set_stereo(u8 stereo
 static void harmony_disable_interrupts(void) 
 {
 	harmony_wait_CNTL();
-	gsc_writel(0, &(harmony.hpa->dstatus)); 
+	gsc_writel(0, &harmony.hpa->dstatus); 
 }
 
 static void harmony_enable_interrupts(void) 
 {
 	harmony_wait_CNTL();
-	gsc_writel(DSTATUS_IE, &(harmony.hpa->dstatus)); 
+	gsc_writel(DSTATUS_IE, &harmony.hpa->dstatus); 
 }
 
 /*
@@ -477,12 +457,13 @@ static ssize_t harmony_audio_read(struct
 
 
 
-/* Here is the place where we try to recognize file format.
-   Sun/NeXT .au files begin with the string .snd
-   At offset 12 is specified the encoding.
-   At offset 16 is specified speed rate
-   At Offset 20 is specified the numbers of voices
-*/
+/*
+ * Here is the place where we try to recognize file format.
+ * Sun/NeXT .au files begin with the string .snd
+ * At offset 12 is specified the encoding.
+ * At offset 16 is specified speed rate
+ * At Offset 20 is specified the numbers of voices
+ */
 
 #define four_bytes_to_u32(start) (file_header[start] << 24)|\
                                   (file_header[start+1] << 16)|\
@@ -746,7 +727,12 @@ static int harmony_audio_ioctl(struct in
 }
 
 
-/* harmony_interrupt() - main harmony interruption service routine */
+/*
+ * harmony_interrupt()
+ *
+ * harmony interruption service routine
+ * 
+ */
 
 static void harmony_interrupt(int irq, void *dev, struct pt_regs *regs)
 {
@@ -813,7 +799,9 @@ static void harmony_interrupt(int irq, v
 	}
 }
 
-/* Sound playing functions */
+/*
+ * Sound playing functions
+ */
 
 static struct file_operations harmony_audio_fops = {
 	owner:	THIS_MODULE,
@@ -857,7 +845,9 @@ static int harmony_audio_init(void)
 }
 
 
-/* mixer functions */
+/*
+ * mixer functions 
+ */
 
 static void harmony_mixer_set_gain(void)
 {

--------------Boundary-00=_YOKYMQZVUQ769MTZM3TD--