ALSA: hda - Add jackpoll_ms to struct azx
authorDylan Reid <dgreid@chromium.org>
Fri, 28 Feb 2014 23:41:18 +0000 (15:41 -0800)
committerTakashi Iwai <tiwai@suse.de>
Sat, 1 Mar 2014 10:21:29 +0000 (11:21 +0100)
Keeping a pointer to the jackpoll_ms array in the chip will allow
azx_codec_create to be shared between hda_intel and hda_platform
drivers.  Also modify get_jackpoll_ms to make the jackpoll_ms member
optional, this way a platform driver can leave it out if it's not
needed.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/hda_intel.c
sound/pci/hda/hda_priv.h

index 7cdb4dde341b271507b1114ec7d9e6ab1823d24a..1e7d3f3e6c5c02d0d70133873d000980b587fbee 100644 (file)
@@ -1324,8 +1324,13 @@ static void azx_bus_reset(struct hda_bus *bus)
 
 static int get_jackpoll_interval(struct azx *chip)
 {
-       int i = jackpoll_ms[chip->dev_index];
+       int i;
        unsigned int j;
+
+       if (!chip->jackpoll_ms)
+               return 0;
+
+       i = chip->jackpoll_ms[chip->dev_index];
        if (i == 0)
                return 0;
        if (i < 50 || i > 60000)
@@ -3172,6 +3177,7 @@ static int azx_create(struct snd_card *card, struct pci_dev *pci,
        chip->driver_type = driver_caps & 0xff;
        check_msi(chip);
        chip->dev_index = dev;
+       chip->jackpoll_ms = jackpoll_ms;
        INIT_WORK(&chip->irq_pending_work, azx_irq_pending_work);
        INIT_LIST_HEAD(&chip->pcm_list);
        INIT_LIST_HEAD(&chip->list);
index c231c11d86698250a630aecf0cadc92e2860c675..0a56e8e18a5a377afe92ed73c3b48a41b8ce67aa 100644 (file)
@@ -321,6 +321,7 @@ struct azx {
        int capture_streams;
        int capture_index_offset;
        int num_streams;
+       const int *jackpoll_ms; /* per-card jack poll interval */
 
        /* Register interaction. */
        const struct hda_controller_ops *ops;
This page took 0.027156 seconds and 5 git commands to generate.