]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - sound/ppc/pmac.c
[ALSA] snd-powermac: no longer handle anything with a layout-id property
[karo-tx-linux.git] / sound / ppc / pmac.c
index 4988f873a7bacc6bd1749bea5f1d137823401da1..b678814975c9e1dd93297033966a527172ec8b28 100644 (file)
@@ -66,7 +66,7 @@ static int snd_pmac_dbdma_alloc(struct snd_pmac *chip, struct pmac_dbdma *rec, i
 
 static void snd_pmac_dbdma_free(struct snd_pmac *chip, struct pmac_dbdma *rec)
 {
-       if (rec) {
+       if (rec->space) {
                unsigned int rsize = sizeof(struct dbdma_cmd) * (rec->size + 1);
 
                dma_free_coherent(&chip->pdev->dev, rsize, rec->space, rec->dma_base);
@@ -867,9 +867,7 @@ static int __init snd_pmac_detect(struct snd_pmac *chip)
        unsigned int *prop, l;
        struct macio_chip* macio;
 
-       u32 layout_id = 0;
-
-       if (_machine != _MACH_Pmac)
+       if (!machine_is(powermac))
                return -ENODEV;
 
        chip->subframe = 0;
@@ -881,6 +879,7 @@ static int __init snd_pmac_detect(struct snd_pmac *chip)
        chip->can_capture = 1;
        chip->num_freqs = ARRAY_SIZE(awacs_freqs);
        chip->freq_table = awacs_freqs;
+       chip->pdev = NULL;
 
        chip->control_mask = MASK_IEPC | MASK_IEE | 0x11; /* default */
 
@@ -928,8 +927,14 @@ static int __init snd_pmac_detect(struct snd_pmac *chip)
        if (prop && *prop < 16)
                chip->subframe = *prop;
        prop = (unsigned int *) get_property(sound, "layout-id", NULL);
-       if (prop)
-               layout_id = *prop;
+       if (prop) {
+               /* partly deprecate snd-powermac, for those machines
+                * that have a layout-id property for now */
+               printk(KERN_INFO "snd-powermac no longer handles any "
+                                "machines with a layout-id property "
+                                "in the device-tree, use snd-aoa.\n");
+               return -ENODEV;
+       }
        /* This should be verified on older screamers */
        if (device_is_compatible(sound, "screamer")) {
                chip->model = PMAC_SCREAMER;
@@ -962,38 +967,6 @@ static int __init snd_pmac_detect(struct snd_pmac *chip)
                chip->freq_table = tumbler_freqs;
                chip->control_mask = MASK_IEPC | 0x11; /* disable IEE */
        }
-       if (device_is_compatible(sound, "AOAKeylargo") ||
-           device_is_compatible(sound, "AOAbase") ||
-           device_is_compatible(sound, "AOAK2")) {
-               /* For now, only support very basic TAS3004 based machines with
-                * single frequency until proper i2s control is implemented
-                */
-               switch(layout_id) {
-               case 0x24:
-               case 0x29:
-               case 0x33:
-               case 0x46:
-               case 0x48:
-               case 0x50:
-               case 0x5c:
-                       chip->num_freqs = ARRAY_SIZE(tumbler_freqs);
-                       chip->model = PMAC_SNAPPER;
-                       chip->can_byte_swap = 0; /* FIXME: check this */
-                       chip->control_mask = MASK_IEPC | 0x11;/* disable IEE */
-                       break;
-               case 0x3a:
-                       chip->num_freqs = ARRAY_SIZE(tumbler_freqs);
-                       chip->model = PMAC_TOONIE;
-                       chip->can_byte_swap = 0; /* FIXME: check this */
-                       chip->control_mask = MASK_IEPC | 0x11;/* disable IEE */
-                       break;
-               default:
-                       printk(KERN_ERR "snd: Unknown layout ID 0x%x\n",
-                              layout_id);
-                       return -ENODEV;
-
-               }
-       }
        prop = (unsigned int *)get_property(sound, "device-id", NULL);
        if (prop)
                chip->device_id = *prop;