aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDylan Reid <dgreid@chromium.org>2014-02-28 18:41:18 -0500
committerTakashi Iwai <tiwai@suse.de>2014-03-01 05:21:29 -0500
commit749ee287fc937d8026fb459b7574d39745c0cbb9 (patch)
treed8f3737c55e424a2e5ac1f65d60b6b9812e6d480
parentf563bf65d9028c58bb0ecea9c8d40d5a57e64b3f (diff)
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: Dylan Reid <dgreid@chromium.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/hda/hda_intel.c8
-rw-r--r--sound/pci/hda/hda_priv.h1
2 files changed, 8 insertions, 1 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 7cdb4dde341b..1e7d3f3e6c5c 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -1324,8 +1324,13 @@ static void azx_bus_reset(struct hda_bus *bus)
1324 1324
1325static int get_jackpoll_interval(struct azx *chip) 1325static int get_jackpoll_interval(struct azx *chip)
1326{ 1326{
1327 int i = jackpoll_ms[chip->dev_index]; 1327 int i;
1328 unsigned int j; 1328 unsigned int j;
1329
1330 if (!chip->jackpoll_ms)
1331 return 0;
1332
1333 i = chip->jackpoll_ms[chip->dev_index];
1329 if (i == 0) 1334 if (i == 0)
1330 return 0; 1335 return 0;
1331 if (i < 50 || i > 60000) 1336 if (i < 50 || i > 60000)
@@ -3172,6 +3177,7 @@ static int azx_create(struct snd_card *card, struct pci_dev *pci,
3172 chip->driver_type = driver_caps & 0xff; 3177 chip->driver_type = driver_caps & 0xff;
3173 check_msi(chip); 3178 check_msi(chip);
3174 chip->dev_index = dev; 3179 chip->dev_index = dev;
3180 chip->jackpoll_ms = jackpoll_ms;
3175 INIT_WORK(&chip->irq_pending_work, azx_irq_pending_work); 3181 INIT_WORK(&chip->irq_pending_work, azx_irq_pending_work);
3176 INIT_LIST_HEAD(&chip->pcm_list); 3182 INIT_LIST_HEAD(&chip->pcm_list);
3177 INIT_LIST_HEAD(&chip->list); 3183 INIT_LIST_HEAD(&chip->list);
diff --git a/sound/pci/hda/hda_priv.h b/sound/pci/hda/hda_priv.h
index c231c11d8669..0a56e8e18a5a 100644
--- a/sound/pci/hda/hda_priv.h
+++ b/sound/pci/hda/hda_priv.h
@@ -321,6 +321,7 @@ struct azx {
321 int capture_streams; 321 int capture_streams;
322 int capture_index_offset; 322 int capture_index_offset;
323 int num_streams; 323 int num_streams;
324 const int *jackpoll_ms; /* per-card jack poll interval */
324 325
325 /* Register interaction. */ 326 /* Register interaction. */
326 const struct hda_controller_ops *ops; 327 const struct hda_controller_ops *ops;