]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - sound/firewire/dice.c
ALSA: dice: restrict the driver to playback-only devices
[karo-tx-linux.git] / sound / firewire / dice.c
index 49d630ba2d9fbd3e8be1026daf72f366bfa514e0..6feee6614193a88d894c8f3e4f4942074523e4e6 100644 (file)
@@ -1128,6 +1128,7 @@ static int dice_interface_check(struct fw_unit *unit)
        int key, value, vendor = -1, model = -1, err;
        unsigned int category, i;
        __be32 pointers[ARRAY_SIZE(min_values)];
+       __be32 tx_data[4];
        __be32 version;
 
        /*
@@ -1171,6 +1172,14 @@ static int dice_interface_check(struct fw_unit *unit)
                        return -ENODEV;
        }
 
+       /* We support playback only. Let capture devices be handled by FFADO. */
+       err = snd_fw_transaction(unit, TCODE_READ_BLOCK_REQUEST,
+                                DICE_PRIVATE_SPACE +
+                                be32_to_cpu(pointers[2]) * 4,
+                                tx_data, sizeof(tx_data), 0);
+       if (err < 0 || (tx_data[0] && tx_data[3]))
+               return -ENODEV;
+
        /*
         * Check that the implemented DICE driver specification major version
         * number matches.