xref: /freebsd-src/sys/contrib/device-tree/src/arm/rockchip/rk3288-veyron-analog-audio.dtsi (revision f126890ac5386406dadf7c4cfa9566cbb56537c5)
1*f126890aSEmmanuel Vadot// SPDX-License-Identifier: GPL-2.0
2*f126890aSEmmanuel Vadot/*
3*f126890aSEmmanuel Vadot * Google Veyron (and derivatives) fragment for the  max98090 audio
4*f126890aSEmmanuel Vadot * codec and analog headphone jack.
5*f126890aSEmmanuel Vadot *
6*f126890aSEmmanuel Vadot * Copyright 2016 Google, Inc
7*f126890aSEmmanuel Vadot */
8*f126890aSEmmanuel Vadot
9*f126890aSEmmanuel Vadot/ {
10*f126890aSEmmanuel Vadot	sound {
11*f126890aSEmmanuel Vadot		compatible = "rockchip,rockchip-audio-max98090";
12*f126890aSEmmanuel Vadot		pinctrl-names = "default";
13*f126890aSEmmanuel Vadot		pinctrl-0 = <&mic_det>, <&hp_det>;
14*f126890aSEmmanuel Vadot		rockchip,model = "VEYRON-I2S";
15*f126890aSEmmanuel Vadot		rockchip,i2s-controller = <&i2s>;
16*f126890aSEmmanuel Vadot		rockchip,audio-codec = <&max98090>;
17*f126890aSEmmanuel Vadot		rockchip,hp-det-gpios = <&gpio6 RK_PA5 GPIO_ACTIVE_HIGH>;
18*f126890aSEmmanuel Vadot		rockchip,mic-det-gpios = <&gpio6 RK_PB3 GPIO_ACTIVE_LOW>;
19*f126890aSEmmanuel Vadot		rockchip,headset-codec = <&headsetcodec>;
20*f126890aSEmmanuel Vadot		rockchip,hdmi-codec = <&hdmi>;
21*f126890aSEmmanuel Vadot	};
22*f126890aSEmmanuel Vadot};
23*f126890aSEmmanuel Vadot
24*f126890aSEmmanuel Vadot&i2c2 {
25*f126890aSEmmanuel Vadot	max98090: max98090@10 {
26*f126890aSEmmanuel Vadot		compatible = "maxim,max98090";
27*f126890aSEmmanuel Vadot		reg = <0x10>;
28*f126890aSEmmanuel Vadot		interrupt-parent = <&gpio6>;
29*f126890aSEmmanuel Vadot		interrupts = <RK_PA7 IRQ_TYPE_EDGE_FALLING>;
30*f126890aSEmmanuel Vadot		clock-names = "mclk";
31*f126890aSEmmanuel Vadot		clocks = <&cru SCLK_I2S0_OUT>;
32*f126890aSEmmanuel Vadot		pinctrl-names = "default";
33*f126890aSEmmanuel Vadot		pinctrl-0 = <&int_codec>;
34*f126890aSEmmanuel Vadot	};
35*f126890aSEmmanuel Vadot};
36*f126890aSEmmanuel Vadot
37*f126890aSEmmanuel Vadot&i2c4 {
38*f126890aSEmmanuel Vadot	headsetcodec: ts3a227e@3b {
39*f126890aSEmmanuel Vadot		compatible = "ti,ts3a227e";
40*f126890aSEmmanuel Vadot		reg = <0x3b>;
41*f126890aSEmmanuel Vadot		interrupt-parent = <&gpio0>;
42*f126890aSEmmanuel Vadot		interrupts = <RK_PA3 IRQ_TYPE_LEVEL_LOW>;
43*f126890aSEmmanuel Vadot		pinctrl-names = "default";
44*f126890aSEmmanuel Vadot		pinctrl-0 = <&ts3a227e_int_l>;
45*f126890aSEmmanuel Vadot		ti,micbias = <7>;		/* MICBIAS = 2.8V */
46*f126890aSEmmanuel Vadot	};
47*f126890aSEmmanuel Vadot};
48*f126890aSEmmanuel Vadot
49*f126890aSEmmanuel Vadot&i2s {
50*f126890aSEmmanuel Vadot	status = "okay";
51*f126890aSEmmanuel Vadot};
52*f126890aSEmmanuel Vadot
53*f126890aSEmmanuel Vadot&io_domains {
54*f126890aSEmmanuel Vadot	audio-supply = <&vcc18_codec>;
55*f126890aSEmmanuel Vadot};
56*f126890aSEmmanuel Vadot
57*f126890aSEmmanuel Vadot&rk808 {
58*f126890aSEmmanuel Vadot	vcc10-supply = <&vcc33_sys>;
59*f126890aSEmmanuel Vadot
60*f126890aSEmmanuel Vadot	regulators {
61*f126890aSEmmanuel Vadot		vcc18_codec: LDO_REG6 {
62*f126890aSEmmanuel Vadot			regulator-name = "vcc18_codec";
63*f126890aSEmmanuel Vadot			regulator-always-on;
64*f126890aSEmmanuel Vadot			regulator-boot-on;
65*f126890aSEmmanuel Vadot			regulator-min-microvolt = <1800000>;
66*f126890aSEmmanuel Vadot			regulator-max-microvolt = <1800000>;
67*f126890aSEmmanuel Vadot			regulator-state-mem {
68*f126890aSEmmanuel Vadot				regulator-off-in-suspend;
69*f126890aSEmmanuel Vadot			};
70*f126890aSEmmanuel Vadot		};
71*f126890aSEmmanuel Vadot	};
72*f126890aSEmmanuel Vadot};
73*f126890aSEmmanuel Vadot
74*f126890aSEmmanuel Vadot&pinctrl {
75*f126890aSEmmanuel Vadot	codec {
76*f126890aSEmmanuel Vadot		hp_det: hp-det {
77*f126890aSEmmanuel Vadot			rockchip,pins = <6 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
78*f126890aSEmmanuel Vadot		};
79*f126890aSEmmanuel Vadot
80*f126890aSEmmanuel Vadot		/*
81*f126890aSEmmanuel Vadot		 * HACK: We're going to _pull down_ this _active low_ interrupt
82*f126890aSEmmanuel Vadot		 * so that it never fires.  We don't need this interrupt because
83*f126890aSEmmanuel Vadot		 * we've got a ts3a227e chip but the driver requires it.
84*f126890aSEmmanuel Vadot		 */
85*f126890aSEmmanuel Vadot		int_codec: int-codec {
86*f126890aSEmmanuel Vadot			rockchip,pins = <6 RK_PA7 RK_FUNC_GPIO &pcfg_pull_down>;
87*f126890aSEmmanuel Vadot		};
88*f126890aSEmmanuel Vadot
89*f126890aSEmmanuel Vadot		mic_det: mic-det {
90*f126890aSEmmanuel Vadot			rockchip,pins = <6 RK_PB3 RK_FUNC_GPIO &pcfg_pull_up>;
91*f126890aSEmmanuel Vadot		};
92*f126890aSEmmanuel Vadot	};
93*f126890aSEmmanuel Vadot
94*f126890aSEmmanuel Vadot	headset {
95*f126890aSEmmanuel Vadot		ts3a227e_int_l: ts3a227e-int-l {
96*f126890aSEmmanuel Vadot			rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
97*f126890aSEmmanuel Vadot		};
98*f126890aSEmmanuel Vadot	};
99*f126890aSEmmanuel Vadot};
100