mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
ASoC: davinci-mcasp: correct tdm_slots limit
The current check for the number of tdm-slots specified by platform data is always true (x >= 2 || x <= 32); therefore the else branch that warns of an incorrect number of slots can never be taken. Check that the number of tdm slots specified by platform data is between 2 and 32, inclusive. Signed-off-by: Ben Gardiner <[email protected]> Reviewed-by: James Nuss <[email protected]> Acked-by: Liam Girdwood <[email protected]> Signed-off-by: Mark Brown <[email protected]>
This commit is contained in:
parent
b3c27b51db
commit
049cfaaa47
1 changed files with 2 additions and 2 deletions
|
|
@ -644,7 +644,7 @@ static void davinci_hw_param(struct davinci_audio_dev *dev, int stream)
|
|||
mcasp_set_reg(dev->base + DAVINCI_MCASP_TXTDM_REG, mask);
|
||||
mcasp_set_bits(dev->base + DAVINCI_MCASP_TXFMT_REG, TXORD);
|
||||
|
||||
if ((dev->tdm_slots >= 2) || (dev->tdm_slots <= 32))
|
||||
if ((dev->tdm_slots >= 2) && (dev->tdm_slots <= 32))
|
||||
mcasp_mod_bits(dev->base + DAVINCI_MCASP_TXFMCTL_REG,
|
||||
FSXMOD(dev->tdm_slots), FSXMOD(0x1FF));
|
||||
else
|
||||
|
|
@ -660,7 +660,7 @@ static void davinci_hw_param(struct davinci_audio_dev *dev, int stream)
|
|||
AHCLKRE);
|
||||
mcasp_set_reg(dev->base + DAVINCI_MCASP_RXTDM_REG, mask);
|
||||
|
||||
if ((dev->tdm_slots >= 2) || (dev->tdm_slots <= 32))
|
||||
if ((dev->tdm_slots >= 2) && (dev->tdm_slots <= 32))
|
||||
mcasp_mod_bits(dev->base + DAVINCI_MCASP_RXFMCTL_REG,
|
||||
FSRMOD(dev->tdm_slots), FSRMOD(0x1FF));
|
||||
else
|
||||
|
|
|
|||
Loading…
Reference in a new issue