mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2025-04-05 20:27:29 +03:00
cleanup-code-style
Signed-off-by: Xiangfu Liu <xiangfu@sharism.cc>
This commit is contained in:
parent
f4362a8e34
commit
73df02f0b7
@ -259,8 +259,8 @@ static int jz4740_i2s_set_fmt(struct snd_soc_dai *dai,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int jz4740_i2s_hw_params(struct snd_pcm_substream *substream,
|
static int jz4740_i2s_hw_params(struct snd_pcm_substream *substream,
|
||||||
struct snd_pcm_hw_params *params,
|
struct snd_pcm_hw_params *params,
|
||||||
struct snd_soc_dai *dai)
|
struct snd_soc_dai *dai)
|
||||||
{
|
{
|
||||||
struct jz4740_i2s *i2s = jz4740_dai_to_i2s(dai);
|
struct jz4740_i2s *i2s = jz4740_dai_to_i2s(dai);
|
||||||
bool playback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK);
|
bool playback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK);
|
||||||
@ -272,11 +272,11 @@ static int jz4740_i2s_hw_params(struct snd_pcm_substream *substream,
|
|||||||
|
|
||||||
switch (params_format(params)) {
|
switch (params_format(params)) {
|
||||||
case SNDRV_PCM_FORMAT_S8:
|
case SNDRV_PCM_FORMAT_S8:
|
||||||
sample_size = 0;
|
sample_size = 0;
|
||||||
dma_width = JZ4740_DMA_WIDTH_8BIT;
|
dma_width = JZ4740_DMA_WIDTH_8BIT;
|
||||||
break;
|
break;
|
||||||
case SNDRV_PCM_FORMAT_S16:
|
case SNDRV_PCM_FORMAT_S16:
|
||||||
sample_size = 1;
|
sample_size = 1;
|
||||||
dma_width = JZ4740_DMA_WIDTH_16BIT;
|
dma_width = JZ4740_DMA_WIDTH_16BIT;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -285,22 +285,22 @@ static int jz4740_i2s_hw_params(struct snd_pcm_substream *substream,
|
|||||||
|
|
||||||
if (playback) {
|
if (playback) {
|
||||||
ctrl &= ~JZ_AIC_CTRL_OUTPUT_SAMPLE_SIZE_MASK;
|
ctrl &= ~JZ_AIC_CTRL_OUTPUT_SAMPLE_SIZE_MASK;
|
||||||
ctrl |= sample_size << JZ_AIC_CTRL_OUTPUT_SAMPLE_SIZE_OFFSET;
|
ctrl |= sample_size << JZ_AIC_CTRL_OUTPUT_SAMPLE_SIZE_OFFSET;
|
||||||
} else {
|
} else {
|
||||||
ctrl &= ~JZ_AIC_CTRL_INPUT_SAMPLE_SIZE_MASK;
|
ctrl &= ~JZ_AIC_CTRL_INPUT_SAMPLE_SIZE_MASK;
|
||||||
ctrl |= sample_size << JZ_AIC_CTRL_INPUT_SAMPLE_SIZE_OFFSET;
|
ctrl |= sample_size << JZ_AIC_CTRL_INPUT_SAMPLE_SIZE_OFFSET;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (params_channels(params)) {
|
switch (params_channels(params)) {
|
||||||
case 2:
|
case 2:
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
if (playback) {
|
if (playback) {
|
||||||
ctrl |= JZ_AIC_CTRL_MONO_TO_STEREO;
|
ctrl |= JZ_AIC_CTRL_MONO_TO_STEREO;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
jz4740_i2s_write(i2s, JZ_REG_AIC_CTRL, ctrl);
|
jz4740_i2s_write(i2s, JZ_REG_AIC_CTRL, ctrl);
|
||||||
@ -410,7 +410,7 @@ static int jz4740_i2s_probe(struct platform_device *pdev, struct snd_soc_dai *da
|
|||||||
conf = (7 << JZ_AIC_CONF_FIFO_RX_THRESHOLD_OFFSET) |
|
conf = (7 << JZ_AIC_CONF_FIFO_RX_THRESHOLD_OFFSET) |
|
||||||
(8 << JZ_AIC_CONF_FIFO_TX_THRESHOLD_OFFSET) |
|
(8 << JZ_AIC_CONF_FIFO_TX_THRESHOLD_OFFSET) |
|
||||||
JZ_AIC_CONF_OVERFLOW_PLAY_LAST |
|
JZ_AIC_CONF_OVERFLOW_PLAY_LAST |
|
||||||
JZ_AIC_CONF_I2S |
|
JZ_AIC_CONF_I2S |
|
||||||
JZ_AIC_CONF_INTERNAL_CODEC;
|
JZ_AIC_CONF_INTERNAL_CODEC;
|
||||||
|
|
||||||
jz4740_i2s_write(i2s, JZ_REG_AIC_CONF, JZ_AIC_CONF_RESET);
|
jz4740_i2s_write(i2s, JZ_REG_AIC_CONF, JZ_AIC_CONF_RESET);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user