Loading Documentation/devicetree/bindings/sound/cs35l35.txt +3 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,9 @@ Required properties: (See Documentation/devicetree/bindings/interrupt-controller/interrupts.txt for further information relating to interrupt properties) - cirrus,boost-ind-nanohenry: Inductor value for boost converter. The value is in nH and they can be values of 1000nH, 1200nH, 1500nH, and 2200nH. Optional properties: - reset-gpios : gpio used to reset the amplifier Loading include/sound/cs35l35.h +2 −0 Original line number Diff line number Diff line Loading @@ -99,6 +99,8 @@ struct cs35l35_platform_data { bool shared_bst; /* Specifies this amp is using an external boost supply */ bool ext_bst; /* Inductor Value */ int boost_ind; /* ClassH Algorithm */ struct classh_cfg classh_algo; /* Monitor Config */ Loading sound/soc/atmel/atmel-pcm.h +2 −4 Original line number Diff line number Diff line Loading @@ -83,8 +83,7 @@ struct atmel_pcm_dma_params { #define ssc_readx(base, reg) (__raw_readl((base) + (reg))) #define ssc_writex(base, reg, value) __raw_writel((value), (base) + (reg)) #if defined(CONFIG_SND_ATMEL_SOC_PDC) || \ defined(CONFIG_SND_ATMEL_SOC_PDC_MODULE) #if IS_ENABLED(CONFIG_SND_ATMEL_SOC_PDC) int atmel_pcm_pdc_platform_register(struct device *dev); void atmel_pcm_pdc_platform_unregister(struct device *dev); #else Loading @@ -97,8 +96,7 @@ static inline void atmel_pcm_pdc_platform_unregister(struct device *dev) } #endif #if defined(CONFIG_SND_ATMEL_SOC_DMA) || \ defined(CONFIG_SND_ATMEL_SOC_DMA_MODULE) #if IS_ENABLED(CONFIG_SND_ATMEL_SOC_DMA) int atmel_pcm_dma_platform_register(struct device *dev); void atmel_pcm_dma_platform_unregister(struct device *dev); #else Loading sound/soc/codecs/ak4613.c +78 −15 Original line number Diff line number Diff line Loading @@ -94,6 +94,8 @@ struct ak4613_interface { struct ak4613_priv { struct mutex lock; const struct ak4613_interface *iface; struct snd_pcm_hw_constraint_list constraint; unsigned int sysclk; unsigned int fmt; u8 oc; Loading Loading @@ -139,9 +141,7 @@ static const struct reg_default ak4613_reg[] = { #define AUDIO_IFACE(b, fmt) { b, SND_SOC_DAIFMT_##fmt } static const struct ak4613_interface ak4613_iface[] = { /* capture */ /* playback */ [0] = { AUDIO_IFACE(24, LEFT_J), AUDIO_IFACE(16, RIGHT_J) }, [1] = { AUDIO_IFACE(24, LEFT_J), AUDIO_IFACE(20, RIGHT_J) }, [2] = { AUDIO_IFACE(24, LEFT_J), AUDIO_IFACE(24, RIGHT_J) }, /* [0] - [2] are not supported */ [3] = { AUDIO_IFACE(24, LEFT_J), AUDIO_IFACE(24, LEFT_J) }, [4] = { AUDIO_IFACE(24, I2S), AUDIO_IFACE(24, I2S) }, }; Loading Loading @@ -254,6 +254,74 @@ static void ak4613_dai_shutdown(struct snd_pcm_substream *substream, mutex_unlock(&priv->lock); } static void ak4613_hw_constraints(struct ak4613_priv *priv, struct snd_pcm_runtime *runtime) { static const unsigned int ak4613_rates[] = { 32000, 44100, 48000, 64000, 88200, 96000, 176400, 192000, }; struct snd_pcm_hw_constraint_list *constraint = &priv->constraint; unsigned int fs; int i; constraint->list = ak4613_rates; constraint->mask = 0; constraint->count = 0; /* * Slave Mode * Normal: [32kHz, 48kHz] : 256fs,384fs or 512fs * Double: [64kHz, 96kHz] : 256fs * Quad : [128kHz,192kHz]: 128fs * * Master mode * Normal: [32kHz, 48kHz] : 256fs or 512fs * Double: [64kHz, 96kHz] : 256fs * Quad : [128kHz,192kHz]: 128fs */ for (i = 0; i < ARRAY_SIZE(ak4613_rates); i++) { /* minimum fs on each range */ fs = (ak4613_rates[i] <= 96000) ? 256 : 128; if (priv->sysclk >= ak4613_rates[i] * fs) constraint->count = i + 1; } snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, constraint); } static int ak4613_dai_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct snd_soc_codec *codec = dai->codec; struct ak4613_priv *priv = snd_soc_codec_get_drvdata(codec); priv->cnt++; ak4613_hw_constraints(priv, substream->runtime); return 0; } static int ak4613_dai_set_sysclk(struct snd_soc_dai *codec_dai, int clk_id, unsigned int freq, int dir) { struct snd_soc_codec *codec = codec_dai->codec; struct ak4613_priv *priv = snd_soc_codec_get_drvdata(codec); priv->sysclk = freq; return 0; } static int ak4613_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) { struct snd_soc_codec *codec = dai->codec; Loading @@ -262,11 +330,9 @@ static int ak4613_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) fmt &= SND_SOC_DAIFMT_FORMAT_MASK; switch (fmt) { case SND_SOC_DAIFMT_RIGHT_J: case SND_SOC_DAIFMT_LEFT_J: case SND_SOC_DAIFMT_I2S: priv->fmt = fmt; break; default: return -EINVAL; Loading @@ -286,13 +352,8 @@ static bool ak4613_dai_fmt_matching(const struct ak4613_interface *iface, if (fmts->fmt != fmt) return false; if (fmt == SND_SOC_DAIFMT_RIGHT_J) { if (fmts->width != width) return false; } else { if (fmts->width < width) return false; } return true; } Loading @@ -319,6 +380,7 @@ static int ak4613_dai_hw_params(struct snd_pcm_substream *substream, case 48000: ctrl2 = DFS_NORMAL_SPEED; break; case 64000: case 88200: case 96000: ctrl2 = DFS_DOUBLE_SPEED; Loading Loading @@ -358,7 +420,6 @@ static int ak4613_dai_hw_params(struct snd_pcm_substream *substream, if ((priv->iface == NULL) || (priv->iface == iface)) { priv->iface = iface; priv->cnt++; ret = 0; } mutex_unlock(&priv->lock); Loading Loading @@ -407,7 +468,9 @@ static int ak4613_set_bias_level(struct snd_soc_codec *codec, } static const struct snd_soc_dai_ops ak4613_dai_ops = { .startup = ak4613_dai_startup, .shutdown = ak4613_dai_shutdown, .set_sysclk = ak4613_dai_set_sysclk, .set_fmt = ak4613_dai_set_fmt, .hw_params = ak4613_dai_hw_params, }; Loading @@ -420,8 +483,7 @@ static const struct snd_soc_dai_ops ak4613_dai_ops = { SNDRV_PCM_RATE_96000 |\ SNDRV_PCM_RATE_176400 |\ SNDRV_PCM_RATE_192000) #define AK4613_PCM_FMTBIT (SNDRV_PCM_FMTBIT_S16_LE |\ SNDRV_PCM_FMTBIT_S24_LE) #define AK4613_PCM_FMTBIT (SNDRV_PCM_FMTBIT_S24_LE) static struct snd_soc_dai_driver ak4613_dai = { .name = "ak4613-hifi", Loading Loading @@ -527,6 +589,7 @@ static int ak4613_i2c_probe(struct i2c_client *i2c, priv->iface = NULL; priv->cnt = 0; priv->sysclk = 0; mutex_init(&priv->lock); Loading sound/soc/codecs/ak4642.c +2 −2 Original line number Diff line number Diff line Loading @@ -433,7 +433,7 @@ static int ak4642_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) static int ak4642_set_mcko(struct snd_soc_codec *codec, u32 frequency) { u32 fs_list[] = { static const u32 fs_list[] = { [0] = 8000, [1] = 12000, [2] = 16000, Loading @@ -447,7 +447,7 @@ static int ak4642_set_mcko(struct snd_soc_codec *codec, [14] = 29400, [15] = 44100, }; u32 ps_list[] = { static const u32 ps_list[] = { [0] = 256, [1] = 128, [2] = 64, Loading Loading
Documentation/devicetree/bindings/sound/cs35l35.txt +3 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,9 @@ Required properties: (See Documentation/devicetree/bindings/interrupt-controller/interrupts.txt for further information relating to interrupt properties) - cirrus,boost-ind-nanohenry: Inductor value for boost converter. The value is in nH and they can be values of 1000nH, 1200nH, 1500nH, and 2200nH. Optional properties: - reset-gpios : gpio used to reset the amplifier Loading
include/sound/cs35l35.h +2 −0 Original line number Diff line number Diff line Loading @@ -99,6 +99,8 @@ struct cs35l35_platform_data { bool shared_bst; /* Specifies this amp is using an external boost supply */ bool ext_bst; /* Inductor Value */ int boost_ind; /* ClassH Algorithm */ struct classh_cfg classh_algo; /* Monitor Config */ Loading
sound/soc/atmel/atmel-pcm.h +2 −4 Original line number Diff line number Diff line Loading @@ -83,8 +83,7 @@ struct atmel_pcm_dma_params { #define ssc_readx(base, reg) (__raw_readl((base) + (reg))) #define ssc_writex(base, reg, value) __raw_writel((value), (base) + (reg)) #if defined(CONFIG_SND_ATMEL_SOC_PDC) || \ defined(CONFIG_SND_ATMEL_SOC_PDC_MODULE) #if IS_ENABLED(CONFIG_SND_ATMEL_SOC_PDC) int atmel_pcm_pdc_platform_register(struct device *dev); void atmel_pcm_pdc_platform_unregister(struct device *dev); #else Loading @@ -97,8 +96,7 @@ static inline void atmel_pcm_pdc_platform_unregister(struct device *dev) } #endif #if defined(CONFIG_SND_ATMEL_SOC_DMA) || \ defined(CONFIG_SND_ATMEL_SOC_DMA_MODULE) #if IS_ENABLED(CONFIG_SND_ATMEL_SOC_DMA) int atmel_pcm_dma_platform_register(struct device *dev); void atmel_pcm_dma_platform_unregister(struct device *dev); #else Loading
sound/soc/codecs/ak4613.c +78 −15 Original line number Diff line number Diff line Loading @@ -94,6 +94,8 @@ struct ak4613_interface { struct ak4613_priv { struct mutex lock; const struct ak4613_interface *iface; struct snd_pcm_hw_constraint_list constraint; unsigned int sysclk; unsigned int fmt; u8 oc; Loading Loading @@ -139,9 +141,7 @@ static const struct reg_default ak4613_reg[] = { #define AUDIO_IFACE(b, fmt) { b, SND_SOC_DAIFMT_##fmt } static const struct ak4613_interface ak4613_iface[] = { /* capture */ /* playback */ [0] = { AUDIO_IFACE(24, LEFT_J), AUDIO_IFACE(16, RIGHT_J) }, [1] = { AUDIO_IFACE(24, LEFT_J), AUDIO_IFACE(20, RIGHT_J) }, [2] = { AUDIO_IFACE(24, LEFT_J), AUDIO_IFACE(24, RIGHT_J) }, /* [0] - [2] are not supported */ [3] = { AUDIO_IFACE(24, LEFT_J), AUDIO_IFACE(24, LEFT_J) }, [4] = { AUDIO_IFACE(24, I2S), AUDIO_IFACE(24, I2S) }, }; Loading Loading @@ -254,6 +254,74 @@ static void ak4613_dai_shutdown(struct snd_pcm_substream *substream, mutex_unlock(&priv->lock); } static void ak4613_hw_constraints(struct ak4613_priv *priv, struct snd_pcm_runtime *runtime) { static const unsigned int ak4613_rates[] = { 32000, 44100, 48000, 64000, 88200, 96000, 176400, 192000, }; struct snd_pcm_hw_constraint_list *constraint = &priv->constraint; unsigned int fs; int i; constraint->list = ak4613_rates; constraint->mask = 0; constraint->count = 0; /* * Slave Mode * Normal: [32kHz, 48kHz] : 256fs,384fs or 512fs * Double: [64kHz, 96kHz] : 256fs * Quad : [128kHz,192kHz]: 128fs * * Master mode * Normal: [32kHz, 48kHz] : 256fs or 512fs * Double: [64kHz, 96kHz] : 256fs * Quad : [128kHz,192kHz]: 128fs */ for (i = 0; i < ARRAY_SIZE(ak4613_rates); i++) { /* minimum fs on each range */ fs = (ak4613_rates[i] <= 96000) ? 256 : 128; if (priv->sysclk >= ak4613_rates[i] * fs) constraint->count = i + 1; } snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, constraint); } static int ak4613_dai_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct snd_soc_codec *codec = dai->codec; struct ak4613_priv *priv = snd_soc_codec_get_drvdata(codec); priv->cnt++; ak4613_hw_constraints(priv, substream->runtime); return 0; } static int ak4613_dai_set_sysclk(struct snd_soc_dai *codec_dai, int clk_id, unsigned int freq, int dir) { struct snd_soc_codec *codec = codec_dai->codec; struct ak4613_priv *priv = snd_soc_codec_get_drvdata(codec); priv->sysclk = freq; return 0; } static int ak4613_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) { struct snd_soc_codec *codec = dai->codec; Loading @@ -262,11 +330,9 @@ static int ak4613_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) fmt &= SND_SOC_DAIFMT_FORMAT_MASK; switch (fmt) { case SND_SOC_DAIFMT_RIGHT_J: case SND_SOC_DAIFMT_LEFT_J: case SND_SOC_DAIFMT_I2S: priv->fmt = fmt; break; default: return -EINVAL; Loading @@ -286,13 +352,8 @@ static bool ak4613_dai_fmt_matching(const struct ak4613_interface *iface, if (fmts->fmt != fmt) return false; if (fmt == SND_SOC_DAIFMT_RIGHT_J) { if (fmts->width != width) return false; } else { if (fmts->width < width) return false; } return true; } Loading @@ -319,6 +380,7 @@ static int ak4613_dai_hw_params(struct snd_pcm_substream *substream, case 48000: ctrl2 = DFS_NORMAL_SPEED; break; case 64000: case 88200: case 96000: ctrl2 = DFS_DOUBLE_SPEED; Loading Loading @@ -358,7 +420,6 @@ static int ak4613_dai_hw_params(struct snd_pcm_substream *substream, if ((priv->iface == NULL) || (priv->iface == iface)) { priv->iface = iface; priv->cnt++; ret = 0; } mutex_unlock(&priv->lock); Loading Loading @@ -407,7 +468,9 @@ static int ak4613_set_bias_level(struct snd_soc_codec *codec, } static const struct snd_soc_dai_ops ak4613_dai_ops = { .startup = ak4613_dai_startup, .shutdown = ak4613_dai_shutdown, .set_sysclk = ak4613_dai_set_sysclk, .set_fmt = ak4613_dai_set_fmt, .hw_params = ak4613_dai_hw_params, }; Loading @@ -420,8 +483,7 @@ static const struct snd_soc_dai_ops ak4613_dai_ops = { SNDRV_PCM_RATE_96000 |\ SNDRV_PCM_RATE_176400 |\ SNDRV_PCM_RATE_192000) #define AK4613_PCM_FMTBIT (SNDRV_PCM_FMTBIT_S16_LE |\ SNDRV_PCM_FMTBIT_S24_LE) #define AK4613_PCM_FMTBIT (SNDRV_PCM_FMTBIT_S24_LE) static struct snd_soc_dai_driver ak4613_dai = { .name = "ak4613-hifi", Loading Loading @@ -527,6 +589,7 @@ static int ak4613_i2c_probe(struct i2c_client *i2c, priv->iface = NULL; priv->cnt = 0; priv->sysclk = 0; mutex_init(&priv->lock); Loading
sound/soc/codecs/ak4642.c +2 −2 Original line number Diff line number Diff line Loading @@ -433,7 +433,7 @@ static int ak4642_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) static int ak4642_set_mcko(struct snd_soc_codec *codec, u32 frequency) { u32 fs_list[] = { static const u32 fs_list[] = { [0] = 8000, [1] = 12000, [2] = 16000, Loading @@ -447,7 +447,7 @@ static int ak4642_set_mcko(struct snd_soc_codec *codec, [14] = 29400, [15] = 44100, }; u32 ps_list[] = { static const u32 ps_list[] = { [0] = 256, [1] = 128, [2] = 64, Loading