[Bluetooth] Add support for newer ANYCOM USB dongles
[pandora-kernel.git] / sound / pci / cs4281.c
index b3c94d8..d54924e 100644 (file)
@@ -33,6 +33,7 @@
 #include <sound/pcm.h>
 #include <sound/rawmidi.h>
 #include <sound/ac97_codec.h>
+#include <sound/tlv.h>
 #include <sound/opl3.h>
 #include <sound/initval.h>
 
@@ -492,9 +493,9 @@ struct cs4281 {
 
 };
 
-static irqreturn_t snd_cs4281_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+static irqreturn_t snd_cs4281_interrupt(int irq, void *dev_id);
 
-static struct pci_device_id snd_cs4281_ids[] __devinitdata = {
+static struct pci_device_id snd_cs4281_ids[] = {
        { 0x1013, 0x6005, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },   /* CS4281 */
        { 0, }
 };
@@ -1054,6 +1055,8 @@ static int snd_cs4281_put_volume(struct snd_kcontrol *kcontrol,
        return change;
 }
 
+static DECLARE_TLV_DB_SCALE(db_scale_dsp, -4650, 150, 0);
+
 static struct snd_kcontrol_new snd_cs4281_fm_vol = 
 {
        .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -1062,6 +1065,7 @@ static struct snd_kcontrol_new snd_cs4281_fm_vol =
        .get = snd_cs4281_get_volume,
        .put = snd_cs4281_put_volume, 
        .private_value = ((BA0_FMLVC << 16) | BA0_FMRVC),
+       .tlv = { .p = db_scale_dsp },
 };
 
 static struct snd_kcontrol_new snd_cs4281_pcm_vol = 
@@ -1072,6 +1076,7 @@ static struct snd_kcontrol_new snd_cs4281_pcm_vol =
        .get = snd_cs4281_get_volume,
        .put = snd_cs4281_put_volume, 
        .private_value = ((BA0_PPLVC << 16) | BA0_PPRVC),
+       .tlv = { .p = db_scale_dsp },
 };
 
 static void snd_cs4281_mixer_free_ac97_bus(struct snd_ac97_bus *bus)
@@ -1184,7 +1189,7 @@ static void __devinit snd_cs4281_proc_init(struct cs4281 * chip)
        struct snd_info_entry *entry;
 
        if (! snd_card_proc_new(chip->card, "cs4281", &entry))
-               snd_info_set_text_ops(entry, chip, 1024, snd_cs4281_proc_read);
+               snd_info_set_text_ops(entry, chip, snd_cs4281_proc_read);
        if (! snd_card_proc_new(chip->card, "cs4281_BA0", &entry)) {
                entry->content = SNDRV_INFO_CONTENT_DATA;
                entry->private_data = chip;
@@ -1379,14 +1384,6 @@ static int __devinit snd_cs4281_create(struct snd_card *card,
        chip->ba0_addr = pci_resource_start(pci, 0);
        chip->ba1_addr = pci_resource_start(pci, 1);
 
-       if (request_irq(pci->irq, snd_cs4281_interrupt, SA_INTERRUPT|SA_SHIRQ,
-                       "CS4281", chip)) {
-               snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
-               snd_cs4281_free(chip);
-               return -ENOMEM;
-       }
-       chip->irq = pci->irq;
-
        chip->ba0 = ioremap_nocache(chip->ba0_addr, pci_resource_len(pci, 0));
        chip->ba1 = ioremap_nocache(chip->ba1_addr, pci_resource_len(pci, 1));
        if (!chip->ba0 || !chip->ba1) {
@@ -1394,6 +1391,14 @@ static int __devinit snd_cs4281_create(struct snd_card *card,
                return -ENOMEM;
        }
        
+       if (request_irq(pci->irq, snd_cs4281_interrupt, IRQF_DISABLED|IRQF_SHARED,
+                       "CS4281", chip)) {
+               snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
+               snd_cs4281_free(chip);
+               return -ENOMEM;
+       }
+       chip->irq = pci->irq;
+
        tmp = snd_cs4281_chip_init(chip);
        if (tmp) {
                snd_cs4281_free(chip);
@@ -1809,7 +1814,7 @@ static int __devinit snd_cs4281_midi(struct cs4281 * chip, int device,
  *  Interrupt handler
  */
 
-static irqreturn_t snd_cs4281_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t snd_cs4281_interrupt(int irq, void *dev_id)
 {
        struct cs4281 *chip = dev_id;
        unsigned int status, dma, val;