Merge branch 'fix/asoc' into for-linus

+27 -103
+1 -1
sound/soc/codecs/Kconfig
··· 44 44 select SND_SOC_TWL6040 if TWL4030_CORE 45 45 select SND_SOC_UDA134X 46 46 select SND_SOC_UDA1380 if I2C 47 - select SND_SOC_WL1273 if WL1273_CORE 47 + select SND_SOC_WL1273 if RADIO_WL1273 48 48 select SND_SOC_WM2000 if I2C 49 49 select SND_SOC_WM8350 if MFD_WM8350 50 50 select SND_SOC_WM8400 if MFD_WM8400
+12 -17
sound/soc/codecs/wl1273.c
··· 42 42 static int snd_wl1273_fm_set_i2s_mode(struct wl1273_core *core, 43 43 int rate, int width) 44 44 { 45 - struct device *dev = &core->i2c_dev->dev; 45 + struct device *dev = &core->client->dev; 46 46 int r = 0; 47 47 u16 mode; 48 48 ··· 123 123 dev_dbg(dev, "mode: 0x%04x\n", mode); 124 124 125 125 if (core->i2s_mode != mode) { 126 - r = wl1273_fm_write_cmd(core, WL1273_I2S_MODE_CONFIG_SET, mode); 126 + r = core->write(core, WL1273_I2S_MODE_CONFIG_SET, mode); 127 127 if (r) 128 128 goto out; 129 129 130 130 core->i2s_mode = mode; 131 - r = wl1273_fm_write_cmd(core, WL1273_AUDIO_ENABLE, 132 - WL1273_AUDIO_ENABLE_I2S); 131 + r = core->write(core, WL1273_AUDIO_ENABLE, 132 + WL1273_AUDIO_ENABLE_I2S); 133 133 if (r) 134 134 goto out; 135 135 } ··· 142 142 static int snd_wl1273_fm_set_channel_number(struct wl1273_core *core, 143 143 int channel_number) 144 144 { 145 - struct i2c_client *client = core->i2c_dev; 146 - struct device *dev = &client->dev; 145 + struct device *dev = &core->client->dev; 147 146 int r = 0; 148 147 149 148 dev_dbg(dev, "%s\n", __func__); ··· 153 154 goto out; 154 155 155 156 if (channel_number == 1 && core->mode == WL1273_MODE_RX) 156 - r = wl1273_fm_write_cmd(core, WL1273_MOST_MODE_SET, 157 - WL1273_RX_MONO); 157 + r = core->write(core, WL1273_MOST_MODE_SET, WL1273_RX_MONO); 158 158 else if (channel_number == 1 && core->mode == WL1273_MODE_TX) 159 - r = wl1273_fm_write_cmd(core, WL1273_MONO_SET, 160 - WL1273_TX_MONO); 159 + r = core->write(core, WL1273_MONO_SET, WL1273_TX_MONO); 161 160 else if (channel_number == 2 && core->mode == WL1273_MODE_RX) 162 - r = wl1273_fm_write_cmd(core, WL1273_MOST_MODE_SET, 163 - WL1273_RX_STEREO); 161 + r = core->write(core, WL1273_MOST_MODE_SET, WL1273_RX_STEREO); 164 162 else if (channel_number == 2 && core->mode == WL1273_MODE_TX) 165 - r = wl1273_fm_write_cmd(core, WL1273_MONO_SET, 166 - WL1273_TX_STEREO); 163 + r = core->write(core, WL1273_MONO_SET, WL1273_TX_STEREO); 167 164 else 168 165 r = -EINVAL; 169 166 out: ··· 232 237 if (wl1273->core->audio_mode == val) 233 238 return 0; 234 239 235 - r = wl1273_fm_set_audio(wl1273->core, val); 240 + r = wl1273->core->set_audio(wl1273->core, val); 236 241 if (r < 0) 237 242 return r; 238 243 ··· 267 272 268 273 dev_dbg(codec->dev, "%s: enter.\n", __func__); 269 274 270 - r = wl1273_fm_set_volume(wl1273->core, 271 - ucontrol->value.integer.value[0]); 275 + r = wl1273->core->set_volume(wl1273->core, 276 + ucontrol->value.integer.value[0]); 272 277 if (r) 273 278 return r; 274 279
-71
sound/soc/codecs/wl1273.h
··· 25 25 #ifndef __WL1273_CODEC_H__ 26 26 #define __WL1273_CODEC_H__ 27 27 28 - /* I2S protocol, left channel first, data width 16 bits */ 29 - #define WL1273_PCM_DEF_MODE 0x00 30 - 31 - /* Rx */ 32 - #define WL1273_AUDIO_ENABLE_I2S (1 << 0) 33 - #define WL1273_AUDIO_ENABLE_ANALOG (1 << 1) 34 - 35 - /* Tx */ 36 - #define WL1273_AUDIO_IO_SET_ANALOG 0 37 - #define WL1273_AUDIO_IO_SET_I2S 1 38 - 39 - #define WL1273_POWER_SET_OFF 0 40 - #define WL1273_POWER_SET_FM (1 << 0) 41 - #define WL1273_POWER_SET_RDS (1 << 1) 42 - #define WL1273_POWER_SET_RETENTION (1 << 4) 43 - 44 - #define WL1273_PUPD_SET_OFF 0x00 45 - #define WL1273_PUPD_SET_ON 0x01 46 - #define WL1273_PUPD_SET_RETENTION 0x10 47 - 48 - /* I2S mode */ 49 - #define WL1273_IS2_WIDTH_32 0x0 50 - #define WL1273_IS2_WIDTH_40 0x1 51 - #define WL1273_IS2_WIDTH_22_23 0x2 52 - #define WL1273_IS2_WIDTH_23_22 0x3 53 - #define WL1273_IS2_WIDTH_48 0x4 54 - #define WL1273_IS2_WIDTH_50 0x5 55 - #define WL1273_IS2_WIDTH_60 0x6 56 - #define WL1273_IS2_WIDTH_64 0x7 57 - #define WL1273_IS2_WIDTH_80 0x8 58 - #define WL1273_IS2_WIDTH_96 0x9 59 - #define WL1273_IS2_WIDTH_128 0xa 60 - #define WL1273_IS2_WIDTH 0xf 61 - 62 - #define WL1273_IS2_FORMAT_STD (0x0 << 4) 63 - #define WL1273_IS2_FORMAT_LEFT (0x1 << 4) 64 - #define WL1273_IS2_FORMAT_RIGHT (0x2 << 4) 65 - #define WL1273_IS2_FORMAT_USER (0x3 << 4) 66 - 67 - #define WL1273_IS2_MASTER (0x0 << 6) 68 - #define WL1273_IS2_SLAVEW (0x1 << 6) 69 - 70 - #define WL1273_IS2_TRI_AFTER_SENDING (0x0 << 7) 71 - #define WL1273_IS2_TRI_ALWAYS_ACTIVE (0x1 << 7) 72 - 73 - #define WL1273_IS2_SDOWS_RR (0x0 << 8) 74 - #define WL1273_IS2_SDOWS_RF (0x1 << 8) 75 - #define WL1273_IS2_SDOWS_FR (0x2 << 8) 76 - #define WL1273_IS2_SDOWS_FF (0x3 << 8) 77 - 78 - #define WL1273_IS2_TRI_OPT (0x0 << 10) 79 - #define WL1273_IS2_TRI_ALWAYS (0x1 << 10) 80 - 81 - #define WL1273_IS2_RATE_48K (0x0 << 12) 82 - #define WL1273_IS2_RATE_44_1K (0x1 << 12) 83 - #define WL1273_IS2_RATE_32K (0x2 << 12) 84 - #define WL1273_IS2_RATE_22_05K (0x4 << 12) 85 - #define WL1273_IS2_RATE_16K (0x5 << 12) 86 - #define WL1273_IS2_RATE_12K (0x8 << 12) 87 - #define WL1273_IS2_RATE_11_025 (0x9 << 12) 88 - #define WL1273_IS2_RATE_8K (0xa << 12) 89 - #define WL1273_IS2_RATE (0xf << 12) 90 - 91 - #define WL1273_I2S_DEF_MODE (WL1273_IS2_WIDTH_32 | \ 92 - WL1273_IS2_FORMAT_STD | \ 93 - WL1273_IS2_MASTER | \ 94 - WL1273_IS2_TRI_AFTER_SENDING | \ 95 - WL1273_IS2_SDOWS_RR | \ 96 - WL1273_IS2_TRI_OPT | \ 97 - WL1273_IS2_RATE_48K) 98 - 99 28 int wl1273_get_format(struct snd_soc_codec *codec, unsigned int *fmt); 100 29 101 30 #endif /* End of __WL1273_CODEC_H__ */
+5 -5
sound/soc/codecs/wm8990.c
··· 1183 1183 WM8990_VMIDTOG); 1184 1184 1185 1185 /* Delay to allow output caps to discharge */ 1186 - msleep(msecs_to_jiffies(300)); 1186 + msleep(300); 1187 1187 1188 1188 /* Disable VMIDTOG */ 1189 1189 snd_soc_write(codec, WM8990_ANTIPOP2, WM8990_SOFTST | ··· 1195 1195 /* Enable outputs */ 1196 1196 snd_soc_write(codec, WM8990_POWER_MANAGEMENT_1, 0x1b00); 1197 1197 1198 - msleep(msecs_to_jiffies(50)); 1198 + msleep(50); 1199 1199 1200 1200 /* Enable VMID at 2x50k */ 1201 1201 snd_soc_write(codec, WM8990_POWER_MANAGEMENT_1, 0x1f02); 1202 1202 1203 - msleep(msecs_to_jiffies(100)); 1203 + msleep(100); 1204 1204 1205 1205 /* Enable VREF */ 1206 1206 snd_soc_write(codec, WM8990_POWER_MANAGEMENT_1, 0x1f03); 1207 1207 1208 - msleep(msecs_to_jiffies(600)); 1208 + msleep(600); 1209 1209 1210 1210 /* Enable BUFIOEN */ 1211 1211 snd_soc_write(codec, WM8990_ANTIPOP2, WM8990_SOFTST | ··· 1250 1250 /* Disable VMID */ 1251 1251 snd_soc_write(codec, WM8990_POWER_MANAGEMENT_1, 0x1f01); 1252 1252 1253 - msleep(msecs_to_jiffies(300)); 1253 + msleep(300); 1254 1254 1255 1255 /* Enable all output discharge bits */ 1256 1256 snd_soc_write(codec, WM8990_ANTIPOP1, WM8990_DIS_LLINE |
+9 -9
sound/soc/ep93xx/ep93xx-i2s.c
··· 267 267 ep93xx_i2s_write_reg(info, EP93XX_I2S_RXWRDLEN, word_len); 268 268 269 269 /* 270 - * Calculate the sdiv (bit clock) and lrdiv (left/right clock) values. 271 - * If the lrclk is pulse length is larger than the word size, then the 272 - * bit clock will be gated for the unused bits. 270 + * EP93xx I2S module can be setup so SCLK / LRCLK value can be 271 + * 32, 64, 128. MCLK / SCLK value can be 2 and 4. 272 + * We set LRCLK equal to `rate' and minimum SCLK / LRCLK 273 + * value is 64, because our sample size is 32 bit * 2 channels. 274 + * I2S standard permits us to transmit more bits than 275 + * the codec uses. 273 276 */ 274 - div = (clk_get_rate(info->mclk) / params_rate(params)) * 275 - params_channels(params); 277 + div = clk_get_rate(info->mclk) / params_rate(params); 276 278 for (sdiv = 2; sdiv <= 4; sdiv += 2) 277 - for (lrdiv = 32; lrdiv <= 128; lrdiv <<= 1) 279 + for (lrdiv = 64; lrdiv <= 128; lrdiv <<= 1) 278 280 if (sdiv * lrdiv == div) { 279 281 found = 1; 280 282 goto out; ··· 343 341 .set_fmt = ep93xx_i2s_set_dai_fmt, 344 342 }; 345 343 346 - #define EP93XX_I2S_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \ 347 - SNDRV_PCM_FMTBIT_S24_LE | \ 348 - SNDRV_PCM_FMTBIT_S32_LE) 344 + #define EP93XX_I2S_FORMATS (SNDRV_PCM_FMTBIT_S32_LE) 349 345 350 346 static struct snd_soc_dai_driver ep93xx_i2s_dai = { 351 347 .symmetric_rates= 1,