|
@@ -632,7 +632,7 @@ static int azx_position_ok(struct azx *chip, struct azx_dev *azx_dev)
|
|
|
if (wallclk < (azx_dev->core.period_wallclk * 5) / 4 &&
|
|
|
pos % azx_dev->core.period_bytes > azx_dev->core.period_bytes / 2)
|
|
|
/* NG - it's below the first next period boundary */
|
|
|
- return chip->bdl_pos_adj[chip->dev_index] ? 0 : -1;
|
|
|
+ return chip->bdl_pos_adj ? 0 : -1;
|
|
|
azx_dev->core.start_wallclk += wallclk;
|
|
|
return 1; /* OK, it's fine */
|
|
|
}
|
|
@@ -1488,6 +1488,17 @@ static void azx_probe_work(struct work_struct *work)
|
|
|
azx_probe_continue(&hda->chip);
|
|
|
}
|
|
|
|
|
|
+static int default_bdl_pos_adj(struct azx *chip)
|
|
|
+{
|
|
|
+ switch (chip->driver_type) {
|
|
|
+ case AZX_DRIVER_ICH:
|
|
|
+ case AZX_DRIVER_PCH:
|
|
|
+ return 1;
|
|
|
+ default:
|
|
|
+ return 32;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
/*
|
|
|
* constructor
|
|
|
*/
|
|
@@ -1541,18 +1552,10 @@ static int azx_create(struct snd_card *card, struct pci_dev *pci,
|
|
|
chip->single_cmd = single_cmd;
|
|
|
azx_check_snoop_available(chip);
|
|
|
|
|
|
- if (bdl_pos_adj[dev] < 0) {
|
|
|
- switch (chip->driver_type) {
|
|
|
- case AZX_DRIVER_ICH:
|
|
|
- case AZX_DRIVER_PCH:
|
|
|
- bdl_pos_adj[dev] = 1;
|
|
|
- break;
|
|
|
- default:
|
|
|
- bdl_pos_adj[dev] = 32;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- chip->bdl_pos_adj = bdl_pos_adj;
|
|
|
+ if (bdl_pos_adj[dev] < 0)
|
|
|
+ chip->bdl_pos_adj = default_bdl_pos_adj(chip);
|
|
|
+ else
|
|
|
+ chip->bdl_pos_adj = bdl_pos_adj[dev];
|
|
|
|
|
|
err = azx_bus_init(chip, model[dev], &pci_hda_io_ops);
|
|
|
if (err < 0) {
|