Skip to content

Instantly share code, notes, and snippets.

@HiassofT
Created February 6, 2018 14:51
Show Gist options
  • Save HiassofT/19546a6fa9bd146652211405438e3ff0 to your computer and use it in GitHub Desktop.
Save HiassofT/19546a6fa9bd146652211405438e3ff0 to your computer and use it in GitHub Desktop.
audio graph card based pcm5122 overlay with amplifier-enable gpio
/dts-v1/;
/plugin/;
/ {
fragment@0 {
target = <&i2s>;
__overlay__ {
#sound-dai-cells = <0>;
status = "okay";
cpu_port: port {
cpu_endpoint: endpoint {
remote-endpoint = <&codec_endpoint>;
dai-format = "i2s";
/*
bitclock-master = <&cpu_endpoint>;
frame-master = <&cpu_endpoint>;
*/
};
};
};
};
fragment@1 {
target = <&i2c1>;
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
pcm5122: pcm5122@4c {
#sound-dai-cells = <0>;
compatible = "ti,pcm5122";
reg = <0x4c>;
AVDD-supply = <&vdd_3v3_reg>;
DVDD-supply = <&vdd_3v3_reg>;
CPVDD-supply = <&vdd_3v3_reg>;
status = "okay";
codec_port: port {
codec_endpoint: endpoint {
remote-endpoint = <&cpu_endpoint>;
};
};
};
};
};
fragment@2 {
target = <&gpio>;
__overlay__ {
audio_amplifier_pins: audio_amplifier_pins {
brcm,pins = <4>;
brcm,function = <1>; // out
};
};
};
fragment@3 {
target-path = "/";
__overlay__ {
graph_pcm5122: graph-pcm5122 {
compatible = "audio-graph-card";
label = "PCM5122 graph";
dais = <&cpu_port>;
pinctrl-names = "default";
pinctrl-0 = <&audio_amplifier_pins>;
pa-gpios = <&gpio 4 0>;
widgets = "Speaker", "Speaker Out Jack";
routing =
"Amplifier", "OUTL",
"Amplifier", "OUTR",
"Speaker Out Jack", "Amplifier";
};
};
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment