Skip to content

Commit

Permalink
Merge remote-tracking branches 'asoc/topic/ssm2518', 'asoc/topic/sta5…
Browse files Browse the repository at this point in the history
…29', 'asoc/topic/sti' and 'asoc/topic/sti-sas' into asoc-next
  • Loading branch information
Mark Brown committed Aug 30, 2015
5 parents cfed47d + 601e457 + 97a7471 + e129091 + 601b9d9 commit 0a5ff07
Show file tree
Hide file tree
Showing 14 changed files with 3,770 additions and 3 deletions.
155 changes: 155 additions & 0 deletions Documentation/devicetree/bindings/sound/st,sti-asoc-card.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
STMicroelectronics sti ASoC cards

The sti ASoC Sound Card can be used, for all sti SoCs using internal sti-sas
codec or external codecs.

sti sound drivers allows to expose sti SoC audio interface through the
generic ASoC simple card. For details about sound card declaration please refer to
Documentation/devicetree/bindings/sound/simple-card.txt.

1) sti-uniperiph-dai: audio dai device.
---------------------------------------

Required properties:
- compatible: "st,sti-uni-player" or "st,sti-uni-reader"

- st,syscfg: phandle to boot-device system configuration registers

- clock-names: name of the clocks listed in clocks property in the same order

- reg: CPU DAI IP Base address and size entries, listed in same
order than the CPU_DAI properties.

- reg-names: names of the mapped memory regions listed in regs property in
the same order.

- interrupts: CPU_DAI interrupt line, listed in the same order than the
CPU_DAI properties.

- dma: CPU_DAI DMA controller phandle and DMA request line, listed in the same
order than the CPU_DAI properties.

- dma-names: identifier string for each DMA request line in the dmas property.
"tx" for "st,sti-uni-player" compatibility
"rx" for "st,sti-uni-reader" compatibility

- version: IP version integrated in SOC.

- dai-name: DAI name that describes the IP.

Required properties ("st,sti-uni-player" compatibility only):
- clocks: CPU_DAI IP clock source, listed in the same order than the
CPU_DAI properties.

- uniperiph-id: internal SOC IP instance ID.

- IP mode: IP working mode depending on associated codec.
"HDMI" connected to HDMI codec IP and IEC HDMI formats.
"SPDIF"connected to SPDIF codec and support SPDIF formats.
"PCM" PCM standard mode for I2S or TDM bus.

Optional properties:
- pinctrl-0: defined for CPU_DAI@1 and CPU_DAI@4 to describe I2S PIOs for
external codecs connection.

- pinctrl-names: should contain only one value - "default".

Example:

sti_uni_player2: sti-uni-player@2 {
compatible = "st,sti-uni-player";
status = "okay";
#sound-dai-cells = <0>;
st,syscfg = <&syscfg_core>;
clocks = <&clk_s_d0_flexgen CLK_PCM_2>;
reg = <0x8D82000 0x158>;
interrupts = <GIC_SPI 86 IRQ_TYPE_NONE>;
dmas = <&fdma0 4 0 1>;
dai-name = "Uni Player #1 (DAC)";
dma-names = "tx";
uniperiph-id = <2>;
version = <5>;
mode = "PCM";
};

sti_uni_player3: sti-uni-player@3 {
compatible = "st,sti-uni-player";
status = "okay";
#sound-dai-cells = <0>;
st,syscfg = <&syscfg_core>;
clocks = <&clk_s_d0_flexgen CLK_SPDIFF>;
reg = <0x8D85000 0x158>;
interrupts = <GIC_SPI 89 IRQ_TYPE_NONE>;
dmas = <&fdma0 7 0 1>;
dma-names = "tx";
dai-name = "Uni Player #1 (PIO)";
uniperiph-id = <3>;
version = <5>;
mode = "SPDIF";
};

sti_uni_reader1: sti-uni-reader@1 {
compatible = "st,sti-uni-reader";
status = "disabled";
#sound-dai-cells = <0>;
st,syscfg = <&syscfg_core>;
reg = <0x8D84000 0x158>;
interrupts = <GIC_SPI 88 IRQ_TYPE_NONE>;
dmas = <&fdma0 6 0 1>;
dma-names = "rx";
dai-name = "Uni Reader #1 (HDMI RX)";
version = <3>;
};

2) sti-sas-codec: internal audio codec IPs driver
-------------------------------------------------

Required properties:
- compatible: "st,sti<chip>-sas-codec" .
Should be chip "st,stih416-sas-codec" or "st,stih407-sas-codec"

- st,syscfg: phandle to boot-device system configuration registers.

- pinctrl-0: SPDIF PIO description.

- pinctrl-names: should contain only one value - "default".

Example:
sti_sas_codec: sti-sas-codec {
compatible = "st,stih407-sas-codec";
#sound-dai-cells = <1>;
st,reg_audio = <&syscfg_core>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_spdif_out >;
};

Example of audio card declaration:
sound {
compatible = "simple-audio-card";
simple-audio-card,name = "sti audio card";
status = "okay";

simple-audio-card,dai-link@0 {
/* DAC */
format = "i2s";
dai-tdm-slot-width = <32>;
cpu {
sound-dai = <&sti_uni_player2>;
};

codec {
sound-dai = <&sti_sasg_codec 1>;
};
};
simple-audio-card,dai-link@1 {
/* SPDIF */
format = "left_j";
cpu {
sound-dai = <&sti_uni_player3>;
};

codec {
sound-dai = <&sti_sasg_codec 0>;
};
};
};
1 change: 1 addition & 0 deletions sound/soc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ source "sound/soc/samsung/Kconfig"
source "sound/soc/sh/Kconfig"
source "sound/soc/sirf/Kconfig"
source "sound/soc/spear/Kconfig"
source "sound/soc/sti/Kconfig"
source "sound/soc/tegra/Kconfig"
source "sound/soc/txx9/Kconfig"
source "sound/soc/ux500/Kconfig"
Expand Down
1 change: 1 addition & 0 deletions sound/soc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ obj-$(CONFIG_SND_SOC) += samsung/
obj-$(CONFIG_SND_SOC) += sh/
obj-$(CONFIG_SND_SOC) += sirf/
obj-$(CONFIG_SND_SOC) += spear/
obj-$(CONFIG_SND_SOC) += sti/
obj-$(CONFIG_SND_SOC) += tegra/
obj-$(CONFIG_SND_SOC) += txx9/
obj-$(CONFIG_SND_SOC) += ux500/
Expand Down
4 changes: 4 additions & 0 deletions sound/soc/codecs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ config SND_SOC_ALL_CODECS
select SND_SOC_STA350 if I2C
select SND_SOC_STA529 if I2C
select SND_SOC_STAC9766 if SND_SOC_AC97_BUS
select SND_SOC_STI_SAS
select SND_SOC_TAS2552 if I2C
select SND_SOC_TAS5086 if I2C
select SND_SOC_TAS571X if I2C
Expand Down Expand Up @@ -631,6 +632,9 @@ config SND_SOC_STA529
config SND_SOC_STAC9766
tristate

config SND_SOC_STI_SAS
tristate "codec Audio support for STI SAS codec"

config SND_SOC_TAS2552
tristate "Texas Instruments TAS2552 Mono Audio amplifier"
depends on I2C
Expand Down
2 changes: 2 additions & 0 deletions sound/soc/codecs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ snd-soc-sta32x-objs := sta32x.o
snd-soc-sta350-objs := sta350.o
snd-soc-sta529-objs := sta529.o
snd-soc-stac9766-objs := stac9766.o
snd-soc-sti-sas-objs := sti-sas.o
snd-soc-tas5086-objs := tas5086.o
snd-soc-tas571x-objs := tas571x.o
snd-soc-tfa9879-objs := tfa9879.o
Expand Down Expand Up @@ -297,6 +298,7 @@ obj-$(CONFIG_SND_SOC_STA32X) += snd-soc-sta32x.o
obj-$(CONFIG_SND_SOC_STA350) += snd-soc-sta350.o
obj-$(CONFIG_SND_SOC_STA529) += snd-soc-sta529.o
obj-$(CONFIG_SND_SOC_STAC9766) += snd-soc-stac9766.o
obj-$(CONFIG_SND_SOC_STI_SAS) += snd-soc-sti-sas.o
obj-$(CONFIG_SND_SOC_TAS2552) += snd-soc-tas2552.o
obj-$(CONFIG_SND_SOC_TAS5086) += snd-soc-tas5086.o
obj-$(CONFIG_SND_SOC_TAS571X) += snd-soc-tas571x.o
Expand Down
9 changes: 9 additions & 0 deletions sound/soc/codecs/ssm2518.c
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,14 @@ static int ssm2518_i2c_remove(struct i2c_client *client)
return 0;
}

#ifdef CONFIG_OF
static const struct of_device_id ssm2518_dt_ids[] = {
{ .compatible = "adi,ssm2518", },
{ }
};
MODULE_DEVICE_TABLE(of, ssm2518_dt_ids);
#endif

static const struct i2c_device_id ssm2518_i2c_ids[] = {
{ "ssm2518", 0 },
{ }
Expand All @@ -815,6 +823,7 @@ MODULE_DEVICE_TABLE(i2c, ssm2518_i2c_ids);
static struct i2c_driver ssm2518_driver = {
.driver = {
.name = "ssm2518",
.of_match_table = of_match_ptr(ssm2518_dt_ids),
},
.probe = ssm2518_i2c_probe,
.remove = ssm2518_i2c_remove,
Expand Down
3 changes: 0 additions & 3 deletions sound/soc/codecs/sta529.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,6 @@ static int sta529_i2c_probe(struct i2c_client *i2c,
struct sta529 *sta529;
int ret;

if (!i2c_check_functionality(i2c->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
return -EINVAL;

sta529 = devm_kzalloc(&i2c->dev, sizeof(struct sta529), GFP_KERNEL);
if (!sta529)
return -ENOMEM;
Expand Down
Loading

0 comments on commit 0a5ff07

Please sign in to comment.