Skip to content

[4.2] fix cyclic dma setup and i2s parameters #1193

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions drivers/dma/bcm2835-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,6 @@ struct bcm2835_desc {
*/
#define MAX_LITE_TRANSFER (SZ_64K - 4)

/*
* Transfers larger than 32k cause issues with the bcm2708-i2s driver,
* so limit transfer size to 32k as bcm2708-dmaengine did.
*/
#define MAX_CYCLIC_LITE_TRANSFER SZ_32K

static inline struct bcm2835_dmadev *to_bcm2835_dma_dev(struct dma_device *d)
{
return container_of(d, struct bcm2835_dmadev, ddev);
Expand Down Expand Up @@ -403,11 +397,11 @@ static struct dma_async_tx_descriptor *bcm2835_dma_prep_dma_cyclic(

d->dir = direction;
if (c->ch >= 8) /* LITE channel */
max_size = MAX_CYCLIC_LITE_TRANSFER;
max_size = MAX_LITE_TRANSFER;
else
max_size = MAX_NORMAL_TRANSFER;
period_len = min(period_len, max_size);
d->frames = (buf_len - 1) / (period_len + 1);
d->frames = DIV_ROUND_UP(buf_len, period_len);

/* Allocate memory for control blocks */
d->control_block_size = d->frames * sizeof(struct bcm2835_dma_cb);
Expand Down
6 changes: 3 additions & 3 deletions sound/soc/bcm/bcm2835-i2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -806,16 +806,16 @@ static struct snd_pcm_hardware bcm2835_pcm_hardware = {
SNDRV_PCM_FMTBIT_S24_LE |
SNDRV_PCM_FMTBIT_S32_LE,
.period_bytes_min = 32,
.period_bytes_max = 64 * PAGE_SIZE,
.period_bytes_max = SZ_64K - 4,
.periods_min = 2,
.periods_max = 255,
.buffer_bytes_max = 128 * PAGE_SIZE,
.buffer_bytes_max = SZ_512K,
};

static const struct snd_dmaengine_pcm_config bcm2835_dmaengine_pcm_config = {
.prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config,
.pcm_hardware = &bcm2835_pcm_hardware,
.prealloc_buffer_size = 256 * PAGE_SIZE,
.prealloc_buffer_size = SZ_1M,
};

static int bcm2835_i2s_probe(struct platform_device *pdev)
Expand Down