Skip to content

Instantly share code, notes, and snippets.

@nyboer
Last active January 11, 2017 22:39
Show Gist options
  • Save nyboer/d429f056dc450eea850ef60b205672c5 to your computer and use it in GitHub Desktop.
Save nyboer/d429f056dc450eea850ef60b205672c5 to your computer and use it in GitHub Desktop.
/*
* Copyright 2017 NextThing Co
* Peter Nyboer <peter@nextthing.co>
* This file is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This file is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
/dts-v1/;
/plugin/;
/ {
compatible = "nextthing,chip", "allwinner,sun5i-r8", "nextthing,gr8-evb", "nextthing,gr8";
/*
* enable i2s0 bus.
*/
fragment@0 {
target = <&i2s0>;
__overlay__ {
pinctrl-names = "default";
pinctrl-0 = <&i2s0_mclk_pins_a>, <&i2s0_data_pins_a>;
status = "okay";
};
};
/*
* enable the wm8978 codec over I2S for CHIP Pro
*/
fragment@1 {
target-path = "/i2s";
__overlay__ {
compatible = "simple-audio-card";
simple-audio-card,name = "NTC-GR8-wm8978";
simple-audio-card,format = "i2s";
simple-audio-card,mclk-fs = <512>;
simple-audio-card,cpu {
sound-dai = <&i2s0>;
};
simple-audio-card,codec {
sound-dai = <&wm8978>;
};
};
};
/*
* enable i2c bus 1 for wm8978 comm
*/
fragment@2 {
target = "<&i2c1>";
__overlay__ {
pinctrl-names = "default";
pinctrl-0 = <&i2c1_pins_a>;
status = "okay";
wm8978: codec@1a {
#sound-dai-cells = <0>;
compatible = "wlf,wm8978";
reg = <0x1a>;
};
};
};
/*
* describe codec for DAC
*/
fragment@3 {
target-path = "/codec";
__overlay__ {
compatible = "nextthing,gr8-audio";
allwinner,i2s-controller = <&i2s0>;
allwinner,audio-codec = <&wm8978>;
};
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment