Skip to content

Commit

Permalink
Merge series "ASoC: Simplify with dma_set_mask_and_coherent()" from T…
Browse files Browse the repository at this point in the history
…akashi Iwai <tiwai@suse.de>:

Simple conversions from two dma_set_mask*() calls into the single
dma_set_mask_and_coherent().

Just a minor code refactoring, no functional changes.

Takashi

===

Takashi Iwai (3):
  ASoC: intel: skl: Simplify with dma_set_mask_and_coherent()
  ASoC: SOF: intel: Simplify with dma_set_mask_and_coherent()
  ASoC: tegra: Simplify with dma_set_mask_and_coherent()

 sound/soc/intel/skylake/skl.c | 8 ++------
 sound/soc/sof/intel/hda.c     | 8 ++------
 sound/soc/tegra/tegra_pcm.c   | 6 +-----
 3 files changed, 5 insertions(+), 17 deletions(-)

--
2.26.2
  • Loading branch information
Mark Brown committed Jan 19, 2021
2 parents 0dedbde + 7cc206b commit 9769243
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 17 deletions.
8 changes: 2 additions & 6 deletions sound/soc/intel/skylake/skl.c
Original file line number Diff line number Diff line change
Expand Up @@ -950,12 +950,8 @@ static int skl_first_init(struct hdac_bus *bus)
bus->num_streams = cp_streams + pb_streams;

/* allow 64bit DMA address if supported by H/W */
if (!dma_set_mask(bus->dev, DMA_BIT_MASK(64))) {
dma_set_coherent_mask(bus->dev, DMA_BIT_MASK(64));
} else {
dma_set_mask(bus->dev, DMA_BIT_MASK(32));
dma_set_coherent_mask(bus->dev, DMA_BIT_MASK(32));
}
if (dma_set_mask_and_coherent(bus->dev, DMA_BIT_MASK(64)))
dma_set_mask_and_coherent(bus->dev, DMA_BIT_MASK(32));

/* initialize streams */
snd_hdac_ext_stream_init_all
Expand Down
8 changes: 2 additions & 6 deletions sound/soc/sof/intel/hda.c
Original file line number Diff line number Diff line change
Expand Up @@ -809,13 +809,9 @@ int hda_dsp_probe(struct snd_sof_dev *sdev)
sdev->mailbox_bar = HDA_DSP_BAR;

/* allow 64bit DMA address if supported by H/W */
if (!dma_set_mask(&pci->dev, DMA_BIT_MASK(64))) {
dev_dbg(sdev->dev, "DMA mask is 64 bit\n");
dma_set_coherent_mask(&pci->dev, DMA_BIT_MASK(64));
} else {
if (dma_set_mask_and_coherent(&pci->dev, DMA_BIT_MASK(64))) {
dev_dbg(sdev->dev, "DMA mask is 32 bit\n");
dma_set_mask(&pci->dev, DMA_BIT_MASK(32));
dma_set_coherent_mask(&pci->dev, DMA_BIT_MASK(32));
dma_set_mask_and_coherent(&pci->dev, DMA_BIT_MASK(32));
}

/* init streams */
Expand Down
6 changes: 1 addition & 5 deletions sound/soc/tegra/tegra_pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,7 @@ static int tegra_pcm_dma_allocate(struct snd_soc_pcm_runtime *rtd,
struct snd_pcm *pcm = rtd->pcm;
int ret;

ret = dma_set_mask(card->dev, DMA_BIT_MASK(32));
if (ret < 0)
return ret;

ret = dma_set_coherent_mask(card->dev, DMA_BIT_MASK(32));
ret = dma_set_mask_and_coherent(card->dev, DMA_BIT_MASK(32));
if (ret < 0)
return ret;

Expand Down

0 comments on commit 9769243

Please sign in to comment.