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

Commit 60790c57 authored by Mark Brown's avatar Mark Brown
Browse files

Merge remote-tracking branch 'asoc/topic/rt5640' into asoc-next

parents 3843e87e 9be94aea
Loading
Loading
Loading
Loading
+71 −0
Original line number Diff line number Diff line
NVIDIA Tegra audio complex, with RT5640 CODEC

Required properties:
- compatible : "nvidia,tegra-audio-rt5640"
- clocks : Must contain an entry for each entry in clock-names.
- clock-names : Must include the following entries:
  "pll_a" (The Tegra clock of that name),
  "pll_a_out0" (The Tegra clock of that name),
  "mclk" (The Tegra cdev1/extern1 clock, which feeds the CODEC's mclk)
- nvidia,model : The user-visible name of this sound complex.
- nvidia,audio-routing : A list of the connections between audio components.
  Each entry is a pair of strings, the first being the connection's sink,
  the second being the connection's source. Valid names for sources and
  sinks are the RT5640's pins, and the jacks on the board:

  RT5640 pins:

  * DMIC1
  * DMIC2
  * MICBIAS1
  * IN1P
  * IN1R
  * IN2P
  * IN2R
  * HPOL
  * HPOR
  * LOUTL
  * LOUTR
  * MONOP
  * MONON
  * SPOLP
  * SPOLN
  * SPORP
  * SPORN

  Board connectors:

  * Headphones
  * Speakers

- nvidia,i2s-controller : The phandle of the Tegra I2S controller that's
  connected to the CODEC.
- nvidia,audio-codec : The phandle of the RT5640 audio codec. This binding
  assumes that AIF1 on the CODEC is connected to Tegra.

Optional properties:
- nvidia,hp-det-gpios : The GPIO that detects headphones are plugged in

Example:

sound {
	compatible = "nvidia,tegra-audio-rt5640-dalmore",
			"nvidia,tegra-audio-rt5640";
	nvidia,model = "NVIDIA Tegra Dalmore";

	nvidia,audio-routing =
		"Headphones", "HPOR",
		"Headphones", "HPOL",
		"Speakers", "SPORP",
		"Speakers", "SPORN",
		"Speakers", "SPOLP",
		"Speakers", "SPOLN";

	nvidia,i2s-controller = <&tegra_i2s1>;
	nvidia,audio-codec = <&rt5640>;

	nvidia,hp-det-gpios = <&gpio 143 0>; /* GPIO PR7 */

	clocks = <&tegra_car 216>, <&tegra_car 217>, <&tegra_car 120>;
	clock-names = "pll_a", "pll_a_out0", "mclk";
};
+30 −0
Original line number Diff line number Diff line
RT5640 audio CODEC

This device supports I2C only.

Required properties:

- compatible : "realtek,rt5640".

- reg : The I2C address of the device.

- interrupts : The CODEC's interrupt output.

Optional properties:

- realtek,in1-differential
- realtek,in2-differential
  Boolean. Indicate MIC1/2 input are differential, rather than single-ended.

- realtek,ldo1-en-gpios : The GPIO that controls the CODEC's LDO1_EN pin.

Example:

rt5640 {
	compatible = "realtek,rt5640";
	reg = <0x1c>;
	interrupt-parent = <&gpio>;
	interrupts = <TEGRA_GPIO(W, 3) GPIO_ACTIVE_HIGH>;
	realtek,ldo1-en-gpios =
		<&gpio TEGRA_GPIO(V, 3) GPIO_ACTIVE_HIGH>;
};

include/sound/rt5640.h

0 → 100644
+22 −0
Original line number Diff line number Diff line
/*
 * linux/sound/rt5640.h -- Platform data for RT5640
 *
 * Copyright 2011 Realtek Microelectronics
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

#ifndef __LINUX_SND_RT5640_H
#define __LINUX_SND_RT5640_H

struct rt5640_platform_data {
	/* IN1 & IN2 can optionally be differential */
	bool in1_diff;
	bool in2_diff;

	int ldo1_en; /* GPIO for LDO1_EN */
};

#endif
+4 −0
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@ config SND_SOC_ALL_CODECS
	select SND_SOC_HDMI_CODEC
	select SND_SOC_PCM3008
	select SND_SOC_RT5631 if I2C
	select SND_SOC_RT5640 if I2C
	select SND_SOC_SGTL5000 if I2C
	select SND_SOC_SI476X if MFD_SI476X_CORE
	select SND_SOC_SN95031 if INTEL_SCU_IPC
@@ -296,6 +297,9 @@ config SND_SOC_PCM3008
config SND_SOC_RT5631
	tristate

config SND_SOC_RT5640
	tristate

#Freescale sgtl5000 codec
config SND_SOC_SGTL5000
	tristate
+2 −0
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ snd-soc-ml26124-objs := ml26124.o
snd-soc-hdmi-codec-objs := hdmi.o
snd-soc-pcm3008-objs := pcm3008.o
snd-soc-rt5631-objs := rt5631.o
snd-soc-rt5640-objs := rt5640.o
snd-soc-sgtl5000-objs := sgtl5000.o
snd-soc-alc5623-objs := alc5623.o
snd-soc-alc5632-objs := alc5632.o
@@ -171,6 +172,7 @@ obj-$(CONFIG_SND_SOC_ML26124) += snd-soc-ml26124.o
obj-$(CONFIG_SND_SOC_HDMI_CODEC) += snd-soc-hdmi-codec.o
obj-$(CONFIG_SND_SOC_PCM3008)	+= snd-soc-pcm3008.o
obj-$(CONFIG_SND_SOC_RT5631)	+= snd-soc-rt5631.o
obj-$(CONFIG_SND_SOC_RT5640)	+= snd-soc-rt5640.o
obj-$(CONFIG_SND_SOC_SGTL5000)  += snd-soc-sgtl5000.o
obj-$(CONFIG_SND_SOC_SIGMADSP)	+= snd-soc-sigmadsp.o
obj-$(CONFIG_SND_SOC_SI476X)	+= snd-soc-si476x.o
Loading