···4444 select SND_SOC_TWL6040 if TWL4030_CORE4545 select SND_SOC_UDA134X4646 select SND_SOC_UDA1380 if I2C4747- select SND_SOC_WL1273 if WL1273_CORE4747+ select SND_SOC_WL1273 if RADIO_WL12734848 select SND_SOC_WM2000 if I2C4949 select SND_SOC_WM8350 if MFD_WM83505050 select SND_SOC_WM8400 if MFD_WM8400
+12-17
sound/soc/codecs/wl1273.c
···4242static int snd_wl1273_fm_set_i2s_mode(struct wl1273_core *core,4343 int rate, int width)4444{4545- struct device *dev = &core->i2c_dev->dev;4545+ struct device *dev = &core->client->dev;4646 int r = 0;4747 u16 mode;4848···123123 dev_dbg(dev, "mode: 0x%04x\n", mode);124124125125 if (core->i2s_mode != mode) {126126- r = wl1273_fm_write_cmd(core, WL1273_I2S_MODE_CONFIG_SET, mode);126126+ r = core->write(core, WL1273_I2S_MODE_CONFIG_SET, mode);127127 if (r)128128 goto out;129129130130 core->i2s_mode = mode;131131- r = wl1273_fm_write_cmd(core, WL1273_AUDIO_ENABLE,132132- WL1273_AUDIO_ENABLE_I2S);131131+ r = core->write(core, WL1273_AUDIO_ENABLE,132132+ WL1273_AUDIO_ENABLE_I2S);133133 if (r)134134 goto out;135135 }···142142static int snd_wl1273_fm_set_channel_number(struct wl1273_core *core,143143 int channel_number)144144{145145- struct i2c_client *client = core->i2c_dev;146146- struct device *dev = &client->dev;145145+ struct device *dev = &core->client->dev;147146 int r = 0;148147149148 dev_dbg(dev, "%s\n", __func__);···153154 goto out;154155155156 if (channel_number == 1 && core->mode == WL1273_MODE_RX)156156- r = wl1273_fm_write_cmd(core, WL1273_MOST_MODE_SET,157157- WL1273_RX_MONO);157157+ r = core->write(core, WL1273_MOST_MODE_SET, WL1273_RX_MONO);158158 else if (channel_number == 1 && core->mode == WL1273_MODE_TX)159159- r = wl1273_fm_write_cmd(core, WL1273_MONO_SET,160160- WL1273_TX_MONO);159159+ r = core->write(core, WL1273_MONO_SET, WL1273_TX_MONO);161160 else if (channel_number == 2 && core->mode == WL1273_MODE_RX)162162- r = wl1273_fm_write_cmd(core, WL1273_MOST_MODE_SET,163163- WL1273_RX_STEREO);161161+ r = core->write(core, WL1273_MOST_MODE_SET, WL1273_RX_STEREO);164162 else if (channel_number == 2 && core->mode == WL1273_MODE_TX)165165- r = wl1273_fm_write_cmd(core, WL1273_MONO_SET,166166- WL1273_TX_STEREO);163163+ r = core->write(core, WL1273_MONO_SET, WL1273_TX_STEREO);167164 else168165 r = -EINVAL;169166out:···232237 if (wl1273->core->audio_mode == val)233238 return 0;234239235235- r = wl1273_fm_set_audio(wl1273->core, val);240240+ r = wl1273->core->set_audio(wl1273->core, val);236241 if (r < 0)237242 return r;238243···267272268273 dev_dbg(codec->dev, "%s: enter.\n", __func__);269274270270- r = wl1273_fm_set_volume(wl1273->core,271271- ucontrol->value.integer.value[0]);275275+ r = wl1273->core->set_volume(wl1273->core,276276+ ucontrol->value.integer.value[0]);272277 if (r)273278 return r;274279
···267267 ep93xx_i2s_write_reg(info, EP93XX_I2S_RXWRDLEN, word_len);268268269269 /*270270- * Calculate the sdiv (bit clock) and lrdiv (left/right clock) values.271271- * If the lrclk is pulse length is larger than the word size, then the272272- * bit clock will be gated for the unused bits.270270+ * EP93xx I2S module can be setup so SCLK / LRCLK value can be271271+ * 32, 64, 128. MCLK / SCLK value can be 2 and 4.272272+ * We set LRCLK equal to `rate' and minimum SCLK / LRCLK 273273+ * value is 64, because our sample size is 32 bit * 2 channels.274274+ * I2S standard permits us to transmit more bits than275275+ * the codec uses.273276 */274274- div = (clk_get_rate(info->mclk) / params_rate(params)) *275275- params_channels(params);277277+ div = clk_get_rate(info->mclk) / params_rate(params);276278 for (sdiv = 2; sdiv <= 4; sdiv += 2)277277- for (lrdiv = 32; lrdiv <= 128; lrdiv <<= 1)279279+ for (lrdiv = 64; lrdiv <= 128; lrdiv <<= 1)278280 if (sdiv * lrdiv == div) {279281 found = 1;280282 goto out;···343341 .set_fmt = ep93xx_i2s_set_dai_fmt,344342};345343346346-#define EP93XX_I2S_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \347347- SNDRV_PCM_FMTBIT_S24_LE | \348348- SNDRV_PCM_FMTBIT_S32_LE)344344+#define EP93XX_I2S_FORMATS (SNDRV_PCM_FMTBIT_S32_LE)349345350346static struct snd_soc_dai_driver ep93xx_i2s_dai = {351347 .symmetric_rates= 1,