Skip to content

bcm2708-i2s add mono support #694

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 2 commits into from
Closed
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
13 changes: 10 additions & 3 deletions sound/soc/bcm/bcm2708-i2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,11 @@ static int bcm2708_i2s_hw_params(struct snd_pcm_substream *substream,
format |= BCM2708_I2S_CH1(BCM2708_I2S_CHPOS(ch1pos));
format |= BCM2708_I2S_CH2(BCM2708_I2S_CHPOS(ch2pos));
break;
case 1:
format = BCM2708_I2S_CH1(format) | BCM2708_I2S_CH2(format^BCM2708_I2S_CHEN);
format |= BCM2708_I2S_CH1(BCM2708_I2S_CHPOS(ch1pos));
format |= BCM2708_I2S_CH2(BCM2708_I2S_CHPOS(ch2pos));
break;
default:
return -EINVAL;
}
Expand Down Expand Up @@ -629,7 +634,9 @@ static int bcm2708_i2s_hw_params(struct snd_pcm_substream *substream,
regmap_update_bits(dev->i2s_regmap, BCM2708_I2S_CS_A_REG,
BCM2708_I2S_RXTHR(1)
| BCM2708_I2S_TXTHR(1)
| BCM2708_I2S_DMAEN, 0xffffffff);
//FIXME if driver adds U24_LE PCM format support
| BCM2708_I2S_RXSEX //sign-extend received data
| BCM2708_I2S_DMAEN, 0xffffffff);

regmap_update_bits(dev->i2s_regmap, BCM2708_I2S_DREQ_A_REG,
BCM2708_I2S_TX_PANIC(0x10)
Expand Down Expand Up @@ -792,15 +799,15 @@ static struct snd_soc_dai_driver bcm2708_i2s_dai = {
.name = "bcm2708-i2s",
.probe = bcm2708_i2s_dai_probe,
.playback = {
.channels_min = 2,
.channels_min = 1,
.channels_max = 2,
.rates = SNDRV_PCM_RATE_8000_192000,
.formats = SNDRV_PCM_FMTBIT_S16_LE
| SNDRV_PCM_FMTBIT_S24_LE
| SNDRV_PCM_FMTBIT_S32_LE
},
.capture = {
.channels_min = 2,
.channels_min = 1,
.channels_max = 2,
.rates = SNDRV_PCM_RATE_8000_192000,
.formats = SNDRV_PCM_FMTBIT_S16_LE
Expand Down