]> rtime.felk.cvut.cz Git - linux-imx.git/commitdiff
Merge branch 'for-linus' into for-next
authorTakashi Iwai <tiwai@suse.de>
Mon, 17 Jun 2013 09:16:16 +0000 (11:16 +0200)
committerTakashi Iwai <tiwai@suse.de>
Mon, 17 Jun 2013 09:16:16 +0000 (11:16 +0200)
* for-linus:
  ALSA: hda - Add models for Dell headset jacks

103 files changed:
include/sound/core.h
include/sound/pcm.h
sound/arm/aaci.c
sound/arm/pxa2xx-ac97.c
sound/core/Kconfig
sound/core/init.c
sound/core/pcm_lib.c
sound/drivers/aloop.c
sound/drivers/dummy.c
sound/drivers/ml403-ac97cr.c
sound/drivers/mpu401/mpu401.c
sound/drivers/mtpav.c
sound/drivers/pcsp/pcsp.c
sound/drivers/serial-u16550.c
sound/drivers/virmidi.c
sound/isa/ad1848/ad1848.c
sound/isa/adlib.c
sound/isa/cmi8328.c
sound/isa/cmi8330.c
sound/isa/cs423x/cs4231.c
sound/isa/cs423x/cs4236.c
sound/isa/es1688/es1688.c
sound/isa/es18xx.c
sound/isa/galaxy/galaxy.c
sound/isa/gus/gusclassic.c
sound/isa/gus/gusextreme.c
sound/isa/gus/gusmax.c
sound/isa/gus/interwave.c
sound/isa/msnd/msnd_pinnacle.c
sound/isa/opl3sa2.c
sound/isa/opti9xx/miro.c
sound/isa/opti9xx/opti92x-ad1848.c
sound/isa/sb/jazz16.c
sound/isa/sb/sb16.c
sound/isa/sb/sb8.c
sound/isa/sc6000.c
sound/isa/sscape.c
sound/isa/wavefront/wavefront.c
sound/oss/kahlua.c
sound/parisc/harmony.c
sound/pci/ad1889.c
sound/pci/ali5451/ali5451.c
sound/pci/als300.c
sound/pci/als4000.c
sound/pci/asihpi/hpioctl.c
sound/pci/atiixp.c
sound/pci/atiixp_modem.c
sound/pci/au88x0/au88x0.c
sound/pci/aw2/aw2-alsa.c
sound/pci/azt3328.c
sound/pci/bt87x.c
sound/pci/ca0106/ca0106_main.c
sound/pci/cmipci.c
sound/pci/cs4281.c
sound/pci/cs46xx/cs46xx.c
sound/pci/cs5530.c
sound/pci/cs5535audio/cs5535audio.c
sound/pci/ctxfi/xfi.c
sound/pci/echoaudio/echoaudio.c
sound/pci/emu10k1/emu10k1.c
sound/pci/emu10k1/emu10k1x.c
sound/pci/ens1370.c
sound/pci/es1938.c
sound/pci/es1968.c
sound/pci/fm801.c
sound/pci/hda/Kconfig
sound/pci/hda/hda_codec.c
sound/pci/hda/hda_codec.h
sound/pci/hda/hda_intel.c
sound/pci/hda/patch_realtek.c
sound/pci/hda/patch_sigmatel.c
sound/pci/hda/patch_via.c
sound/pci/ice1712/ice1712.c
sound/pci/ice1712/ice1724.c
sound/pci/intel8x0.c
sound/pci/intel8x0m.c
sound/pci/korg1212/korg1212.c
sound/pci/lola/lola.c
sound/pci/lx6464es/lx6464es.c
sound/pci/maestro3.c
sound/pci/mixart/mixart.c
sound/pci/nm256/nm256.c
sound/pci/oxygen/oxygen_lib.c
sound/pci/pcxhr/pcxhr.c
sound/pci/riptide/riptide.c
sound/pci/rme32.c
sound/pci/rme96.c
sound/pci/rme9652/hdsp.c
sound/pci/rme9652/hdspm.c
sound/pci/rme9652/rme9652.c
sound/pci/sis7019.c
sound/pci/sonicvibes.c
sound/pci/trident/trident.c
sound/pci/via82xx.c
sound/pci/via82xx_modem.c
sound/pci/vx222/vx222.c
sound/pci/ymfpci/ymfpci.c
sound/ppc/powermac.c
sound/sh/aica.c
sound/sh/sh_dac_audio.c
sound/sparc/dbri.c
sound/spi/at73c213.c
sound/usb/usx2y/usbusx2yaudio.c

index 5bfe5136441c748de80c27992c94d6d60deb96bc..c586617cfa0dffaa2cdce5e548f78fed28e1f63e 100644 (file)
@@ -30,7 +30,7 @@
 
 /* number of supported soundcards */
 #ifdef CONFIG_SND_DYNAMIC_MINORS
-#define SNDRV_CARDS 32
+#define SNDRV_CARDS CONFIG_SND_MAX_CARDS
 #else
 #define SNDRV_CARDS 8          /* don't change - minor numbers */
 #endif
index b48792fe386b5e2ae18fb7be8799bea78f38b8a0..84b10f9a28324951a2a56d1cc89df9d50e0623bb 100644 (file)
@@ -384,7 +384,7 @@ struct snd_pcm_substream {
        unsigned int dma_buf_id;
        size_t dma_max;
        /* -- hardware operations -- */
-       struct snd_pcm_ops *ops;
+       const struct snd_pcm_ops *ops;
        /* -- runtime information -- */
        struct snd_pcm_runtime *runtime;
         /* -- timer section -- */
@@ -871,7 +871,8 @@ const unsigned char *snd_pcm_format_silence_64(snd_pcm_format_t format);
 int snd_pcm_format_set_silence(snd_pcm_format_t format, void *buf, unsigned int frames);
 snd_pcm_format_t snd_pcm_build_linear_format(int width, int unsigned, int big_endian);
 
-void snd_pcm_set_ops(struct snd_pcm * pcm, int direction, struct snd_pcm_ops *ops);
+void snd_pcm_set_ops(struct snd_pcm * pcm, int direction,
+                    const struct snd_pcm_ops *ops);
 void snd_pcm_set_sync(struct snd_pcm_substream *substream);
 int snd_pcm_lib_interleave_len(struct snd_pcm_substream *substream);
 int snd_pcm_lib_ioctl(struct snd_pcm_substream *substream,
index aa5d8034890b5f6d3fc7ede653862e17bf46b9db..1ca8dc2ccb89f21cb0d102d2d4cd4cc0c74e4bf0 100644 (file)
@@ -1076,8 +1076,6 @@ static int aaci_remove(struct amba_device *dev)
 {
        struct snd_card *card = amba_get_drvdata(dev);
 
-       amba_set_drvdata(dev, NULL);
-
        if (card) {
                struct aaci *aaci = card->private_data;
                writel(0, aaci->base + AACI_MAINCR);
index ec54be4efff09c48ec1ff7a5b09318a831ac563e..ce431e6e07cfc7df27e8320d6da1b13516310df9 100644 (file)
@@ -230,7 +230,6 @@ static int pxa2xx_ac97_remove(struct platform_device *dev)
 
        if (card) {
                snd_card_free(card);
-               platform_set_drvdata(dev, NULL);
                pxa2xx_ac97_hw_remove(dev);
        }
 
index b413ed05e74deae78fbd97809c99f0fd68f1ee46..c0c2f57a0d6f332b6143c3eaa6850921c1dde485 100644 (file)
@@ -157,6 +157,15 @@ config SND_DYNAMIC_MINORS
 
          If you are unsure about this, say N here.
 
+config SND_MAX_CARDS
+       int "Max number of sound cards"
+       range 4 256
+       default 32
+       depends on SND_DYNAMIC_MINORS
+       help
+         Specify the max number of sound cards that can be assigned
+         on a single machine.
+
 config SND_SUPPORT_OLD_API
        bool "Support old ALSA API"
        default y
index 6ef06400dfc83884f2feaf6ddd26529498bae8c3..6b9087115da24806e8aba244127ac8ec3a4e93f8 100644 (file)
@@ -46,7 +46,8 @@ static LIST_HEAD(shutdown_files);
 
 static const struct file_operations snd_shutdown_f_ops;
 
-static unsigned int snd_cards_lock;    /* locked for registering/using */
+/* locked for registering/using */
+static DECLARE_BITMAP(snd_cards_lock, SNDRV_CARDS);
 struct snd_card *snd_cards[SNDRV_CARDS];
 EXPORT_SYMBOL(snd_cards);
 
@@ -167,29 +168,35 @@ int snd_card_create(int idx, const char *xid,
        err = 0;
        mutex_lock(&snd_card_mutex);
        if (idx < 0) {
-               for (idx2 = 0; idx2 < SNDRV_CARDS; idx2++)
+               for (idx2 = 0; idx2 < SNDRV_CARDS; idx2++) {
                        /* idx == -1 == 0xffff means: take any free slot */
-                       if (~snd_cards_lock & idx & 1<<idx2) {
+                       if (idx2 < sizeof(int) && !(idx & (1U << idx2)))
+                               continue;
+                       if (!test_bit(idx2, snd_cards_lock)) {
                                if (module_slot_match(module, idx2)) {
                                        idx = idx2;
                                        break;
                                }
                        }
+               }
        }
        if (idx < 0) {
-               for (idx2 = 0; idx2 < SNDRV_CARDS; idx2++)
+               for (idx2 = 0; idx2 < SNDRV_CARDS; idx2++) {
                        /* idx == -1 == 0xffff means: take any free slot */
-                       if (~snd_cards_lock & idx & 1<<idx2) {
+                       if (idx2 < sizeof(int) && !(idx & (1U << idx2)))
+                               continue;
+                       if (!test_bit(idx2, snd_cards_lock)) {
                                if (!slots[idx2] || !*slots[idx2]) {
                                        idx = idx2;
                                        break;
                                }
                        }
+               }
        }
        if (idx < 0)
                err = -ENODEV;
        else if (idx < snd_ecards_limit) {
-               if (snd_cards_lock & (1 << idx))
+               if (test_bit(idx, snd_cards_lock))
                        err = -EBUSY;   /* invalid */
        } else if (idx >= SNDRV_CARDS)
                err = -ENODEV;
@@ -199,7 +206,7 @@ int snd_card_create(int idx, const char *xid,
                         idx, snd_ecards_limit - 1, err);
                goto __error;
        }
-       snd_cards_lock |= 1 << idx;             /* lock it */
+       set_bit(idx, snd_cards_lock);           /* lock it */
        if (idx >= snd_ecards_limit)
                snd_ecards_limit = idx + 1; /* increase the limit */
        mutex_unlock(&snd_card_mutex);
@@ -249,7 +256,7 @@ int snd_card_locked(int card)
        int locked;
 
        mutex_lock(&snd_card_mutex);
-       locked = snd_cards_lock & (1 << card);
+       locked = test_bit(card, snd_cards_lock);
        mutex_unlock(&snd_card_mutex);
        return locked;
 }
@@ -361,7 +368,7 @@ int snd_card_disconnect(struct snd_card *card)
        /* phase 1: disable fops (user space) operations for ALSA API */
        mutex_lock(&snd_card_mutex);
        snd_cards[card->number] = NULL;
-       snd_cards_lock &= ~(1 << card->number);
+       clear_bit(card->number, snd_cards_lock);
        mutex_unlock(&snd_card_mutex);
        
        /* phase 2: replace file->f_op with special dummy operations */
@@ -549,7 +556,6 @@ static void snd_card_set_id_no_lock(struct snd_card *card, const char *src,
                                    const char *nid)
 {
        int len, loops;
-       bool with_suffix;
        bool is_default = false;
        char *id;
        
@@ -565,26 +571,23 @@ static void snd_card_set_id_no_lock(struct snd_card *card, const char *src,
                is_default = true;
        }
 
-       with_suffix = false;
+       len = strlen(id);
        for (loops = 0; loops < SNDRV_CARDS; loops++) {
+               char *spos;
+               char sfxstr[5]; /* "_012" */
+               int sfxlen;
+
                if (card_id_ok(card, id))
                        return; /* OK */
 
-               len = strlen(id);
-               if (!with_suffix) {
-                       /* add the "_X" suffix */
-                       char *spos = id + len;
-                       if (len >  sizeof(card->id) - 3)
-                               spos = id + sizeof(card->id) - 3;
-                       strcpy(spos, "_1");
-                       with_suffix = true;
-               } else {
-                       /* modify the existing suffix */
-                       if (id[len - 1] != '9')
-                               id[len - 1]++;
-                       else
-                               id[len - 1] = 'A';
-               }
+               /* Add _XYZ suffix */
+               sprintf(sfxstr, "_%X", loops + 1);
+               sfxlen = strlen(sfxstr);
+               if (len + sfxlen >= sizeof(card->id))
+                       spos = id + sizeof(card->id) - sfxlen - 1;
+               else
+                       spos = id + len;
+               strcpy(spos, sfxstr);
        }
        /* fallback to the default id */
        if (!is_default) {
index 41b3dfe68698985e2d5f7e85a4e8411cb6a6371e..82bb029d4414155e60ae2a01ddd4707d926b83ae 100644 (file)
@@ -568,7 +568,8 @@ int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream)
  *
  * Sets the given PCM operators to the pcm instance.
  */
-void snd_pcm_set_ops(struct snd_pcm *pcm, int direction, struct snd_pcm_ops *ops)
+void snd_pcm_set_ops(struct snd_pcm *pcm, int direction,
+                    const struct snd_pcm_ops *ops)
 {
        struct snd_pcm_str *stream = &pcm->streams[direction];
        struct snd_pcm_substream *substream;
index 6f78de9c6fb68bbcedcbbbe473d1eb6c837d24a6..f7589923effa08f25094b87423e559414e7f8aaf 100644 (file)
@@ -1183,7 +1183,6 @@ static int loopback_probe(struct platform_device *devptr)
 static int loopback_remove(struct platform_device *devptr)
 {
        snd_card_free(platform_get_drvdata(devptr));
-       platform_set_drvdata(devptr, NULL);
        return 0;
 }
 
index fd798f753609c81a64e6391132d73543cfbf1761..11048cc744d0ef01034ce0a9aceb517ff202b5a5 100644 (file)
@@ -1129,7 +1129,6 @@ static int snd_dummy_probe(struct platform_device *devptr)
 static int snd_dummy_remove(struct platform_device *devptr)
 {
        snd_card_free(platform_get_drvdata(devptr));
-       platform_set_drvdata(devptr, NULL);
        return 0;
 }
 
index 8125a7e95ee4dd0bf93dbd07291abb17dbcd1347..95ea4a153ea43afb916de2ad86ffd2990650d355 100644 (file)
@@ -1325,7 +1325,6 @@ static int snd_ml403_ac97cr_probe(struct platform_device *pfdev)
 static int snd_ml403_ac97cr_remove(struct platform_device *pfdev)
 {
        snd_card_free(platform_get_drvdata(pfdev));
-       platform_set_drvdata(pfdev, NULL);
        return 0;
 }
 
index da1a29bfc85d7a21c91f8efb6f29edaae6fa0677..90a3a7b38a2a01eee908c7975f1dedce783a2948 100644 (file)
@@ -129,7 +129,6 @@ static int snd_mpu401_probe(struct platform_device *devptr)
 static int snd_mpu401_remove(struct platform_device *devptr)
 {
        snd_card_free(platform_get_drvdata(devptr));
-       platform_set_drvdata(devptr, NULL);
        return 0;
 }
 
index 9f1815b99a15235ec2923e39ed040998ee7a3448..e5ec7eb27dec5f873c36b6c6f5e3e79a44fdddfe 100644 (file)
@@ -749,7 +749,6 @@ static int snd_mtpav_probe(struct platform_device *dev)
 static int snd_mtpav_remove(struct platform_device *devptr)
 {
        snd_card_free(platform_get_drvdata(devptr));
-       platform_set_drvdata(devptr, NULL);
        return 0;
 }
 
index 7a5fdb9b0afcd000acc649042a38f182cc280f4e..1c19cd7ad26e76af7c71b6615ae291aeed42faf7 100644 (file)
@@ -189,7 +189,6 @@ static int pcsp_remove(struct platform_device *dev)
        struct snd_pcsp *chip = platform_get_drvdata(dev);
        alsa_card_pcsp_exit(chip);
        pcspkr_input_remove(chip->input_dev);
-       platform_set_drvdata(dev, NULL);
        return 0;
 }
 
index 7425dd8c1f095072d3163d98ccd5378594627886..e0bf5e77b43ae757d1f607b5c86a3636a4e371df 100644 (file)
@@ -985,7 +985,6 @@ static int snd_serial_probe(struct platform_device *devptr)
 static int snd_serial_remove(struct platform_device *devptr)
 {
        snd_card_free(platform_get_drvdata(devptr));
-       platform_set_drvdata(devptr, NULL);
        return 0;
 }
 
index cc4be88d73184a6e538a4eb961c3f47c182abdd0..ace3879e8d9649fb95a8d65a4c3481e0ce0e49a4 100644 (file)
@@ -132,7 +132,6 @@ static int snd_virmidi_probe(struct platform_device *devptr)
 static int snd_virmidi_remove(struct platform_device *devptr)
 {
        snd_card_free(platform_get_drvdata(devptr));
-       platform_set_drvdata(devptr, NULL);
        return 0;
 }
 
index c214ecf45400a1c7de02aacaf0d68b6495ae719e..e3f455bd85cd55c12ac8d561ef0793ba96ab8c4f 100644 (file)
@@ -135,7 +135,6 @@ out:        snd_card_free(card);
 static int snd_ad1848_remove(struct device *dev, unsigned int n)
 {
        snd_card_free(dev_get_drvdata(dev));
-       dev_set_drvdata(dev, NULL);
        return 0;
 }
 
index d26545543732dab8b0805a97dbbcb9f40ba22b28..35659218710f93f1d738b327f4f43c650b8043cc 100644 (file)
@@ -101,7 +101,6 @@ out:        snd_card_free(card);
 static int snd_adlib_remove(struct device *dev, unsigned int n)
 {
        snd_card_free(dev_get_drvdata(dev));
-       dev_set_drvdata(dev, NULL);
        return 0;
 }
 
index a7369fe19a6f045fdf5098ed93660f07997489c2..f84f073fc1e82db9738788f2d930d75993c98c2d 100644 (file)
@@ -418,7 +418,6 @@ static int snd_cmi8328_remove(struct device *pdev, unsigned int dev)
        snd_cmi8328_cfg_write(cmi->port, CFG2, 0);
        snd_cmi8328_cfg_write(cmi->port, CFG3, 0);
        snd_card_free(card);
-       dev_set_drvdata(pdev, NULL);
        return 0;
 }
 
index c707c52268ab44aed2d1165079e889c6470de344..270b9659ef7f703790a65531fc0205ddfead3c3a 100644 (file)
@@ -651,7 +651,6 @@ static int snd_cmi8330_isa_remove(struct device *devptr,
                                  unsigned int dev)
 {
        snd_card_free(dev_get_drvdata(devptr));
-       dev_set_drvdata(devptr, NULL);
        return 0;
 }
 
index aa7a5d86e480412b1bb2da2411847e5d574d0880..ba9a74eff3e0dda98644dbe13df9cdb505e3043f 100644 (file)
@@ -151,7 +151,6 @@ out:        snd_card_free(card);
 static int snd_cs4231_remove(struct device *dev, unsigned int n)
 {
        snd_card_free(dev_get_drvdata(dev));
-       dev_set_drvdata(dev, NULL);
        return 0;
 }
 
index 252e9fb37db34bc862627255e129f1f36f50ed86..69614acb20520678ea0c58c5dbfb5a4a74563772 100644 (file)
@@ -504,7 +504,6 @@ static int snd_cs423x_isa_remove(struct device *pdev,
                                 unsigned int dev)
 {
        snd_card_free(dev_get_drvdata(pdev));
-       dev_set_drvdata(pdev, NULL);
        return 0;
 }
 
@@ -600,7 +599,6 @@ static int snd_cs423x_pnpbios_detect(struct pnp_dev *pdev,
 static void snd_cs423x_pnp_remove(struct pnp_dev *pdev)
 {
        snd_card_free(pnp_get_drvdata(pdev));
-       pnp_set_drvdata(pdev, NULL);
 }
 
 #ifdef CONFIG_PM
index 102874a703d4cc8c53e98db88728215ef60cbec6..cdcfb57f1f0a94226d2f131d1005117c33766627 100644 (file)
@@ -213,7 +213,6 @@ out:
 static int snd_es1688_isa_remove(struct device *dev, unsigned int n)
 {
        snd_card_free(dev_get_drvdata(dev));
-       dev_set_drvdata(dev, NULL);
        return 0;
 }
 
index 24380efe31a11099417f3422838f5854249cf286..12978b864c3ab52b8cc1388d24d15ead0fd4f690 100644 (file)
@@ -2235,7 +2235,6 @@ static int snd_es18xx_isa_remove(struct device *devptr,
                                 unsigned int dev)
 {
        snd_card_free(dev_get_drvdata(devptr));
-       dev_set_drvdata(devptr, NULL);
        return 0;
 }
 
@@ -2305,7 +2304,6 @@ static int snd_audiodrive_pnp_detect(struct pnp_dev *pdev,
 static void snd_audiodrive_pnp_remove(struct pnp_dev *pdev)
 {
        snd_card_free(pnp_get_drvdata(pdev));
-       pnp_set_drvdata(pdev, NULL);
 }
 
 #ifdef CONFIG_PM
index 672184e3221a6e2765accc287c8e7b47596ff235..81244e7cea5be0d32d00cf14fe2a461432cd1082 100644 (file)
@@ -623,7 +623,6 @@ error:
 static int snd_galaxy_remove(struct device *dev, unsigned int n)
 {
        snd_card_free(dev_get_drvdata(dev));
-       dev_set_drvdata(dev, NULL);
        return 0;
 }
 
index 16bca4e96c08a01d5af759c95626b7bcbcc53065..1adc1b924f39f4e3d3dc7a4d4414568a3cb10b7c 100644 (file)
@@ -215,7 +215,6 @@ out:        snd_card_free(card);
 static int snd_gusclassic_remove(struct device *dev, unsigned int n)
 {
        snd_card_free(dev_get_drvdata(dev));
-       dev_set_drvdata(dev, NULL);
        return 0;
 }
 
index 0b9c2426b49f05608a3e0c099a9efdad20157cdf..38e1e3260c2453be6c07d0dfecdb48d5869bba78 100644 (file)
@@ -344,7 +344,6 @@ out:        snd_card_free(card);
 static int snd_gusextreme_remove(struct device *dev, unsigned int n)
 {
        snd_card_free(dev_get_drvdata(dev));
-       dev_set_drvdata(dev, NULL);
        return 0;
 }
 
index c309a5d0e7e12e0eba6a3fc8a4d1414aebf5408c..652d5d834620daa453caf9390b618e1fcc46afa6 100644 (file)
@@ -357,7 +357,6 @@ static int snd_gusmax_probe(struct device *pdev, unsigned int dev)
 static int snd_gusmax_remove(struct device *devptr, unsigned int dev)
 {
        snd_card_free(dev_get_drvdata(devptr));
-       dev_set_drvdata(devptr, NULL);
        return 0;
 }
 
index 78bc5744e89a0cb66a34628916632186c8dd3029..9942691cc0ca9c101bfd830b134bc4e97bddb727 100644 (file)
@@ -849,7 +849,6 @@ static int snd_interwave_isa_probe(struct device *pdev,
 static int snd_interwave_isa_remove(struct device *devptr, unsigned int dev)
 {
        snd_card_free(dev_get_drvdata(devptr));
-       dev_set_drvdata(devptr, NULL);
        return 0;
 }
 
index ddabb406b14cbacfe660678fe72326fab49bc15c..81aeb934261a26d2f2fca18060f21517b4650b32 100644 (file)
@@ -1064,7 +1064,6 @@ cfg_error:
 static int snd_msnd_isa_remove(struct device *pdev, unsigned int dev)
 {
        snd_msnd_unload(dev_get_drvdata(pdev));
-       dev_set_drvdata(pdev, NULL);
        return 0;
 }
 
index 075777a6cf0b3d165ff27d537eb48a9573d6b1f4..cc01c419b7e91931a1b61d0170d101256d9446fe 100644 (file)
@@ -757,7 +757,6 @@ static int snd_opl3sa2_pnp_detect(struct pnp_dev *pdev,
 static void snd_opl3sa2_pnp_remove(struct pnp_dev *pdev)
 {
        snd_card_free(pnp_get_drvdata(pdev));
-       pnp_set_drvdata(pdev, NULL);
 }
 
 #ifdef CONFIG_PM
@@ -900,7 +899,6 @@ static int snd_opl3sa2_isa_remove(struct device *devptr,
                                  unsigned int dev)
 {
        snd_card_free(dev_get_drvdata(devptr));
-       dev_set_drvdata(devptr, NULL);
        return 0;
 }
 
index c3da1df9371df1c4c5cce4c6c00001906d270395..619753d96ca5e1cfbc51d4fd146cba5e9b520cfe 100644 (file)
@@ -1495,7 +1495,6 @@ static int snd_miro_isa_remove(struct device *devptr,
                               unsigned int dev)
 {
        snd_card_free(dev_get_drvdata(devptr));
-       dev_set_drvdata(devptr, NULL);
        return 0;
 }
 
index b41ed8661b237abd41676cf2bed810686028e046..103b33373fd4d8e83233c7e08d2478b64302c840 100644 (file)
@@ -1035,7 +1035,6 @@ static int snd_opti9xx_isa_remove(struct device *devptr,
                                  unsigned int dev)
 {
        snd_card_free(dev_get_drvdata(devptr));
-       dev_set_drvdata(devptr, NULL);
        return 0;
 }
 
index 4961da4e627c24878c5cf0537cf70ffd90c8b221..356a6308392f29a19fabd4e670cafdac35cc3486 100644 (file)
@@ -345,7 +345,6 @@ static int snd_jazz16_remove(struct device *devptr, unsigned int dev)
 {
        struct snd_card *card = dev_get_drvdata(devptr);
 
-       dev_set_drvdata(devptr, NULL);
        snd_card_free(card);
        return 0;
 }
index 50dbec454f9872df065c54667d77e6ac1753f635..a4130993955f39d0781983c7f12060ba518c0770 100644 (file)
@@ -566,7 +566,6 @@ static int snd_sb16_isa_probe(struct device *pdev, unsigned int dev)
 static int snd_sb16_isa_remove(struct device *pdev, unsigned int dev)
 {
        snd_card_free(dev_get_drvdata(pdev));
-       dev_set_drvdata(pdev, NULL);
        return 0;
 }
 
index 237d964ff8a6bcd49a955ff266f19494d6fa3cec..a806ae90a9449246cd9b8a43ae6924f7439def21 100644 (file)
@@ -208,7 +208,6 @@ static int snd_sb8_probe(struct device *pdev, unsigned int dev)
 static int snd_sb8_remove(struct device *pdev, unsigned int dev)
 {
        snd_card_free(dev_get_drvdata(pdev));
-       dev_set_drvdata(pdev, NULL);
        return 0;
 }
 
index 5376ebff845ec4a091dfc38349b7d6c337633bad..09d481b3ba7fae52346ccdb273403e32c76e4862 100644 (file)
@@ -698,7 +698,6 @@ static int snd_sc6000_remove(struct device *devptr, unsigned int dev)
        release_region(port[dev], 0x10);
        release_region(mss_port[dev], 4);
 
-       dev_set_drvdata(devptr, NULL);
        snd_card_free(card);
        return 0;
 }
index 42a009720b29c2e89201e923b6160c4f3ed52136..57b338973ede0c99ff9b2b291761bc2d1dfa62c3 100644 (file)
@@ -1200,7 +1200,6 @@ _release_card:
 static int snd_sscape_remove(struct device *devptr, unsigned int dev)
 {
        snd_card_free(dev_get_drvdata(devptr));
-       dev_set_drvdata(devptr, NULL);
        return 0;
 }
 
index fe5dd982bd2384a6e14fa837292f4f381b092352..82dd76939fa040b639f32cb33d072fecafd22239 100644 (file)
@@ -581,7 +581,6 @@ static int snd_wavefront_isa_remove(struct device *devptr,
                                    unsigned int dev)
 {
        snd_card_free(dev_get_drvdata(devptr));
-       dev_set_drvdata(devptr, NULL);
        return 0;
 }
 
index 2a44cc10645924820972e8a1cf90e00ac5881ab7..12be1fb512dd277a8df2f104ba11f91365c0033d 100644 (file)
@@ -178,7 +178,6 @@ static int probe_one(struct pci_dev *pdev, const struct pci_device_id *ent)
        return 0;
 
 err_out_free:
-       pci_set_drvdata(pdev, NULL);
        kfree(hw_config);
        return 1;
 }
@@ -187,7 +186,6 @@ static void remove_one(struct pci_dev *pdev)
 {
        struct address_info *hw_config = pci_get_drvdata(pdev);
        sb_dsp_unload(hw_config, 0);
-       pci_set_drvdata(pdev, NULL);
        kfree(hw_config);
 }
 
index 0e66ba48d453fd9e81e431623320d8e86f3ad758..67f56a2cee6aec83bd4710f645a82cdca9e39847 100644 (file)
@@ -902,8 +902,6 @@ snd_harmony_free(struct snd_harmony *h)
        if (h->iobase)
                iounmap(h->iobase);
 
-       parisc_set_drvdata(h->dev, NULL);
-
        kfree(h);
        return 0;
 }
@@ -1016,7 +1014,6 @@ static int
 snd_harmony_remove(struct parisc_device *padev)
 {
        snd_card_free(parisc_get_drvdata(padev));
-       parisc_set_drvdata(padev, NULL);
        return 0;
 }
 
index ad8a31173939d80a6738656579a2a88bd793ac86..d2b9d617aee52e1343a61e134e1c82f97db2c272 100644 (file)
@@ -1046,7 +1046,6 @@ static void
 snd_ad1889_remove(struct pci_dev *pci)
 {
        snd_card_free(pci_get_drvdata(pci));
-       pci_set_drvdata(pci, NULL);
 }
 
 static DEFINE_PCI_DEVICE_TABLE(snd_ad1889_ids) = {
index 53754f5edeb13062ddfc1cfb28e5d0e8179c1cb3..3dfa12b670ebfaf0a9ce5c04fed7710eea28b211 100644 (file)
@@ -2298,7 +2298,6 @@ static int snd_ali_probe(struct pci_dev *pci,
 static void snd_ali_remove(struct pci_dev *pci)
 {
        snd_card_free(pci_get_drvdata(pci));
-       pci_set_drvdata(pci, NULL);
 }
 
 static struct pci_driver ali5451_driver = {
index 864c4310366b4da41ad891ce829d0e2fc0a10300..591efb6eef05687a93ce4cd3b77a8a9134b6aa33 100644 (file)
@@ -282,7 +282,6 @@ static void snd_als300_remove(struct pci_dev *pci)
 {
        snd_als300_dbgcallenter();
        snd_card_free(pci_get_drvdata(pci));
-       pci_set_drvdata(pci, NULL);
        snd_als300_dbgcallleave();
 }
 
index 61efda2a4d949f56d4ace3b82daf1fe37dc4660b..ffc821b0139e9a3566ca56856667f443ba954d35 100644 (file)
@@ -984,7 +984,6 @@ out:
 static void snd_card_als4000_remove(struct pci_dev *pci)
 {
        snd_card_free(pci_get_drvdata(pci));
-       pci_set_drvdata(pci, NULL);
 }
 
 #ifdef CONFIG_PM_SLEEP
index ef5019fe51930a7cedda5bc32949633d950dd878..7f0272032fbb2b25e8c8104523b41a7a5dc82f04 100644 (file)
@@ -445,7 +445,6 @@ void asihpi_adapter_remove(struct pci_dev *pci_dev)
        if (pa->p_buffer)
                vfree(pa->p_buffer);
 
-       pci_set_drvdata(pci_dev, NULL);
        if (1)
                dev_info(&pci_dev->dev,
                         "remove %04x:%04x,%04x:%04x,%04x, HPI index %d\n",
index 6e78c6789858394b16c7c4543d4c30874602c978..fe4c61bdb8bac5764556bce3da8301653042d2c3 100644 (file)
@@ -1714,7 +1714,6 @@ static int snd_atiixp_probe(struct pci_dev *pci,
 static void snd_atiixp_remove(struct pci_dev *pci)
 {
        snd_card_free(pci_get_drvdata(pci));
-       pci_set_drvdata(pci, NULL);
 }
 
 static struct pci_driver atiixp_driver = {
index d0bec7ba3b0d8f3eb610807525e071ed53c4e220..cf29b9a1d65d71dbcc0608b1db89bef5273a199b 100644 (file)
@@ -1334,7 +1334,6 @@ static int snd_atiixp_probe(struct pci_dev *pci,
 static void snd_atiixp_remove(struct pci_dev *pci)
 {
        snd_card_free(pci_get_drvdata(pci));
-       pci_set_drvdata(pci, NULL);
 }
 
 static struct pci_driver atiixp_modem_driver = {
index b157e1fadd8fb3b014575cefe8e3f317bc3747f3..7059dd69e5e611598530edf8ba6b6beba7a16050 100644 (file)
@@ -371,7 +371,6 @@ snd_vortex_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
 static void snd_vortex_remove(struct pci_dev *pci)
 {
        snd_card_free(pci_get_drvdata(pci));
-       pci_set_drvdata(pci, NULL);
 }
 
 // pci_driver definition
index 08e9a4702cbc4cafcd34a9d52c2219da0c6ca441..2925220d3fcf84afdd27c0636b5b1939cd087f3f 100644 (file)
@@ -392,7 +392,6 @@ static int snd_aw2_probe(struct pci_dev *pci,
 static void snd_aw2_remove(struct pci_dev *pci)
 {
        snd_card_free(pci_get_drvdata(pci));
-       pci_set_drvdata(pci, NULL);
 }
 
 /* open callback */
index 1204a0fa336889c0bc92600496520e2b07961b20..c8e1216115936015a73e67df84e2c83ecc0d1975 100644 (file)
@@ -2725,7 +2725,6 @@ snd_azf3328_remove(struct pci_dev *pci)
 {
        snd_azf3328_dbgcallenter();
        snd_card_free(pci_get_drvdata(pci));
-       pci_set_drvdata(pci, NULL);
        snd_azf3328_dbgcallleave();
 }
 
index 9febe5509748ed5a1cdc2556d441ff770f31f8ea..18802039497afd3dfcafdd53dd1d0d62e503c4cc 100644 (file)
@@ -953,7 +953,6 @@ _error:
 static void snd_bt87x_remove(struct pci_dev *pci)
 {
        snd_card_free(pci_get_drvdata(pci));
-       pci_set_drvdata(pci, NULL);
 }
 
 /* default entries for all Bt87x cards - it's not exported */
index 1610a5705970790973d0eecdd6b34d36c1d4506b..f4db5587e86ee9b3f509d1541b9ae85c0a64cbab 100644 (file)
@@ -1896,7 +1896,6 @@ static int snd_ca0106_probe(struct pci_dev *pci,
 static void snd_ca0106_remove(struct pci_dev *pci)
 {
        snd_card_free(pci_get_drvdata(pci));
-       pci_set_drvdata(pci, NULL);
 }
 
 #ifdef CONFIG_PM_SLEEP
index c617435db6e6532a1caad658a4cb7773bc252d2a..2755ec5bcc258d695d534f3ca99d895218c49215 100644 (file)
@@ -3317,7 +3317,6 @@ static int snd_cmipci_probe(struct pci_dev *pci,
 static void snd_cmipci_remove(struct pci_dev *pci)
 {
        snd_card_free(pci_get_drvdata(pci));
-       pci_set_drvdata(pci, NULL);
 }
 
 
index 6a86950699415527261c4d938bbe7cfaca328010..64659facd1554cc66e50cced02bfd20c4da649cc 100644 (file)
@@ -1971,7 +1971,6 @@ static int snd_cs4281_probe(struct pci_dev *pci,
 static void snd_cs4281_remove(struct pci_dev *pci)
 {
        snd_card_free(pci_get_drvdata(pci));
-       pci_set_drvdata(pci, NULL);
 }
 
 /*
index 6b0d8b50a305d4a632f6702a7a445c2febdc3733..b03498325d661d091ca18d84614fdebd1fb22032 100644 (file)
@@ -158,7 +158,6 @@ static int snd_card_cs46xx_probe(struct pci_dev *pci,
 static void snd_card_cs46xx_remove(struct pci_dev *pci)
 {
        snd_card_free(pci_get_drvdata(pci));
-       pci_set_drvdata(pci, NULL);
 }
 
 static struct pci_driver cs46xx_driver = {
index dace827b45d1390401b2f8ae7a0a1fa78cfc0cb8..c6b82c85e044b9eec35e212f2dc487452651430e 100644 (file)
@@ -91,7 +91,6 @@ static int snd_cs5530_dev_free(struct snd_device *device)
 static void snd_cs5530_remove(struct pci_dev *pci)
 {
        snd_card_free(pci_get_drvdata(pci));
-       pci_set_drvdata(pci, NULL);
 }
 
 static u8 snd_cs5530_mixer_read(unsigned long io, u8 reg)
index 7e4b13e2d12aa84d89e7532f23a9b5053f8c1b2c..902bebd3b3fb6d660a9d5f00ddca921c149a7009 100644 (file)
@@ -391,7 +391,6 @@ static void snd_cs5535audio_remove(struct pci_dev *pci)
 {
        olpc_quirks_cleanup();
        snd_card_free(pci_get_drvdata(pci));
-       pci_set_drvdata(pci, NULL);
 }
 
 static struct pci_driver cs5535audio_driver = {
index d01ffcb2b2f5f823033869f24faf1a12b7cc70df..d464ad2fc7b71632afd81df4ef0e3ea4dda265f2 100644 (file)
@@ -122,7 +122,6 @@ error:
 static void ct_card_remove(struct pci_dev *pci)
 {
        snd_card_free(pci_get_drvdata(pci));
-       pci_set_drvdata(pci, NULL);
 }
 
 #ifdef CONFIG_PM_SLEEP
index 760cbff532105f3bf56485082a43f0e6177fbad9..05cfe551ce425b6d4049755688d6d76883e768c8 100644 (file)
@@ -2323,7 +2323,6 @@ static void snd_echo_remove(struct pci_dev *pci)
        chip = pci_get_drvdata(pci);
        if (chip)
                snd_card_free(chip->card);
-       pci_set_drvdata(pci, NULL);
 }
 
 
index 8c5010f7889cbd57192cfaa03d77972f7522aded..9e1bd0c39a8cf27230bd50196a525d1c2c3f525d 100644 (file)
@@ -202,7 +202,6 @@ static int snd_card_emu10k1_probe(struct pci_dev *pci,
 static void snd_card_emu10k1_remove(struct pci_dev *pci)
 {
        snd_card_free(pci_get_drvdata(pci));
-       pci_set_drvdata(pci, NULL);
 }
 
 
index cdff11d48ebd5b4316584552ca7191e4ee7aee97..56ad9d6f200df7daa7de21fea6d7d59ef502c881 100644 (file)
@@ -1623,7 +1623,6 @@ static int snd_emu10k1x_probe(struct pci_dev *pci,
 static void snd_emu10k1x_remove(struct pci_dev *pci)
 {
        snd_card_free(pci_get_drvdata(pci));
-       pci_set_drvdata(pci, NULL);
 }
 
 // PCI IDs
index db2dc835171d2a6bf9ee8d4468ca6e54911b06c2..372f8ea91fcaa0f37132e64671ca47235bab3a69 100644 (file)
@@ -2497,7 +2497,6 @@ static int snd_audiopci_probe(struct pci_dev *pci,
 static void snd_audiopci_remove(struct pci_dev *pci)
 {
        snd_card_free(pci_get_drvdata(pci));
-       pci_set_drvdata(pci, NULL);
 }
 
 static struct pci_driver ens137x_driver = {
index 8423403954abfae68b01ab7a96e93f0e025d1628..9213fb38921c6b7687bfaaa262c6c3b3de0a09d3 100644 (file)
@@ -1881,7 +1881,6 @@ static int snd_es1938_probe(struct pci_dev *pci,
 static void snd_es1938_remove(struct pci_dev *pci)
 {
        snd_card_free(pci_get_drvdata(pci));
-       pci_set_drvdata(pci, NULL);
 }
 
 static struct pci_driver es1938_driver = {
index a1f32b5ae0d1b4131a7ba7b9a8d2366bfd959e3d..5e2ec9687731119d80ebc5994b2bdb8fcec06c0d 100644 (file)
@@ -564,6 +564,7 @@ struct es1968 {
 #ifdef CONFIG_SND_ES1968_RADIO
        struct v4l2_device v4l2_dev;
        struct snd_tea575x tea;
+       unsigned int tea575x_tuner;
 #endif
 };
 
@@ -2557,37 +2558,47 @@ static int snd_es1968_input_register(struct es1968 *chip)
                                bits 1=unmask write to given bit */
 #define IO_DIR         8      /* direction register offset from GPIO_DATA
                                bits 0/1=read/write direction */
-/* mask bits for GPIO lines */
-#define STR_DATA       0x0040 /* GPIO6 */
-#define STR_CLK                0x0080 /* GPIO7 */
-#define STR_WREN       0x0100 /* GPIO8 */
-#define STR_MOST       0x0200 /* GPIO9 */
+
+/* GPIO to TEA575x maps */
+struct snd_es1968_tea575x_gpio {
+       u8 data, clk, wren, most;
+       char *name;
+};
+
+static struct snd_es1968_tea575x_gpio snd_es1968_tea575x_gpios[] = {
+       { .data = 6, .clk = 7, .wren = 8, .most = 9, .name = "SF64-PCE2" },
+       { .data = 7, .clk = 8, .wren = 6, .most = 10, .name = "M56VAP" },
+};
+
+#define get_tea575x_gpio(chip) \
+       (&snd_es1968_tea575x_gpios[(chip)->tea575x_tuner])
+
 
 static void snd_es1968_tea575x_set_pins(struct snd_tea575x *tea, u8 pins)
 {
        struct es1968 *chip = tea->private_data;
-       unsigned long io = chip->io_port + GPIO_DATA;
+       struct snd_es1968_tea575x_gpio gpio = *get_tea575x_gpio(chip);
        u16 val = 0;
 
-       val |= (pins & TEA575X_DATA) ? STR_DATA : 0;
-       val |= (pins & TEA575X_CLK)  ? STR_CLK  : 0;
-       val |= (pins & TEA575X_WREN) ? STR_WREN : 0;
+       val |= (pins & TEA575X_DATA) ? (1 << gpio.data) : 0;
+       val |= (pins & TEA575X_CLK)  ? (1 << gpio.clk)  : 0;
+       val |= (pins & TEA575X_WREN) ? (1 << gpio.wren) : 0;
 
-       outw(val, io);
+       outw(val, chip->io_port + GPIO_DATA);
 }
 
 static u8 snd_es1968_tea575x_get_pins(struct snd_tea575x *tea)
 {
        struct es1968 *chip = tea->private_data;
-       unsigned long io = chip->io_port + GPIO_DATA;
-       u16 val = inw(io);
-       u8 ret;
+       struct snd_es1968_tea575x_gpio gpio = *get_tea575x_gpio(chip);
+       u16 val = inw(chip->io_port + GPIO_DATA);
+       u8 ret = 0;
 
-       ret = 0;
-       if (val & STR_DATA)
+       if (val & (1 << gpio.data))
                ret |= TEA575X_DATA;
-       if (val & STR_MOST)
+       if (val & (1 << gpio.most))
                ret |= TEA575X_MOST;
+
        return ret;
 }
 
@@ -2596,13 +2607,18 @@ static void snd_es1968_tea575x_set_direction(struct snd_tea575x *tea, bool outpu
        struct es1968 *chip = tea->private_data;
        unsigned long io = chip->io_port + GPIO_DATA;
        u16 odir = inw(io + IO_DIR);
+       struct snd_es1968_tea575x_gpio gpio = *get_tea575x_gpio(chip);
 
        if (output) {
-               outw(~(STR_DATA | STR_CLK | STR_WREN), io + IO_MASK);
-               outw(odir | STR_DATA | STR_CLK | STR_WREN, io + IO_DIR);
+               outw(~((1 << gpio.data) | (1 << gpio.clk) | (1 << gpio.wren)),
+                       io + IO_MASK);
+               outw(odir | (1 << gpio.data) | (1 << gpio.clk) | (1 << gpio.wren),
+                       io + IO_DIR);
        } else {
-               outw(~(STR_CLK | STR_WREN | STR_DATA | STR_MOST), io + IO_MASK);
-               outw((odir & ~(STR_DATA | STR_MOST)) | STR_CLK | STR_WREN, io + IO_DIR);
+               outw(~((1 << gpio.clk) | (1 << gpio.wren) | (1 << gpio.data) | (1 << gpio.most)),
+                       io + IO_MASK);
+               outw((odir & ~((1 << gpio.data) | (1 << gpio.most)))
+                       | (1 << gpio.clk) | (1 << gpio.wren), io + IO_DIR);
        }
 }
 
@@ -2772,6 +2788,9 @@ static int snd_es1968_create(struct snd_card *card,
        snd_card_set_dev(card, &pci->dev);
 
 #ifdef CONFIG_SND_ES1968_RADIO
+       /* don't play with GPIOs on laptops */
+       if (chip->pci->subsystem_vendor != 0x125d)
+               goto no_radio;
        err = v4l2_device_register(&pci->dev, &chip->v4l2_dev);
        if (err < 0) {
                snd_es1968_free(chip);
@@ -2781,10 +2800,18 @@ static int snd_es1968_create(struct snd_card *card,
        chip->tea.private_data = chip;
        chip->tea.radio_nr = radio_nr;
        chip->tea.ops = &snd_es1968_tea_ops;
-       strlcpy(chip->tea.card, "SF64-PCE2", sizeof(chip->tea.card));
        sprintf(chip->tea.bus_info, "PCI:%s", pci_name(pci));
-       if (!snd_tea575x_init(&chip->tea, THIS_MODULE))
-               printk(KERN_INFO "es1968: detected TEA575x radio\n");
+       for (i = 0; i < ARRAY_SIZE(snd_es1968_tea575x_gpios); i++) {
+               chip->tea575x_tuner = i;
+               if (!snd_tea575x_init(&chip->tea, THIS_MODULE)) {
+                       snd_printk(KERN_INFO "es1968: detected TEA575x radio type %s\n",
+                                  get_tea575x_gpio(chip)->name);
+                       strlcpy(chip->tea.card, get_tea575x_gpio(chip)->name,
+                               sizeof(chip->tea.card));
+                       break;
+               }
+       }
+no_radio:
 #endif
 
        *chip_ret = chip;
@@ -2909,7 +2936,6 @@ static int snd_es1968_probe(struct pci_dev *pci,
 static void snd_es1968_remove(struct pci_dev *pci)
 {
        snd_card_free(pci_get_drvdata(pci));
-       pci_set_drvdata(pci, NULL);
 }
 
 static struct pci_driver es1968_driver = {
index 4f07fda5adf2cc534d2e52a4c2577ea666c2bd39..706c5b67b708e441dbd6d768c5698effd8d9e570 100644 (file)
@@ -1370,7 +1370,6 @@ static int snd_card_fm801_probe(struct pci_dev *pci,
 static void snd_card_fm801_remove(struct pci_dev *pci)
 {
        snd_card_free(pci_get_drvdata(pci));
-       pci_set_drvdata(pci, NULL);
 }
 
 #ifdef CONFIG_PM_SLEEP
index 80a7d44bcf81f38780776fa5abb0eb2f8f35087b..0c5371abecd256ab9467a02378266fa902267c2c 100644 (file)
@@ -140,7 +140,6 @@ config SND_HDA_CODEC_VIA
 
 config SND_HDA_CODEC_HDMI
        bool "Build HDMI/DisplayPort HD-audio codec support"
-       select SND_DYNAMIC_MINORS
        default y
        help
          Say Y here to include HDMI and DisplayPort HD-audio codec
index 55108b5fb2919c597177d9dc5f28b56cb34d28a2..35090b3acbaca242f63064de691c30647110c6c1 100644 (file)
@@ -185,20 +185,19 @@ EXPORT_SYMBOL_HDA(snd_hda_get_jack_type);
  * Compose a 32bit command word to be sent to the HD-audio controller
  */
 static inline unsigned int
-make_codec_cmd(struct hda_codec *codec, hda_nid_t nid, int direct,
+make_codec_cmd(struct hda_codec *codec, hda_nid_t nid, int flags,
               unsigned int verb, unsigned int parm)
 {
        u32 val;
 
-       if ((codec->addr & ~0xf) || (direct & ~1) || (nid & ~0x7f) ||
+       if ((codec->addr & ~0xf) || (nid & ~0x7f) ||
            (verb & ~0xfff) || (parm & ~0xffff)) {
-               printk(KERN_ERR "hda-codec: out of range cmd %x:%x:%x:%x:%x\n",
-                      codec->addr, direct, nid, verb, parm);
+               printk(KERN_ERR "hda-codec: out of range cmd %x:%x:%x:%x\n",
+                      codec->addr, nid, verb, parm);
                return ~0;
        }
 
        val = (u32)codec->addr << 28;
-       val |= (u32)direct << 27;
        val |= (u32)nid << 20;
        val |= verb << 8;
        val |= parm;
@@ -209,7 +208,7 @@ make_codec_cmd(struct hda_codec *codec, hda_nid_t nid, int direct,
  * Send and receive a verb
  */
 static int codec_exec_verb(struct hda_codec *codec, unsigned int cmd,
-                          unsigned int *res)
+                          int flags, unsigned int *res)
 {
        struct hda_bus *bus = codec->bus;
        int err;
@@ -222,6 +221,8 @@ static int codec_exec_verb(struct hda_codec *codec, unsigned int cmd,
  again:
        snd_hda_power_up(codec);
        mutex_lock(&bus->cmd_mutex);
+       if (flags & HDA_RW_NO_RESPONSE_FALLBACK)
+               bus->no_response_fallback = 1;
        for (;;) {
                trace_hda_send_cmd(codec, cmd);
                err = bus->ops.command(bus, cmd);
@@ -234,6 +235,7 @@ static int codec_exec_verb(struct hda_codec *codec, unsigned int cmd,
                *res = bus->ops.get_response(bus, codec->addr);
                trace_hda_get_response(codec, *res);
        }
+       bus->no_response_fallback = 0;
        mutex_unlock(&bus->cmd_mutex);
        snd_hda_power_down(codec);
        if (!codec_in_pm(codec) && res && *res == -1 && bus->rirb_error) {
@@ -255,7 +257,7 @@ static int codec_exec_verb(struct hda_codec *codec, unsigned int cmd,
  * snd_hda_codec_read - send a command and get the response
  * @codec: the HDA codec
  * @nid: NID to send the command
- * @direct: direct flag
+ * @flags: optional bit flags
  * @verb: the verb to send
  * @parm: the parameter for the verb
  *
@@ -264,12 +266,12 @@ static int codec_exec_verb(struct hda_codec *codec, unsigned int cmd,
  * Returns the obtained response value, or -1 for an error.
  */
 unsigned int snd_hda_codec_read(struct hda_codec *codec, hda_nid_t nid,
-                               int direct,
+                               int flags,
                                unsigned int verb, unsigned int parm)
 {
-       unsigned cmd = make_codec_cmd(codec, nid, direct, verb, parm);
+       unsigned cmd = make_codec_cmd(codec, nid, flags, verb, parm);
        unsigned int res;
-       if (codec_exec_verb(codec, cmd, &res))
+       if (codec_exec_verb(codec, cmd, flags, &res))
                return -1;
        return res;
 }
@@ -279,7 +281,7 @@ EXPORT_SYMBOL_HDA(snd_hda_codec_read);
  * snd_hda_codec_write - send a single command without waiting for response
  * @codec: the HDA codec
  * @nid: NID to send the command
- * @direct: direct flag
+ * @flags: optional bit flags
  * @verb: the verb to send
  * @parm: the parameter for the verb
  *
@@ -287,12 +289,12 @@ EXPORT_SYMBOL_HDA(snd_hda_codec_read);
  *
  * Returns 0 if successful, or a negative error code.
  */
-int snd_hda_codec_write(struct hda_codec *codec, hda_nid_t nid, int direct,
-                        unsigned int verb, unsigned int parm)
+int snd_hda_codec_write(struct hda_codec *codec, hda_nid_t nid, int flags,
+                       unsigned int verb, unsigned int parm)
 {
-       unsigned int cmd = make_codec_cmd(codec, nid, direct, verb, parm);
+       unsigned int cmd = make_codec_cmd(codec, nid, flags, verb, parm);
        unsigned int res;
-       return codec_exec_verb(codec, cmd,
+       return codec_exec_verb(codec, cmd, flags,
                               codec->bus->sync_write ? &res : NULL);
 }
 EXPORT_SYMBOL_HDA(snd_hda_codec_write);
@@ -3582,7 +3584,7 @@ EXPORT_SYMBOL_HDA(snd_hda_create_spdif_in_ctls);
  * snd_hda_codec_write_cache - send a single command with caching
  * @codec: the HDA codec
  * @nid: NID to send the command
- * @direct: direct flag
+ * @flags: optional bit flags
  * @verb: the verb to send
  * @parm: the parameter for the verb
  *
@@ -3591,7 +3593,7 @@ EXPORT_SYMBOL_HDA(snd_hda_create_spdif_in_ctls);
  * Returns 0 if successful, or a negative error code.
  */
 int snd_hda_codec_write_cache(struct hda_codec *codec, hda_nid_t nid,
-                             int direct, unsigned int verb, unsigned int parm)
+                             int flags, unsigned int verb, unsigned int parm)
 {
        int err;
        struct hda_cache_head *c;
@@ -3600,7 +3602,7 @@ int snd_hda_codec_write_cache(struct hda_codec *codec, hda_nid_t nid,
 
        cache_only = codec->cached_write;
        if (!cache_only) {
-               err = snd_hda_codec_write(codec, nid, direct, verb, parm);
+               err = snd_hda_codec_write(codec, nid, flags, verb, parm);
                if (err < 0)
                        return err;
        }
@@ -3624,7 +3626,7 @@ EXPORT_SYMBOL_HDA(snd_hda_codec_write_cache);
  * snd_hda_codec_update_cache - check cache and write the cmd only when needed
  * @codec: the HDA codec
  * @nid: NID to send the command
- * @direct: direct flag
+ * @flags: optional bit flags
  * @verb: the verb to send
  * @parm: the parameter for the verb
  *
@@ -3635,7 +3637,7 @@ EXPORT_SYMBOL_HDA(snd_hda_codec_write_cache);
  * Returns 0 if successful, or a negative error code.
  */
 int snd_hda_codec_update_cache(struct hda_codec *codec, hda_nid_t nid,
-                              int direct, unsigned int verb, unsigned int parm)
+                              int flags, unsigned int verb, unsigned int parm)
 {
        struct hda_cache_head *c;
        u32 key;
@@ -3651,7 +3653,7 @@ int snd_hda_codec_update_cache(struct hda_codec *codec, hda_nid_t nid,
                return 0;
        }
        mutex_unlock(&codec->bus->cmd_mutex);
-       return snd_hda_codec_write_cache(codec, nid, direct, verb, parm);
+       return snd_hda_codec_write_cache(codec, nid, flags, verb, parm);
 }
 EXPORT_SYMBOL_HDA(snd_hda_codec_update_cache);
 
@@ -3806,11 +3808,13 @@ static unsigned int hda_set_power_state(struct hda_codec *codec,
        hda_nid_t fg = codec->afg ? codec->afg : codec->mfg;
        int count;
        unsigned int state;
+       int flags = 0;
 
        /* this delay seems necessary to avoid click noise at power-down */
        if (power_state == AC_PWRST_D3) {
                /* transition time less than 10ms for power down */
                msleep(codec->epss ? 10 : 100);
+               flags = HDA_RW_NO_RESPONSE_FALLBACK;
        }
 
        /* repeat power states setting at most 10 times*/
@@ -3819,7 +3823,7 @@ static unsigned int hda_set_power_state(struct hda_codec *codec,
                        codec->patch_ops.set_power_state(codec, fg,
                                                         power_state);
                else {
-                       snd_hda_codec_read(codec, fg, 0,
+                       snd_hda_codec_read(codec, fg, flags,
                                           AC_VERB_SET_POWER_STATE,
                                           power_state);
                        snd_hda_codec_set_power_to_all(codec, fg, power_state);
@@ -4461,12 +4465,13 @@ const char *snd_hda_pcm_type_name[HDA_PCM_NTYPES] = {
 
 /*
  * get the empty PCM device number to assign
- *
- * note the max device number is limited by HDA_MAX_PCMS, currently 10
  */
-static int get_empty_pcm_device(struct hda_bus *bus, int type)
+static int get_empty_pcm_device(struct hda_bus *bus, unsigned int type)
 {
        /* audio device indices; not linear to keep compatibility */
+       /* assigned to static slots up to dev#10; if more needed, assign
+        * the later slot dynamically (when CONFIG_SND_DYNAMIC_MINORS=y)
+        */
        static int audio_idx[HDA_PCM_NTYPES][5] = {
                [HDA_PCM_TYPE_AUDIO] = { 0, 2, 4, 5, -1 },
                [HDA_PCM_TYPE_SPDIF] = { 1, -1 },
@@ -4480,18 +4485,28 @@ static int get_empty_pcm_device(struct hda_bus *bus, int type)
                return -EINVAL;
        }
 
-       for (i = 0; audio_idx[type][i] >= 0 ; i++)
+       for (i = 0; audio_idx[type][i] >= 0; i++) {
+#ifndef CONFIG_SND_DYNAMIC_MINORS
+               if (audio_idx[type][i] >= 8)
+                       break;
+#endif
                if (!test_and_set_bit(audio_idx[type][i], bus->pcm_dev_bits))
                        return audio_idx[type][i];
+       }
 
+#ifdef CONFIG_SND_DYNAMIC_MINORS
        /* non-fixed slots starting from 10 */
        for (i = 10; i < 32; i++) {
                if (!test_and_set_bit(i, bus->pcm_dev_bits))
                        return i;
        }
+#endif
 
        snd_printk(KERN_WARNING "Too many %s devices\n",
                snd_hda_pcm_type_name[type]);
+#ifndef CONFIG_SND_DYNAMIC_MINORS
+       snd_printk(KERN_WARNING "Consider building the kernel with CONFIG_SND_DYNAMIC_MINORS=y\n");
+#endif
        return -EAGAIN;
 }
 
index c93f9021f45212d523e8928db45bcef6f65c4576..701c2e069b10ad218886f5853caa1c5c3e31409c 100644 (file)
@@ -679,6 +679,7 @@ struct hda_bus {
        unsigned int response_reset:1;  /* controller was reset */
        unsigned int in_reset:1;        /* during reset operation */
        unsigned int power_keep_link_on:1; /* don't power off HDA link */
+       unsigned int no_response_fallback:1; /* don't fallback at RIRB error */
 
        int primary_dig_out_type;       /* primary digital out PCM type */
 };
@@ -930,6 +931,8 @@ enum {
        HDA_INPUT, HDA_OUTPUT
 };
 
+/* snd_hda_codec_read/write optional flags */
+#define HDA_RW_NO_RESPONSE_FALLBACK    (1 << 0)
 
 /*
  * constructors
@@ -945,9 +948,9 @@ int snd_hda_codec_update_widgets(struct hda_codec *codec);
  * low level functions
  */
 unsigned int snd_hda_codec_read(struct hda_codec *codec, hda_nid_t nid,
-                               int direct,
+                               int flags,
                                unsigned int verb, unsigned int parm);
-int snd_hda_codec_write(struct hda_codec *codec, hda_nid_t nid, int direct,
+int snd_hda_codec_write(struct hda_codec *codec, hda_nid_t nid, int flags,
                        unsigned int verb, unsigned int parm);
 #define snd_hda_param_read(codec, nid, param) \
        snd_hda_codec_read(codec, nid, 0, AC_VERB_PARAMETERS, param)
@@ -986,11 +989,11 @@ int snd_hda_queue_unsol_event(struct hda_bus *bus, u32 res, u32 res_ex);
 
 /* cached write */
 int snd_hda_codec_write_cache(struct hda_codec *codec, hda_nid_t nid,
-                             int direct, unsigned int verb, unsigned int parm);
+                             int flags, unsigned int verb, unsigned int parm);
 void snd_hda_sequence_write_cache(struct hda_codec *codec,
                                  const struct hda_verb *seq);
 int snd_hda_codec_update_cache(struct hda_codec *codec, hda_nid_t nid,
-                             int direct, unsigned int verb, unsigned int parm);
+                             int flags, unsigned int verb, unsigned int parm);
 void snd_hda_codec_resume_cache(struct hda_codec *codec);
 /* both for cmd & amp caches */
 void snd_hda_codec_flush_cache(struct hda_codec *codec);
index de18722c487346858783fa5d5e9f9fd574b70b39..f089fa0aa03dcc9c228c36f44f09615cf084efb5 100644 (file)
@@ -942,6 +942,9 @@ static unsigned int azx_rirb_get_response(struct hda_bus *bus,
                }
        }
 
+       if (!bus->no_response_fallback)
+               return -1;
+
        if (!chip->polling_mode && chip->poll_count < 2) {
                snd_printdd(SFX "%s: azx_get_response timeout, "
                           "polling the codec once: last cmd=0x%08x\n",
@@ -3764,7 +3767,6 @@ static int azx_probe(struct pci_dev *pci,
 
 out_free:
        snd_card_free(card);
-       pci_set_drvdata(pci, NULL);
        return err;
 }
 
@@ -3834,7 +3836,6 @@ static void azx_remove(struct pci_dev *pci)
 
        if (card)
                snd_card_free(card);
-       pci_set_drvdata(pci, NULL);
 }
 
 /* PCI IDs */
@@ -3878,6 +3879,9 @@ static DEFINE_PCI_DEVICE_TABLE(azx_ids) = {
        /* Oaktrail */
        { PCI_DEVICE(0x8086, 0x080a),
          .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_INTEL_PCH_NOPM },
+       /* BayTrail */
+       { PCI_DEVICE(0x8086, 0x0f04),
+         .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH_NOPM },
        /* ICH */
        { PCI_DEVICE(0x8086, 0x2668),
          .driver_data = AZX_DRIVER_ICH | AZX_DCAPS_OLD_SSYNC |
index 403010c9e82ea610125c82811e7f1f4ea3d27aac..ad087ea32f3a82df9b00524045e7407a9ae3540d 100644 (file)
@@ -3225,6 +3225,7 @@ enum {
        ALC271_FIXUP_HP_GATE_MIC_JACK,
        ALC269_FIXUP_ACER_AC700,
        ALC269_FIXUP_LIMIT_INT_MIC_BOOST,
+       ALC269VB_FIXUP_ORDISSIMO_EVE2,
 };
 
 static const struct hda_fixup alc269_fixups[] = {
@@ -3467,6 +3468,15 @@ static const struct hda_fixup alc269_fixups[] = {
                .type = HDA_FIXUP_FUNC,
                .v.func = alc269_fixup_limit_int_mic_boost,
        },
+       [ALC269VB_FIXUP_ORDISSIMO_EVE2] = {
+               .type = HDA_FIXUP_PINS,
+               .v.pins = (const struct hda_pintbl[]) {
+                       { 0x12, 0x99a3092f }, /* int-mic */
+                       { 0x18, 0x03a11d20 }, /* mic */
+                       { 0x19, 0x411111f0 }, /* Unused bogus pin */
+                       { }
+               },
+       },
 };
 
 static const struct snd_pci_quirk alc269_fixup_tbl[] = {
@@ -3539,6 +3549,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
        SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK),
        SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K),
        SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
+       SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */
 
 #if 0
        /* Below is a quirk table taken from the old code.
index 1d9d6427e0bf7cd3f09bc3a83fb1e0b08ad64848..9b6cb270dbe521703560bbbe0ffe86df5c4cfe50 100644 (file)
@@ -2233,6 +2233,10 @@ static const struct snd_pci_quirk stac92hd83xxx_fixup_tbl[] = {
                          "HP Folio", STAC_92HD83XXX_HP_MIC_LED),
        SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xff00, 0x1900,
                          "HP", STAC_92HD83XXX_HP_MIC_LED),
+       SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xff00, 0x2000,
+                         "HP", STAC_92HD83XXX_HP_MIC_LED),
+       SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xff00, 0x2100,
+                         "HP", STAC_92HD83XXX_HP_MIC_LED),
        SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3388,
                          "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD),
        SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3389,
index e5245544eb52bbecaaf0ff3e60b6f4f25d80d3c3..cf31b664d2ed8ce8c13b4cbae8d0be3f6a0e9887 100644 (file)
@@ -480,14 +480,9 @@ static int via_suspend(struct hda_codec *codec)
        struct via_spec *spec = codec->spec;
        vt1708_stop_hp_work(codec);
 
-       if (spec->codec_type == VT1802) {
-               /* Fix pop noise on headphones */
-               int i;
-               for (i = 0; i < spec->gen.autocfg.hp_outs; i++)
-                       snd_hda_codec_write(codec, spec->gen.autocfg.hp_pins[i],
-                                           0, AC_VERB_SET_PIN_WIDGET_CONTROL,
-                                           0x00);
-       }
+       /* Fix pop noise on headphones */
+       if (spec->codec_type == VT1802)
+               snd_hda_shutup_pins(codec);
 
        return 0;
 }
index 806407a3973e41784749f21c841628ad262c73f7..28ec872e54c01350369bf47f143db9c2d5da8b8d 100644 (file)
@@ -2807,7 +2807,6 @@ static void snd_ice1712_remove(struct pci_dev *pci)
        if (ice->card_info && ice->card_info->chip_exit)
                ice->card_info->chip_exit(ice);
        snd_card_free(card);
-       pci_set_drvdata(pci, NULL);
 }
 
 static struct pci_driver ice1712_driver = {
index ce70e7f113e0545f90e70edfd363271b9455dc58..50047177829172f97c0c6b9302854bdd8b0aca93 100644 (file)
@@ -2800,7 +2800,6 @@ static void snd_vt1724_remove(struct pci_dev *pci)
        if (ice->card_info && ice->card_info->chip_exit)
                ice->card_info->chip_exit(ice);
        snd_card_free(card);
-       pci_set_drvdata(pci, NULL);
 }
 
 #ifdef CONFIG_PM_SLEEP
index b8fe40531b9c52f905a45a0505dd1e9f09d107d4..59c8aaebb91ea4106bf315139603af307f13b25f 100644 (file)
@@ -3364,7 +3364,6 @@ static int snd_intel8x0_probe(struct pci_dev *pci,
 static void snd_intel8x0_remove(struct pci_dev *pci)
 {
        snd_card_free(pci_get_drvdata(pci));
-       pci_set_drvdata(pci, NULL);
 }
 
 static struct pci_driver intel8x0_driver = {
index fea09e8ea608d0078fa84e8fa81e73e40a33802c..3573c11936656d8f1b003573d559494618c7a694 100644 (file)
@@ -1328,7 +1328,6 @@ static int snd_intel8x0m_probe(struct pci_dev *pci,
 static void snd_intel8x0m_remove(struct pci_dev *pci)
 {
        snd_card_free(pci_get_drvdata(pci));
-       pci_set_drvdata(pci, NULL);
 }
 
 static struct pci_driver intel8x0m_driver = {
index 43b4228d9afe41812a25d4d9ea81e2b028016410..9cf9829555d422a250cff10dd956b23e09dca996 100644 (file)
@@ -2473,7 +2473,6 @@ snd_korg1212_probe(struct pci_dev *pci,
 static void snd_korg1212_remove(struct pci_dev *pci)
 {
        snd_card_free(pci_get_drvdata(pci));
-       pci_set_drvdata(pci, NULL);
 }
 
 static struct pci_driver korg1212_driver = {
index 322b638e8ec48056c7e433f2067e4aff80bd0014..7307d97186cb45c66f7584f9857c559533038f72 100644 (file)
@@ -759,7 +759,6 @@ out_free:
 static void lola_remove(struct pci_dev *pci)
 {
        snd_card_free(pci_get_drvdata(pci));
-       pci_set_drvdata(pci, NULL);
 }
 
 /* PCI IDs */
index 298bc9b7299116b23a83e572c69cfb3224124351..3230e57f246c32c362aeab200200e78100a7f919 100644 (file)
@@ -1139,7 +1139,6 @@ out_free:
 static void snd_lx6464es_remove(struct pci_dev *pci)
 {
        snd_card_free(pci_get_drvdata(pci));
-       pci_set_drvdata(pci, NULL);
 }
 
 
index c76ac14112108a9a07eef1bd3c844f48b92228eb..d5417360f51fb8be6a43be6ddef9bd6c2e7ac2e3 100644 (file)
@@ -2775,7 +2775,6 @@ snd_m3_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
 static void snd_m3_remove(struct pci_dev *pci)
 {
        snd_card_free(pci_get_drvdata(pci));
-       pci_set_drvdata(pci, NULL);
 }
 
 static struct pci_driver m3_driver = {
index 934dec98e2ced022e3818a60d5d7ab65f3d4ba19..1e0f6ee193f0a926279e3d3d25a4ea995b78bfdd 100644 (file)
@@ -1377,7 +1377,6 @@ static int snd_mixart_probe(struct pci_dev *pci,
 static void snd_mixart_remove(struct pci_dev *pci)
 {
        snd_mixart_free(pci_get_drvdata(pci));
-       pci_set_drvdata(pci, NULL);
 }
 
 static struct pci_driver mixart_driver = {
index 6febedb05936f3f441f55fdb297a42d57f8b7137..fe79fff4c6dc303fd3a5babde6320446979a3f14 100644 (file)
@@ -1746,7 +1746,6 @@ static int snd_nm256_probe(struct pci_dev *pci,
 static void snd_nm256_remove(struct pci_dev *pci)
 {
        snd_card_free(pci_get_drvdata(pci));
-       pci_set_drvdata(pci, NULL);
 }
 
 
index 9562dc63ba607c70db84443a961b57fad9e20927..b0cb48adddc790c3f87e7a52cdb0431430e13ce2 100644 (file)
@@ -722,7 +722,6 @@ EXPORT_SYMBOL(oxygen_pci_probe);
 void oxygen_pci_remove(struct pci_dev *pci)
 {
        snd_card_free(pci_get_drvdata(pci));
-       pci_set_drvdata(pci, NULL);
 }
 EXPORT_SYMBOL(oxygen_pci_remove);
 
index b97384ad946dae84ec724f4c91d2b46a226b50df..d379b284955b23dea2cded6e8efe7e0ba17ccda2 100644 (file)
@@ -1691,7 +1691,6 @@ static int pcxhr_probe(struct pci_dev *pci,
 static void pcxhr_remove(struct pci_dev *pci)
 {
        pcxhr_free(pci_get_drvdata(pci));
-       pci_set_drvdata(pci, NULL);
 }
 
 static struct pci_driver pcxhr_driver = {
index 63c1c80415541c8a7207ded0c1cab82e8fb952a2..56cc891e395e54a17edf0a80b377370b317c628c 100644 (file)
@@ -2066,7 +2066,6 @@ static void snd_riptide_joystick_remove(struct pci_dev *pci)
        if (gameport) {
                release_region(gameport->io, 8);
                gameport_unregister_port(gameport);
-               pci_set_drvdata(pci, NULL);
        }
 }
 #endif
@@ -2179,7 +2178,6 @@ snd_card_riptide_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
 static void snd_card_riptide_remove(struct pci_dev *pci)
 {
        snd_card_free(pci_get_drvdata(pci));
-       pci_set_drvdata(pci, NULL);
 }
 
 static struct pci_driver driver = {
index 0ecd4100713ecf2eb6b61bdc845f8000fc4b070e..cc26346ae66bf82d6fc4680b56ed4f136ff832ab 100644 (file)
@@ -1981,7 +1981,6 @@ snd_rme32_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
 static void snd_rme32_remove(struct pci_dev *pci)
 {
        snd_card_free(pci_get_drvdata(pci));
-       pci_set_drvdata(pci, NULL);
 }
 
 static struct pci_driver rme32_driver = {
index 5fb88ac82aa93f6f4f0d0021ba0775ebf952e1ac..2a8ad9d1a2aea290cf433c0fccb4218ab78cf5ff 100644 (file)
@@ -2390,7 +2390,6 @@ snd_rme96_probe(struct pci_dev *pci,
 static void snd_rme96_remove(struct pci_dev *pci)
 {
        snd_card_free(pci_get_drvdata(pci));
-       pci_set_drvdata(pci, NULL);
 }
 
 static struct pci_driver rme96_driver = {
index 94084cdb130c44823d04dbb8b617572e43f7987f..4f255dfee4504454702bfdec305b1b72820a26ac 100644 (file)
@@ -5412,7 +5412,6 @@ static int snd_hdsp_probe(struct pci_dev *pci,
 static void snd_hdsp_remove(struct pci_dev *pci)
 {
        snd_card_free(pci_get_drvdata(pci));
-       pci_set_drvdata(pci, NULL);
 }
 
 static struct pci_driver hdsp_driver = {
index 9ea05e956474fe0847ea6734348626f02c627a63..bd501931ee2341f1a6f913dc1b21a967268de704 100644 (file)
@@ -400,8 +400,8 @@ MODULE_SUPPORTED_DEVICE("{{RME HDSPM-MADI}}");
 
 #define HDSPM_wc_freq0 (1<<5)  /* input freq detected via autosync  */
 #define HDSPM_wc_freq1 (1<<6)  /* 001=32, 010==44.1, 011=48, */
-#define HDSPM_wc_freq2 (1<<7)  /* 100=64, 101=88.2, 110=96, */
-/* missing Bit   for               111=128, 1000=176.4, 1001=192 */
+#define HDSPM_wc_freq2 (1<<7)  /* 100=64, 101=88.2, 110=96, 111=128 */
+#define HDSPM_wc_freq3 0x800   /* 1000=176.4, 1001=192 */
 
 #define HDSPM_SyncRef0 0x10000  /* Sync Reference */
 #define HDSPM_SyncRef1 0x20000
@@ -412,13 +412,17 @@ MODULE_SUPPORTED_DEVICE("{{RME HDSPM-MADI}}");
 
 #define HDSPM_wc_valid (HDSPM_wcLock|HDSPM_wcSync)
 
-#define HDSPM_wcFreqMask  (HDSPM_wc_freq0|HDSPM_wc_freq1|HDSPM_wc_freq2)
+#define HDSPM_wcFreqMask  (HDSPM_wc_freq0|HDSPM_wc_freq1|HDSPM_wc_freq2|\
+                           HDSPM_wc_freq3)
 #define HDSPM_wcFreq32    (HDSPM_wc_freq0)
 #define HDSPM_wcFreq44_1  (HDSPM_wc_freq1)
 #define HDSPM_wcFreq48    (HDSPM_wc_freq0|HDSPM_wc_freq1)
 #define HDSPM_wcFreq64    (HDSPM_wc_freq2)
 #define HDSPM_wcFreq88_2  (HDSPM_wc_freq0|HDSPM_wc_freq2)
 #define HDSPM_wcFreq96    (HDSPM_wc_freq1|HDSPM_wc_freq2)
+#define HDSPM_wcFreq128   (HDSPM_wc_freq0|HDSPM_wc_freq1|HDSPM_wc_freq2)
+#define HDSPM_wcFreq176_4 (HDSPM_wc_freq3)
+#define HDSPM_wcFreq192   (HDSPM_wc_freq0|HDSPM_wc_freq3)
 
 #define HDSPM_status1_F_0 0x0400000
 #define HDSPM_status1_F_1 0x0800000
@@ -1087,6 +1091,26 @@ static int hdspm_round_frequency(int rate)
                return 48000;
 }
 
+/* QS and DS rates normally can not be detected
+ * automatically by the card. Only exception is MADI
+ * in 96k frame mode.
+ *
+ * So if we read SS values (32 .. 48k), check for
+ * user-provided DS/QS bits in the control register
+ * and multiply the base frequency accordingly.
+ */
+static int hdspm_rate_multiplier(struct hdspm *hdspm, int rate)
+{
+       if (rate <= 48000) {
+               if (hdspm->control_register & HDSPM_QuadSpeed)
+                       return rate * 4;
+               else if (hdspm->control_register &
+                               HDSPM_DoubleSpeed)
+                       return rate * 2;
+       };
+       return rate;
+}
+
 static int hdspm_tco_sync_check(struct hdspm *hdspm);
 static int hdspm_sync_in_sync_check(struct hdspm *hdspm);
 
@@ -1181,6 +1205,15 @@ static int hdspm_external_sample_rate(struct hdspm *hdspm)
                        case HDSPM_wcFreq96:
                                rate = 96000;
                                break;
+                       case HDSPM_wcFreq128:
+                               rate = 128000;
+                               break;
+                       case HDSPM_wcFreq176_4:
+                               rate = 176400;
+                               break;
+                       case HDSPM_wcFreq192:
+                               rate = 192000;
+                               break;
                        default:
                                rate = 0;
                                break;
@@ -1192,7 +1225,7 @@ static int hdspm_external_sample_rate(struct hdspm *hdspm)
                 */
                if (rate != 0 &&
                (status2 & HDSPM_SelSyncRefMask) == HDSPM_SelSyncRef_WORD)
-                       return rate;
+                       return hdspm_rate_multiplier(hdspm, rate);
 
                /* maybe a madi input (which is taken if sel sync is madi) */
                if (status & HDSPM_madiLock) {
@@ -1255,21 +1288,8 @@ static int hdspm_external_sample_rate(struct hdspm *hdspm)
                        }
                }
 
-               /* QS and DS rates normally can not be detected
-                * automatically by the card. Only exception is MADI
-                * in 96k frame mode.
-                *
-                * So if we read SS values (32 .. 48k), check for
-                * user-provided DS/QS bits in the control register
-                * and multiply the base frequency accordingly.
-                */
-               if (rate <= 48000) {
-                       if (hdspm->control_register & HDSPM_QuadSpeed)
-                               rate *= 4;
-                       else if (hdspm->control_register &
-                                       HDSPM_DoubleSpeed)
-                               rate *= 2;
-               }
+               rate = hdspm_rate_multiplier(hdspm, rate);
+
                break;
        }
 
@@ -6737,7 +6757,6 @@ static int snd_hdspm_probe(struct pci_dev *pci,
 static void snd_hdspm_remove(struct pci_dev *pci)
 {
        snd_card_free(pci_get_drvdata(pci));
-       pci_set_drvdata(pci, NULL);
 }
 
 static struct pci_driver hdspm_driver = {
index 773a67fff4cdeb64469170912e82034919e5a841..b96d9e1adf6de027cb57899a6f31998d69988300 100644 (file)
@@ -2628,7 +2628,6 @@ static int snd_rme9652_probe(struct pci_dev *pci,
 static void snd_rme9652_remove(struct pci_dev *pci)
 {
        snd_card_free(pci_get_drvdata(pci));
-       pci_set_drvdata(pci, NULL);
 }
 
 static struct pci_driver rme9652_driver = {
index 748e82d4d25715b43e4b6790513941fe200f0191..e413b4e2c81952101294d993dba70aee9c1a14fb 100644 (file)
@@ -1482,7 +1482,6 @@ error_out:
 static void snd_sis7019_remove(struct pci_dev *pci)
 {
        snd_card_free(pci_get_drvdata(pci));
-       pci_set_drvdata(pci, NULL);
 }
 
 static struct pci_driver sis7019_driver = {
index a2e7686e7ae3300f78240db2755fc23899ecec30..2a46bf98af30f054a20109ada2a17115de05b127 100644 (file)
@@ -1528,7 +1528,6 @@ static int snd_sonic_probe(struct pci_dev *pci,
 static void snd_sonic_remove(struct pci_dev *pci)
 {
        snd_card_free(pci_get_drvdata(pci));
-       pci_set_drvdata(pci, NULL);
 }
 
 static struct pci_driver sonicvibes_driver = {
index 1aefd6204a63f26347f856881b3522d00e37e169..b3b588bc94c37720dd20026589b39ae342a9890d 100644 (file)
@@ -169,7 +169,6 @@ static int snd_trident_probe(struct pci_dev *pci,
 static void snd_trident_remove(struct pci_dev *pci)
 {
        snd_card_free(pci_get_drvdata(pci));
-       pci_set_drvdata(pci, NULL);
 }
 
 static struct pci_driver trident_driver = {
index d756a3562706c8182db03a358ec4edd9cc3a4437..3c511d0caf9ef25d4a985abfbd3e797b916209a8 100644 (file)
@@ -2646,7 +2646,6 @@ static int snd_via82xx_probe(struct pci_dev *pci,
 static void snd_via82xx_remove(struct pci_dev *pci)
 {
        snd_card_free(pci_get_drvdata(pci));
-       pci_set_drvdata(pci, NULL);
 }
 
 static struct pci_driver via82xx_driver = {
index 4f5fd80b7e5688ef008691f908e4b781b5d186dd..ca190283cbd7745f50d4ec4ffeaf74726ea3afc1 100644 (file)
@@ -1227,7 +1227,6 @@ static int snd_via82xx_probe(struct pci_dev *pci,
 static void snd_via82xx_remove(struct pci_dev *pci)
 {
        snd_card_free(pci_get_drvdata(pci));
-       pci_set_drvdata(pci, NULL);
 }
 
 static struct pci_driver via82xx_modem_driver = {
index e2f1ab37e1548661dae8f8cadce87764db7d52d6..ab8a9b1bfb8e21933290e86be80a4f8a6459313b 100644 (file)
@@ -254,7 +254,6 @@ static int snd_vx222_probe(struct pci_dev *pci,
 static void snd_vx222_remove(struct pci_dev *pci)
 {
        snd_card_free(pci_get_drvdata(pci));
-       pci_set_drvdata(pci, NULL);
 }
 
 #ifdef CONFIG_PM_SLEEP
index 01c49655a3c1014bb9dec01784971b6e8a4d250c..e8932b2e4a5dcce73f4a2417933d90cf618079cb 100644 (file)
@@ -347,7 +347,6 @@ static int snd_card_ymfpci_probe(struct pci_dev *pci,
 static void snd_card_ymfpci_remove(struct pci_dev *pci)
 {
        snd_card_free(pci_get_drvdata(pci));
-       pci_set_drvdata(pci, NULL);
 }
 
 static struct pci_driver ymfpci_driver = {
index 09fc848d32ecd475951f09513e492e78a03d2a1c..8abb521b4814b413a9423edf48bf2d7e41c08e2e 100644 (file)
@@ -139,7 +139,6 @@ __error:
 static int snd_pmac_remove(struct platform_device *devptr)
 {
        snd_card_free(platform_get_drvdata(devptr));
-       platform_set_drvdata(devptr, NULL);
        return 0;
 }
 
index e59a73a9bc427602717633ea66953a73950d2d18..78a369785a9ecf3b3e8d1a72e6b536e6a8ddb89a 100644 (file)
@@ -598,7 +598,6 @@ static int snd_aica_remove(struct platform_device *devptr)
                return -ENODEV;
        snd_card_free(dreamcastcard->card);
        kfree(dreamcastcard);
-       platform_set_drvdata(devptr, NULL);
        return 0;
 }
 
index e68c4fc91a0304002537845b4a8b1182ab107258..7c9422c4fc0f99097c0b3b6197a1dc0ff8165099 100644 (file)
@@ -290,8 +290,6 @@ static int snd_sh_dac_pcm(struct snd_sh_dac *chip, int device)
 static int snd_sh_dac_remove(struct platform_device *devptr)
 {
        snd_card_free(platform_get_drvdata(devptr));
-       platform_set_drvdata(devptr, NULL);
-
        return 0;
 }
 
index 75e6016d3efe79e0b025115f2f0148a9e3403aa3..eee7afcae37510db454f132c65f01ba5c34f776e 100644 (file)
@@ -2670,8 +2670,6 @@ static int dbri_remove(struct platform_device *op)
        snd_dbri_free(card->private_data);
        snd_card_free(card);
 
-       dev_set_drvdata(&op->dev, NULL);
-
        return 0;
 }
 
index a1a24b979ed2799476e8962cd65908c6ca538c9f..8e3d9a6c7a3ba6e88f6cd29d0894a6c5a69162d7 100644 (file)
@@ -1070,7 +1070,6 @@ out:
 
        ssc_free(chip->ssc);
        snd_card_free(card);
-       dev_set_drvdata(&spi->dev, NULL);
 
        return 0;
 }
index b37653247ef4e035b096153253b69ca0fd1e9a8b..4967fe9c938df0079a4f5d63881b15b627673094 100644 (file)
@@ -695,9 +695,6 @@ static int usX2Y_rate_set(struct usX2Ydev *usX2Y, int rate)
                        ((char*)(usbdata + i))[1] = ra[i].c2;
                        usb_fill_bulk_urb(us->urb[i], usX2Y->dev, usb_sndbulkpipe(usX2Y->dev, 4),
                                          usbdata + i, 2, i_usX2Y_04Int, usX2Y);
-#ifdef OLD_USB
-                       us->urb[i]->transfer_flags = USB_QUEUE_BULK;
-#endif
                }
                us->submitted = 0;
                us->len =       NOOF_SETRATE_URBS;