ASoC: Fix checkpatch issues and typos of ad1938 codec and bf5xx-tdm dai

1. fix "line over 80 characters" checkpatch warnings
2. ‘DMA_nnBIT_MASK’ is deprecated, use DMA_BIT_MASK instead
3. fix typos

Signed-off-by: Barry Song <21cnbao@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
Barry Song 2009-07-29 15:03:16 +08:00 committed by Mark Brown
parent c8489c3ed3
commit 3a39f832a5
4 changed files with 37 additions and 21 deletions

View File

@ -276,7 +276,7 @@ static void bf5xx_pcm_free_dma_buffers(struct snd_pcm *pcm)
sport_done(sport_handle); sport_done(sport_handle);
} }
static u64 bf5xx_pcm_dmamask = DMA_32BIT_MASK; static u64 bf5xx_pcm_dmamask = DMA_BIT_MASK(32);
static int bf5xx_pcm_tdm_new(struct snd_card *card, struct snd_soc_dai *dai, static int bf5xx_pcm_tdm_new(struct snd_card *card, struct snd_soc_dai *dai,
struct snd_pcm *pcm) struct snd_pcm *pcm)
@ -286,7 +286,7 @@ static int bf5xx_pcm_tdm_new(struct snd_card *card, struct snd_soc_dai *dai,
if (!card->dev->dma_mask) if (!card->dev->dma_mask)
card->dev->dma_mask = &bf5xx_pcm_dmamask; card->dev->dma_mask = &bf5xx_pcm_dmamask;
if (!card->dev->coherent_dma_mask) if (!card->dev->coherent_dma_mask)
card->dev->coherent_dma_mask = DMA_32BIT_MASK; card->dev->coherent_dma_mask = DMA_BIT_MASK(32);
if (dai->playback.channels_min) { if (dai->playback.channels_min) {
ret = bf5xx_pcm_preallocate_dma_buffer(pcm, ret = bf5xx_pcm_preallocate_dma_buffer(pcm,

View File

@ -1,5 +1,5 @@
/* /*
* linux/sound/arm/bf5xx-tdm-pcm.h -- ALSA PCM interface for the Blackfin * sound/soc/blackfin/bf5xx-tdm-pcm.h -- ALSA PCM interface for the Blackfin
* *
* Copyright 2009 Analog Device Inc. * Copyright 2009 Analog Device Inc.
* *

View File

@ -1,5 +1,5 @@
/* /*
* linux/sound/arm/bf5xx-i2s.h * sound/soc/blackfin/bf5xx-tdm.h
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as * it under the terms of the GNU General Public License version 2 as

View File

@ -72,14 +72,20 @@ static const struct snd_kcontrol_new ad1938_snd_controls[] = {
AD1938_DAC_R4_VOL, 0, 0xFF, 1), AD1938_DAC_R4_VOL, 0, 0xFF, 1),
/* ADC switch control */ /* ADC switch control */
SOC_DOUBLE("ADC1 Switch", AD1938_ADC_CTRL0, AD1938_ADCL1_MUTE, AD1938_ADCR1_MUTE, 1, 1), SOC_DOUBLE("ADC1 Switch", AD1938_ADC_CTRL0, AD1938_ADCL1_MUTE,
SOC_DOUBLE("ADC2 Switch", AD1938_ADC_CTRL0, AD1938_ADCL2_MUTE, AD1938_ADCR2_MUTE, 1, 1), AD1938_ADCR1_MUTE, 1, 1),
SOC_DOUBLE("ADC2 Switch", AD1938_ADC_CTRL0, AD1938_ADCL2_MUTE,
AD1938_ADCR2_MUTE, 1, 1),
/* DAC switch control */ /* DAC switch control */
SOC_DOUBLE("DAC1 Switch", AD1938_DAC_CHNL_MUTE, AD1938_DACL1_MUTE, AD1938_DACR1_MUTE, 1, 1), SOC_DOUBLE("DAC1 Switch", AD1938_DAC_CHNL_MUTE, AD1938_DACL1_MUTE,
SOC_DOUBLE("DAC2 Switch", AD1938_DAC_CHNL_MUTE, AD1938_DACL2_MUTE, AD1938_DACR2_MUTE, 1, 1), AD1938_DACR1_MUTE, 1, 1),
SOC_DOUBLE("DAC3 Switch", AD1938_DAC_CHNL_MUTE, AD1938_DACL3_MUTE, AD1938_DACR3_MUTE, 1, 1), SOC_DOUBLE("DAC2 Switch", AD1938_DAC_CHNL_MUTE, AD1938_DACL2_MUTE,
SOC_DOUBLE("DAC4 Switch", AD1938_DAC_CHNL_MUTE, AD1938_DACL4_MUTE, AD1938_DACR4_MUTE, 1, 1), AD1938_DACR2_MUTE, 1, 1),
SOC_DOUBLE("DAC3 Switch", AD1938_DAC_CHNL_MUTE, AD1938_DACL3_MUTE,
AD1938_DACR3_MUTE, 1, 1),
SOC_DOUBLE("DAC4 Switch", AD1938_DAC_CHNL_MUTE, AD1938_DACL4_MUTE,
AD1938_DACR4_MUTE, 1, 1),
/* ADC high-pass filter */ /* ADC high-pass filter */
SOC_SINGLE("ADC High Pass Filter Switch", AD1938_ADC_CTRL0, SOC_SINGLE("ADC High Pass Filter Switch", AD1938_ADC_CTRL0,
@ -110,7 +116,8 @@ static int ad1938_mute(struct snd_soc_dai *dai, int mute)
int reg; int reg;
reg = codec->read(codec, AD1938_DAC_CTRL2); reg = codec->read(codec, AD1938_DAC_CTRL2);
reg = (mute > 0) ? reg | AD1938_DAC_MASTER_MUTE : reg & (~AD1938_DAC_MASTER_MUTE); reg = (mute > 0) ? reg | AD1938_DAC_MASTER_MUTE : reg &
(~AD1938_DAC_MASTER_MUTE);
codec->write(codec, AD1938_DAC_CTRL2, reg); codec->write(codec, AD1938_DAC_CTRL2, reg);
return 0; return 0;
@ -119,7 +126,8 @@ static int ad1938_mute(struct snd_soc_dai *dai, int mute)
static inline int ad1938_pll_powerctrl(struct snd_soc_codec *codec, int cmd) static inline int ad1938_pll_powerctrl(struct snd_soc_codec *codec, int cmd)
{ {
int reg = codec->read(codec, AD1938_PLL_CLK_CTRL0); int reg = codec->read(codec, AD1938_PLL_CLK_CTRL0);
reg = (cmd > 0) ? reg & (~AD1938_PLL_POWERDOWN) : reg | AD1938_PLL_POWERDOWN; reg = (cmd > 0) ? reg & (~AD1938_PLL_POWERDOWN) : reg |
AD1938_PLL_POWERDOWN;
codec->write(codec, AD1938_PLL_CLK_CTRL0, reg); codec->write(codec, AD1938_PLL_CLK_CTRL0, reg);
return 0; return 0;
@ -171,8 +179,8 @@ static int ad1938_set_dai_fmt(struct snd_soc_dai *codec_dai,
adc_reg = codec->read(codec, AD1938_ADC_CTRL2); adc_reg = codec->read(codec, AD1938_ADC_CTRL2);
dac_reg = codec->read(codec, AD1938_DAC_CTRL1); dac_reg = codec->read(codec, AD1938_DAC_CTRL1);
/* At present, the driver only support AUX ADC mode(SND_SOC_DAIFMT_I2S with TDM) /* At present, the driver only support AUX ADC mode(SND_SOC_DAIFMT_I2S
* and ADC&DAC TDM mode(SND_SOC_DAIFMT_DSP_A) * with TDM) and ADC&DAC TDM mode(SND_SOC_DAIFMT_DSP_A)
*/ */
switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
case SND_SOC_DAIFMT_I2S: case SND_SOC_DAIFMT_I2S:
@ -363,7 +371,8 @@ static unsigned int ad1938_read_reg_cache(struct snd_soc_codec *codec,
* read from the ad1938 register space * read from the ad1938 register space
*/ */
static unsigned int ad1938_read_reg(struct snd_soc_codec *codec, unsigned int reg) static unsigned int ad1938_read_reg(struct snd_soc_codec *codec,
unsigned int reg)
{ {
char w_buf[AD1938_SPI_BUFLEN]; char w_buf[AD1938_SPI_BUFLEN];
char r_buf[AD1938_SPI_BUFLEN]; char r_buf[AD1938_SPI_BUFLEN];
@ -502,12 +511,19 @@ static int ad1938_register(struct ad1938_priv *ad1938)
ad1938_codec = codec; ad1938_codec = codec;
/* default setting for ad1938 */ /* default setting for ad1938 */
codec->write(codec, AD1938_DAC_CHNL_MUTE, 0x0); /* unmute dac channels */
codec->write(codec, AD1938_DAC_CTRL2, 0x1A); /* de-emphasis: 48kHz, powedown dac */ /* unmute dac channels */
codec->write(codec, AD1938_DAC_CTRL0, 0x21); /* powerdown dac, dac tdm mode */ codec->write(codec, AD1938_DAC_CHNL_MUTE, 0x0);
codec->write(codec, AD1938_ADC_CTRL0, 0x3); /* high-pass filter enable */ /* de-emphasis: 48kHz, powedown dac */
codec->write(codec, AD1938_ADC_CTRL1, 0x43); /* sata delay=1, adc aux mode */ codec->write(codec, AD1938_DAC_CTRL2, 0x1A);
codec->write(codec, AD1938_PLL_CLK_CTRL0, 0x9D); /* pll input:mclki/xi */ /* powerdown dac, dac in tdm mode */
codec->write(codec, AD1938_DAC_CTRL0, 0x41);
/* high-pass filter enable */
codec->write(codec, AD1938_ADC_CTRL0, 0x3);
/* sata delay=1, adc aux mode */
codec->write(codec, AD1938_ADC_CTRL1, 0x43);
/* pll input: mclki/xi */
codec->write(codec, AD1938_PLL_CLK_CTRL0, 0x9D);
codec->write(codec, AD1938_PLL_CLK_CTRL1, 0x04); codec->write(codec, AD1938_PLL_CLK_CTRL1, 0x04);
ad1938_fill_cache(codec); ad1938_fill_cache(codec);