Skip to content

Commit

Permalink
Merge remote-tracking branches 'asoc/topic/sgtl5000', 'asoc/topic/si4…
Browse files Browse the repository at this point in the history
…76x', 'asoc/topic/simple', 'asoc/topic/spdif' and 'asoc/topic/st-dfsdm' into asoc-next
  • Loading branch information
Mark Brown committed Jan 18, 2018
6 parents bb4f1a6 + 8af5748 + 3047ec5 + ef42e35 + eb73336 + 166a5a3 commit eeb1a49
Show file tree
Hide file tree
Showing 9 changed files with 444 additions and 8 deletions.
3 changes: 3 additions & 0 deletions Documentation/devicetree/bindings/sound/simple-card.txt
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ sound {
simple-audio-card,name = "Cubox Audio";

simple-audio-card,dai-link@0 { /* I2S - HDMI */
reg = <0>;
format = "i2s";
cpu {
sound-dai = <&audio1 0>;
Expand All @@ -150,6 +151,7 @@ sound {
};

simple-audio-card,dai-link@1 { /* S/PDIF - HDMI */
reg = <1>;
cpu {
sound-dai = <&audio1 1>;
};
Expand All @@ -159,6 +161,7 @@ sound {
};

simple-audio-card,dai-link@2 { /* S/PDIF - S/PDIF */
reg = <2>;
cpu {
sound-dai = <&audio1 1>;
};
Expand Down
63 changes: 63 additions & 0 deletions Documentation/devicetree/bindings/sound/st,stm32-adfsdm.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
STMicroelectronics Audio Digital Filter Sigma Delta modulators(DFSDM)

The DFSDM allows PDM microphones capture through SPI interface. The Audio
interface is seems as a sub block of the DFSDM device.
For details on DFSDM bindings refer to ../iio/adc/st,stm32-dfsdm-adc.txt

Required properties:
- compatible: "st,stm32h7-dfsdm-dai".

- #sound-dai-cells : Must be equal to 0

- io-channels : phandle to iio dfsdm instance node.

Example of a sound card using audio DFSDM node.

sound_card {
compatible = "audio-graph-card";

dais = <&cpu_port>;
};

dfsdm: dfsdm@40017000 {
compatible = "st,stm32h7-dfsdm";
reg = <0x40017000 0x400>;
clocks = <&rcc DFSDM1_CK>;
clock-names = "dfsdm";
#interrupt-cells = <1>;
#address-cells = <1>;
#size-cells = <0>;

dfsdm_adc0: filter@0 {
compatible = "st,stm32-dfsdm-dmic";
reg = <0>;
interrupts = <110>;
dmas = <&dmamux1 101 0x400 0x00>;
dma-names = "rx";
st,adc-channels = <1>;
st,adc-channel-names = "dmic0";
st,adc-channel-types = "SPI_R";
st,adc-channel-clk-src = "CLKOUT";
st,filter-order = <5>;

dfsdm_dai0: dfsdm-dai {
compatible = "st,stm32h7-dfsdm-dai";
#sound-dai-cells = <0>;
io-channels = <&dfsdm_adc0 0>;
cpu_port: port {
dfsdm_endpoint: endpoint {
remote-endpoint = <&dmic0_endpoint>;
};
};
};
};

dmic0: dmic@0 {
compatible = "dmic-codec";
#sound-dai-cells = <0>;
port {
dmic0_endpoint: endpoint {
remote-endpoint = <&dfsdm_endpoint>;
};
};
};
5 changes: 4 additions & 1 deletion sound/soc/codecs/sgtl5000.c
Original file line number Diff line number Diff line change
Expand Up @@ -1332,10 +1332,13 @@ static int sgtl5000_i2c_probe(struct i2c_client *client,
sgtl5000->mclk = devm_clk_get(&client->dev, NULL);
if (IS_ERR(sgtl5000->mclk)) {
ret = PTR_ERR(sgtl5000->mclk);
dev_err(&client->dev, "Failed to get mclock: %d\n", ret);
/* Defer the probe to see if the clk will be provided later */
if (ret == -ENOENT)
ret = -EPROBE_DEFER;

if (ret != -EPROBE_DEFER)
dev_err(&client->dev, "Failed to get mclock: %d\n",
ret);
goto disable_regs;
}

Expand Down
9 changes: 6 additions & 3 deletions sound/soc/codecs/si476x.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,14 +231,17 @@ static struct snd_soc_dai_driver si476x_dai = {
.ops = &si476x_dai_ops,
};

static struct regmap *si476x_get_regmap(struct device *dev)
static int si476x_probe(struct snd_soc_component *component)
{
return dev_get_regmap(dev->parent, NULL);
snd_soc_component_init_regmap(component,
dev_get_regmap(component->dev->parent, NULL));

return 0;
}

static const struct snd_soc_codec_driver soc_codec_dev_si476x = {
.get_regmap = si476x_get_regmap,
.component_driver = {
.probe = si476x_probe,
.dapm_widgets = si476x_dapm_widgets,
.num_dapm_widgets = ARRAY_SIZE(si476x_dapm_widgets),
.dapm_routes = si476x_dapm_routes,
Expand Down
5 changes: 3 additions & 2 deletions sound/soc/codecs/spdif_receiver.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ static const struct snd_soc_dapm_route dir_routes[] = {
#define STUB_RATES SNDRV_PCM_RATE_8000_192000
#define STUB_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \
SNDRV_PCM_FMTBIT_S20_3LE | \
SNDRV_PCM_FMTBIT_S24_LE | \
SNDRV_PCM_FMTBIT_S24_LE | \
SNDRV_PCM_FMTBIT_S32_LE | \
SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE)

static const struct snd_soc_codec_driver soc_codec_spdif_dir = {
static struct snd_soc_codec_driver soc_codec_spdif_dir = {
.component_driver = {
.dapm_widgets = dir_widgets,
.num_dapm_widgets = ARRAY_SIZE(dir_widgets),
Expand Down
5 changes: 3 additions & 2 deletions sound/soc/codecs/spdif_transmitter.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
#define STUB_RATES SNDRV_PCM_RATE_8000_192000
#define STUB_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \
SNDRV_PCM_FMTBIT_S20_3LE | \
SNDRV_PCM_FMTBIT_S24_LE)
SNDRV_PCM_FMTBIT_S24_LE | \
SNDRV_PCM_FMTBIT_S32_LE)

static const struct snd_soc_dapm_widget dit_widgets[] = {
SND_SOC_DAPM_OUTPUT("spdif-out"),
Expand All @@ -37,7 +38,7 @@ static const struct snd_soc_dapm_route dit_routes[] = {
{ "spdif-out", NULL, "Playback" },
};

static const struct snd_soc_codec_driver soc_codec_spdif_dit = {
static struct snd_soc_codec_driver soc_codec_spdif_dit = {
.component_driver = {
.dapm_widgets = dit_widgets,
.num_dapm_widgets = ARRAY_SIZE(dit_widgets),
Expand Down
12 changes: 12 additions & 0 deletions sound/soc/stm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,16 @@ config SND_SOC_STM32_SPDIFRX
help
Say Y if you want to enable S/PDIF capture for STM32

config SND_SOC_STM32_DFSDM
tristate "SoC Audio support for STM32 DFSDM"
depends on ARCH_STM32 || COMPILE_TEST
depends on SND_SOC
depends on STM32_DFSDM_ADC
select SND_SOC_GENERIC_DMAENGINE_PCM
select SND_SOC_DMIC
select IIO_BUFFER_CB
help
Select this option to enable the STM32 Digital Filter
for Sigma Delta Modulators (DFSDM) driver used
in various STM32 series for digital microphone capture.
endmenu
3 changes: 3 additions & 0 deletions sound/soc/stm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ obj-$(CONFIG_SND_SOC_STM32_I2S) += snd-soc-stm32-i2s.o
# SPDIFRX
snd-soc-stm32-spdifrx-objs := stm32_spdifrx.o
obj-$(CONFIG_SND_SOC_STM32_SPDIFRX) += snd-soc-stm32-spdifrx.o

#DFSDM
obj-$(CONFIG_SND_SOC_STM32_DFSDM) += stm32_adfsdm.o
Loading

0 comments on commit eeb1a49

Please sign in to comment.