aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorJarkko Nikula <jhnikula@gmail.com>2010-09-14 07:54:47 -0400
committerLiam Girdwood <lrg@slimlogic.co.uk>2010-09-15 08:56:15 -0400
commite18eca4303c67ac58c75e72c7318e9709188f40d (patch)
tree7fa8f32dc95bfd42a663866083662d7999350413 /sound/soc
parent2c4ee9b579d17006ad9a83f13e3ae15c142dc41e (diff)
ASoC: tlv320aic3x: Use snd_soc_read and snd_soc_write
Start phasing out aic3x_read_reg_cache, aic3x_write_reg_cache, aic3x_read and aic3x_write calls in order to switch to soc-cache helpers. This patch replaces aic3x_read_reg_cache and aic3x_write with snd_soc_read and snd_soc_write. This is basically null-op since .read and .write in soc_codec_dev_aic3x points to aic3x_read_reg_cache and aic3x_write. Signed-off-by: Jarkko Nikula <jhnikula@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/codecs/tlv320aic3x.c194
1 files changed, 98 insertions, 96 deletions
diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c
index 94dc707d9022..138165c3a180 100644
--- a/sound/soc/codecs/tlv320aic3x.c
+++ b/sound/soc/codecs/tlv320aic3x.c
@@ -839,8 +839,7 @@ static int aic3x_hw_params(struct snd_pcm_substream *substream,
839 int clk; 839 int clk;
840 840
841 /* select data word length */ 841 /* select data word length */
842 data = 842 data = snd_soc_read(codec, AIC3X_ASD_INTF_CTRLB) & (~(0x3 << 4));
843 aic3x_read_reg_cache(codec, AIC3X_ASD_INTF_CTRLB) & (~(0x3 << 4));
844 switch (params_format(params)) { 843 switch (params_format(params)) {
845 case SNDRV_PCM_FORMAT_S16_LE: 844 case SNDRV_PCM_FORMAT_S16_LE:
846 break; 845 break;
@@ -854,7 +853,7 @@ static int aic3x_hw_params(struct snd_pcm_substream *substream,
854 data |= (0x03 << 4); 853 data |= (0x03 << 4);
855 break; 854 break;
856 } 855 }
857 aic3x_write(codec, AIC3X_ASD_INTF_CTRLB, data); 856 snd_soc_write(codec, AIC3X_ASD_INTF_CTRLB, data);
858 857
859 /* Fsref can be 44100 or 48000 */ 858 /* Fsref can be 44100 or 48000 */
860 fsref = (params_rate(params) % 11025 == 0) ? 44100 : 48000; 859 fsref = (params_rate(params) % 11025 == 0) ? 44100 : 48000;
@@ -869,17 +868,17 @@ static int aic3x_hw_params(struct snd_pcm_substream *substream,
869 868
870 if (bypass_pll) { 869 if (bypass_pll) {
871 pll_q &= 0xf; 870 pll_q &= 0xf;
872 aic3x_write(codec, AIC3X_PLL_PROGA_REG, pll_q << PLLQ_SHIFT); 871 snd_soc_write(codec, AIC3X_PLL_PROGA_REG, pll_q << PLLQ_SHIFT);
873 aic3x_write(codec, AIC3X_GPIOB_REG, CODEC_CLKIN_CLKDIV); 872 snd_soc_write(codec, AIC3X_GPIOB_REG, CODEC_CLKIN_CLKDIV);
874 /* disable PLL if it is bypassed */ 873 /* disable PLL if it is bypassed */
875 reg = aic3x_read_reg_cache(codec, AIC3X_PLL_PROGA_REG); 874 reg = snd_soc_read(codec, AIC3X_PLL_PROGA_REG);
876 aic3x_write(codec, AIC3X_PLL_PROGA_REG, reg & ~PLL_ENABLE); 875 snd_soc_write(codec, AIC3X_PLL_PROGA_REG, reg & ~PLL_ENABLE);
877 876
878 } else { 877 } else {
879 aic3x_write(codec, AIC3X_GPIOB_REG, CODEC_CLKIN_PLLDIV); 878 snd_soc_write(codec, AIC3X_GPIOB_REG, CODEC_CLKIN_PLLDIV);
880 /* enable PLL when it is used */ 879 /* enable PLL when it is used */
881 reg = aic3x_read_reg_cache(codec, AIC3X_PLL_PROGA_REG); 880 reg = snd_soc_read(codec, AIC3X_PLL_PROGA_REG);
882 aic3x_write(codec, AIC3X_PLL_PROGA_REG, reg | PLL_ENABLE); 881 snd_soc_write(codec, AIC3X_PLL_PROGA_REG, reg | PLL_ENABLE);
883 } 882 }
884 883
885 /* Route Left DAC to left channel input and 884 /* Route Left DAC to left channel input and
@@ -888,7 +887,7 @@ static int aic3x_hw_params(struct snd_pcm_substream *substream,
888 data |= (fsref == 44100) ? FSREF_44100 : FSREF_48000; 887 data |= (fsref == 44100) ? FSREF_44100 : FSREF_48000;
889 if (params_rate(params) >= 64000) 888 if (params_rate(params) >= 64000)
890 data |= DUAL_RATE_MODE; 889 data |= DUAL_RATE_MODE;
891 aic3x_write(codec, AIC3X_CODEC_DATAPATH_REG, data); 890 snd_soc_write(codec, AIC3X_CODEC_DATAPATH_REG, data);
892 891
893 /* codec sample rate select */ 892 /* codec sample rate select */
894 data = (fsref * 20) / params_rate(params); 893 data = (fsref * 20) / params_rate(params);
@@ -897,7 +896,7 @@ static int aic3x_hw_params(struct snd_pcm_substream *substream,
897 data /= 5; 896 data /= 5;
898 data -= 2; 897 data -= 2;
899 data |= (data << 4); 898 data |= (data << 4);
900 aic3x_write(codec, AIC3X_SAMPLE_RATE_SEL_REG, data); 899 snd_soc_write(codec, AIC3X_SAMPLE_RATE_SEL_REG, data);
901 900
902 if (bypass_pll) 901 if (bypass_pll)
903 return 0; 902 return 0;
@@ -966,13 +965,16 @@ static int aic3x_hw_params(struct snd_pcm_substream *substream,
966 } 965 }
967 966
968found: 967found:
969 data = aic3x_read_reg_cache(codec, AIC3X_PLL_PROGA_REG); 968 data = snd_soc_read(codec, AIC3X_PLL_PROGA_REG);
970 aic3x_write(codec, AIC3X_PLL_PROGA_REG, data | (pll_p << PLLP_SHIFT)); 969 snd_soc_write(codec, AIC3X_PLL_PROGA_REG,
971 aic3x_write(codec, AIC3X_OVRF_STATUS_AND_PLLR_REG, pll_r << PLLR_SHIFT); 970 data | (pll_p << PLLP_SHIFT));
972 aic3x_write(codec, AIC3X_PLL_PROGB_REG, pll_j << PLLJ_SHIFT); 971 snd_soc_write(codec, AIC3X_OVRF_STATUS_AND_PLLR_REG,
973 aic3x_write(codec, AIC3X_PLL_PROGC_REG, (pll_d >> 6) << PLLD_MSB_SHIFT); 972 pll_r << PLLR_SHIFT);
974 aic3x_write(codec, AIC3X_PLL_PROGD_REG, 973 snd_soc_write(codec, AIC3X_PLL_PROGB_REG, pll_j << PLLJ_SHIFT);
975 (pll_d & 0x3F) << PLLD_LSB_SHIFT); 974 snd_soc_write(codec, AIC3X_PLL_PROGC_REG,
975 (pll_d >> 6) << PLLD_MSB_SHIFT);
976 snd_soc_write(codec, AIC3X_PLL_PROGD_REG,
977 (pll_d & 0x3F) << PLLD_LSB_SHIFT);
976 978
977 return 0; 979 return 0;
978} 980}
@@ -980,15 +982,15 @@ found:
980static int aic3x_mute(struct snd_soc_dai *dai, int mute) 982static int aic3x_mute(struct snd_soc_dai *dai, int mute)
981{ 983{
982 struct snd_soc_codec *codec = dai->codec; 984 struct snd_soc_codec *codec = dai->codec;
983 u8 ldac_reg = aic3x_read_reg_cache(codec, LDAC_VOL) & ~MUTE_ON; 985 u8 ldac_reg = snd_soc_read(codec, LDAC_VOL) & ~MUTE_ON;
984 u8 rdac_reg = aic3x_read_reg_cache(codec, RDAC_VOL) & ~MUTE_ON; 986 u8 rdac_reg = snd_soc_read(codec, RDAC_VOL) & ~MUTE_ON;
985 987
986 if (mute) { 988 if (mute) {
987 aic3x_write(codec, LDAC_VOL, ldac_reg | MUTE_ON); 989 snd_soc_write(codec, LDAC_VOL, ldac_reg | MUTE_ON);
988 aic3x_write(codec, RDAC_VOL, rdac_reg | MUTE_ON); 990 snd_soc_write(codec, RDAC_VOL, rdac_reg | MUTE_ON);
989 } else { 991 } else {
990 aic3x_write(codec, LDAC_VOL, ldac_reg); 992 snd_soc_write(codec, LDAC_VOL, ldac_reg);
991 aic3x_write(codec, RDAC_VOL, rdac_reg); 993 snd_soc_write(codec, RDAC_VOL, rdac_reg);
992 } 994 }
993 995
994 return 0; 996 return 0;
@@ -1012,8 +1014,8 @@ static int aic3x_set_dai_fmt(struct snd_soc_dai *codec_dai,
1012 u8 iface_areg, iface_breg; 1014 u8 iface_areg, iface_breg;
1013 int delay = 0; 1015 int delay = 0;
1014 1016
1015 iface_areg = aic3x_read_reg_cache(codec, AIC3X_ASD_INTF_CTRLA) & 0x3f; 1017 iface_areg = snd_soc_read(codec, AIC3X_ASD_INTF_CTRLA) & 0x3f;
1016 iface_breg = aic3x_read_reg_cache(codec, AIC3X_ASD_INTF_CTRLB) & 0x3f; 1018 iface_breg = snd_soc_read(codec, AIC3X_ASD_INTF_CTRLB) & 0x3f;
1017 1019
1018 /* set master/slave audio interface */ 1020 /* set master/slave audio interface */
1019 switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { 1021 switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
@@ -1052,9 +1054,9 @@ static int aic3x_set_dai_fmt(struct snd_soc_dai *codec_dai,
1052 } 1054 }
1053 1055
1054 /* set iface */ 1056 /* set iface */
1055 aic3x_write(codec, AIC3X_ASD_INTF_CTRLA, iface_areg); 1057 snd_soc_write(codec, AIC3X_ASD_INTF_CTRLA, iface_areg);
1056 aic3x_write(codec, AIC3X_ASD_INTF_CTRLB, iface_breg); 1058 snd_soc_write(codec, AIC3X_ASD_INTF_CTRLB, iface_breg);
1057 aic3x_write(codec, AIC3X_ASD_INTF_CTRLC, delay); 1059 snd_soc_write(codec, AIC3X_ASD_INTF_CTRLC, delay);
1058 1060
1059 return 0; 1061 return 0;
1060} 1062}
@@ -1072,18 +1074,18 @@ static int aic3x_set_bias_level(struct snd_soc_codec *codec,
1072 if (codec->bias_level == SND_SOC_BIAS_STANDBY && 1074 if (codec->bias_level == SND_SOC_BIAS_STANDBY &&
1073 aic3x->master) { 1075 aic3x->master) {
1074 /* enable pll */ 1076 /* enable pll */
1075 reg = aic3x_read_reg_cache(codec, AIC3X_PLL_PROGA_REG); 1077 reg = snd_soc_read(codec, AIC3X_PLL_PROGA_REG);
1076 aic3x_write(codec, AIC3X_PLL_PROGA_REG, 1078 snd_soc_write(codec, AIC3X_PLL_PROGA_REG,
1077 reg | PLL_ENABLE); 1079 reg | PLL_ENABLE);
1078 } 1080 }
1079 break; 1081 break;
1080 case SND_SOC_BIAS_STANDBY: 1082 case SND_SOC_BIAS_STANDBY:
1081 if (codec->bias_level == SND_SOC_BIAS_PREPARE && 1083 if (codec->bias_level == SND_SOC_BIAS_PREPARE &&
1082 aic3x->master) { 1084 aic3x->master) {
1083 /* disable pll */ 1085 /* disable pll */
1084 reg = aic3x_read_reg_cache(codec, AIC3X_PLL_PROGA_REG); 1086 reg = snd_soc_read(codec, AIC3X_PLL_PROGA_REG);
1085 aic3x_write(codec, AIC3X_PLL_PROGA_REG, 1087 snd_soc_write(codec, AIC3X_PLL_PROGA_REG,
1086 reg & ~PLL_ENABLE); 1088 reg & ~PLL_ENABLE);
1087 } 1089 }
1088 break; 1090 break;
1089 case SND_SOC_BIAS_OFF: 1091 case SND_SOC_BIAS_OFF:
@@ -1098,8 +1100,8 @@ void aic3x_set_gpio(struct snd_soc_codec *codec, int gpio, int state)
1098{ 1100{
1099 u8 reg = gpio ? AIC3X_GPIO2_REG : AIC3X_GPIO1_REG; 1101 u8 reg = gpio ? AIC3X_GPIO2_REG : AIC3X_GPIO1_REG;
1100 u8 bit = gpio ? 3: 0; 1102 u8 bit = gpio ? 3: 0;
1101 u8 val = aic3x_read_reg_cache(codec, reg) & ~(1 << bit); 1103 u8 val = snd_soc_read(codec, reg) & ~(1 << bit);
1102 aic3x_write(codec, reg, val | (!!state << bit)); 1104 snd_soc_write(codec, reg, val | (!!state << bit));
1103} 1105}
1104EXPORT_SYMBOL_GPL(aic3x_set_gpio); 1106EXPORT_SYMBOL_GPL(aic3x_set_gpio);
1105 1107
@@ -1128,7 +1130,7 @@ void aic3x_set_headset_detection(struct snd_soc_codec *codec, int detect,
1128 if (detect & AIC3X_HEADSET_DETECT_MASK) 1130 if (detect & AIC3X_HEADSET_DETECT_MASK)
1129 val |= AIC3X_HEADSET_DETECT_ENABLED; 1131 val |= AIC3X_HEADSET_DETECT_ENABLED;
1130 1132
1131 aic3x_write(codec, AIC3X_HEADSET_DETECT_CTRL_A, val); 1133 snd_soc_write(codec, AIC3X_HEADSET_DETECT_CTRL_A, val);
1132} 1134}
1133EXPORT_SYMBOL_GPL(aic3x_set_headset_detection); 1135EXPORT_SYMBOL_GPL(aic3x_set_headset_detection);
1134 1136
@@ -1211,81 +1213,81 @@ static int aic3x_init(struct snd_soc_codec *codec)
1211 struct aic3x_priv *aic3x = snd_soc_codec_get_drvdata(codec); 1213 struct aic3x_priv *aic3x = snd_soc_codec_get_drvdata(codec);
1212 int reg; 1214 int reg;
1213 1215
1214 aic3x_write(codec, AIC3X_PAGE_SELECT, PAGE0_SELECT); 1216 snd_soc_write(codec, AIC3X_PAGE_SELECT, PAGE0_SELECT);
1215 aic3x_write(codec, AIC3X_RESET, SOFT_RESET); 1217 snd_soc_write(codec, AIC3X_RESET, SOFT_RESET);
1216 1218
1217 /* DAC default volume and mute */ 1219 /* DAC default volume and mute */
1218 aic3x_write(codec, LDAC_VOL, DEFAULT_VOL | MUTE_ON); 1220 snd_soc_write(codec, LDAC_VOL, DEFAULT_VOL | MUTE_ON);
1219 aic3x_write(codec, RDAC_VOL, DEFAULT_VOL | MUTE_ON); 1221 snd_soc_write(codec, RDAC_VOL, DEFAULT_VOL | MUTE_ON);
1220 1222
1221 /* DAC to HP default volume and route to Output mixer */ 1223 /* DAC to HP default volume and route to Output mixer */
1222 aic3x_write(codec, DACL1_2_HPLOUT_VOL, DEFAULT_VOL | ROUTE_ON); 1224 snd_soc_write(codec, DACL1_2_HPLOUT_VOL, DEFAULT_VOL | ROUTE_ON);
1223 aic3x_write(codec, DACR1_2_HPROUT_VOL, DEFAULT_VOL | ROUTE_ON); 1225 snd_soc_write(codec, DACR1_2_HPROUT_VOL, DEFAULT_VOL | ROUTE_ON);
1224 aic3x_write(codec, DACL1_2_HPLCOM_VOL, DEFAULT_VOL | ROUTE_ON); 1226 snd_soc_write(codec, DACL1_2_HPLCOM_VOL, DEFAULT_VOL | ROUTE_ON);
1225 aic3x_write(codec, DACR1_2_HPRCOM_VOL, DEFAULT_VOL | ROUTE_ON); 1227 snd_soc_write(codec, DACR1_2_HPRCOM_VOL, DEFAULT_VOL | ROUTE_ON);
1226 /* DAC to Line Out default volume and route to Output mixer */ 1228 /* DAC to Line Out default volume and route to Output mixer */
1227 aic3x_write(codec, DACL1_2_LLOPM_VOL, DEFAULT_VOL | ROUTE_ON); 1229 snd_soc_write(codec, DACL1_2_LLOPM_VOL, DEFAULT_VOL | ROUTE_ON);
1228 aic3x_write(codec, DACR1_2_RLOPM_VOL, DEFAULT_VOL | ROUTE_ON); 1230 snd_soc_write(codec, DACR1_2_RLOPM_VOL, DEFAULT_VOL | ROUTE_ON);
1229 /* DAC to Mono Line Out default volume and route to Output mixer */ 1231 /* DAC to Mono Line Out default volume and route to Output mixer */
1230 aic3x_write(codec, DACL1_2_MONOLOPM_VOL, DEFAULT_VOL | ROUTE_ON); 1232 snd_soc_write(codec, DACL1_2_MONOLOPM_VOL, DEFAULT_VOL | ROUTE_ON);
1231 aic3x_write(codec, DACR1_2_MONOLOPM_VOL, DEFAULT_VOL | ROUTE_ON); 1233 snd_soc_write(codec, DACR1_2_MONOLOPM_VOL, DEFAULT_VOL | ROUTE_ON);
1232 1234
1233 /* unmute all outputs */ 1235 /* unmute all outputs */
1234 reg = aic3x_read_reg_cache(codec, LLOPM_CTRL); 1236 reg = snd_soc_read(codec, LLOPM_CTRL);
1235 aic3x_write(codec, LLOPM_CTRL, reg | UNMUTE); 1237 snd_soc_write(codec, LLOPM_CTRL, reg | UNMUTE);
1236 reg = aic3x_read_reg_cache(codec, RLOPM_CTRL); 1238 reg = snd_soc_read(codec, RLOPM_CTRL);
1237 aic3x_write(codec, RLOPM_CTRL, reg | UNMUTE); 1239 snd_soc_write(codec, RLOPM_CTRL, reg | UNMUTE);
1238 reg = aic3x_read_reg_cache(codec, MONOLOPM_CTRL); 1240 reg = snd_soc_read(codec, MONOLOPM_CTRL);
1239 aic3x_write(codec, MONOLOPM_CTRL, reg | UNMUTE); 1241 snd_soc_write(codec, MONOLOPM_CTRL, reg | UNMUTE);
1240 reg = aic3x_read_reg_cache(codec, HPLOUT_CTRL); 1242 reg = snd_soc_read(codec, HPLOUT_CTRL);
1241 aic3x_write(codec, HPLOUT_CTRL, reg | UNMUTE); 1243 snd_soc_write(codec, HPLOUT_CTRL, reg | UNMUTE);
1242 reg = aic3x_read_reg_cache(codec, HPROUT_CTRL); 1244 reg = snd_soc_read(codec, HPROUT_CTRL);
1243 aic3x_write(codec, HPROUT_CTRL, reg | UNMUTE); 1245 snd_soc_write(codec, HPROUT_CTRL, reg | UNMUTE);
1244 reg = aic3x_read_reg_cache(codec, HPLCOM_CTRL); 1246 reg = snd_soc_read(codec, HPLCOM_CTRL);
1245 aic3x_write(codec, HPLCOM_CTRL, reg | UNMUTE); 1247 snd_soc_write(codec, HPLCOM_CTRL, reg | UNMUTE);
1246 reg = aic3x_read_reg_cache(codec, HPRCOM_CTRL); 1248 reg = snd_soc_read(codec, HPRCOM_CTRL);
1247 aic3x_write(codec, HPRCOM_CTRL, reg | UNMUTE); 1249 snd_soc_write(codec, HPRCOM_CTRL, reg | UNMUTE);
1248 1250
1249 /* ADC default volume and unmute */ 1251 /* ADC default volume and unmute */
1250 aic3x_write(codec, LADC_VOL, DEFAULT_GAIN); 1252 snd_soc_write(codec, LADC_VOL, DEFAULT_GAIN);
1251 aic3x_write(codec, RADC_VOL, DEFAULT_GAIN); 1253 snd_soc_write(codec, RADC_VOL, DEFAULT_GAIN);
1252 /* By default route Line1 to ADC PGA mixer */ 1254 /* By default route Line1 to ADC PGA mixer */
1253 aic3x_write(codec, LINE1L_2_LADC_CTRL, 0x0); 1255 snd_soc_write(codec, LINE1L_2_LADC_CTRL, 0x0);
1254 aic3x_write(codec, LINE1R_2_RADC_CTRL, 0x0); 1256 snd_soc_write(codec, LINE1R_2_RADC_CTRL, 0x0);
1255 1257
1256 /* PGA to HP Bypass default volume, disconnect from Output Mixer */ 1258 /* PGA to HP Bypass default volume, disconnect from Output Mixer */
1257 aic3x_write(codec, PGAL_2_HPLOUT_VOL, DEFAULT_VOL); 1259 snd_soc_write(codec, PGAL_2_HPLOUT_VOL, DEFAULT_VOL);
1258 aic3x_write(codec, PGAR_2_HPROUT_VOL, DEFAULT_VOL); 1260 snd_soc_write(codec, PGAR_2_HPROUT_VOL, DEFAULT_VOL);
1259 aic3x_write(codec, PGAL_2_HPLCOM_VOL, DEFAULT_VOL); 1261 snd_soc_write(codec, PGAL_2_HPLCOM_VOL, DEFAULT_VOL);
1260 aic3x_write(codec, PGAR_2_HPRCOM_VOL, DEFAULT_VOL); 1262 snd_soc_write(codec, PGAR_2_HPRCOM_VOL, DEFAULT_VOL);
1261 /* PGA to Line Out default volume, disconnect from Output Mixer */ 1263 /* PGA to Line Out default volume, disconnect from Output Mixer */
1262 aic3x_write(codec, PGAL_2_LLOPM_VOL, DEFAULT_VOL); 1264 snd_soc_write(codec, PGAL_2_LLOPM_VOL, DEFAULT_VOL);
1263 aic3x_write(codec, PGAR_2_RLOPM_VOL, DEFAULT_VOL); 1265 snd_soc_write(codec, PGAR_2_RLOPM_VOL, DEFAULT_VOL);
1264 /* PGA to Mono Line Out default volume, disconnect from Output Mixer */ 1266 /* PGA to Mono Line Out default volume, disconnect from Output Mixer */
1265 aic3x_write(codec, PGAL_2_MONOLOPM_VOL, DEFAULT_VOL); 1267 snd_soc_write(codec, PGAL_2_MONOLOPM_VOL, DEFAULT_VOL);
1266 aic3x_write(codec, PGAR_2_MONOLOPM_VOL, DEFAULT_VOL); 1268 snd_soc_write(codec, PGAR_2_MONOLOPM_VOL, DEFAULT_VOL);
1267 1269
1268 /* Line2 to HP Bypass default volume, disconnect from Output Mixer */ 1270 /* Line2 to HP Bypass default volume, disconnect from Output Mixer */
1269 aic3x_write(codec, LINE2L_2_HPLOUT_VOL, DEFAULT_VOL); 1271 snd_soc_write(codec, LINE2L_2_HPLOUT_VOL, DEFAULT_VOL);
1270 aic3x_write(codec, LINE2R_2_HPROUT_VOL, DEFAULT_VOL); 1272 snd_soc_write(codec, LINE2R_2_HPROUT_VOL, DEFAULT_VOL);
1271 aic3x_write(codec, LINE2L_2_HPLCOM_VOL, DEFAULT_VOL); 1273 snd_soc_write(codec, LINE2L_2_HPLCOM_VOL, DEFAULT_VOL);
1272 aic3x_write(codec, LINE2R_2_HPRCOM_VOL, DEFAULT_VOL); 1274 snd_soc_write(codec, LINE2R_2_HPRCOM_VOL, DEFAULT_VOL);
1273 /* Line2 Line Out default volume, disconnect from Output Mixer */ 1275 /* Line2 Line Out default volume, disconnect from Output Mixer */
1274 aic3x_write(codec, LINE2L_2_LLOPM_VOL, DEFAULT_VOL); 1276 snd_soc_write(codec, LINE2L_2_LLOPM_VOL, DEFAULT_VOL);
1275 aic3x_write(codec, LINE2R_2_RLOPM_VOL, DEFAULT_VOL); 1277 snd_soc_write(codec, LINE2R_2_RLOPM_VOL, DEFAULT_VOL);
1276 /* Line2 to Mono Out default volume, disconnect from Output Mixer */ 1278 /* Line2 to Mono Out default volume, disconnect from Output Mixer */
1277 aic3x_write(codec, LINE2L_2_MONOLOPM_VOL, DEFAULT_VOL); 1279 snd_soc_write(codec, LINE2L_2_MONOLOPM_VOL, DEFAULT_VOL);
1278 aic3x_write(codec, LINE2R_2_MONOLOPM_VOL, DEFAULT_VOL); 1280 snd_soc_write(codec, LINE2R_2_MONOLOPM_VOL, DEFAULT_VOL);
1279 1281
1280 if (aic3x->model == AIC3X_MODEL_3007) { 1282 if (aic3x->model == AIC3X_MODEL_3007) {
1281 /* Class-D speaker driver init; datasheet p. 46 */ 1283 /* Class-D speaker driver init; datasheet p. 46 */
1282 aic3x_write(codec, AIC3X_PAGE_SELECT, 0x0D); 1284 snd_soc_write(codec, AIC3X_PAGE_SELECT, 0x0D);
1283 aic3x_write(codec, 0xD, 0x0D); 1285 snd_soc_write(codec, 0xD, 0x0D);
1284 aic3x_write(codec, 0x8, 0x5C); 1286 snd_soc_write(codec, 0x8, 0x5C);
1285 aic3x_write(codec, 0x8, 0x5D); 1287 snd_soc_write(codec, 0x8, 0x5D);
1286 aic3x_write(codec, 0x8, 0x5C); 1288 snd_soc_write(codec, 0x8, 0x5C);
1287 aic3x_write(codec, AIC3X_PAGE_SELECT, 0x00); 1289 snd_soc_write(codec, AIC3X_PAGE_SELECT, 0x00);
1288 aic3x_write(codec, CLASSD_CTRL, 0); 1290 snd_soc_write(codec, CLASSD_CTRL, 0);
1289 } 1291 }
1290 1292
1291 /* off, with power on */ 1293 /* off, with power on */
@@ -1305,10 +1307,10 @@ static int aic3x_probe(struct snd_soc_codec *codec)
1305 1307
1306 if (aic3x->setup) { 1308 if (aic3x->setup) {
1307 /* setup GPIO functions */ 1309 /* setup GPIO functions */
1308 aic3x_write(codec, AIC3X_GPIO1_REG, 1310 snd_soc_write(codec, AIC3X_GPIO1_REG,
1309 (aic3x->setup->gpio_func[0] & 0xf) << 4); 1311 (aic3x->setup->gpio_func[0] & 0xf) << 4);
1310 aic3x_write(codec, AIC3X_GPIO2_REG, 1312 snd_soc_write(codec, AIC3X_GPIO2_REG,
1311 (aic3x->setup->gpio_func[1] & 0xf) << 4); 1313 (aic3x->setup->gpio_func[1] & 0xf) << 4);
1312 } 1314 }
1313 1315
1314 snd_soc_add_controls(codec, aic3x_snd_controls, 1316 snd_soc_add_controls(codec, aic3x_snd_controls,