Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5b56b9bb authored by Mark Brown's avatar Mark Brown
Browse files

Merge remote-tracking branches 'asoc/topic/sgtl5000', 'asoc/topic/simple',...

Merge remote-tracking branches 'asoc/topic/sgtl5000', 'asoc/topic/simple', 'asoc/topic/stac9766', 'asoc/topic/sti' and 'asoc/topic/sunxi' into asoc-next
Loading
Loading
Loading
Loading
+37 −0
Original line number Diff line number Diff line
@@ -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:

@@ -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 = ...
	};
};
+16 −36
Original line number Diff line number Diff line
@@ -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

@@ -33,32 +35,24 @@ 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>;
@@ -66,15 +60,12 @@ Example:
		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>;
@@ -82,15 +73,11 @@ Example:
		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>;
@@ -99,14 +86,10 @@ 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>;
@@ -114,9 +97,6 @@ Example:
		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
+3 −0
Original line number Diff line number Diff line
@@ -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.

@@ -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 {
+1 −0
Original line number Diff line number Diff line
@@ -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, ...);
+3 −0
Original line number Diff line number Diff line
@@ -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),

@@ -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 */
Loading