Skip to content

Commit b90b925

Browse files
pujarstiwai
authored andcommitted
ALSA: hda: avoid reset of sdo_limit
By default 'sdo_limit' is initialized with a default value of '8' as per spec. This is overridden in cases where a different value is required. However this is getting reset when snd_hdac_bus_init_chip() is called again, which happens during runtime PM cycle. Avoid this reset by moving 'sdo_limit' setup to 'snd_hdac_bus_init()' function which would be called only once. Fixes: 67ae482 ("ALSA: hda: add member to store ratio for stripe control") Cc: <[email protected]> Signed-off-by: Sameer Pujar <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent e17f02d commit b90b925

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

sound/hda/hdac_bus.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,18 @@ int snd_hdac_bus_init(struct hdac_bus *bus, struct device *dev,
4646
INIT_LIST_HEAD(&bus->hlink_list);
4747
init_waitqueue_head(&bus->rirb_wq);
4848
bus->irq = -1;
49+
50+
/*
51+
* Default value of '8' is as per the HD audio specification (Rev 1.0a).
52+
* Following relation is used to derive STRIPE control value.
53+
* For sample rate <= 48K:
54+
* { ((num_channels * bits_per_sample) / number of SDOs) >= 8 }
55+
* For sample rate > 48K:
56+
* { ((num_channels * bits_per_sample * rate/48000) /
57+
* number of SDOs) >= 8 }
58+
*/
59+
bus->sdo_limit = 8;
60+
4961
return 0;
5062
}
5163
EXPORT_SYMBOL_GPL(snd_hdac_bus_init);

sound/hda/hdac_controller.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -529,17 +529,6 @@ bool snd_hdac_bus_init_chip(struct hdac_bus *bus, bool full_reset)
529529

530530
bus->chip_init = true;
531531

532-
/*
533-
* Default value of '8' is as per the HD audio specification (Rev 1.0a).
534-
* Following relation is used to derive STRIPE control value.
535-
* For sample rate <= 48K:
536-
* { ((num_channels * bits_per_sample) / number of SDOs) >= 8 }
537-
* For sample rate > 48K:
538-
* { ((num_channels * bits_per_sample * rate/48000) /
539-
* number of SDOs) >= 8 }
540-
*/
541-
bus->sdo_limit = 8;
542-
543532
return true;
544533
}
545534
EXPORT_SYMBOL_GPL(snd_hdac_bus_init_chip);

0 commit comments

Comments
 (0)