]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/commitdiff
ALSA: hda - Raise AZX_DCAPS_RIRB_DELAY handling into top drivers
authorTakashi Iwai <tiwai@suse.de>
Thu, 17 Dec 2015 07:23:39 +0000 (08:23 +0100)
committerIshan Mittal <imittal@nvidia.com>
Fri, 6 Jan 2017 10:16:48 +0000 (15:46 +0530)
commit 7d9a180895ee8c301df7f9447429009795c56c21 upstream.

AZX_DCAPS_RIRB_DELAY is dedicated only for Nvidia and its purpose is
just to set a flag in bus.  So it's better to be set in the toplevel
driver, either hda_intel.c or hda_tegra.c, instead of the common
hda_controller.c.  This also allows us to strip this flag from dcaps,
so save one more bit there.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/pci/hda/hda_controller.c
sound/pci/hda/hda_controller.h
sound/pci/hda/hda_intel.c
sound/pci/hda/hda_tegra.c

index 77cda91a81328009cc4b48b3f009434178b564f1..5baf8b56b6e7604637bca89eae54ca63ce4e6232 100644 (file)
@@ -1055,11 +1055,6 @@ int azx_bus_init(struct azx *chip, const char *model,
        if (chip->driver_caps & AZX_DCAPS_CORBRP_SELF_CLEAR)
                bus->core.corbrp_self_clear = true;
 
-       if (chip->driver_caps & AZX_DCAPS_RIRB_DELAY) {
-               dev_dbg(chip->card->dev, "Enable delay in RIRB handling\n");
-               bus->needs_damn_long_delay = 1;
-       }
-
        if (chip->driver_caps & AZX_DCAPS_4K_BDLE_BOUNDARY)
                bus->core.align_bdle_4k = true;
 
index b69552c19032a19b66be1d937a027d57fd898f77..b17539537b2e0b90cb55f95a6d3e0689003822a8 100644 (file)
@@ -32,7 +32,7 @@
 #define AZX_DCAPS_NO_MSI       (1 << 9)        /* No MSI support */
 #define AZX_DCAPS_SNOOP_MASK   (3 << 10)       /* snoop type mask */
 #define AZX_DCAPS_SNOOP_OFF    (1 << 12)       /* snoop default off */
-#define AZX_DCAPS_RIRB_DELAY   (1 << 13)       /* Long delay in read loop */
+/* 13 unused */
 /* 14 unused */
 #define AZX_DCAPS_CTX_WORKAROUND (1 << 15)     /* X-Fi workaround */
 #define AZX_DCAPS_POSFIX_LPIB  (1 << 16)       /* Use LPIB as default */
index 74a6f83e643826902a96641cc8e0a852e198dfe5..da64932c83837ab5c00ef3ce0955df39511f71b8 100644 (file)
@@ -334,7 +334,7 @@ enum {
 
 /* quirks for Nvidia */
 #define AZX_DCAPS_PRESET_NVIDIA \
-       (AZX_DCAPS_RIRB_DELAY | AZX_DCAPS_NO_MSI | /*AZX_DCAPS_ALIGN_BUFSIZE |*/ \
+       (AZX_DCAPS_NO_MSI | /*AZX_DCAPS_ALIGN_BUFSIZE |*/ \
         AZX_DCAPS_NO_64BIT | AZX_DCAPS_CORBRP_SELF_CLEAR |\
         AZX_DCAPS_SNOOP_TYPE(NVIDIA))
 
@@ -1637,6 +1637,11 @@ static int azx_create(struct snd_card *card, struct pci_dev *pci,
                return err;
        }
 
+       if (chip->driver_type == AZX_DRIVER_NVIDIA) {
+               dev_dbg(chip->card->dev, "Enable delay in RIRB handling\n");
+               chip->bus.needs_damn_long_delay = 1;
+       }
+
        err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops);
        if (err < 0) {
                dev_err(card->dev, "Error creating device [card]!\n");
index 58c0aad372842125be5529d07aecbbe98e2c8859..17fd81736d3d67f6a6fb67ef1ad624a6d96d93a9 100644 (file)
@@ -464,6 +464,8 @@ static int hda_tegra_create(struct snd_card *card,
        if (err < 0)
                return err;
 
+       chip->bus.needs_damn_long_delay = 1;
+
        err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops);
        if (err < 0) {
                dev_err(card->dev, "Error creating device\n");
@@ -481,8 +483,7 @@ MODULE_DEVICE_TABLE(of, hda_tegra_match);
 
 static int hda_tegra_probe(struct platform_device *pdev)
 {
-       const unsigned int driver_flags = AZX_DCAPS_RIRB_DELAY |
-                                         AZX_DCAPS_CORBRP_SELF_CLEAR;
+       const unsigned int driver_flags = AZX_DCAPS_CORBRP_SELF_CLEAR;
        struct snd_card *card;
        struct azx *chip;
        struct hda_tegra *hda;