diff options
author | Frank.Li <Frank.Li@freescale.com> | 2009-11-18 11:43:37 -0600 |
---|---|---|
committer | Alejandro Gonzalez <alex.gonzalez@digi.com> | 2010-02-12 17:19:41 +0100 |
commit | a05a18e1b38d0e479bfcad647bcd9947b20232cb (patch) | |
tree | f34f68db4501618df14f82033f2ad4d5057ebc8d /sound | |
parent | 66569dabd047718edd6ec5e02e6624e9d258cd40 (diff) |
ENGR00118544 iMX23 Clear dangerous macro stmp3xxx_setl(clearl)
No all regiser use _SCT. stmp3xxx_setl may write to wrong address.
please use __raw_write (value, REG_XXX_SET) to write date to SCT
register. Only REG_XXX_SCT is defined when it exist at hardware.
Signed-off-by: Frank.Li <Frank.Li@freescale.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/stmp378x_codec.c | 260 | ||||
-rw-r--r-- | sound/soc/codecs/stmp3xxx_spdif.c | 22 | ||||
-rw-r--r-- | sound/soc/stmp3xxx/stmp3xxx_dai.c | 54 | ||||
-rw-r--r-- | sound/soc/stmp3xxx/stmp3xxx_pcm.c | 4 | ||||
-rw-r--r-- | sound/soc/stmp3xxx/stmp3xxx_spdif_dai.c | 32 |
5 files changed, 197 insertions, 175 deletions
diff --git a/sound/soc/codecs/stmp378x_codec.c b/sound/soc/codecs/stmp378x_codec.c index 770163947171..90df291b6aaf 100644 --- a/sound/soc/codecs/stmp378x_codec.c +++ b/sound/soc/codecs/stmp378x_codec.c @@ -238,10 +238,10 @@ static int dac_put_volsw(struct snd_kcontrol *kcontrol, reg = reg | BF(r, AUDIOOUT_DACVOLUME_VOLUME_RIGHT); /*Clear left/right dac volume */ - stmp3xxx_clearl(BM_AUDIOOUT_DACVOLUME_VOLUME_LEFT | + __raw_writel(BM_AUDIOOUT_DACVOLUME_VOLUME_LEFT | BM_AUDIOOUT_DACVOLUME_VOLUME_RIGHT, - REGS_AUDIOOUT_BASE + HW_AUDIOOUT_DACVOLUME); - stmp3xxx_setl(reg, REGS_AUDIOOUT_BASE + HW_AUDIOOUT_DACVOLUME); + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_DACVOLUME_CLR); + __raw_writel(reg, REGS_AUDIOOUT_BASE + HW_AUDIOOUT_DACVOLUME_SET); return 0; } @@ -462,21 +462,21 @@ static int stmp378x_codec_hw_params(struct snd_pcm_substream *substream, switch (params_format(params)) { case SNDRV_PCM_FORMAT_S16_LE: if (playback) - stmp3xxx_setl(BM_AUDIOOUT_CTRL_WORD_LENGTH, - REGS_AUDIOOUT_BASE + HW_AUDIOOUT_CTRL); + __raw_writel(BM_AUDIOOUT_CTRL_WORD_LENGTH, + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_CTRL_SET); else - stmp3xxx_setl(BM_AUDIOIN_CTRL_WORD_LENGTH, - REGS_AUDIOIN_BASE + HW_AUDIOIN_CTRL); + __raw_writel(BM_AUDIOIN_CTRL_WORD_LENGTH, + REGS_AUDIOIN_BASE + HW_AUDIOIN_CTRL_SET); break; case SNDRV_PCM_FORMAT_S32_LE: if (playback) - stmp3xxx_clearl(BM_AUDIOOUT_CTRL_WORD_LENGTH, - REGS_AUDIOOUT_BASE + HW_AUDIOOUT_CTRL); + __raw_writel(BM_AUDIOOUT_CTRL_WORD_LENGTH, + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_CTRL_CLR); else - stmp3xxx_clearl(BM_AUDIOIN_CTRL_WORD_LENGTH, - REGS_AUDIOIN_BASE + HW_AUDIOIN_CTRL); + __raw_writel(BM_AUDIOIN_CTRL_WORD_LENGTH, + REGS_AUDIOIN_BASE + HW_AUDIOIN_CTRL_CLR); break; @@ -495,19 +495,19 @@ static int stmp378x_codec_dig_mute(struct snd_soc_dai *dai, int mute) BM_AUDIOOUT_DACVOLUME_MUTE_RIGHT; if (mute) { - stmp3xxx_setl(dac_mask, - REGS_AUDIOOUT_BASE + HW_AUDIOOUT_DACVOLUME); - stmp3xxx_setl(BM_AUDIOOUT_HPVOL_MUTE, - REGS_AUDIOOUT_BASE + HW_AUDIOOUT_HPVOL); - stmp3xxx_setl(BM_AUDIOOUT_SPEAKERCTRL_MUTE, - REGS_AUDIOOUT_BASE + HW_AUDIOOUT_SPEAKERCTRL); + __raw_writel(dac_mask, + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_DACVOLUME_SET); + __raw_writel(BM_AUDIOOUT_HPVOL_MUTE, + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_HPVOL_SET); + __raw_writel(BM_AUDIOOUT_SPEAKERCTRL_MUTE, + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_SPEAKERCTRL_SET); } else { - stmp3xxx_clearl(dac_mask, - REGS_AUDIOOUT_BASE + HW_AUDIOOUT_DACVOLUME); - stmp3xxx_clearl(BM_AUDIOOUT_HPVOL_MUTE, - REGS_AUDIOOUT_BASE + HW_AUDIOOUT_HPVOL); - stmp3xxx_clearl(BM_AUDIOOUT_SPEAKERCTRL_MUTE, - REGS_AUDIOOUT_BASE + HW_AUDIOOUT_SPEAKERCTRL); + __raw_writel(dac_mask, + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_DACVOLUME_CLR); + __raw_writel(BM_AUDIOOUT_HPVOL_MUTE, + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_HPVOL_CLR); + __raw_writel(BM_AUDIOOUT_SPEAKERCTRL_MUTE, + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_SPEAKERCTRL_CLR); } return 0; } @@ -535,83 +535,83 @@ static void stmp378x_codec_dac_power_on(struct stmp378x_codec_priv *stmp378x_adc) { /* Ungate DAC clocks */ - stmp3xxx_clearl(BM_AUDIOOUT_CTRL_CLKGATE, - REGS_AUDIOOUT_BASE + HW_AUDIOOUT_CTRL); - stmp3xxx_clearl(BM_AUDIOOUT_ANACLKCTRL_CLKGATE, - REGS_AUDIOOUT_BASE + HW_AUDIOOUT_ANACLKCTRL); + __raw_writel(BM_AUDIOOUT_CTRL_CLKGATE, + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_CTRL_CLR); + __raw_writel(BM_AUDIOOUT_ANACLKCTRL_CLKGATE, + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_ANACLKCTRL_CLR); /* 16 bit word length */ - stmp3xxx_setl(BM_AUDIOOUT_CTRL_WORD_LENGTH, - REGS_AUDIOOUT_BASE + HW_AUDIOOUT_CTRL); + __raw_writel(BM_AUDIOOUT_CTRL_WORD_LENGTH, + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_CTRL_SET); /* Update DAC volume over zero crossings */ - stmp3xxx_setl(BM_AUDIOOUT_DACVOLUME_EN_ZCD, - REGS_AUDIOOUT_BASE + HW_AUDIOOUT_DACVOLUME); + __raw_writel(BM_AUDIOOUT_DACVOLUME_EN_ZCD, + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_DACVOLUME_SET); /* Mute DAC */ - stmp3xxx_setl(BM_AUDIOOUT_DACVOLUME_MUTE_LEFT | + __raw_writel(BM_AUDIOOUT_DACVOLUME_MUTE_LEFT | BM_AUDIOOUT_DACVOLUME_MUTE_RIGHT, - REGS_AUDIOOUT_BASE + HW_AUDIOOUT_DACVOLUME); + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_DACVOLUME_SET); /* Update HP volume over zero crossings */ - stmp3xxx_setl(BM_AUDIOOUT_HPVOL_EN_MSTR_ZCD, - REGS_AUDIOOUT_BASE + HW_AUDIOOUT_HPVOL); + __raw_writel(BM_AUDIOOUT_HPVOL_EN_MSTR_ZCD, + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_HPVOL_SET); /* Prepare powering up HP output */ - stmp3xxx_setl(BM_AUDIOOUT_ANACTRL_HP_HOLD_GND, - REGS_AUDIOOUT_BASE + HW_AUDIOOUT_ANACTRL); - stmp3xxx_setl(BF(0x2, RTC_PERSISTENT0_SPARE_ANALOG), - REGS_RTC_BASE + HW_RTC_PERSISTENT0); - stmp3xxx_setl(BM_AUDIOOUT_ANACTRL_HP_CLASSAB, - REGS_AUDIOOUT_BASE + HW_AUDIOOUT_ANACTRL); - stmp3xxx_clearl(BM_AUDIOOUT_ANACTRL_HP_HOLD_GND, - REGS_AUDIOOUT_BASE + HW_AUDIOOUT_ANACTRL); + __raw_writel(BM_AUDIOOUT_ANACTRL_HP_HOLD_GND, + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_ANACTRL_SET); + __raw_writel(BF(0x2, RTC_PERSISTENT0_SPARE_ANALOG), + REGS_RTC_BASE + HW_RTC_PERSISTENT0_SET); + __raw_writel(BM_AUDIOOUT_ANACTRL_HP_CLASSAB, + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_ANACTRL_SET); + __raw_writel(BM_AUDIOOUT_ANACTRL_HP_HOLD_GND, + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_ANACTRL_CLR); /* Mute HP output */ - stmp3xxx_setl(BM_AUDIOOUT_HPVOL_MUTE, - REGS_AUDIOOUT_BASE + HW_AUDIOOUT_HPVOL); + __raw_writel(BM_AUDIOOUT_HPVOL_MUTE, + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_HPVOL_SET); /* Mute speaker amp */ - stmp3xxx_setl(BM_AUDIOOUT_SPEAKERCTRL_MUTE, - REGS_AUDIOOUT_BASE + HW_AUDIOOUT_SPEAKERCTRL); + __raw_writel(BM_AUDIOOUT_SPEAKERCTRL_MUTE, + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_SPEAKERCTRL_SET); } static void stmp378x_codec_dac_power_down(struct stmp378x_codec_priv *stmp378x_adc) { /* Disable class AB */ - stmp3xxx_clearl(BM_AUDIOOUT_ANACTRL_HP_CLASSAB, - REGS_AUDIOOUT_BASE + HW_AUDIOOUT_ANACTRL); + __raw_writel(BM_AUDIOOUT_ANACTRL_HP_CLASSAB, + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_ANACTRL_CLR); /* Set hold to ground */ - stmp3xxx_setl(BM_AUDIOOUT_ANACTRL_HP_HOLD_GND, - REGS_AUDIOOUT_BASE + HW_AUDIOOUT_ANACTRL); + __raw_writel(BM_AUDIOOUT_ANACTRL_HP_HOLD_GND, + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_ANACTRL_SET); /* Mute HP output */ - stmp3xxx_setl(BM_AUDIOOUT_HPVOL_MUTE, - REGS_AUDIOOUT_BASE + HW_AUDIOOUT_HPVOL); + __raw_writel(BM_AUDIOOUT_HPVOL_MUTE, + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_HPVOL_SET); /* Power down HP output */ - stmp3xxx_setl(BM_AUDIOOUT_PWRDN_HEADPHONE, - REGS_AUDIOOUT_BASE + HW_AUDIOOUT_PWRDN); + __raw_writel(BM_AUDIOOUT_PWRDN_HEADPHONE, + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_PWRDN_SET); /* Mute speaker amp */ - stmp3xxx_setl(BM_AUDIOOUT_SPEAKERCTRL_MUTE, - REGS_AUDIOOUT_BASE + HW_AUDIOOUT_SPEAKERCTRL); + __raw_writel(BM_AUDIOOUT_SPEAKERCTRL_MUTE, + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_SPEAKERCTRL_SET); /* Power down speaker amp */ - stmp3xxx_setl(BM_AUDIOOUT_PWRDN_SPEAKER, - REGS_AUDIOOUT_BASE + HW_AUDIOOUT_PWRDN); + __raw_writel(BM_AUDIOOUT_PWRDN_SPEAKER, + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_PWRDN_SET); /* Mute DAC */ - stmp3xxx_setl(BM_AUDIOOUT_DACVOLUME_MUTE_LEFT | + __raw_writel(BM_AUDIOOUT_DACVOLUME_MUTE_LEFT | BM_AUDIOOUT_DACVOLUME_MUTE_RIGHT, - REGS_AUDIOOUT_BASE + HW_AUDIOOUT_DACVOLUME); + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_DACVOLUME_SET); /* Power down DAC */ - stmp3xxx_setl(BM_AUDIOOUT_PWRDN_DAC, - REGS_AUDIOOUT_BASE + HW_AUDIOOUT_PWRDN); + __raw_writel(BM_AUDIOOUT_PWRDN_DAC, + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_PWRDN_SET); /* Gate DAC clocks */ - stmp3xxx_setl(BM_AUDIOOUT_ANACLKCTRL_CLKGATE, - REGS_AUDIOOUT_BASE + HW_AUDIOOUT_ANACLKCTRL); - stmp3xxx_setl(BM_AUDIOOUT_CTRL_CLKGATE, - REGS_AUDIOOUT_BASE + HW_AUDIOOUT_CTRL); + __raw_writel(BM_AUDIOOUT_ANACLKCTRL_CLKGATE, + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_ANACLKCTRL_SET); + __raw_writel(BM_AUDIOOUT_CTRL_CLKGATE, + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_CTRL_SET); } static void @@ -620,54 +620,54 @@ stmp378x_codec_adc_power_on(struct stmp378x_codec_priv *stmp378x_adc) u32 reg; /* Ungate ADC clocks */ - stmp3xxx_clearl(BM_AUDIOIN_CTRL_CLKGATE, - REGS_AUDIOIN_BASE + HW_AUDIOIN_CTRL); - stmp3xxx_clearl(BM_AUDIOIN_ANACLKCTRL_CLKGATE, - REGS_AUDIOIN_BASE + HW_AUDIOIN_ANACLKCTRL); + __raw_writel(BM_AUDIOIN_CTRL_CLKGATE, + REGS_AUDIOIN_BASE + HW_AUDIOIN_CTRL_CLR); + __raw_writel(BM_AUDIOIN_ANACLKCTRL_CLKGATE, + REGS_AUDIOIN_BASE + HW_AUDIOIN_ANACLKCTRL_CLR); /* 16 bit word length */ - stmp3xxx_setl(BM_AUDIOIN_CTRL_WORD_LENGTH, - REGS_AUDIOIN_BASE + HW_AUDIOIN_CTRL); + __raw_writel(BM_AUDIOIN_CTRL_WORD_LENGTH, + REGS_AUDIOIN_BASE + HW_AUDIOIN_CTRL_SET); /* Unmute ADC channels */ - stmp3xxx_clearl(BM_AUDIOIN_ADCVOL_MUTE, - REGS_AUDIOIN_BASE + HW_AUDIOIN_ADCVOL); + __raw_writel(BM_AUDIOIN_ADCVOL_MUTE, + REGS_AUDIOIN_BASE + HW_AUDIOIN_ADCVOL_CLR); /* * The MUTE_LEFT and MUTE_RIGHT fields need to be cleared. * They aren't presented in the datasheet, so this is hardcode. */ - stmp3xxx_clearl(0x01000100, REGS_AUDIOIN_BASE + HW_AUDIOIN_ADCVOLUME); + __raw_writel(0x01000100, REGS_AUDIOIN_BASE + HW_AUDIOIN_ADCVOLUME_CLR); /* Set the Input channel gain 3dB */ - stmp3xxx_clearl(BM_AUDIOIN_ADCVOL_GAIN_LEFT, - REGS_AUDIOIN_BASE + HW_AUDIOIN_ADCVOL); - stmp3xxx_clearl(BM_AUDIOIN_ADCVOL_GAIN_RIGHT, - REGS_AUDIOIN_BASE + HW_AUDIOIN_ADCVOL); - stmp3xxx_setl(BF(2, AUDIOIN_ADCVOL_GAIN_LEFT), - REGS_AUDIOIN_BASE + HW_AUDIOIN_ADCVOL); - stmp3xxx_setl(BF(2, AUDIOIN_ADCVOL_GAIN_RIGHT), - REGS_AUDIOIN_BASE + HW_AUDIOIN_ADCVOL); + __raw_writel(BM_AUDIOIN_ADCVOL_GAIN_LEFT, + REGS_AUDIOIN_BASE + HW_AUDIOIN_ADCVOL_CLR); + __raw_writel(BM_AUDIOIN_ADCVOL_GAIN_RIGHT, + REGS_AUDIOIN_BASE + HW_AUDIOIN_ADCVOL_CLR); + __raw_writel(BF(2, AUDIOIN_ADCVOL_GAIN_LEFT), + REGS_AUDIOIN_BASE + HW_AUDIOIN_ADCVOL_SET); + __raw_writel(BF(2, AUDIOIN_ADCVOL_GAIN_RIGHT), + REGS_AUDIOIN_BASE + HW_AUDIOIN_ADCVOL_SET); /* Select default input - Microphone */ - stmp3xxx_clearl(BM_AUDIOIN_ADCVOL_SELECT_LEFT, - REGS_AUDIOIN_BASE + HW_AUDIOIN_ADCVOL); - stmp3xxx_clearl(BM_AUDIOIN_ADCVOL_SELECT_RIGHT, - REGS_AUDIOIN_BASE + HW_AUDIOIN_ADCVOL); - stmp3xxx_setl(BF + __raw_writel(BM_AUDIOIN_ADCVOL_SELECT_LEFT, + REGS_AUDIOIN_BASE + HW_AUDIOIN_ADCVOL_CLR); + __raw_writel(BM_AUDIOIN_ADCVOL_SELECT_RIGHT, + REGS_AUDIOIN_BASE + HW_AUDIOIN_ADCVOL_CLR); + __raw_writel(BF (BV_AUDIOIN_ADCVOL_SELECT__MIC, AUDIOIN_ADCVOL_SELECT_LEFT), - REGS_AUDIOIN_BASE + HW_AUDIOIN_ADCVOL); - stmp3xxx_setl(BF + REGS_AUDIOIN_BASE + HW_AUDIOIN_ADCVOL_SET); + __raw_writel(BF (BV_AUDIOIN_ADCVOL_SELECT__MIC, AUDIOIN_ADCVOL_SELECT_RIGHT), - REGS_AUDIOIN_BASE + HW_AUDIOIN_ADCVOL); + REGS_AUDIOIN_BASE + HW_AUDIOIN_ADCVOL_SET); /* Supply bias voltage to microphone */ - stmp3xxx_setl(BF(2, AUDIOIN_MICLINE_MIC_RESISTOR), - REGS_AUDIOIN_BASE + HW_AUDIOIN_MICLINE); - stmp3xxx_setl(BM_AUDIOIN_MICLINE_MIC_SELECT, - REGS_AUDIOIN_BASE + HW_AUDIOIN_MICLINE); + __raw_writel(BF(2, AUDIOIN_MICLINE_MIC_RESISTOR), + REGS_AUDIOIN_BASE + HW_AUDIOIN_MICLINE_SET); + __raw_writel(BM_AUDIOIN_MICLINE_MIC_SELECT, + REGS_AUDIOIN_BASE + HW_AUDIOIN_MICLINE_SET); /* Set max ADC volume */ reg = __raw_readl(REGS_AUDIOIN_BASE + HW_AUDIOIN_ADCVOLUME); @@ -682,43 +682,43 @@ static void stmp378x_codec_adc_power_down(struct stmp378x_codec_priv *stmp378x_adc) { /* Mute ADC channels */ - stmp3xxx_setl(BM_AUDIOIN_ADCVOL_MUTE, - REGS_AUDIOIN_BASE + HW_AUDIOIN_ADCVOL); + __raw_writel(BM_AUDIOIN_ADCVOL_MUTE, + REGS_AUDIOIN_BASE + HW_AUDIOIN_ADCVOL_SET); /* Power Down ADC */ - stmp3xxx_setl(BM_AUDIOOUT_PWRDN_ADC | BM_AUDIOOUT_PWRDN_RIGHT_ADC, - REGS_AUDIOOUT_BASE + HW_AUDIOOUT_PWRDN); + __raw_writel(BM_AUDIOOUT_PWRDN_ADC | BM_AUDIOOUT_PWRDN_RIGHT_ADC, + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_PWRDN_SET); /* Gate ADC clocks */ - stmp3xxx_setl(BM_AUDIOIN_CTRL_CLKGATE, - REGS_AUDIOIN_BASE + HW_AUDIOIN_CTRL); - stmp3xxx_setl(BM_AUDIOIN_ANACLKCTRL_CLKGATE, - REGS_AUDIOIN_BASE + HW_AUDIOIN_ANACLKCTRL); + __raw_writel(BM_AUDIOIN_CTRL_CLKGATE, + REGS_AUDIOIN_BASE + HW_AUDIOIN_CTRL_SET); + __raw_writel(BM_AUDIOIN_ANACLKCTRL_CLKGATE, + REGS_AUDIOIN_BASE + HW_AUDIOIN_ANACLKCTRL_SET); /* Disable bias voltage to microphone */ - stmp3xxx_setl(BF(0, AUDIOIN_MICLINE_MIC_RESISTOR), - REGS_AUDIOIN_BASE + HW_AUDIOIN_MICLINE); + __raw_writel(BF(0, AUDIOIN_MICLINE_MIC_RESISTOR), + REGS_AUDIOIN_BASE + HW_AUDIOIN_MICLINE_SET); } static void stmp378x_codec_dac_enable(struct stmp378x_codec_priv *stmp378x_adc) { /* Move DAC codec out of reset */ - stmp3xxx_clearl(BM_AUDIOOUT_CTRL_SFTRST, - REGS_AUDIOOUT_BASE + HW_AUDIOOUT_CTRL); + __raw_writel(BM_AUDIOOUT_CTRL_SFTRST, + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_CTRL_CLR); /* Reduce analog power */ - stmp3xxx_clearl(BM_AUDIOOUT_TEST_HP_I1_ADJ, - REGS_AUDIOOUT_BASE + HW_AUDIOOUT_TEST); - stmp3xxx_setl(BF(0x1, AUDIOOUT_TEST_HP_I1_ADJ), - REGS_AUDIOOUT_BASE + HW_AUDIOOUT_TEST); - stmp3xxx_setl(BM_AUDIOOUT_REFCTRL_LOW_PWR, - REGS_AUDIOOUT_BASE + HW_AUDIOOUT_REFCTRL); - stmp3xxx_setl(BM_AUDIOOUT_REFCTRL_XTAL_BGR_BIAS, - REGS_AUDIOOUT_BASE + HW_AUDIOOUT_REFCTRL); - stmp3xxx_clearl(BM_AUDIOOUT_REFCTRL_BIAS_CTRL, - REGS_AUDIOOUT_BASE + HW_AUDIOOUT_REFCTRL); - stmp3xxx_clearl(BF(0x1, AUDIOOUT_REFCTRL_BIAS_CTRL), - REGS_AUDIOOUT_BASE + HW_AUDIOOUT_REFCTRL); + __raw_writel(BM_AUDIOOUT_TEST_HP_I1_ADJ, + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_TEST_CLR); + __raw_writel(BF(0x1, AUDIOOUT_TEST_HP_I1_ADJ), + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_TEST_SET); + __raw_writel(BM_AUDIOOUT_REFCTRL_LOW_PWR, + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_REFCTRL_SET); + __raw_writel(BM_AUDIOOUT_REFCTRL_XTAL_BGR_BIAS, + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_REFCTRL_SET); + __raw_writel(BM_AUDIOOUT_REFCTRL_BIAS_CTRL, + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_REFCTRL_CLR); + __raw_writel(BF(0x1, AUDIOOUT_REFCTRL_BIAS_CTRL), + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_REFCTRL_CLR); /* Set Vag value */ stmp378x_codec_dac_set_vag(); @@ -735,8 +735,8 @@ static void stmp378x_codec_dac_disable(struct stmp378x_codec_priv *stmp378x_adc) static void stmp378x_codec_adc_enable(struct stmp378x_codec_priv *stmp378x_adc) { /* Move ADC codec out of reset */ - stmp3xxx_clearl(BM_AUDIOIN_CTRL_SFTRST, - REGS_AUDIOIN_BASE + HW_AUDIOIN_CTRL); + __raw_writel(BM_AUDIOIN_CTRL_SFTRST, + REGS_AUDIOIN_BASE + HW_AUDIOIN_CTRL_CLR); /* Power on ADC codec */ stmp378x_codec_adc_power_on(stmp378x_adc); @@ -752,14 +752,14 @@ static void stmp378x_codec_startup(struct snd_soc_codec *codec) struct stmp378x_codec_priv *stmp378x_adc = codec->private_data; /* Soft reset DAC block */ - stmp3xxx_setl(BM_AUDIOOUT_CTRL_SFTRST, - REGS_AUDIOOUT_BASE + HW_AUDIOOUT_CTRL); + __raw_writel(BM_AUDIOOUT_CTRL_SFTRST, + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_CTRL_SET); while (!(__raw_readl(REGS_AUDIOOUT_BASE + HW_AUDIOOUT_CTRL) & BM_AUDIOOUT_CTRL_CLKGATE)); /* Soft reset ADC block */ - stmp3xxx_setl(BM_AUDIOIN_CTRL_SFTRST, - REGS_AUDIOIN_BASE + HW_AUDIOIN_CTRL); + __raw_writel(BM_AUDIOIN_CTRL_SFTRST, + REGS_AUDIOIN_BASE + HW_AUDIOIN_CTRL_SET); while (!(__raw_readl(REGS_AUDIOIN_BASE + HW_AUDIOIN_CTRL) & BM_AUDIOIN_CTRL_CLKGATE)) ; @@ -894,15 +894,15 @@ static int stmp378x_codec_resume(struct platform_device *pdev) clk_enable(stmp378x_adc->clk); /* Soft reset DAC block */ - stmp3xxx_setl(BM_AUDIOOUT_CTRL_SFTRST, - REGS_AUDIOOUT_BASE + HW_AUDIOOUT_CTRL); + __raw_writel(BM_AUDIOOUT_CTRL_SFTRST, + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_CTRL_SET); while (! (__raw_readl(REGS_AUDIOOUT_BASE + HW_AUDIOOUT_CTRL) & BM_AUDIOOUT_CTRL_CLKGATE)) ; /* Soft reset ADC block */ - stmp3xxx_setl(BM_AUDIOIN_CTRL_SFTRST, - REGS_AUDIOIN_BASE + HW_AUDIOIN_CTRL); + __raw_writel(BM_AUDIOIN_CTRL_SFTRST, + REGS_AUDIOIN_BASE + HW_AUDIOIN_CTRL_SET); while (! (__raw_readl(REGS_AUDIOIN_BASE + HW_AUDIOIN_CTRL) & BM_AUDIOIN_CTRL_CLKGATE)) ; diff --git a/sound/soc/codecs/stmp3xxx_spdif.c b/sound/soc/codecs/stmp3xxx_spdif.c index db5627e5e156..afbcfa6c9f8c 100644 --- a/sound/soc/codecs/stmp3xxx_spdif.c +++ b/sound/soc/codecs/stmp3xxx_spdif.c @@ -164,11 +164,13 @@ static int stmp3xxx_codec_hw_params(struct snd_pcm_substream *substream, switch (params_format(params)) { case SNDRV_PCM_FORMAT_S16_LE: if (playback) - stmp3xxx_setl(BM_SPDIF_CTRL_WORD_LENGTH, REGS_SPDIF_BASE + HW_SPDIF_CTRL); + __raw_writel(BM_SPDIF_CTRL_WORD_LENGTH, + REGS_SPDIF_BASE + HW_SPDIF_CTRL_SET); break; case SNDRV_PCM_FORMAT_S32_LE: if (playback) - stmp3xxx_clearl(BM_SPDIF_CTRL_WORD_LENGTH, REGS_SPDIF_BASE + HW_SPDIF_CTRL); + __raw_writel(BM_SPDIF_CTRL_WORD_LENGTH, + REGS_SPDIF_BASE + HW_SPDIF_CTRL_CLR); break; default: printk(KERN_WARNING "%s doesn't support format %d\n", @@ -182,20 +184,24 @@ static void stmp3xxx_codec_spdif_enable(struct stmp3xxx_codec_priv *stmp3xxx_spdif) { /* Move SPDIF codec out of reset */ - stmp3xxx_clearl(BM_SPDIF_CTRL_SFTRST, REGS_SPDIF_BASE + HW_SPDIF_CTRL); + __raw_writel(BM_SPDIF_CTRL_SFTRST, + REGS_SPDIF_BASE + HW_SPDIF_CTRL_CLR); /* Ungate SPDIF clocks */ - stmp3xxx_clearl(BM_SPDIF_CTRL_CLKGATE, REGS_SPDIF_BASE + HW_SPDIF_CTRL); + __raw_writel(BM_SPDIF_CTRL_CLKGATE, + REGS_SPDIF_BASE + HW_SPDIF_CTRL_CLR); /* 16 bit word length */ - stmp3xxx_setl(BM_SPDIF_CTRL_WORD_LENGTH, REGS_SPDIF_BASE + HW_SPDIF_CTRL); + __raw_writel(BM_SPDIF_CTRL_WORD_LENGTH, + REGS_SPDIF_BASE + HW_SPDIF_CTRL_SET); } static void stmp3xxx_codec_spdif_disable(struct stmp3xxx_codec_priv *stmp3xxx_spdif) { /* Gate SPDIF clocks */ - stmp3xxx_setl(BM_SPDIF_CTRL_CLKGATE, REGS_SPDIF_BASE + HW_SPDIF_CTRL); + __raw_writel(BM_SPDIF_CTRL_CLKGATE, + REGS_SPDIF_BASE + HW_SPDIF_CTRL_SET); } static void stmp3xxx_codec_init(struct snd_soc_codec *codec) @@ -203,7 +209,7 @@ static void stmp3xxx_codec_init(struct snd_soc_codec *codec) struct stmp3xxx_codec_priv *stmp3xxx_spdif = codec->private_data; /* Soft reset SPDIF block */ - stmp3xxx_setl(BM_SPDIF_CTRL_SFTRST, REGS_SPDIF_BASE + HW_SPDIF_CTRL); + __raw_writel(BM_SPDIF_CTRL_SFTRST, REGS_SPDIF_BASE + HW_SPDIF_CTRL_SET); while (!(__raw_readl(REGS_SPDIF_BASE + HW_SPDIF_CTRL) & BM_SPDIF_CTRL_CLKGATE)); stmp3xxx_codec_spdif_enable(stmp3xxx_spdif); @@ -323,7 +329,7 @@ static int stmp3xxx_codec_resume(struct platform_device *pdev) clk_enable(stmp3xxx_spdif->clk); /* Soft reset SPDIF block */ - stmp3xxx_setl(BM_SPDIF_CTRL_SFTRST, REGS_SPDIF_BASE + HW_SPDIF_CTRL); + __raw_writel(BM_SPDIF_CTRL_SFTRST, REGS_SPDIF_BASE + HW_SPDIF_CTRL_SET); while (!(__raw_readl(REGS_SPDIF_BASE + HW_SPDIF_CTRL) & BM_SPDIF_CTRL_CLKGATE)); stmp3xxx_codec_spdif_enable(stmp3xxx_spdif); diff --git a/sound/soc/stmp3xxx/stmp3xxx_dai.c b/sound/soc/stmp3xxx/stmp3xxx_dai.c index 742b466a5f70..ab367cc6a7fe 100644 --- a/sound/soc/stmp3xxx/stmp3xxx_dai.c +++ b/sound/soc/stmp3xxx/stmp3xxx_dai.c @@ -73,21 +73,25 @@ static irqreturn_t stmp3xxx_err_irq(int irq, void *dev_id) playback ? "DAC" : "ADC"); if (playback) - stmp3xxx_clearl( - BM_AUDIOOUT_CTRL_FIFO_UNDERFLOW_IRQ, REGS_AUDIOOUT_BASE + HW_AUDIOOUT_CTRL); + __raw_writel( + BM_AUDIOOUT_CTRL_FIFO_UNDERFLOW_IRQ, + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_CTRL_CLR); else - stmp3xxx_clearl( - BM_AUDIOIN_CTRL_FIFO_UNDERFLOW_IRQ, REGS_AUDIOIN_BASE + HW_AUDIOIN_CTRL); + __raw_writel( + BM_AUDIOIN_CTRL_FIFO_UNDERFLOW_IRQ, + REGS_AUDIOIN_BASE + HW_AUDIOIN_CTRL_CLR); } else if (ctrl_reg & overflow_mask) { printk(KERN_DEBUG "%s overflow detected\n", playback ? "DAC" : "ADC"); if (playback) - stmp3xxx_clearl( - BM_AUDIOOUT_CTRL_FIFO_OVERFLOW_IRQ, REGS_AUDIOOUT_BASE + HW_AUDIOOUT_CTRL); + __raw_writel( + BM_AUDIOOUT_CTRL_FIFO_OVERFLOW_IRQ, + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_CTRL_CLR); else - stmp3xxx_clearl(BM_AUDIOIN_CTRL_FIFO_OVERFLOW_IRQ, REGS_AUDIOIN_BASE + HW_AUDIOIN_CTRL); + __raw_writel(BM_AUDIOIN_CTRL_FIFO_OVERFLOW_IRQ, + REGS_AUDIOIN_BASE + HW_AUDIOIN_CTRL_CLR); } else printk(KERN_WARNING "Unknown DAC error interrupt\n"); @@ -104,16 +108,20 @@ static int stmp3xxx_adc_trigger(struct snd_pcm_substream *substream, switch (cmd) { case SNDRV_PCM_TRIGGER_START: if (playback) - stmp3xxx_setl(BM_AUDIOOUT_CTRL_RUN, REGS_AUDIOOUT_BASE + HW_AUDIOOUT_CTRL); + __raw_writel(BM_AUDIOOUT_CTRL_RUN, + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_CTRL_SET); else - stmp3xxx_setl(BM_AUDIOIN_CTRL_RUN, REGS_AUDIOIN_BASE + HW_AUDIOIN_CTRL); + __raw_writel(BM_AUDIOIN_CTRL_RUN, + REGS_AUDIOIN_BASE + HW_AUDIOIN_CTRL_SET); break; case SNDRV_PCM_TRIGGER_STOP: if (playback) - stmp3xxx_clearl(BM_AUDIOOUT_CTRL_RUN, REGS_AUDIOOUT_BASE + HW_AUDIOOUT_CTRL); + __raw_writel(BM_AUDIOOUT_CTRL_RUN, + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_CTRL_CLR); else - stmp3xxx_clearl(BM_AUDIOIN_CTRL_RUN, REGS_AUDIOIN_BASE + HW_AUDIOIN_CTRL); + __raw_writel(BM_AUDIOIN_CTRL_RUN, + REGS_AUDIOIN_BASE + HW_AUDIOIN_CTRL_CLR); break; case SNDRV_PCM_TRIGGER_RESUME: @@ -155,13 +163,19 @@ static int stmp3xxx_adc_startup(struct snd_pcm_substream *substream, /* Enable error interrupt */ if (playback) { - stmp3xxx_clearl(BM_AUDIOOUT_CTRL_FIFO_OVERFLOW_IRQ, REGS_AUDIOOUT_BASE + HW_AUDIOOUT_CTRL); - stmp3xxx_clearl(BM_AUDIOOUT_CTRL_FIFO_UNDERFLOW_IRQ, REGS_AUDIOOUT_BASE + HW_AUDIOOUT_CTRL); - stmp3xxx_setl(BM_AUDIOOUT_CTRL_FIFO_ERROR_IRQ_EN, REGS_AUDIOOUT_BASE + HW_AUDIOOUT_CTRL); + __raw_writel(BM_AUDIOOUT_CTRL_FIFO_OVERFLOW_IRQ, + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_CTRL_CLR); + __raw_writel(BM_AUDIOOUT_CTRL_FIFO_UNDERFLOW_IRQ, + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_CTRL_CLR); + __raw_writel(BM_AUDIOOUT_CTRL_FIFO_ERROR_IRQ_EN, + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_CTRL_SET); } else { - stmp3xxx_clearl(BM_AUDIOIN_CTRL_FIFO_OVERFLOW_IRQ, REGS_AUDIOIN_BASE + HW_AUDIOIN_CTRL); - stmp3xxx_clearl(BM_AUDIOIN_CTRL_FIFO_UNDERFLOW_IRQ, REGS_AUDIOIN_BASE + HW_AUDIOIN_CTRL); - stmp3xxx_setl(BM_AUDIOIN_CTRL_FIFO_ERROR_IRQ_EN, REGS_AUDIOIN_BASE + HW_AUDIOIN_CTRL); + __raw_writel(BM_AUDIOIN_CTRL_FIFO_OVERFLOW_IRQ, + REGS_AUDIOIN_BASE + HW_AUDIOIN_CTRL_CLR); + __raw_writel(BM_AUDIOIN_CTRL_FIFO_UNDERFLOW_IRQ, + REGS_AUDIOIN_BASE + HW_AUDIOIN_CTRL_CLR); + __raw_writel(BM_AUDIOIN_CTRL_FIFO_ERROR_IRQ_EN, + REGS_AUDIOIN_BASE + HW_AUDIOIN_CTRL_SET); } return 0; @@ -174,10 +188,12 @@ static void stmp3xxx_adc_shutdown(struct snd_pcm_substream *substream, /* Disable error interrupt */ if (playback) { - stmp3xxx_clearl(BM_AUDIOOUT_CTRL_FIFO_ERROR_IRQ_EN, REGS_AUDIOOUT_BASE + HW_AUDIOOUT_CTRL); + __raw_writel(BM_AUDIOOUT_CTRL_FIFO_ERROR_IRQ_EN, + REGS_AUDIOOUT_BASE + HW_AUDIOOUT_CTRL_CLR); free_irq(IRQ_DAC_ERROR, substream); } else { - stmp3xxx_clearl(BM_AUDIOIN_CTRL_FIFO_ERROR_IRQ_EN, REGS_AUDIOIN_BASE + HW_AUDIOIN_CTRL); + __raw_writel(BM_AUDIOIN_CTRL_FIFO_ERROR_IRQ_EN, + REGS_AUDIOIN_BASE + HW_AUDIOIN_CTRL_CLR); free_irq(IRQ_ADC_ERROR, substream); } } diff --git a/sound/soc/stmp3xxx/stmp3xxx_pcm.c b/sound/soc/stmp3xxx/stmp3xxx_pcm.c index 21cf86200668..cff13a5b4234 100644 --- a/sound/soc/stmp3xxx/stmp3xxx_pcm.c +++ b/sound/soc/stmp3xxx/stmp3xxx_pcm.c @@ -89,10 +89,10 @@ static irqreturn_t stmp3xxx_pcm_dma_irq(int irq, void *dev_id) printk(KERN_WARNING "%s: DMA audio channel %d (%s) error\n", __func__, prtd->params->dma_ch, prtd->params->name); #ifdef CONFIG_ARCH_STMP37XX - stmp3xxx_clearl(err_mask, REGS_APBX_BASE + HW_APBX_CTRL1); + __raw_writel(err_mask, REGS_APBX_BASE + HW_APBX_CTRL1_CLR); #endif #ifdef CONFIG_ARCH_STMP378X - stmp3xxx_clearl(err_mask, REGS_APBX_BASE + HW_APBX_CTRL2); + __raw_writel(err_mask, REGS_APBX_BASE + HW_APBX_CTRL2_CLR); #endif } else if (__raw_readl(REGS_APBX_BASE + HW_APBX_CTRL1) & irq_mask) { stmp3xxx_dma_clear_interrupt(prtd->dma_ch); diff --git a/sound/soc/stmp3xxx/stmp3xxx_spdif_dai.c b/sound/soc/stmp3xxx/stmp3xxx_spdif_dai.c index b09604725b6b..504192619c43 100644 --- a/sound/soc/stmp3xxx/stmp3xxx_spdif_dai.c +++ b/sound/soc/stmp3xxx/stmp3xxx_spdif_dai.c @@ -57,14 +57,14 @@ static irqreturn_t stmp3xxx_err_irq(int irq, void *dev_id) printk(KERN_DEBUG "underflow detected SPDIF\n"); if (playback) - stmp3xxx_clearl(BM_SPDIF_CTRL_FIFO_UNDERFLOW_IRQ, - REGS_SPDIF_BASE + HW_SPDIF_CTRL); + __raw_writel(BM_SPDIF_CTRL_FIFO_UNDERFLOW_IRQ, + REGS_SPDIF_BASE + HW_SPDIF_CTRL_CLR); } else if (ctrl_reg & overflow_mask) { printk(KERN_DEBUG "overflow detected SPDIF\n"); if (playback) - stmp3xxx_clearl(BM_SPDIF_CTRL_FIFO_OVERFLOW_IRQ, - REGS_SPDIF_BASE + HW_SPDIF_CTRL); + __raw_writel(BM_SPDIF_CTRL_FIFO_OVERFLOW_IRQ, + REGS_SPDIF_BASE + HW_SPDIF_CTRL_CLR); } else printk(KERN_WARNING "Unknown SPDIF error interrupt\n"); @@ -80,13 +80,13 @@ static int stmp3xxx_spdif_trigger(struct snd_pcm_substream *substream, int cmd, switch (cmd) { case SNDRV_PCM_TRIGGER_START: if (playback) - stmp3xxx_setl(BM_SPDIF_CTRL_RUN, - REGS_SPDIF_BASE + HW_SPDIF_CTRL); + __raw_writel(BM_SPDIF_CTRL_RUN, + REGS_SPDIF_BASE + HW_SPDIF_CTRL_SET); break; case SNDRV_PCM_TRIGGER_STOP: if (playback) - stmp3xxx_clearl(BM_SPDIF_CTRL_RUN, - REGS_SPDIF_BASE + HW_SPDIF_CTRL); + __raw_writel(BM_SPDIF_CTRL_RUN, + REGS_SPDIF_BASE + HW_SPDIF_CTRL_CLR); break; case SNDRV_PCM_TRIGGER_RESUME: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: @@ -124,12 +124,12 @@ static int stmp3xxx_spdif_startup(struct snd_pcm_substream *substream, /* Enable error interrupt */ if (playback) { - stmp3xxx_clearl(BM_SPDIF_CTRL_FIFO_OVERFLOW_IRQ, - REGS_SPDIF_BASE + HW_SPDIF_CTRL); - stmp3xxx_clearl(BM_SPDIF_CTRL_FIFO_UNDERFLOW_IRQ, - REGS_SPDIF_BASE + HW_SPDIF_CTRL); - stmp3xxx_setl(BM_SPDIF_CTRL_FIFO_ERROR_IRQ_EN, - REGS_SPDIF_BASE + HW_SPDIF_CTRL); + __raw_writel(BM_SPDIF_CTRL_FIFO_OVERFLOW_IRQ, + REGS_SPDIF_BASE + HW_SPDIF_CTRL_CLR); + __raw_writel(BM_SPDIF_CTRL_FIFO_UNDERFLOW_IRQ, + REGS_SPDIF_BASE + HW_SPDIF_CTRL_CLR); + __raw_writel(BM_SPDIF_CTRL_FIFO_ERROR_IRQ_EN, + REGS_SPDIF_BASE + HW_SPDIF_CTRL_SET); } return 0; @@ -142,8 +142,8 @@ static void stmp3xxx_spdif_shutdown(struct snd_pcm_substream *substream, /* Disable error interrupt */ if (playback) { - stmp3xxx_clearl(BM_SPDIF_CTRL_FIFO_ERROR_IRQ_EN, - REGS_SPDIF_BASE + HW_SPDIF_CTRL); + __raw_writel(BM_SPDIF_CTRL_FIFO_ERROR_IRQ_EN, + REGS_SPDIF_BASE + HW_SPDIF_CTRL_CLR); free_irq(IRQ_SPDIF_ERROR, substream); } } |