Loading sound/soc/codecs/twl4030.c +45 −48 Original line number Original line Diff line number Diff line Loading @@ -171,8 +171,8 @@ static bool twl4030_can_write_to_chip(struct snd_soc_codec *codec, return write_to_reg; return write_to_reg; } } static int twl4030_write(struct snd_soc_codec *codec, static int twl4030_write(struct snd_soc_codec *codec, unsigned int reg, unsigned int reg, unsigned int value) unsigned int value) { { twl4030_update_ctl_cache(codec, reg, value); twl4030_update_ctl_cache(codec, reg, value); if (twl4030_can_write_to_chip(codec, reg)) if (twl4030_can_write_to_chip(codec, reg)) Loading Loading @@ -588,8 +588,7 @@ static int pin_name##pga_event(struct snd_soc_dapm_widget *w, \ break; \ break; \ case SND_SOC_DAPM_POST_PMD: \ case SND_SOC_DAPM_POST_PMD: \ twl4030->pin_name##_enabled = 0; \ twl4030->pin_name##_enabled = 0; \ twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE, \ twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE, 0, reg); \ 0, reg); \ break; \ break; \ } \ } \ return 0; \ return 0; \ Loading Loading @@ -736,8 +735,7 @@ static void headset_ramp(struct snd_soc_codec *codec, int ramp) hs_pop |= TWL4030_VMID_EN; hs_pop |= TWL4030_VMID_EN; twl4030_write(codec, TWL4030_REG_HS_POPN_SET, hs_pop); twl4030_write(codec, TWL4030_REG_HS_POPN_SET, hs_pop); /* Actually write to the register */ /* Actually write to the register */ twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE, twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE, hs_gain, hs_gain, TWL4030_REG_HS_GAIN_SET); TWL4030_REG_HS_GAIN_SET); hs_pop |= TWL4030_RAMP_EN; hs_pop |= TWL4030_RAMP_EN; twl4030_write(codec, TWL4030_REG_HS_POPN_SET, hs_pop); twl4030_write(codec, TWL4030_REG_HS_POPN_SET, hs_pop); Loading @@ -751,8 +749,7 @@ static void headset_ramp(struct snd_soc_codec *codec, int ramp) /* Wait ramp delay time + 1, so the VMID can settle */ /* Wait ramp delay time + 1, so the VMID can settle */ twl4030_wait_ms(delay); twl4030_wait_ms(delay); /* Bypass the reg_cache to mute the headset */ /* Bypass the reg_cache to mute the headset */ twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE, twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE, hs_gain & (~0x0f), hs_gain & (~0x0f), TWL4030_REG_HS_GAIN_SET); TWL4030_REG_HS_GAIN_SET); hs_pop &= ~TWL4030_VMID_EN; hs_pop &= ~TWL4030_VMID_EN; Loading Loading @@ -1845,8 +1842,8 @@ static int twl4030_hw_params(struct snd_pcm_substream *substream, return 0; return 0; } } static int twl4030_set_dai_sysclk(struct snd_soc_dai *codec_dai, static int twl4030_set_dai_sysclk(struct snd_soc_dai *codec_dai, int clk_id, int clk_id, unsigned int freq, int dir) unsigned int freq, int dir) { { struct snd_soc_codec *codec = codec_dai->codec; struct snd_soc_codec *codec = codec_dai->codec; struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); Loading @@ -1871,8 +1868,7 @@ static int twl4030_set_dai_sysclk(struct snd_soc_dai *codec_dai, return 0; return 0; } } static int twl4030_set_dai_fmt(struct snd_soc_dai *codec_dai, static int twl4030_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) unsigned int fmt) { { struct snd_soc_codec *codec = codec_dai->codec; struct snd_soc_codec *codec = codec_dai->codec; struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); Loading Loading @@ -2003,7 +1999,8 @@ static void twl4030_voice_shutdown(struct snd_pcm_substream *substream, } } static int twl4030_voice_hw_params(struct snd_pcm_substream *substream, static int twl4030_voice_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) { { struct snd_soc_codec *codec = dai->codec; struct snd_soc_codec *codec = dai->codec; struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); Loading @@ -2013,8 +2010,8 @@ static int twl4030_voice_hw_params(struct snd_pcm_substream *substream, twl4030_voice_enable(codec, substream->stream, 1); twl4030_voice_enable(codec, substream->stream, 1); /* bit rate */ /* bit rate */ old_mode = twl4030_read(codec, TWL4030_REG_CODEC_MODE) old_mode = twl4030_read(codec, & ~(TWL4030_CODECPDZ); TWL4030_REG_CODEC_MODE) & ~TWL4030_CODECPDZ; mode = old_mode; mode = old_mode; switch (params_rate(params)) { switch (params_rate(params)) { Loading Loading
sound/soc/codecs/twl4030.c +45 −48 Original line number Original line Diff line number Diff line Loading @@ -171,8 +171,8 @@ static bool twl4030_can_write_to_chip(struct snd_soc_codec *codec, return write_to_reg; return write_to_reg; } } static int twl4030_write(struct snd_soc_codec *codec, static int twl4030_write(struct snd_soc_codec *codec, unsigned int reg, unsigned int reg, unsigned int value) unsigned int value) { { twl4030_update_ctl_cache(codec, reg, value); twl4030_update_ctl_cache(codec, reg, value); if (twl4030_can_write_to_chip(codec, reg)) if (twl4030_can_write_to_chip(codec, reg)) Loading Loading @@ -588,8 +588,7 @@ static int pin_name##pga_event(struct snd_soc_dapm_widget *w, \ break; \ break; \ case SND_SOC_DAPM_POST_PMD: \ case SND_SOC_DAPM_POST_PMD: \ twl4030->pin_name##_enabled = 0; \ twl4030->pin_name##_enabled = 0; \ twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE, \ twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE, 0, reg); \ 0, reg); \ break; \ break; \ } \ } \ return 0; \ return 0; \ Loading Loading @@ -736,8 +735,7 @@ static void headset_ramp(struct snd_soc_codec *codec, int ramp) hs_pop |= TWL4030_VMID_EN; hs_pop |= TWL4030_VMID_EN; twl4030_write(codec, TWL4030_REG_HS_POPN_SET, hs_pop); twl4030_write(codec, TWL4030_REG_HS_POPN_SET, hs_pop); /* Actually write to the register */ /* Actually write to the register */ twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE, twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE, hs_gain, hs_gain, TWL4030_REG_HS_GAIN_SET); TWL4030_REG_HS_GAIN_SET); hs_pop |= TWL4030_RAMP_EN; hs_pop |= TWL4030_RAMP_EN; twl4030_write(codec, TWL4030_REG_HS_POPN_SET, hs_pop); twl4030_write(codec, TWL4030_REG_HS_POPN_SET, hs_pop); Loading @@ -751,8 +749,7 @@ static void headset_ramp(struct snd_soc_codec *codec, int ramp) /* Wait ramp delay time + 1, so the VMID can settle */ /* Wait ramp delay time + 1, so the VMID can settle */ twl4030_wait_ms(delay); twl4030_wait_ms(delay); /* Bypass the reg_cache to mute the headset */ /* Bypass the reg_cache to mute the headset */ twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE, twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE, hs_gain & (~0x0f), hs_gain & (~0x0f), TWL4030_REG_HS_GAIN_SET); TWL4030_REG_HS_GAIN_SET); hs_pop &= ~TWL4030_VMID_EN; hs_pop &= ~TWL4030_VMID_EN; Loading Loading @@ -1845,8 +1842,8 @@ static int twl4030_hw_params(struct snd_pcm_substream *substream, return 0; return 0; } } static int twl4030_set_dai_sysclk(struct snd_soc_dai *codec_dai, static int twl4030_set_dai_sysclk(struct snd_soc_dai *codec_dai, int clk_id, int clk_id, unsigned int freq, int dir) unsigned int freq, int dir) { { struct snd_soc_codec *codec = codec_dai->codec; struct snd_soc_codec *codec = codec_dai->codec; struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); Loading @@ -1871,8 +1868,7 @@ static int twl4030_set_dai_sysclk(struct snd_soc_dai *codec_dai, return 0; return 0; } } static int twl4030_set_dai_fmt(struct snd_soc_dai *codec_dai, static int twl4030_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) unsigned int fmt) { { struct snd_soc_codec *codec = codec_dai->codec; struct snd_soc_codec *codec = codec_dai->codec; struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); Loading Loading @@ -2003,7 +1999,8 @@ static void twl4030_voice_shutdown(struct snd_pcm_substream *substream, } } static int twl4030_voice_hw_params(struct snd_pcm_substream *substream, static int twl4030_voice_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) { { struct snd_soc_codec *codec = dai->codec; struct snd_soc_codec *codec = dai->codec; struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); Loading @@ -2013,8 +2010,8 @@ static int twl4030_voice_hw_params(struct snd_pcm_substream *substream, twl4030_voice_enable(codec, substream->stream, 1); twl4030_voice_enable(codec, substream->stream, 1); /* bit rate */ /* bit rate */ old_mode = twl4030_read(codec, TWL4030_REG_CODEC_MODE) old_mode = twl4030_read(codec, & ~(TWL4030_CODECPDZ); TWL4030_REG_CODEC_MODE) & ~TWL4030_CODECPDZ; mode = old_mode; mode = old_mode; switch (params_rate(params)) { switch (params_rate(params)) { Loading