From: Mark Brown Date: Tue, 25 Mar 2014 21:22:15 +0000 (+0000) Subject: Merge remote-tracking branches 'asoc/topic/tdm' and 'asoc/topic/tegra' into asoc... X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c159a85013afbb8283f0c7272812952e04d5c3a1;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git Merge remote-tracking branches 'asoc/topic/tdm' and 'asoc/topic/tegra' into asoc-next --- c159a85013afbb8283f0c7272812952e04d5c3a1 diff --cc sound/soc/soc-core.c index daca4b7de45c,318fee8093ce,fe1df50805a3..caebd6353112 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@@@ -3619,30 -3624,30 -3608,6 +3619,30 @@@@ int snd_soc_dai_set_fmt(struct snd_soc_ } EXPORT_SYMBOL_GPL(snd_soc_dai_set_fmt); +/** - * snd_soc_of_xlate_tdm_slot - generate tx/rx slot mask. + + * snd_soc_xlate_tdm_slot - generate tx/rx slot mask. + * @slots: Number of slots in use. + * @tx_mask: bitmask representing active TX slots. + * @rx_mask: bitmask representing active RX slots. + * + * Generates the TDM tx and rx slot default masks for DAI. + */ - static int snd_soc_of_xlate_tdm_slot_mask(unsigned int slots, + +static int snd_soc_xlate_tdm_slot_mask(unsigned int slots, + unsigned int *tx_mask, + unsigned int *rx_mask) +{ + if (*tx_mask || *rx_mask) + return 0; + + if (!slots) + return -EINVAL; + + *tx_mask = (1 << slots) - 1; + *rx_mask = (1 << slots) - 1; + + return 0; +} + /** * snd_soc_dai_set_tdm_slot - configure DAI TDM. * @dai: DAI @@@@ -3657,12 -3662,12 -3622,6 +3657,12 @@@@ int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width) { - if (dai->driver && dai->driver->ops->of_xlate_tdm_slot_mask) - dai->driver->ops->of_xlate_tdm_slot_mask(slots, + + if (dai->driver && dai->driver->ops->xlate_tdm_slot_mask) + + dai->driver->ops->xlate_tdm_slot_mask(slots, + &tx_mask, &rx_mask); + else - snd_soc_of_xlate_tdm_slot_mask(slots, &tx_mask, &rx_mask); + + snd_soc_xlate_tdm_slot_mask(slots, &tx_mask, &rx_mask); + if (dai->driver && dai->driver->ops->set_tdm_slot) return dai->driver->ops->set_tdm_slot(dai, tx_mask, rx_mask, slots, slot_width);