
/ {
        rt5651-sound {
                compatible = "simple-audio-card";
                simple-audio-card,format = "i2s";
                simple-audio-card,name = "rockchip,rt5651-codec";
                simple-audio-card,mclk-fs = <256>;
                simple-audio-card,widgets =
                        "Microphone", "Mic Jack",
                        "Headphone", "Headphone Jack";
                simple-audio-card,routing =
                        "Mic Jack", "micbias1",
                        "IN1P", "Mic Jack",
                        "Headphone Jack", "HPOL",
                        "Headphone Jack", "HPOR";
                pinctrl-names = "default";
                pinctrl-0 = <&rt5651_hp_det_gpio>;
                simple-audio-card,hp-det-gpio = <&gpio4 28 GPIO_ACTIVE_HIGH>;
                simple-audio-card,cpu {
                        sound-dai = <&i2s0>;
                };
                simple-audio-card,codec {
                        sound-dai = <&rt5651>;
                };
        };
};

&i2c1 {
        status = "okay";
        i2c-scl-rising-time-ns = <300>;
        i2c-scl-falling-time-ns = <15>;

        rt5651: rt5651@1a {
                #sound-dai-cells = <0>;
                compatible = "realtek,rt5651";
                reg = <0x1a>;
                clocks = <&cru SCLK_I2S_8CH_OUT>;
                clock-names = "mclk";
                pinctrl-names = "default";
                pinctrl-0 = <&i2s_8ch_mclk>;
                io-channels = <&saradc 4>;
                spk-con-gpio = <&gpio0 11 GPIO_ACTIVE_HIGH>;
//                hp-det-gpio = <&gpio4 28 GPIO_ACTIVE_LOW>;
                hp-det-adc-value = <500>;
                status = "okay";
        };

};

&i2s0 {
    status = "okay";
    rockchip,playback-channels = <8>;
    rockchip,capture-channels = <8>;
    #sound-dai-cells = <0>;
};

&pinctrl {
        rt5651 {
                rt5651_hp_det_gpio: rt5651_hp_det_gpio {
                        rockchip,pins = <4 28 RK_FUNC_GPIO &pcfg_pull_none>;
                };
        };
};
