[PATCH 001c/001] snd-powermac: more older kernel compatibility

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2008/4/17, Takashi Iwai <tiwai@xxxxxxx>:
>
> The hack isn't definitely for the latest upstream, so if this is
>  needed, rather define in each *.c in alsa-driver/ppc please.
>

Now it's done in ppc/*.patch.

Risto
From: Risto Suominen <Risto.Suominen@xxxxxxxxx>

More patches to allow to compile snd-powermac on older kernels.

Signed-off-by: Risto Suominen <Risto.Suominen@xxxxxxxxx>
---
Kernel version < 2.6.16

--- ppc/beep.patch.orig	2008-04-17 15:12:32.400094000 +0300
+++ ppc/beep.patch	2008-04-17 15:26:55.175799266 +0300
@@ -1,17 +1,20 @@
 --- ../alsa-kernel/ppc/beep.c	2008-02-05 11:23:24.000000000 +0200
-+++ beep.c	2008-03-27 11:56:01.482564272 +0200
-@@ -1,3 +1,10 @@
++++ beep.c	2008-04-17 15:26:15.732223056 +0300
+@@ -1,3 +1,13 @@
 +#define __NO_VERSION__
 +#include "adriver.h"
 +
 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
 +#include "beep_old.c"
 +#else /* 2.6 kernels */
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16)
++#define input_get_drvdata(dev) (dev->private)
++#endif
 +
  /*
   * Beep using pcm
   *
-@@ -226,7 +233,11 @@
+@@ -226,7 +236,11 @@
  		return -ENOMEM;
  	dmabuf = dma_alloc_coherent(&chip->pdev->dev, BEEP_BUFLEN * 4,
  				    &beep->addr, GFP_KERNEL);
@@ -23,7 +26,7 @@
  	if (! dmabuf || ! input_dev)
  		goto fail1;
  
-@@ -241,8 +252,15 @@
+@@ -241,8 +255,15 @@
  	input_dev->evbit[0] = BIT_MASK(EV_SND);
  	input_dev->sndbit[0] = BIT_MASK(SND_BELL) | BIT_MASK(SND_TONE);
  	input_dev->event = snd_pmac_beep_event;
@@ -39,7 +42,7 @@
  
  	beep->dev = input_dev;
  	beep->buf = dmabuf;
-@@ -256,14 +274,23 @@
+@@ -256,14 +277,23 @@
  
  	chip->beep = beep;
  
@@ -64,7 +67,7 @@
  	if (dmabuf)
  		dma_free_coherent(&chip->pdev->dev, BEEP_BUFLEN * 4,
  				  dmabuf, beep->addr);
-@@ -275,9 +302,16 @@
+@@ -275,9 +305,16 @@
  {
  	if (chip->beep) {
  		input_unregister_device(chip->beep->dev);
--- ppc/tumbler.patch.orig	2008-02-05 11:23:23.000000000 +0200
+++ ppc/tumbler.patch	2008-04-17 15:35:05.783529874 +0300
@@ -1,21 +1,27 @@
---- ../alsa-kernel/ppc/tumbler.c	2007-12-20 11:47:37.000000000 +0100
-+++ tumbler.c	2007-12-20 12:25:05.000000000 +0100
+--- ../alsa-kernel/ppc/tumbler.c	2008-02-05 11:23:24.000000000 +0200
++++ tumbler.c	2008-04-17 15:33:50.504338918 +0300
 @@ -1,3 +1,5 @@
 +#define __NO_VERSION__
 +#include "adriver.h"
  /*
   * PMac Tumbler/Snapper lowlevel functions
   *
-@@ -38,6 +40,8 @@
+@@ -38,6 +40,14 @@
  #include "pmac.h"
  #include "tumbler_volume.h"
  
 +#include "ppc-prom-hack.h"
 +
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16)
++#define of_device_is_compatible(dev, s) device_is_compatible(dev, s)
++#define i2c_smbus_write_i2c_block_data(client, cmd, len, vals) \
++	i2c_smbus_write_block_data(client, cmd, len, vals)
++#endif
++
  #undef DEBUG
  
  #ifdef DEBUG
-@@ -965,7 +969,11 @@
+@@ -965,7 +975,11 @@
  	}
  }
  
@@ -27,7 +33,7 @@
  static struct snd_pmac *device_change_chip;
  
  static void device_change_handler(struct work_struct *work)
-@@ -1035,7 +1043,11 @@
+@@ -1035,7 +1049,11 @@
  		mix = chip->mixer_data;
  		snd_assert(mix, return);
  		mix->auto_mute_notify = do_notify;
@@ -39,7 +45,7 @@
  	}
  }
  #endif /* PMAC_SUPPORT_AUTOMUTE */
-@@ -1455,7 +1467,11 @@
+@@ -1455,7 +1473,11 @@
  	chip->resume = tumbler_resume;
  #endif
  
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux