ASoC: omap-abe-twl6040: Add device tree support
Subsystems (3)
PATCH RESEND v2 1/1 ASoC: omap-abe-twl6040: Add device tree support
When the board boots with device tree the driver will receive the name of the card, DAPM routing map, phandle for the audio components described in the dts file, mclk speed, and the possibility of detecting the jack detection.
The card will be set up based on this information.
Since the routing is provided via DT we can mark the card fully routed so core can take care of disconnecting the unused pins.
---
Hi Mark, Liam.
This patch was part of the series to add the Device Tree support for ABE+TWL6040 based audio.
The intro mail for the series was:
http://mailman.alsa-project.org/pipermail/alsa-devel/2012-May/052103.html
Thank you,
Peter
.../devicetree/bindings/sound/omap-abe-twl6040.txt | 91 ++++++++++++ sound/soc/omap/omap-abe-twl6040.c | 145 ++++++++++++++++---- 2 files changed, 206 insertions(+), 30 deletions(-) create mode 100644 Documentation/devicetree/bindings/sound/omap-abe-twl6040.txt
Documentation/devicetree/bindings/sound/omap-abe-twl6040.txt new file +91 -0
@@ -0,0 +1,91 @@ +* Texas Instruments OMAP4+ and twl6040 based audio setups + +Required properties: +- compatible: "ti,abe-twl6040" +- ti,model: Name of the sound card ( for example "SDP4430") +- ti,mclk-freq: MCLK frequency for HPPLL operation +- ti,mcpdm: phandle for the McPDM node +- ti,twl6040: phandle for the twl6040 core node +- ti,audio-routing: List of 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. + +Optional properties: +- ti,dmic: phandle for the OMAP dmic node if the machine have it connected +- ti,jack_detection: Need to be set to <1> if the board capable to detect jack + insertion, removal. + +Available audio endpoints for the audio-routing table: + +Board connectors: + * Headset Stereophone + * Earphone Spk + * Ext Spk + * Line Out + * Vibrator + * Headset Mic + * Main Handset Mic + * Sub Handset Mic + * Line In + * Digital Mic + +twl6040 pins: + * HSOL + * HSOR + * EP + * HFL + * HFR + * AUXL + * AUXR + * VIBRAL + * VIBRAR + * HSMIC + * MAINMIC + * SUBMIC + * AFML + * AFMR + + * Headset Mic Bias + * Main Mic Bias + * Digital Mic1 Bias + * Digital Mic2 Bias + +Digital mic pins: + * DMic + +Example: + +sound { + compatible = "ti,abe-twl6040"; + ti,model = "SDP4430"; + + ti,jack-detection = <1>; + ti,mclk-freq = <38400000>; + + ti,mcpdm = <&mcpdm>; + ti,dmic = <&dmic>; + + ti,twl6040 = <&twl6040>; + + /* Audio routing */ + ti,audio-routing = + "Headset Stereophone", "HSOL", + "Headset Stereophone", "HSOR", + "Earphone Spk", "EP", + "Ext Spk", "HFL", + "Ext Spk", "HFR", + "Line Out", "AUXL", + "Line Out", "AUXR", + "Vibrator", "VIBRAL", + "Vibrator", "VIBRAR", + "HSMIC", "Headset Mic", + "Headset Mic", "Headset Mic Bias", + "MAINMIC", "Main Handset Mic", + "Main Handset Mic", "Main Mic Bias", + "SUBMIC", "Sub Handset Mic", + "Sub Handset Mic", "Main Mic Bias", + "AFML", "Line In", + "AFMR", "Line In", + "DMic", "Digital Mic", + "Digital Mic", "Digital Mic1 Bias"; +};
sound/soc/omap/omap-abe-twl6040.c +115 -30
219 lines not on this page · raw message
Signature · 1 line
1.7.8.6
sound/soc/omap/omap-abe-twl6040.c static struct snd_soc_card omap_abe_card = { · line 310
Quoted 7 lines · Peter Ujfalusi
sound/soc/omap/omap-abe-twl6040.c +7
-0+ + ret =snd_soc_of_parse_audio_routing (card, +"ti,audio-routing" ); +if (ret) { +dev_err (&pdev->dev, +"Error while parsing DAPM routing\n" ); +return -EINVAL ;
Should pass back the error code you got. Otherwise this looks good - with that fixed up