--- ../alsa-kernel/arm/sa11xx-uda1341.c	2007-12-20 11:47:36.000000000 +0100
+++ sa11xx-uda1341.c	2007-12-20 12:22:43.000000000 +0100
@@ -1,3 +1,4 @@
+#include "adriver.h"
 /*
  *  Driver for Philips UDA1341TS on Compaq iPAQ H3600 soundcard
  *  Copyright (C) 2002 Tomas Kasparek <tomas.kasparek@seznam.cz>
@@ -78,6 +79,12 @@
 #include <asm/mach-types.h>
 #include <asm/dma.h>
 
+#ifdef CONFIG_H3600_HAL
+#include <asm/semaphore.h>
+#include <asm/uaccess.h>
+#include <asm/arch/h3600_hal.h>
+#endif
+
 #include <sound/core.h>
 #include <sound/pcm.h>
 #include <sound/initval.h>
@@ -93,6 +100,9 @@
  * We use DMA stuff from 2.4.18-rmk3-hh24 here to be able to compile this
  * module for Familiar 0.6.1
  */
+#ifdef CONFIG_H3600_HAL
+#define HH_VERSION 1
+#endif
 
 /* {{{ Type definitions */
 
@@ -228,8 +238,11 @@
 		rate = 8000;
 
 	/* Set the external clock generator */
-	
+#ifdef CONFIG_H3600_HAL
+	h3600_audio_clock(rate);
+#else	
 	sa11xx_uda1341_set_audio_clock(rate);
+#endif
 
 	/* Select the clock divisor */
 	switch (rate) {
@@ -294,10 +307,13 @@
 	local_irq_restore(flags);
 
 	/* Enable the audio power */
-
+#ifdef CONFIG_H3600_HAL
+	h3600_audio_power(AUDIO_RATE_DEFAULT);
+#else
 	clr_sa11xx_uda1341_egpio(IPAQ_EGPIO_CODEC_NRESET);
 	set_sa11xx_uda1341_egpio(IPAQ_EGPIO_AUDIO_ON);
 	set_sa11xx_uda1341_egpio(IPAQ_EGPIO_QMUTE);
+#endif
  
 	/* Wait for the UDA1341 to wake up */
 	mdelay(1); //FIXME - was removed by Perex - Why?
@@ -315,13 +331,21 @@
 	/* make the left and right channels unswapped (flip the WS latch) */
 	Ser4SSDR = 0;
 
-	clr_sa11xx_uda1341_egpio(IPAQ_EGPIO_QMUTE);
+#ifdef CONFIG_H3600_HAL
+	h3600_audio_mute(0);
+#else	
+	clr_sa11xx_uda1341_egpio(IPAQ_EGPIO_QMUTE);        
+#endif     
 }
 
 static void sa11xx_uda1341_audio_shutdown(struct sa11xx_uda1341 *sa11xx_uda1341)
 {
 	/* mute on */
+#ifdef CONFIG_H3600_HAL
+	h3600_audio_mute(1);
+#else	
 	set_sa11xx_uda1341_egpio(IPAQ_EGPIO_QMUTE);
+#endif
 	
 	/* disable the audio power and all signals leading to the audio chip */
 	l3_close(sa11xx_uda1341->uda1341);
@@ -330,9 +354,13 @@
 
 	/* power off and mute off */
 	/* FIXME - is muting off necesary??? */
-
+#ifdef CONFIG_H3600_HAL
+	h3600_audio_power(0);
+	h3600_audio_mute(0);
+#else	
 	clr_sa11xx_uda1341_egpio(IPAQ_EGPIO_AUDIO_ON);
 	clr_sa11xx_uda1341_egpio(IPAQ_EGPIO_QMUTE);
+#endif	
 }
 
 /* }}} */
@@ -980,3 +1008,4 @@
  * indent-tabs-mode: t
  * End:
  */
+EXPORT_NO_SYMBOLS;
