Skip to content

Commit

Permalink
Merge remote-tracking branches 'asoc/topic/sgtl5000', 'asoc/topic/sim…
Browse files Browse the repository at this point in the history
…ple', 'asoc/topic/stac9766', 'asoc/topic/sti' and 'asoc/topic/sunxi' into asoc-next
  • Loading branch information
broonie committed Sep 29, 2016
6 parents 096388b + 904a987 + 899a247 + f2b2f6d + b7c8c5d + c9e902f commit 5b56b9b
Show file tree
Hide file tree
Showing 14 changed files with 342 additions and 238 deletions.
37 changes: 37 additions & 0 deletions Documentation/devicetree/bindings/sound/simple-card.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Optional properties:
headphones are attached.
- simple-audio-card,mic-det-gpio : Reference to GPIO that signals when
a microphone is attached.
- simple-audio-card,aux-devs : List of phandles pointing to auxiliary devices, such
as amplifiers, to be added to the sound card.

Optional subnodes:

Expand Down Expand Up @@ -162,3 +164,38 @@ sound {
};
};
};

Example 3 - route audio from IMX6 SSI2 through TLV320DAC3100 codec
through TPA6130A2 amplifier to headphones:

&i2c0 {
codec: tlv320dac3100@18 {
compatible = "ti,tlv320dac3100";
...
}

amp: tpa6130a2@60 {
compatible = "ti,tpa6130a2";
...
}
}

sound {
compatible = "simple-audio-card";
...
simple-audio-card,widgets =
"Headphone", "Headphone Jack";
simple-audio-card,routing =
"Headphone Jack", "HPLEFT",
"Headphone Jack", "HPRIGHT",
"LEFTIN", "HPL",
"RIGHTIN", "HPR";
simple-audio-card,aux-devs = <&amp>;
simple-audio-card,cpu {
sound-dai = <&ssi2>;
};
simple-audio-card,codec {
sound-dai = <&codec>;
clocks = ...
};
};
52 changes: 16 additions & 36 deletions Documentation/devicetree/bindings/sound/st,sti-asoc-card.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ Documentation/devicetree/bindings/sound/simple-card.txt.
---------------------------------------

Required properties:
- compatible: "st,sti-uni-player" or "st,sti-uni-reader"
- compatible: "st,stih407-uni-player-hdmi", "st,stih407-uni-player-pcm-out",
"st,stih407-uni-player-dac", "st,stih407-uni-player-spdif",
"st,stih407-uni-reader-pcm_in", "st,stih407-uni-reader-hdmi",

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

Expand All @@ -33,64 +35,49 @@ Required properties:
"tx" for "st,sti-uni-player" compatibility
"rx" for "st,sti-uni-reader" compatibility

- st,version: IP version integrated in SOC.

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

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

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

- st,uniperiph-id: internal SOC IP instance ID.

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".

- st,tdm-mode: to declare to set TDM mode for unireader and uniplayer IPs.
Only compartible with IPs in charge of the external I2S/TDM bus.
Should be declared depending on associated codec.

Example:

sti_uni_player1: sti-uni-player@1 {
compatible = "st,sti-uni-player";
sti_uni_player1: sti-uni-player@0x8D81000 {
compatible = "st,stih407-uni-player-hdmi";
status = "okay";
#sound-dai-cells = <0>;
st,syscfg = <&syscfg_core>;
clocks = <&clk_s_d0_flexgen CLK_PCM_1>;
reg = <0x8D81000 0x158>;
interrupts = <GIC_SPI 85 IRQ_TYPE_NONE>;
dmas = <&fdma0 3 0 1>;
st,dai-name = "Uni Player #1 (I2S)";
dma-names = "tx";
st,uniperiph-id = <1>;
st,version = <5>;
st,mode = "TDM";
st,tdm-mode = <1>;
};

sti_uni_player2: sti-uni-player@2 {
compatible = "st,sti-uni-player";
sti_uni_player2: sti-uni-player@0x8D82000 {
compatible = "st,stih407-uni-player-pcm-out";
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 #2 (DAC)";
dma-names = "tx";
st,uniperiph-id = <2>;
st,version = <5>;
st,mode = "PCM";
};

sti_uni_player3: sti-uni-player@3 {
compatible = "st,sti-uni-player";
sti_uni_player3: sti-uni-player@0x8D85000 {
compatible = "st,stih407-uni-player-spdif";
status = "okay";
#sound-dai-cells = <0>;
st,syscfg = <&syscfg_core>;
Expand All @@ -99,24 +86,17 @@ Example:
interrupts = <GIC_SPI 89 IRQ_TYPE_NONE>;
dmas = <&fdma0 7 0 1>;
dma-names = "tx";
dai-name = "Uni Player #3 (SPDIF)";
st,uniperiph-id = <3>;
st,version = <5>;
st,mode = "SPDIF";
};

sti_uni_reader1: sti-uni-reader@1 {
compatible = "st,sti-uni-reader";
sti_uni_reader1: sti-uni-reader@0x8D84000 {
compatible = "st,stih407-uni-reader-hdmi";
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)";
st,version = <3>;
st,mode = "PCM";
};

2) sti-sas-codec: internal audio codec IPs driver
Expand Down
3 changes: 3 additions & 0 deletions Documentation/devicetree/bindings/sound/sunxi,sun4i-spdif.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Required properties:

- compatible : should be one of the following:
- "allwinner,sun4i-a10-spdif": for the Allwinner A10 SoC
- "allwinner,sun6i-a31-spdif": for the Allwinner A31 SoC

- reg : Offset and length of the register set for the device.

Expand All @@ -25,6 +26,8 @@ Required properties:
"apb" clock for the spdif bus.
"spdif" clock for spdif controller.

- resets : reset specifier for the ahb reset (A31 and newer only)

Example:

spdif: spdif@01c21000 {
Expand Down
1 change: 1 addition & 0 deletions include/sound/simple_card_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ int asoc_simple_card_parse_daifmt(struct device *dev,
struct device_node *codec,
char *prefix,
unsigned int *retfmt);
__printf(3, 4)
int asoc_simple_card_set_dailink_name(struct device *dev,
struct snd_soc_dai_link *dai_link,
const char *fmt, ...);
Expand Down
3 changes: 3 additions & 0 deletions sound/soc/codecs/sgtl5000.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,8 @@ static const struct snd_kcontrol_new sgtl5000_snd_controls[] = {
0, 8,
0x7f, 1,
headphone_volume),
SOC_SINGLE("Headphone Playback Switch", SGTL5000_CHIP_ANA_CTRL,
4, 1, 1),
SOC_SINGLE("Headphone Playback ZC Switch", SGTL5000_CHIP_ANA_CTRL,
5, 1, 0),

Expand All @@ -423,6 +425,7 @@ static const struct snd_kcontrol_new sgtl5000_snd_controls[] = {
SGTL5000_LINE_OUT_VOL_RIGHT_SHIFT,
0x1f, 1,
lineout_volume),
SOC_SINGLE("Lineout Playback Switch", SGTL5000_CHIP_ANA_CTRL, 8, 1, 1),
};

/* mute the codec used by alsa core */
Expand Down
8 changes: 4 additions & 4 deletions sound/soc/codecs/stac9766.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ static SOC_ENUM_SINGLE_DECL(stac9766_boost2_enum,
static SOC_ENUM_SINGLE_DECL(stac9766_stereo_mic_enum,
AC97_STAC_STEREO_MIC, 2, stac9766_stereo_mic);

static const DECLARE_TLV_DB_LINEAR(master_tlv, -4600, 0);
static const DECLARE_TLV_DB_LINEAR(record_tlv, 0, 2250);
static const DECLARE_TLV_DB_LINEAR(beep_tlv, -4500, 0);
static const DECLARE_TLV_DB_LINEAR(mix_tlv, -3450, 1200);
static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(master_tlv, -4650, 150, 0);
static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(record_tlv, 0, 150, 0);
static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(beep_tlv, -4500, 300, 0);
static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(mix_tlv, -3450, 150, 0);

static const struct snd_kcontrol_new stac9766_snd_ac97_controls[] = {
SOC_DOUBLE_TLV("Speaker Volume", AC97_MASTER, 8, 0, 31, 1, master_tlv),
Expand Down
Loading

0 comments on commit 5b56b9b

Please sign in to comment.