Commit 749ee287 authored by Dylan Reid's avatar Dylan Reid Committed by Takashi Iwai

ALSA: hda - Add jackpoll_ms to struct azx

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: default avatarDylan Reid <dgreid@chromium.org>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent f563bf65
...@@ -1324,8 +1324,13 @@ static void azx_bus_reset(struct hda_bus *bus) ...@@ -1324,8 +1324,13 @@ static void azx_bus_reset(struct hda_bus *bus)
static int get_jackpoll_interval(struct azx *chip) static int get_jackpoll_interval(struct azx *chip)
{ {
int i = jackpoll_ms[chip->dev_index]; int i;
unsigned int j; unsigned int j;
if (!chip->jackpoll_ms)
return 0;
i = chip->jackpoll_ms[chip->dev_index];
if (i == 0) if (i == 0)
return 0; return 0;
if (i < 50 || i > 60000) if (i < 50 || i > 60000)
...@@ -3172,6 +3177,7 @@ static int azx_create(struct snd_card *card, struct pci_dev *pci, ...@@ -3172,6 +3177,7 @@ static int azx_create(struct snd_card *card, struct pci_dev *pci,
chip->driver_type = driver_caps & 0xff; chip->driver_type = driver_caps & 0xff;
check_msi(chip); check_msi(chip);
chip->dev_index = dev; chip->dev_index = dev;
chip->jackpoll_ms = jackpoll_ms;
INIT_WORK(&chip->irq_pending_work, azx_irq_pending_work); INIT_WORK(&chip->irq_pending_work, azx_irq_pending_work);
INIT_LIST_HEAD(&chip->pcm_list); INIT_LIST_HEAD(&chip->pcm_list);
INIT_LIST_HEAD(&chip->list); INIT_LIST_HEAD(&chip->list);
......
...@@ -321,6 +321,7 @@ struct azx { ...@@ -321,6 +321,7 @@ struct azx {
int capture_streams; int capture_streams;
int capture_index_offset; int capture_index_offset;
int num_streams; int num_streams;
const int *jackpoll_ms; /* per-card jack poll interval */
/* Register interaction. */ /* Register interaction. */
const struct hda_controller_ops *ops; const struct hda_controller_ops *ops;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment