pmac.c (48a7afe314bfc4d7f50e1608632f503dbba7e013) pmac.c (55b61fec22caa3e7872caea6c4100fc75cb8f49b)
1/*
2 * PMac DBDMA lowlevel functions
3 *
4 * Copyright (c) by Takashi Iwai <tiwai@suse.de>
5 * code based on dmasound.c.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by

--- 829 unchanged lines hidden (view full) ---

838
839static void __init detect_byte_swap(struct snd_pmac *chip)
840{
841 struct device_node *mio;
842
843 /* if seems that Keylargo can't byte-swap */
844 for (mio = chip->node->parent; mio; mio = mio->parent) {
845 if (strcmp(mio->name, "mac-io") == 0) {
1/*
2 * PMac DBDMA lowlevel functions
3 *
4 * Copyright (c) by Takashi Iwai <tiwai@suse.de>
5 * code based on dmasound.c.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by

--- 829 unchanged lines hidden (view full) ---

838
839static void __init detect_byte_swap(struct snd_pmac *chip)
840{
841 struct device_node *mio;
842
843 /* if seems that Keylargo can't byte-swap */
844 for (mio = chip->node->parent; mio; mio = mio->parent) {
845 if (strcmp(mio->name, "mac-io") == 0) {
846 if (device_is_compatible(mio, "Keylargo"))
846 if (of_device_is_compatible(mio, "Keylargo"))
847 chip->can_byte_swap = 0;
848 break;
849 }
850 }
851
852 /* it seems the Pismo & iBook can't byte-swap in hardware. */
853 if (machine_is_compatible("PowerBook3,1") ||
854 machine_is_compatible("PowerBook2,1"))

--- 50 unchanged lines hidden (view full) ---

905 /*
906 * if we didn't find a davbus device, try 'i2s-a' since
907 * this seems to be what iBooks have
908 */
909 if (! chip->node) {
910 chip->node = of_find_node_by_name(NULL, "i2s-a");
911 if (chip->node && chip->node->parent &&
912 chip->node->parent->parent) {
847 chip->can_byte_swap = 0;
848 break;
849 }
850 }
851
852 /* it seems the Pismo & iBook can't byte-swap in hardware. */
853 if (machine_is_compatible("PowerBook3,1") ||
854 machine_is_compatible("PowerBook2,1"))

--- 50 unchanged lines hidden (view full) ---

905 /*
906 * if we didn't find a davbus device, try 'i2s-a' since
907 * this seems to be what iBooks have
908 */
909 if (! chip->node) {
910 chip->node = of_find_node_by_name(NULL, "i2s-a");
911 if (chip->node && chip->node->parent &&
912 chip->node->parent->parent) {
913 if (device_is_compatible(chip->node->parent->parent,
913 if (of_device_is_compatible(chip->node->parent->parent,
914 "K2-Keylargo"))
915 chip->is_k2 = 1;
916 }
917 }
918 if (! chip->node)
919 return -ENODEV;
920
921 if (!sound) {

--- 14 unchanged lines hidden (view full) ---

936 * that have a layout-id property for now */
937 printk(KERN_INFO "snd-powermac no longer handles any "
938 "machines with a layout-id property "
939 "in the device-tree, use snd-aoa.\n");
940 of_node_put(chip->node);
941 return -ENODEV;
942 }
943 /* This should be verified on older screamers */
914 "K2-Keylargo"))
915 chip->is_k2 = 1;
916 }
917 }
918 if (! chip->node)
919 return -ENODEV;
920
921 if (!sound) {

--- 14 unchanged lines hidden (view full) ---

936 * that have a layout-id property for now */
937 printk(KERN_INFO "snd-powermac no longer handles any "
938 "machines with a layout-id property "
939 "in the device-tree, use snd-aoa.\n");
940 of_node_put(chip->node);
941 return -ENODEV;
942 }
943 /* This should be verified on older screamers */
944 if (device_is_compatible(sound, "screamer")) {
944 if (of_device_is_compatible(sound, "screamer")) {
945 chip->model = PMAC_SCREAMER;
946 // chip->can_byte_swap = 0; /* FIXME: check this */
947 }
945 chip->model = PMAC_SCREAMER;
946 // chip->can_byte_swap = 0; /* FIXME: check this */
947 }
948 if (device_is_compatible(sound, "burgundy")) {
948 if (of_device_is_compatible(sound, "burgundy")) {
949 chip->model = PMAC_BURGUNDY;
950 chip->control_mask = MASK_IEPC | 0x11; /* disable IEE */
951 }
949 chip->model = PMAC_BURGUNDY;
950 chip->control_mask = MASK_IEPC | 0x11; /* disable IEE */
951 }
952 if (device_is_compatible(sound, "daca")) {
952 if (of_device_is_compatible(sound, "daca")) {
953 chip->model = PMAC_DACA;
954 chip->can_capture = 0; /* no capture */
955 chip->can_duplex = 0;
956 // chip->can_byte_swap = 0; /* FIXME: check this */
957 chip->control_mask = MASK_IEPC | 0x11; /* disable IEE */
958 }
953 chip->model = PMAC_DACA;
954 chip->can_capture = 0; /* no capture */
955 chip->can_duplex = 0;
956 // chip->can_byte_swap = 0; /* FIXME: check this */
957 chip->control_mask = MASK_IEPC | 0x11; /* disable IEE */
958 }
959 if (device_is_compatible(sound, "tumbler")) {
959 if (of_device_is_compatible(sound, "tumbler")) {
960 chip->model = PMAC_TUMBLER;
961 chip->can_capture = 0; /* no capture */
962 chip->can_duplex = 0;
963 // chip->can_byte_swap = 0; /* FIXME: check this */
964 chip->num_freqs = ARRAY_SIZE(tumbler_freqs);
965 chip->freq_table = tumbler_freqs;
966 chip->control_mask = MASK_IEPC | 0x11; /* disable IEE */
967 }
960 chip->model = PMAC_TUMBLER;
961 chip->can_capture = 0; /* no capture */
962 chip->can_duplex = 0;
963 // chip->can_byte_swap = 0; /* FIXME: check this */
964 chip->num_freqs = ARRAY_SIZE(tumbler_freqs);
965 chip->freq_table = tumbler_freqs;
966 chip->control_mask = MASK_IEPC | 0x11; /* disable IEE */
967 }
968 if (device_is_compatible(sound, "snapper")) {
968 if (of_device_is_compatible(sound, "snapper")) {
969 chip->model = PMAC_SNAPPER;
970 // chip->can_byte_swap = 0; /* FIXME: check this */
971 chip->num_freqs = ARRAY_SIZE(tumbler_freqs);
972 chip->freq_table = tumbler_freqs;
973 chip->control_mask = MASK_IEPC | 0x11; /* disable IEE */
974 }
975 prop = of_get_property(sound, "device-id", NULL);
976 if (prop)

--- 385 unchanged lines hidden ---
969 chip->model = PMAC_SNAPPER;
970 // chip->can_byte_swap = 0; /* FIXME: check this */
971 chip->num_freqs = ARRAY_SIZE(tumbler_freqs);
972 chip->freq_table = tumbler_freqs;
973 chip->control_mask = MASK_IEPC | 0x11; /* disable IEE */
974 }
975 prop = of_get_property(sound, "device-id", NULL);
976 if (prop)

--- 385 unchanged lines hidden ---